SOITA/trials/urls.py
Hubert Jankowski d9ad2c2f9d test visibility
2022-04-09 13:02:21 +02:00

31 lines
1.5 KiB
Python

from django.urls import path
from rest_framework.routers import DefaultRouter
from trials.views import TestModelViewSet
from trials.views import TestTemplateView
from trials.views import TestValidateAPIView
from trials.views import TestResultView, addTest, addQuestions, myTests, editTest, solvedTests, EditTestTemplateView, deleteTest, AddQuestionToExistingTest, RemoveQuestionFromExistingTest, EditQuestionTemplateView, editName
router = DefaultRouter(trailing_slash=False)
router.register("items", TestModelViewSet)
urlpatterns = [
path('<int:test_id>/show', TestTemplateView.as_view()),
path('<int:test_id>/mark', TestValidateAPIView.as_view()),
path('<int:test_id>/result', TestResultView.as_view()),
path('<int:test_id>/edit', EditTestTemplateView.as_view()),
path('<int:test_id>/add-question', AddQuestionToExistingTest.as_view()),
path('<int:test_id>/remove-question', RemoveQuestionFromExistingTest.as_view()),
path('question/<int:question_id>/edit', EditQuestionTemplateView.as_view()),
path('<int:test_id>/editName', editName, name="editName"),
path('<int:test_id>/editVisible', editName, name="editVisible"),
path('<int:test_id>/remove', deleteTest, name="deleteTest"),
# path('delete', deleteTest, name="deleteTest"),
path('add/test', addTest, name="newTest"),
path('add/questions', addQuestions, name="addQuestions"),
path('my', myTests, name="myTests"),
path('solved', solvedTests, name="solvedTests")
]
urlpatterns += router.urls