.
This commit is contained in:
+17
-1
@@ -1149,4 +1149,20 @@ def question_review(request, pk):
|
||||
|
||||
question_json = question.get_question_json(based=False)
|
||||
return JsonResponse(question_json)
|
||||
return JsonResponse({"status": "error"})
|
||||
return JsonResponse({"status": "error"})
|
||||
|
||||
@user_is_author_or_rapid_checker
|
||||
def question_save_annotation(request, pk):
|
||||
if request.is_ajax() and request.method == "POST":
|
||||
question = get_object_or_404(Rapid, pk=pk)
|
||||
|
||||
question.image_annotations = request.POST.get("annotation")
|
||||
print(question.image_annotations)
|
||||
|
||||
question.save()
|
||||
data = {"status": "success"}
|
||||
return JsonResponse(data, status=200)
|
||||
else:
|
||||
data = {"status": "error"}
|
||||
return JsonResponse(data, status=400)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user