.
This commit is contained in:
+22
-1
@@ -224,4 +224,25 @@ def answer_suggestion_submit(request):
|
||||
return JsonResponse({"success": True, "error": "Answer submited"})
|
||||
|
||||
# postExamAnswers
|
||||
return JsonResponse({"success": False, "error": "Invalid data"})
|
||||
return JsonResponse({"success": False, "error": "Invalid data"})
|
||||
|
||||
@login_required
|
||||
def answer_suggestion_confirm(request):
|
||||
if request.is_ajax and request.method == "POST":
|
||||
j = json.loads(request.body.decode())
|
||||
question_type = j["question_type"]
|
||||
aid = j["aid"]
|
||||
|
||||
if question_type == "anatomy":
|
||||
AnswerModel = AnatomyAnswer
|
||||
question = AnatomyQuestion
|
||||
elif question_type == "rapid":
|
||||
AnswerModel = RapidAnswer
|
||||
question = Rapid
|
||||
else:
|
||||
return JsonResponse({"success": False, "error": "Invalid question type"})
|
||||
|
||||
answer = get_object_or_404(AnswerModel, pk=qid)
|
||||
answer.proposed = False
|
||||
answer.save()
|
||||
return JsonResponse({"success": True, "error": "Answer changed"})
|
||||
|
||||
Reference in New Issue
Block a user