Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-proctoring
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
edx-proctoring
Commits
185e8304
Commit
185e8304
authored
Jul 14, 2015
by
Afzal Wali
Committed by
Muhammad Shoaib
Jul 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
used the api's function.
parent
07f070c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
edx_proctoring/api.py
+5
-5
edx_proctoring/views.py
+4
-6
No files found.
edx_proctoring/api.py
View file @
185e8304
...
@@ -306,18 +306,18 @@ def stop_exam_attempt(exam_id, user_id):
...
@@ -306,18 +306,18 @@ def stop_exam_attempt(exam_id, user_id):
exam_attempt_obj
.
save
()
exam_attempt_obj
.
save
()
return
exam_attempt_obj
.
id
return
exam_attempt_obj
.
id
def
remove_exam_attempt_by_
code
(
attempt_code
):
def
remove_exam_attempt_by_
id
(
attempt_id
):
"""
"""
Removes an exam attempt given the attempt
code
.
Removes an exam attempt given the attempt
id
.
"""
"""
existing_attempt
=
ProctoredExamStudentAttempt
.
get_exam_attempt_by_
code
(
attempt_code
)
existing_attempt
=
ProctoredExamStudentAttempt
.
get_exam_attempt_by_
id
(
attempt_id
)
if
not
existing_attempt
:
if
not
existing_attempt
:
err_msg
=
(
err_msg
=
(
'Cannot remove attempt for attempt_
code = {attempt_code
} '
'Cannot remove attempt for attempt_
id = {attempt_id
} '
'because it does not exist!'
'because it does not exist!'
)
.
format
(
attempt_
code
=
attempt_code
)
)
.
format
(
attempt_
id
=
attempt_id
)
raise
StudentExamAttemptDoesNotExistsException
(
err_msg
)
raise
StudentExamAttemptDoesNotExistsException
(
err_msg
)
...
...
edx_proctoring/views.py
View file @
185e8304
...
@@ -27,7 +27,8 @@ from edx_proctoring.api import (
...
@@ -27,7 +27,8 @@ from edx_proctoring.api import (
get_allowances_for_course
,
get_allowances_for_course
,
get_all_exams_for_course
,
get_all_exams_for_course
,
get_exam_attempt_by_id
,
get_exam_attempt_by_id
,
get_all_exam_attempts
get_all_exam_attempts
,
remove_exam_attempt_by_id
,
)
)
from
edx_proctoring.exceptions
import
(
from
edx_proctoring.exceptions
import
(
ProctoredBaseException
,
ProctoredBaseException
,
...
@@ -328,11 +329,8 @@ class StudentProctoredExamAttempt(AuthenticatedAPIView):
...
@@ -328,11 +329,8 @@ class StudentProctoredExamAttempt(AuthenticatedAPIView):
)
)
raise
StudentExamAttemptDoesNotExistsException
(
err_msg
)
raise
StudentExamAttemptDoesNotExistsException
(
err_msg
)
exam_attempt_id
=
stop_exam_attempt
(
remove_exam_attempt_by_id
(
attempt_id
)
exam_id
=
attempt
[
'proctored_exam'
][
'id'
],
return
Response
()
user_id
=
request
.
user
.
id
)
return
Response
({
"exam_attempt_id"
:
exam_attempt_id
})
except
ProctoredBaseException
,
ex
:
except
ProctoredBaseException
,
ex
:
return
Response
(
return
Response
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment