more improvements ot image annotatiotns
This commit is contained in:
@@ -474,6 +474,21 @@ def active_exams(request):
|
||||
return JsonResponse(active_exams)
|
||||
|
||||
|
||||
def question_save_annotation(request, pk):
|
||||
if request.is_ajax() and request.method=='POST':
|
||||
question = get_object_or_404(AnatomyQuestion, 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)
|
||||
|
||||
|
||||
def exam_json(request, pk):
|
||||
|
||||
exam = get_object_or_404(Exam, pk=pk)
|
||||
@@ -497,6 +512,7 @@ def exam_json(request, pk):
|
||||
"title": "{}".format(q.description),
|
||||
"question": str(q.question_type),
|
||||
"images": [image_as_base64(q.image)],
|
||||
"annotations": [q.image_annotations],
|
||||
"type": "anatomy",
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user