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 router = DefaultRouter(trailing_slash=False) router.register("items", TestModelViewSet) urlpatterns = [ path('/show', TestTemplateView.as_view()), path('/password', TestPasswordTemplateView), path('/mark', TestValidateAPIView.as_view()), path('/result', TestResultView.as_view()), path('/rateTest', rateTest, name="rateTest"), path('/edit', EditTestTemplateView.as_view()), path('/add-question', AddQuestionToExistingTest.as_view()), path('/remove-question', RemoveQuestionFromExistingTest.as_view()), path('question//edit', EditQuestionTemplateView.as_view()), path('/editName', editName, name="editName"), path('/editVisible', editVisible, name="editVisible"), path('/editPassword', editPassword, name="editPassword"), path('/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/', solvedTestsDetailed, name="solvedTests"), path('tournamets', TournamentView, name="tournaments"), path('add/tournament', CreateTournamentView, name="CreateTournament"), path('/tournament/show', TournamentTemplateView.as_view()), path('/tournament/result', TournamentResultView.as_view()) ] urlpatterns += router.urls