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
931ee10c
Commit
931ee10c
authored
May 20, 2016
by
Afzal Wali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Call into instructor service's method to create the zendesk ticket.
parent
f5df57f8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
2 deletions
+27
-2
edx_proctoring/backends/software_secure.py
+18
-0
edx_proctoring/backends/tests/test_software_secure.py
+2
-1
edx_proctoring/tests/test_services.py
+6
-0
setup.py
+1
-1
No files found.
edx_proctoring/backends/software_secure.py
View file @
931ee10c
...
...
@@ -24,6 +24,7 @@ from edx_proctoring.exceptions import (
ProctoredExamReviewAlreadyExists
,
ProctoredExamBadReviewStatus
,
)
from
edx_proctoring.runtime
import
get_runtime_service
from
edx_proctoring.utils
import
locate_attempt_by_attempt_code
,
emit_event
from
edx_proctoring
.
models
import
(
ProctoredExamSoftwareSecureReview
,
...
...
@@ -64,6 +65,7 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider):
self
.
send_email
=
send_email
self
.
passing_review_status
=
[
'Clean'
,
'Rules Violation'
]
self
.
failing_review_status
=
[
'Not Reviewed'
,
'Suspicious'
]
self
.
notify_support_for_status
=
[
'Suspicious'
]
def
register_exam_attempt
(
self
,
exam
,
context
):
"""
...
...
@@ -261,6 +263,8 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider):
exam
=
serialized_exam_object
.
data
emit_event
(
exam
,
'review_received'
,
attempt
=
attempt
,
override_data
=
data
)
self
.
_create_zendesk_ticket
(
review
,
serialized_exam_object
,
serialized_attempt_obj
)
def
on_review_saved
(
self
,
review
,
allow_rejects
=
False
):
# pylint: disable=arguments-differ
"""
called when a review has been save - either through API (on_review_callback) or via Django Admin panel
...
...
@@ -349,6 +353,20 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider):
return
(
first_name
,
last_name
)
def
_create_zendesk_ticket
(
self
,
review
,
serialized_exam_object
,
serialized_attempt_obj
):
"""
Creates a Zendesk ticket for reviews with status listed in self.notify_support_for_status
"""
if
review
.
review_status
in
self
.
notify_support_for_status
:
instructor_service
=
get_runtime_service
(
'instructor'
)
if
instructor_service
:
instructor_service
.
send_support_notification
(
course_id
=
serialized_exam_object
[
"course_id"
],
exam_name
=
serialized_exam_object
[
"exam_name"
],
student_username
=
serialized_attempt_obj
[
"user"
][
"username"
],
review_status
=
review
.
review_status
)
def
_get_payload
(
self
,
exam
,
context
):
"""
Constructs the data payload that Software Secure expects
...
...
edx_proctoring/backends/tests/test_software_secure.py
View file @
931ee10c
...
...
@@ -45,7 +45,7 @@ from edx_proctoring.backends.tests.test_review_payload import (
TEST_REVIEW_PAYLOAD
)
from
edx_proctoring.tests.test_services
import
MockCreditService
from
edx_proctoring.tests.test_services
import
MockCreditService
,
MockInstructorService
from
edx_proctoring.backends.software_secure
import
SOFTWARE_SECURE_INVALID_CHARS
...
...
@@ -104,6 +104,7 @@ class SoftwareSecureTests(TestCase):
self
.
user
.
save
()
set_runtime_service
(
'credit'
,
MockCreditService
())
set_runtime_service
(
'instructor'
,
MockInstructorService
())
def
tearDown
(
self
):
"""
...
...
edx_proctoring/tests/test_services.py
View file @
931ee10c
...
...
@@ -128,6 +128,12 @@ class MockInstructorService(object):
"""
return
self
.
is_user_course_staff
def
send_support_notification
(
self
,
course_id
,
exam_name
,
student_username
,
review_status
):
"""
Mocked implementation of send_support_notification
"""
pass
class
TestProctoringService
(
unittest
.
TestCase
):
"""
...
...
setup.py
View file @
931ee10c
...
...
@@ -34,7 +34,7 @@ def load_requirements(*requirements_paths):
setup
(
name
=
'edx-proctoring'
,
version
=
'0.12.1
7
'
,
version
=
'0.12.1
8
'
,
description
=
'Proctoring subsystem for Open edX'
,
long_description
=
open
(
'README.md'
)
.
read
(),
author
=
'edX'
,
...
...
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