Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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-platform
Commits
eadd656d
Commit
eadd656d
authored
May 20, 2016
by
Afzal Wali
Committed by
Douglas Hall
May 27, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SOL-1802 Allow proctoring service to create support ticket.
parent
0f0ea0cf
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
4 deletions
+73
-4
cms/djangoapps/contentstore/views/item.py
+1
-0
common/lib/xmodule/xmodule/course_module.py
+9
-0
common/test/acceptance/pages/studio/settings_advanced.py
+2
-1
lms/djangoapps/instructor/services.py
+33
-0
lms/djangoapps/instructor/tests/test_services.py
+27
-2
requirements/edx/github.txt
+1
-1
No files found.
cms/djangoapps/contentstore/views/item.py
View file @
eadd656d
...
@@ -987,6 +987,7 @@ def create_xblock_info(xblock, data=None, metadata=None, include_ancestor_info=F
...
@@ -987,6 +987,7 @@ def create_xblock_info(xblock, data=None, metadata=None, include_ancestor_info=F
if
xblock
.
category
==
'course'
:
if
xblock
.
category
==
'course'
:
xblock_info
.
update
({
xblock_info
.
update
({
"enable_proctored_exams"
:
xblock
.
enable_proctored_exams
,
"enable_proctored_exams"
:
xblock
.
enable_proctored_exams
,
"create_zendesk_tickets"
:
xblock
.
create_zendesk_tickets
,
"enable_timed_exams"
:
xblock
.
enable_timed_exams
"enable_timed_exams"
:
xblock
.
enable_timed_exams
})
})
elif
xblock
.
category
==
'sequential'
:
elif
xblock
.
category
==
'sequential'
:
...
...
common/lib/xmodule/xmodule/course_module.py
View file @
eadd656d
...
@@ -742,6 +742,15 @@ class CourseFields(object):
...
@@ -742,6 +742,15 @@ class CourseFields(object):
scope
=
Scope
.
settings
scope
=
Scope
.
settings
)
)
create_zendesk_tickets
=
Boolean
(
display_name
=
_
(
"Create Zendesk Tickets For Suspicious Proctored Exam Attempts"
),
help
=
_
(
"Enter true or false. If this value is true, a Zendesk ticket will be created for suspicious attempts."
),
default
=
True
,
scope
=
Scope
.
settings
)
enable_timed_exams
=
Boolean
(
enable_timed_exams
=
Boolean
(
display_name
=
_
(
"Enable Timed Exams"
),
display_name
=
_
(
"Enable Timed Exams"
),
help
=
_
(
help
=
_
(
...
...
common/test/acceptance/pages/studio/settings_advanced.py
View file @
eadd656d
...
@@ -220,5 +220,6 @@ class AdvancedSettingsPage(CoursePage):
...
@@ -220,5 +220,6 @@ class AdvancedSettingsPage(CoursePage):
'enable_timed_exams'
,
'enable_timed_exams'
,
'enable_subsection_gating'
,
'enable_subsection_gating'
,
'learning_info'
,
'learning_info'
,
'instructor_info'
'instructor_info'
,
'create_zendesk_tickets'
]
]
lms/djangoapps/instructor/services.py
View file @
eadd656d
...
@@ -6,10 +6,15 @@ import logging
...
@@ -6,10 +6,15 @@ import logging
from
opaque_keys
import
InvalidKeyError
from
opaque_keys
import
InvalidKeyError
from
opaque_keys.edx.keys
import
CourseKey
,
UsageKey
from
opaque_keys.edx.keys
import
CourseKey
,
UsageKey
from
commerce.signals
import
create_zendesk_ticket
from
courseware.models
import
StudentModule
from
courseware.models
import
StudentModule
from
instructor.views.tools
import
get_student_from_identifier
from
instructor.views.tools
import
get_student_from_identifier
from
django.core.exceptions
import
ObjectDoesNotExist
from
django.core.exceptions
import
ObjectDoesNotExist
import
instructor.enrollment
as
enrollment
import
instructor.enrollment
as
enrollment
from
django.utils.translation
import
ugettext
as
_
from
xmodule.modulestore.django
import
modulestore
from
student.roles
import
CourseStaffRole
from
student.roles
import
CourseStaffRole
...
@@ -86,3 +91,31 @@ class InstructorService(object):
...
@@ -86,3 +91,31 @@ class InstructorService(object):
else Returns False
else Returns False
"""
"""
return
auth
.
user_has_role
(
user
,
CourseStaffRole
(
CourseKey
.
from_string
(
course_id
)))
return
auth
.
user_has_role
(
user
,
CourseStaffRole
(
CourseKey
.
from_string
(
course_id
)))
def
send_support_notification
(
self
,
course_id
,
exam_name
,
student_username
,
review_status
):
"""
Creates a Zendesk ticket for an exam attempt review from the proctoring system.
Currently, it sends notifications for 'Suspicious" status, but additional statuses can be supported
by adding to the notify_support_for_status list in edx_proctoring/backends/software_secure.py
The notifications can be disabled by disabling the
"Create Zendesk Tickets For Suspicious Proctored Exam Attempts" setting in the course's Advanced settings.
"""
course_key
=
CourseKey
.
from_string
(
course_id
)
course
=
modulestore
()
.
get_course
(
course_key
)
if
course
.
create_zendesk_tickets
:
requester_name
=
"edx-proctoring"
email
=
"edx-proctoring@edx.org"
subject
=
_
(
"Proctored Exam Review: {review_status}"
)
.
format
(
review_status
=
review_status
)
body
=
_
(
"A proctored exam attempt for {exam_name} in {course_name} by username: {student_username} "
"was reviewed as {review_status} by the proctored exam review provider."
)
.
format
(
exam_name
=
exam_name
,
course_name
=
course
.
display_name
,
student_username
=
student_username
,
review_status
=
review_status
)
tags
=
[
"proctoring"
]
create_zendesk_ticket
(
requester_name
,
email
,
subject
,
body
,
tags
)
lms/djangoapps/instructor/tests/test_services.py
View file @
eadd656d
...
@@ -10,9 +10,9 @@ from instructor.access import allow_access
...
@@ -10,9 +10,9 @@ from instructor.access import allow_access
from
instructor.services
import
InstructorService
from
instructor.services
import
InstructorService
from
instructor.tests.test_tools
import
msk_from_problem_urlname
from
instructor.tests.test_tools
import
msk_from_problem_urlname
from
nose.plugins.attrib
import
attr
from
nose.plugins.attrib
import
attr
from
student.models
import
CourseEnrollment
from
student.models
import
CourseEnrollment
from
student.tests.factories
import
UserFactory
from
student.tests.factories
import
UserFactory
import
mock
@attr
(
'shard_1'
)
@attr
(
'shard_1'
)
...
@@ -122,7 +122,7 @@ class InstructorServiceTests(SharedModuleStoreTestCase):
...
@@ -122,7 +122,7 @@ class InstructorServiceTests(SharedModuleStoreTestCase):
def
test_is_user_staff
(
self
):
def
test_is_user_staff
(
self
):
"""
"""
Test to assert that the us
r
r is staff or not
Test to assert that the us
e
r is staff or not
"""
"""
result
=
self
.
service
.
is_course_staff
(
result
=
self
.
service
.
is_course_staff
(
self
.
student
,
self
.
student
,
...
@@ -137,3 +137,28 @@ class InstructorServiceTests(SharedModuleStoreTestCase):
...
@@ -137,3 +137,28 @@ class InstructorServiceTests(SharedModuleStoreTestCase):
unicode
(
self
.
course
.
id
)
unicode
(
self
.
course
.
id
)
)
)
self
.
assertTrue
(
result
)
self
.
assertTrue
(
result
)
def
test_report_suspicious_attempt
(
self
):
"""
Test to verify that the create_zendesk_ticket() is called
"""
requester_name
=
"edx-proctoring"
email
=
"edx-proctoring@edx.org"
subject
=
"Proctored Exam Review: {review_status}"
.
format
(
review_status
=
"Suspicious"
)
body
=
"A proctored exam attempt for {exam_name} in {course_name} by username: {student_username} was "
\
"reviewed as {review_status} by the proctored exam review provider."
body
=
body
.
format
(
exam_name
=
"test_exam"
,
course_name
=
self
.
course
.
display_name
,
student_username
=
"test_student"
,
review_status
=
"Suspicious"
)
tags
=
[
"proctoring"
]
with
mock
.
patch
(
"instructor.services.create_zendesk_ticket"
)
as
mock_create_zendesk_ticket
:
self
.
service
.
send_support_notification
(
course_id
=
unicode
(
self
.
course
.
id
),
exam_name
=
"test_exam"
,
student_username
=
"test_student"
,
review_status
=
"Suspicious"
)
mock_create_zendesk_ticket
.
assert_called_with
(
requester_name
,
email
,
subject
,
body
,
tags
)
requirements/edx/github.txt
View file @
eadd656d
...
@@ -90,7 +90,7 @@ git+https://github.com/edx/xblock-utils.git@v1.0.2#egg=xblock-utils==1.0.2
...
@@ -90,7 +90,7 @@ git+https://github.com/edx/xblock-utils.git@v1.0.2#egg=xblock-utils==1.0.2
-e git+https://github.com/edx/edx-reverification-block.git@0.0.5#egg=edx-reverification-block==0.0.5
-e git+https://github.com/edx/edx-reverification-block.git@0.0.5#egg=edx-reverification-block==0.0.5
git+https://github.com/edx/edx-user-state-client.git@1.0.1#egg=edx-user-state-client==1.0.1
git+https://github.com/edx/edx-user-state-client.git@1.0.1#egg=edx-user-state-client==1.0.1
git+https://github.com/edx/xblock-lti-consumer.git@v1.0.6#egg=xblock-lti-consumer==1.0.6
git+https://github.com/edx/xblock-lti-consumer.git@v1.0.6#egg=xblock-lti-consumer==1.0.6
git+https://github.com/edx/edx-proctoring.git@0.12.1
7#egg=edx-proctoring==0.12.17
git+https://github.com/edx/edx-proctoring.git@0.12.1
8#egg=edx-proctoring==0.12.18
# Third Party XBlocks
# Third Party XBlocks
-e git+https://github.com/mitodl/edx-sga@172a90fd2738f8142c10478356b2d9ed3e55334a#egg=edx-sga
-e git+https://github.com/mitodl/edx-sga@172a90fd2738f8142c10478356b2d9ed3e55334a#egg=edx-sga
...
...
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