.
This commit is contained in:
+14
-2
@@ -36,9 +36,9 @@ from longs.models import Exam as LongExam
|
||||
from anatomy.models import AnatomyQuestion as AnatomyQuestion
|
||||
from anatomy.models import Exam as AnatomyExam
|
||||
from sbas.models import Question as SbasQuestion
|
||||
#from sbas.models import Exam as SbasExam
|
||||
from sbas.models import Exam as SbasExam
|
||||
from physics.models import Question as PhysicsQuestion
|
||||
#from physics.models import Exam as PhysicsExam
|
||||
from physics.models import Exam as PhysicsExam
|
||||
|
||||
from django.db.models import Case, When
|
||||
from django.conf import settings
|
||||
@@ -109,6 +109,12 @@ def generic_exam_json_edit(request):
|
||||
elif question_type == "anatomy":
|
||||
Exam = AnatomyExam
|
||||
Question = AnatomyQuestion
|
||||
elif question_type == "physics":
|
||||
Exam = PhysicsExam
|
||||
Question = PhysicsQuestion
|
||||
elif question_type == "sbas":
|
||||
Exam = SbasExam
|
||||
Question = SbasQuestion
|
||||
else:
|
||||
data = {"status": "error"}
|
||||
return JsonResponse(data, status=400)
|
||||
@@ -116,6 +122,12 @@ def generic_exam_json_edit(request):
|
||||
|
||||
exam = get_object_or_404(Exam, pk=request.POST.get("exam_id"))
|
||||
|
||||
#if "exam_toggle_active" in request.POST:
|
||||
# active = json.loads(request.POST.get("active"))
|
||||
|
||||
# data = {"status": "success"}
|
||||
# return JsonResponse(data, status=200)
|
||||
|
||||
if "add_exam_questions" in request.POST:
|
||||
question_ids = json.loads(request.POST.get("add_exam_questions"))
|
||||
#question_objects = Question.objects.filter(pk__in=question_ids)
|
||||
|
||||
Reference in New Issue
Block a user