2021-12-05 13:50:34 +01:00
|
|
|
from django.urls import path
|
|
|
|
from rest_framework.routers import DefaultRouter
|
|
|
|
|
2022-05-24 21:01:45 +02:00
|
|
|
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
|
2021-12-05 13:50:34 +01:00
|
|
|
|
2021-12-12 11:35:35 +01:00
|
|
|
router = DefaultRouter(trailing_slash=False)
|
2021-12-05 13:50:34 +01:00
|
|
|
router.register("items", TestModelViewSet)
|
|
|
|
|
|
|
|
urlpatterns = [
|
2021-12-12 11:35:35 +01:00
|
|
|
path('<int:test_id>/show', TestTemplateView.as_view()),
|
2022-04-10 15:05:07 +02:00
|
|
|
path('<int:test_id>/password', TestPasswordTemplateView),
|
2022-01-12 10:50:34 +01:00
|
|
|
path('<int:test_id>/mark', TestValidateAPIView.as_view()),
|
2022-01-17 16:31:09 +01:00
|
|
|
path('<int:test_id>/result', TestResultView.as_view()),
|
2022-04-16 17:05:39 +02:00
|
|
|
path('<int:test_id>/rateTest', rateTest, name="rateTest"),
|
2022-01-21 18:34:46 +01:00
|
|
|
path('<int:test_id>/edit', EditTestTemplateView.as_view()),
|
2022-01-30 20:04:27 +01:00
|
|
|
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"),
|
2022-04-10 15:05:07 +02:00
|
|
|
path('<int:test_id>/editVisible', editVisible, name="editVisible"),
|
|
|
|
path('<int:test_id>/editPassword', editPassword, name="editPassword"),
|
2022-01-30 20:04:27 +01:00
|
|
|
path('<int:test_id>/remove', deleteTest, name="deleteTest"),
|
2022-01-17 16:31:09 +01:00
|
|
|
path('add/test', addTest, name="newTest"),
|
2022-01-17 17:38:53 +01:00
|
|
|
path('add/questions', addQuestions, name="addQuestions"),
|
2022-01-19 20:56:00 +01:00
|
|
|
path('my', myTests, name="myTests"),
|
2022-04-15 21:04:04 +02:00
|
|
|
path('solved', solvedTests, name="solvedTests"),
|
2022-05-24 21:01:45 +02:00
|
|
|
path('solved/<int:test_id>', solvedTestsDetailed, name="solvedTests"),
|
|
|
|
path('tournamets', TournamentView, name="tournaments"),
|
|
|
|
path('add/tournament', CreateTournamentView, name="CreateTournament")
|
2021-12-05 13:50:34 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
urlpatterns += router.urls
|