Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
4957b981
Commit
4957b981
authored
5 years ago
by
Matt Hughes
Committed by
Matt Hughes
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Only delete latest grade override if it came from proctoring
... on proctored exam attempt deletion JIRA:EDUCATOR-4642
parent
e80b76c3
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lms/djangoapps/grades/api.py
+7
-2
7 additions, 2 deletions
lms/djangoapps/grades/api.py
lms/djangoapps/grades/constants.py
+1
-0
1 addition, 0 deletions
lms/djangoapps/grades/constants.py
lms/djangoapps/grades/tests/test_services.py
+24
-1
24 additions, 1 deletion
lms/djangoapps/grades/tests/test_services.py
with
32 additions
and
3 deletions
lms/djangoapps/grades/api.py
+
7
−
2
View file @
4957b981
...
...
@@ -65,6 +65,7 @@ def override_subsection_grade(
requesting_user
=
overrider
,
subsection_grade_model
=
grade
,
feature
=
feature
,
system
=
feature
,
earned_all_override
=
earned_all
,
earned_graded_override
=
earned_graded
,
)
...
...
@@ -93,6 +94,10 @@ def undo_override_subsection_grade(user_id, course_key_or_id, usage_key_or_id, f
Fires off a recalculate_subsection_grade async task to update the PersistentSubsectionGrade table. If the
override does not exist, no error is raised, it just triggers the recalculation.
feature: if specified, the deletion will only occur if the
override to be deleted was created by the corresponding
subsystem
"""
course_key
=
_get_key
(
course_key_or_id
,
CourseKey
)
usage_key
=
_get_key
(
usage_key_or_id
,
UsageKey
)
...
...
@@ -102,8 +107,8 @@ def undo_override_subsection_grade(user_id, course_key_or_id, usage_key_or_id, f
except
ObjectDoesNotExist
:
return
# Older rejected exam attempts that transition to verified might
not
hav
e an
override created
if
override
is
not
None
:
if
override
is
not
Non
e
an
d
(
not
feature
or
feature
==
override
.
system
)
:
override
.
delete
(
feature
=
feature
)
# Cache a new event id and event type which the signal handler will use to emit a tracking log event.
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/grades/constants.py
+
1
−
0
View file @
4957b981
...
...
@@ -15,3 +15,4 @@ class ScoreDatabaseTableEnum(object):
class
GradeOverrideFeatureEnum
(
object
):
proctoring
=
'
PROCTORING
'
gradebook
=
'
GRADEBOOK
'
grade_import
=
'
grade-import
'
This diff is collapsed.
Click to expand it.
lms/djangoapps/grades/tests/test_services.py
+
24
−
1
View file @
4957b981
...
...
@@ -259,7 +259,10 @@ class GradesServiceTests(ModuleStoreTestCase):
@freeze_time
(
'
2017-01-01
'
)
def
test_undo_override_subsection_grade
(
self
):
override
,
_
=
PersistentSubsectionGradeOverride
.
objects
.
update_or_create
(
grade
=
self
.
grade
)
override
,
_
=
PersistentSubsectionGradeOverride
.
objects
.
update_or_create
(
grade
=
self
.
grade
,
system
=
GradeOverrideFeatureEnum
.
proctoring
)
override_id
=
override
.
id
self
.
service
.
undo_override_subsection_grade
(
user_id
=
self
.
user
.
id
,
...
...
@@ -286,6 +289,26 @@ class GradesServiceTests(ModuleStoreTestCase):
override_history
=
PersistentSubsectionGradeOverrideHistory
.
objects
.
filter
(
override_id
=
override_id
).
first
()
self
.
_verify_override_history
(
override_history
,
PersistentSubsectionGradeOverrideHistory
.
DELETE
)
def
test_undo_override_subsection_grade_across_features
(
self
):
"""
Test that deletion of subsection grade overrides requested by
one feature doesn
'
t delete overrides created by another
feature.
"""
override
,
_
=
PersistentSubsectionGradeOverride
.
objects
.
update_or_create
(
grade
=
self
.
grade
,
system
=
GradeOverrideFeatureEnum
.
gradebook
)
self
.
service
.
undo_override_subsection_grade
(
user_id
=
self
.
user
.
id
,
course_key_or_id
=
self
.
course
.
id
,
usage_key_or_id
=
self
.
subsection
.
location
,
feature
=
GradeOverrideFeatureEnum
.
proctoring
,
)
override
=
self
.
service
.
get_subsection_grade_override
(
self
.
user
.
id
,
self
.
course
.
id
,
self
.
subsection
.
location
)
self
.
assertIsNotNone
(
override
)
@freeze_time
(
'
2018-01-01
'
)
def
test_undo_override_subsection_grade_without_grade
(
self
):
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment