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
0fc15978
Commit
0fc15978
authored
Dec 13, 2017
by
Bill Filler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add flag to not persist grade in SubsectionGradeFactory
parent
f448b63c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
lms/djangoapps/grades/subsection_grade_factory.py
+2
-2
openedx/core/lib/gating/api.py
+2
-2
No files found.
lms/djangoapps/grades/subsection_grade_factory.py
View file @
0fc15978
...
...
@@ -63,7 +63,7 @@ class SubsectionGradeFactory(object):
)
self
.
_unsaved_subsection_grades
.
clear
()
def
update
(
self
,
subsection
,
only_if_higher
=
None
,
score_deleted
=
False
):
def
update
(
self
,
subsection
,
only_if_higher
=
None
,
score_deleted
=
False
,
persist_grade
=
True
):
"""
Updates the SubsectionGrade object for the student and subsection.
"""
...
...
@@ -73,7 +73,7 @@ class SubsectionGradeFactory(object):
subsection
,
self
.
course_data
.
structure
,
self
.
_submissions_scores
,
self
.
_csm_scores
,
)
if
should_persist_grades
(
self
.
course_data
.
course_key
):
if
persist_grade
and
should_persist_grades
(
self
.
course_data
.
course_key
):
if
only_if_higher
:
try
:
grade_model
=
PersistentSubsectionGrade
.
read_grade
(
self
.
student
.
id
,
subsection
.
location
)
...
...
openedx/core/lib/gating/api.py
View file @
0fc15978
...
...
@@ -342,11 +342,11 @@ def compute_is_prereq_met(content_id, user_id, recalc_on_unmet=False):
with
store
.
bulk_operations
(
course_id
):
subsection_usage_key
=
UsageKey
.
from_string
(
_get_gating_block_id
(
milestone
))
subsection_structure
=
get_course_blocks
(
student
,
subsection_usage_key
)
subsection_grade_factory
=
SubsectionGradeFactory
(
student
,
None
,
subsection_structure
)
subsection_grade_factory
=
SubsectionGradeFactory
(
student
,
course_structure
=
subsection_structure
)
if
subsection_usage_key
in
subsection_structure
:
# this will force a recalcuation of the subsection grade
subsection_grade
=
subsection_grade_factory
.
update
(
subsection_structure
[
subsection_usage_key
])
subsection_grade
=
subsection_grade_factory
.
update
(
subsection_structure
[
subsection_usage_key
]
,
persist_grade
=
False
)
prereq_met
=
update_milestone
(
milestone
,
subsection_grade
,
milestone
,
user_id
)
prereq_meta_info
=
{
'url'
:
reverse
(
'jump_to'
,
kwargs
=
{
'course_id'
:
course_id
,
'location'
:
subsection_usage_key
}),
...
...
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