This commit is contained in:
Ross
2021-01-03 16:50:26 +00:00
parent 2205bd4dfe
commit b7cf7e2a9a
2 changed files with 6 additions and 1 deletions
+3 -1
View File
@@ -322,11 +322,13 @@ def exam_json_edit(request, pk):
exam = get_object_or_404(Exam, pk=pk)
questions_changed = []
for q in exam.exam_questions.all():
q.open_acess = request.POST.get("set_open_access")
q.save()
questions_changed.append(q)
data = {"status": "success"}
data = {"status": "success", "questions": json.dumps(questions_changed)}
return JsonResponse(data, status=200)
else:
data = {"status": "error"}