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
edx
edx-proctoring
Commits
c57c8095
Commit
c57c8095
authored
Aug 05, 2015
by
chrisndodge
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #58 from edx/muhhshoaib/PHX-78
PHX-78 used the new service for resetting the student attempts
parents
3e08fb6a
d7641295
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
2 deletions
+22
-2
edx_proctoring/api.py
+6
-1
edx_proctoring/tests/test_api.py
+5
-1
edx_proctoring/tests/test_services.py
+11
-0
No files found.
edx_proctoring/api.py
View file @
c57c8095
...
...
@@ -507,7 +507,6 @@ def remove_exam_attempt(attempt_id):
"""
existing_attempt
=
ProctoredExamStudentAttempt
.
objects
.
get_exam_attempt_by_id
(
attempt_id
)
if
not
existing_attempt
:
err_msg
=
(
'Cannot remove attempt for attempt_id = {attempt_id} '
...
...
@@ -516,7 +515,13 @@ def remove_exam_attempt(attempt_id):
raise
StudentExamAttemptDoesNotExistsException
(
err_msg
)
username
=
existing_attempt
.
user
.
username
course_id
=
existing_attempt
.
proctored_exam
.
course_id
content_id
=
existing_attempt
.
proctored_exam
.
content_id
existing_attempt
.
delete_exam_attempt
()
instructor_service
=
get_runtime_service
(
'instructor'
)
if
instructor_service
:
instructor_service
.
delete_student_attempt
(
username
,
course_id
,
content_id
)
def
get_all_exams_for_course
(
course_id
):
...
...
edx_proctoring/tests/test_api.py
View file @
c57c8095
...
...
@@ -54,7 +54,10 @@ from .utils import (
LoggedInTestCase
,
)
from
edx_proctoring.tests.test_services
import
MockCreditService
from
edx_proctoring.tests.test_services
import
(
MockCreditService
,
MockInstructorService
,
)
from
edx_proctoring.runtime
import
set_runtime_service
,
get_runtime_service
...
...
@@ -100,6 +103,7 @@ class ProctoredExamApiTests(LoggedInTestCase):
self
.
practice_exam_submitted_msg
=
'You have submitted this practice proctored exam'
set_runtime_service
(
'credit'
,
MockCreditService
())
set_runtime_service
(
'instructor'
,
MockInstructorService
())
def
_create_proctored_exam
(
self
):
"""
...
...
edx_proctoring/tests/test_services.py
View file @
c57c8095
...
...
@@ -60,6 +60,17 @@ class MockCreditService(object):
found
[
0
][
'status'
]
=
status
class
MockInstructorService
(
object
):
"""
Simple mock of the Instructor Service
"""
def
delete_student_attempt
(
self
,
student_identifier
,
course_id
,
content_id
):
# pylint: disable=unused-argument
"""
Mock implementation
"""
return
True
class
TestProctoringService
(
unittest
.
TestCase
):
"""
Tests for ProctoringService
...
...
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