.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user