This commit is contained in:
Ross
2021-02-25 18:02:02 +00:00
parent 67163e85ee
commit f5b61f4488
9 changed files with 68 additions and 7 deletions
+9
View File
@@ -131,6 +131,15 @@ class ExamViews(View, LoginRequiredMixin):
exam = get_object_or_404(self.Exam, pk=pk)
if "add_exam_questions" in request.POST:
question_ids = json.loads(request.POST.get("add_exam_questions"))
question_objects = self.Question.objects.filter(pk__in=question_ids)
exam.exam_questions.add(question_objects)
exam.save()
data = {"status": "success"}
return JsonResponse(data, status=200)
if "set_open_access" in request.POST:
if request.POST.get("set_open_access") == "true":
state = True