36 lines
2.2 KiB
Python
36 lines
2.2 KiB
Python
from django.urls import path
|
|
from rest_framework.routers import DefaultRouter
|
|
|
|
from trials.views import TestModelViewSet, TestTemplateView, TestValidateAPIView, TestResultView, rateTest, addTest, addQuestions, myTests, solvedTests, solvedTestsDetailed, EditTestTemplateView, deleteTest, AddQuestionToExistingTest, RemoveQuestionFromExistingTest, EditQuestionTemplateView, editName, editVisible, editPassword, TestPasswordTemplateView, TournamentView, CreateTournamentView, TournamentTemplateView, TournamentResultView, TournamentClassificationView
|
|
|
|
router = DefaultRouter(trailing_slash=False)
|
|
router.register("items", TestModelViewSet)
|
|
|
|
urlpatterns = [
|
|
path('<int:test_id>/show', TestTemplateView.as_view()),
|
|
path('<int:test_id>/password', TestPasswordTemplateView),
|
|
path('<int:test_id>/mark', TestValidateAPIView.as_view()),
|
|
path('<int:test_id>/result', TestResultView.as_view()),
|
|
path('<int:test_id>/rateTest', rateTest, name="rateTest"),
|
|
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', editVisible, name="editVisible"),
|
|
path('<int:test_id>/editPassword', editPassword, name="editPassword"),
|
|
path('<int:test_id>/remove', 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"),
|
|
path('solved/<int:test_id>', solvedTestsDetailed, name="solvedTests"),
|
|
path('tournamets', TournamentView, name="tournaments"),
|
|
path('add/tournament', CreateTournamentView, name="CreateTournament"),
|
|
path('<int:tournament_id>/tournament/show', TournamentTemplateView.as_view()),
|
|
path('<int:tournament_id>/tournament/result', TournamentResultView.as_view()),
|
|
path('tournament/classification', TournamentClassificationView.as_view(), name="TournamentClassification")
|
|
]
|
|
|
|
urlpatterns += router.urls
|