Commit 795d41b9 by Afzal Wali

is_practice_exam is now passed in the POST api to create the exam and also in…

is_practice_exam is now passed in the POST api to create the exam and also in the get_student_view() when being called from edx-platform
parent 8d23902c
...@@ -533,12 +533,14 @@ def get_student_view(user_id, course_id, content_id, ...@@ -533,12 +533,14 @@ def get_student_view(user_id, course_id, content_id,
# This really shouldn't happen # This really shouldn't happen
# as Studio will be setting this up # as Studio will be setting this up
is_proctored = context.get('is_proctored', False) is_proctored = context.get('is_proctored', False)
is_practice_exam = context.get('is_practice_exam', False)
exam_id = create_exam( exam_id = create_exam(
course_id=course_id, course_id=course_id,
content_id=unicode(content_id), content_id=unicode(content_id),
exam_name=context['display_name'], exam_name=context['display_name'],
time_limit_mins=context['default_time_limit_mins'], time_limit_mins=context['default_time_limit_mins'],
is_proctored=is_proctored is_proctored=is_proctored,
is_practice_exam=is_practice_exam
) )
attempt = get_exam_attempt(exam_id, user_id) attempt = get_exam_attempt(exam_id, user_id)
......
...@@ -81,6 +81,7 @@ class ProctoredExamView(AuthenticatedAPIView): ...@@ -81,6 +81,7 @@ class ProctoredExamView(AuthenticatedAPIView):
"exam_name": "Midterm", "exam_name": "Midterm",
"time_limit_mins": 90, "time_limit_mins": 90,
"is_proctored": true, "is_proctored": true,
"is_practice_exam": false,
"external_id": "12213DASAD", "external_id": "12213DASAD",
"is_active": true "is_active": true
} }
...@@ -91,6 +92,7 @@ class ProctoredExamView(AuthenticatedAPIView): ...@@ -91,6 +92,7 @@ class ProctoredExamView(AuthenticatedAPIView):
* exam_name: This is the display name of the Exam (Midterm etc). * exam_name: This is the display name of the Exam (Midterm etc).
* time_limit_mins: Time limit (in minutes) that a student can finish this exam. * time_limit_mins: Time limit (in minutes) that a student can finish this exam.
* is_proctored: Whether this exam actually is proctored or not. * is_proctored: Whether this exam actually is proctored or not.
* is_proctored: Whether this exam will be for practice only.
* external_id: This will be a integration specific ID - say to SoftwareSecure. * external_id: This will be a integration specific ID - say to SoftwareSecure.
* is_active: Whether this exam will be active. * is_active: Whether this exam will be active.
...@@ -108,6 +110,7 @@ class ProctoredExamView(AuthenticatedAPIView): ...@@ -108,6 +110,7 @@ class ProctoredExamView(AuthenticatedAPIView):
"exam_name": "Final", "exam_name": "Final",
"time_limit_mins": 120, "time_limit_mins": 120,
"is_proctored": true, "is_proctored": true,
"is_practice_exam": false,
"external_id": 235 "external_id": 235
"is_active": true "is_active": true
} }
...@@ -140,6 +143,7 @@ class ProctoredExamView(AuthenticatedAPIView): ...@@ -140,6 +143,7 @@ class ProctoredExamView(AuthenticatedAPIView):
exam_name=request.DATA.get('exam_name', None), exam_name=request.DATA.get('exam_name', None),
time_limit_mins=request.DATA.get('time_limit_mins', None), time_limit_mins=request.DATA.get('time_limit_mins', None),
is_proctored=request.DATA.get('is_proctored', None), is_proctored=request.DATA.get('is_proctored', None),
is_practice_exam=request.DATA.get('is_practice_exam', None),
external_id=request.DATA.get('external_id', None), external_id=request.DATA.get('external_id', None),
is_active=request.DATA.get('is_active', None) is_active=request.DATA.get('is_active', None)
) )
...@@ -162,6 +166,7 @@ class ProctoredExamView(AuthenticatedAPIView): ...@@ -162,6 +166,7 @@ class ProctoredExamView(AuthenticatedAPIView):
exam_name=request.DATA.get('exam_name', None), exam_name=request.DATA.get('exam_name', None),
time_limit_mins=request.DATA.get('time_limit_mins', None), time_limit_mins=request.DATA.get('time_limit_mins', None),
is_proctored=request.DATA.get('is_proctored', None), is_proctored=request.DATA.get('is_proctored', None),
is_practice_exam=request.DATA.get('is_practice_exam', None),
external_id=request.DATA.get('external_id', None), external_id=request.DATA.get('external_id', None),
is_active=request.DATA.get('is_active', None), is_active=request.DATA.get('is_active', None),
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment