.
This commit is contained in:
@@ -56,6 +56,7 @@ urlpatterns = [
|
||||
path("exam/submit", views.exam_submit, name="global_exam_answers_submit"),
|
||||
#path('', include('generic.urls')),
|
||||
path("feedback/<str:question_type>/<int:pk>", views.feedback_create, name="feedback_create"),
|
||||
path("feedback/", views.AddQuestionNote().as_view(), name="feedback"),
|
||||
|
||||
|
||||
path('api/', include(router.urls)),
|
||||
|
||||
+11
-4
@@ -41,6 +41,9 @@ from anatomy.views import AnatomyExamViews
|
||||
from rapids.views import RapidExamViews
|
||||
from longs.views import LongExamViews
|
||||
|
||||
from generic.forms import QuestionNoteForm
|
||||
from generic.models import QuestionNote
|
||||
|
||||
|
||||
@login_required
|
||||
def profile(request):
|
||||
@@ -147,10 +150,14 @@ def exam_submit(request):
|
||||
|
||||
def feedback_create(request, question_type, pk):
|
||||
if question_type == "anatomy":
|
||||
content_type = ContentType.objects.get(model="AnatomyQuestion")
|
||||
question = AnatomyQuestion
|
||||
elif question_type == "rapid":
|
||||
content_type = ContentType.objects.get(model="Rapid")
|
||||
question = Rapid
|
||||
elif question_type == "long":
|
||||
content_type = ContentType.objects.get(model="Long")
|
||||
question = Long
|
||||
|
||||
return JsonResponse({"success": False, "error": "Invalid exam type"})
|
||||
return JsonResponse({"success": False, "error": "Invalid exam type"})
|
||||
|
||||
class AddQuestionNote(LoginRequiredMixin, CreateView):
|
||||
model = QuestionNote
|
||||
form_class = QuestionNoteForm
|
||||
Reference in New Issue
Block a user