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
2e0945a5
Commit
2e0945a5
authored
Feb 19, 2016
by
Ibrahim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
send student email conditionally to software secure
parent
d5d52a3e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
12 deletions
+23
-12
edx_proctoring/api.py
+3
-0
edx_proctoring/backends/software_secure.py
+16
-10
edx_proctoring/backends/tests/test_software_secure.py
+2
-1
edx_proctoring/tests/test_services.py
+2
-1
No files found.
edx_proctoring/api.py
View file @
2e0945a5
...
@@ -557,11 +557,13 @@ def create_exam_attempt(exam_id, user_id, taking_as_proctored=False):
...
@@ -557,11 +557,13 @@ def create_exam_attempt(exam_id, user_id, taking_as_proctored=False):
# get the name of the user, if the service is available
# get the name of the user, if the service is available
full_name
=
None
full_name
=
None
email
=
None
credit_service
=
get_runtime_service
(
'credit'
)
credit_service
=
get_runtime_service
(
'credit'
)
if
credit_service
:
if
credit_service
:
credit_state
=
credit_service
.
get_credit_state
(
user_id
,
exam
[
'course_id'
])
credit_state
=
credit_service
.
get_credit_state
(
user_id
,
exam
[
'course_id'
])
full_name
=
credit_state
[
'profile_fullname'
]
full_name
=
credit_state
[
'profile_fullname'
]
email
=
credit_state
[
'student_email'
]
context
=
{
context
=
{
'time_limit_mins'
:
allowed_time_limit_mins
,
'time_limit_mins'
:
allowed_time_limit_mins
,
...
@@ -569,6 +571,7 @@ def create_exam_attempt(exam_id, user_id, taking_as_proctored=False):
...
@@ -569,6 +571,7 @@ def create_exam_attempt(exam_id, user_id, taking_as_proctored=False):
'is_sample_attempt'
:
exam
[
'is_practice_exam'
],
'is_sample_attempt'
:
exam
[
'is_practice_exam'
],
'callback_url'
:
callback_url
,
'callback_url'
:
callback_url
,
'full_name'
:
full_name
,
'full_name'
:
full_name
,
'email'
:
email
}
}
# see if there is an exam review policy for this exam
# see if there is an exam review policy for this exam
...
...
edx_proctoring/backends/software_secure.py
View file @
2e0945a5
...
@@ -47,7 +47,8 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider):
...
@@ -47,7 +47,8 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider):
"""
"""
def
__init__
(
self
,
organization
,
exam_sponsor
,
exam_register_endpoint
,
def
__init__
(
self
,
organization
,
exam_sponsor
,
exam_register_endpoint
,
secret_key_id
,
secret_key
,
crypto_key
,
software_download_url
):
secret_key_id
,
secret_key
,
crypto_key
,
software_download_url
,
send_email
=
False
):
"""
"""
Class initializer
Class initializer
"""
"""
...
@@ -60,6 +61,7 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider):
...
@@ -60,6 +61,7 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider):
self
.
crypto_key
=
crypto_key
self
.
crypto_key
=
crypto_key
self
.
timeout
=
10
self
.
timeout
=
10
self
.
software_download_url
=
software_download_url
self
.
software_download_url
=
software_download_url
self
.
send_email
=
send_email
self
.
passing_review_status
=
[
'Clean'
,
'Rules Violation'
]
self
.
passing_review_status
=
[
'Clean'
,
'Rules Violation'
]
self
.
failing_review_status
=
[
'Not Reviewed'
,
'Suspicious'
]
self
.
failing_review_status
=
[
'Not Reviewed'
,
'Suspicious'
]
...
@@ -392,6 +394,18 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider):
...
@@ -392,6 +394,18 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider):
if
not
exam_name
:
if
not
exam_name
:
exam_name
=
'Proctored Exam'
exam_name
=
'Proctored Exam'
org_extra
=
{
"examStartDate"
:
start_time_str
,
"examEndDate"
:
end_time_str
,
"noOfStudents"
:
1
,
"examID"
:
exam
[
'id'
],
"courseID"
:
exam
[
'course_id'
],
"firstName"
:
first_name
,
"lastName"
:
last_name
}
if
self
.
send_email
:
org_extra
[
"email"
]
=
context
[
'email'
]
return
{
return
{
"examCode"
:
attempt_code
,
"examCode"
:
attempt_code
,
"organization"
:
self
.
organization
,
"organization"
:
self
.
organization
,
...
@@ -406,15 +420,7 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider):
...
@@ -406,15 +420,7 @@ class SoftwareSecureBackendProvider(ProctoringBackendProvider):
"ssiProduct"
:
'rp-now'
,
"ssiProduct"
:
'rp-now'
,
# need to pass in a URL to the LMS?
# need to pass in a URL to the LMS?
"examUrl"
:
callback_url
,
"examUrl"
:
callback_url
,
"orgExtra"
:
{
"orgExtra"
:
org_extra
"examStartDate"
:
start_time_str
,
"examEndDate"
:
end_time_str
,
"noOfStudents"
:
1
,
"examID"
:
exam
[
'id'
],
"courseID"
:
exam
[
'course_id'
],
"firstName"
:
first_name
,
"lastName"
:
last_name
,
}
}
}
def
_header_string
(
self
,
headers
,
date
):
def
_header_string
(
self
,
headers
,
date
):
...
...
edx_proctoring/backends/tests/test_software_secure.py
View file @
2e0945a5
...
@@ -84,7 +84,8 @@ def mock_response_error(url, request): # pylint: disable=unused-argument
...
@@ -84,7 +84,8 @@ def mock_response_error(url, request): # pylint: disable=unused-argument
"exam_register_endpoint"
:
"http://test"
,
"exam_register_endpoint"
:
"http://test"
,
"organization"
:
"edx"
,
"organization"
:
"edx"
,
"exam_sponsor"
:
"edX LMS"
,
"exam_sponsor"
:
"edX LMS"
,
"software_download_url"
:
"http://example.com"
"software_download_url"
:
"http://example.com"
,
"send_email"
:
True
}
}
}
}
)
)
...
...
edx_proctoring/tests/test_services.py
View file @
2e0945a5
...
@@ -18,7 +18,7 @@ class MockCreditService(object):
...
@@ -18,7 +18,7 @@ class MockCreditService(object):
"""
"""
def
__init__
(
self
,
enrollment_mode
=
'verified'
,
profile_fullname
=
'Wolfgang von Strucker'
,
def
__init__
(
self
,
enrollment_mode
=
'verified'
,
profile_fullname
=
'Wolfgang von Strucker'
,
course_name
=
'edx demo'
):
course_name
=
'edx demo'
,
student_email
=
'foo@bar'
):
"""
"""
Initializer
Initializer
"""
"""
...
@@ -27,6 +27,7 @@ class MockCreditService(object):
...
@@ -27,6 +27,7 @@ class MockCreditService(object):
'course_name'
:
course_name
,
'course_name'
:
course_name
,
'enrollment_mode'
:
enrollment_mode
,
'enrollment_mode'
:
enrollment_mode
,
'profile_fullname'
:
profile_fullname
,
'profile_fullname'
:
profile_fullname
,
'student_email'
:
student_email
,
'credit_requirement_status'
:
[]
'credit_requirement_status'
:
[]
}
}
...
...
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