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
e9b43963
Commit
e9b43963
authored
Jul 26, 2017
by
Tyler Hallada
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to match changes to API of GradesService
parent
e074693f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
edx_proctoring/api.py
+1
-1
edx_proctoring/tests/test_api.py
+1
-1
edx_proctoring/tests/test_services.py
+5
-4
No files found.
edx_proctoring/api.py
View file @
e9b43963
...
@@ -911,7 +911,7 @@ def update_attempt_status(exam_id, user_id, to_status,
...
@@ -911,7 +911,7 @@ def update_attempt_status(exam_id, user_id, to_status,
grades_service
.
override_subsection_grade
(
grades_service
.
override_subsection_grade
(
user_id
=
exam_attempt_obj
.
user_id
,
user_id
=
exam_attempt_obj
.
user_id
,
course_key_or_id
=
exam
[
'course_id'
],
course_key_or_id
=
exam
[
'course_id'
],
subsection
=
exam_attempt_obj
.
proctored_exam
.
content_id
,
usage_key_or_id
=
exam_attempt_obj
.
proctored_exam
.
content_id
,
earned_all
=
REJECTED_GRADE_OVERRIDE_EARNED
,
earned_all
=
REJECTED_GRADE_OVERRIDE_EARNED
,
earned_graded
=
REJECTED_GRADE_OVERRIDE_EARNED
earned_graded
=
REJECTED_GRADE_OVERRIDE_EARNED
)
)
...
...
edx_proctoring/tests/test_api.py
View file @
e9b43963
...
@@ -930,7 +930,7 @@ class ProctoredExamApiTests(ProctoredExamTestCase):
...
@@ -930,7 +930,7 @@ class ProctoredExamApiTests(ProctoredExamTestCase):
grades_service
=
get_runtime_service
(
'grades'
)
grades_service
=
get_runtime_service
(
'grades'
)
grades
=
grades_service
.
get_subsection_grade
(
user_id
=
self
.
user
.
id
,
grades
=
grades_service
.
get_subsection_grade
(
user_id
=
self
.
user
.
id
,
course_key_or_id
=
exam_attempt
.
proctored_exam
.
course_id
,
course_key_or_id
=
exam_attempt
.
proctored_exam
.
course_id
,
subsection
=
exam_attempt
.
proctored_exam
.
content_id
)
usage_key_or_id
=
exam_attempt
.
proctored_exam
.
content_id
)
self
.
assertEqual
(
grades
,
{
self
.
assertEqual
(
grades
,
{
'earned_all'
:
0.0
,
'earned_all'
:
0.0
,
...
...
edx_proctoring/tests/test_services.py
View file @
e9b43963
...
@@ -183,13 +183,14 @@ class MockGradesService(object):
...
@@ -183,13 +183,14 @@ class MockGradesService(object):
"""Initialize empty data store for grades (a dict)"""
"""Initialize empty data store for grades (a dict)"""
self
.
grades
=
{}
self
.
grades
=
{}
def
get_subsection_grade
(
self
,
user_id
,
course_key_or_id
,
subsection
):
def
get_subsection_grade
(
self
,
user_id
,
course_key_or_id
,
usage_key_or_id
):
"""Returns entered grade override for key (user_id + course_key + subsection) or None"""
"""Returns entered grade override for key (user_id + course_key + subsection) or None"""
return
self
.
grades
.
get
(
str
(
user_id
)
+
str
(
course_key_or_id
)
+
str
(
subsection
))
return
self
.
grades
.
get
(
str
(
user_id
)
+
str
(
course_key_or_id
)
+
str
(
usage_key_or_id
))
def
override_subsection_grade
(
self
,
user_id
,
course_key_or_id
,
subsection
,
earned_all
=
None
,
earned_graded
=
None
):
def
override_subsection_grade
(
self
,
user_id
,
course_key_or_id
,
usage_key_or_id
,
earned_all
=
None
,
earned_graded
=
None
):
"""Sets grade override earned points for key (user_id + course_key + subsection)"""
"""Sets grade override earned points for key (user_id + course_key + subsection)"""
self
.
grades
[
str
(
user_id
)
+
str
(
course_key_or_id
)
+
str
(
subsection
)]
=
{
self
.
grades
[
str
(
user_id
)
+
str
(
course_key_or_id
)
+
str
(
usage_key_or_id
)]
=
{
'earned_all'
:
earned_all
,
'earned_all'
:
earned_all
,
'earned_graded'
:
earned_graded
'earned_graded'
:
earned_graded
}
}
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