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
cee69bb7
Commit
cee69bb7
authored
12 years ago
by
Vik Paruchuri
Browse files
Options
Downloads
Patches
Plain Diff
Fix return of score to progress tab
parent
252e54fe
No related branches found
Branches containing commit
Tags
release-2021-08-25-12.36
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/lib/xmodule/xmodule/combined_open_ended_module.py
+24
-4
24 additions, 4 deletions
common/lib/xmodule/xmodule/combined_open_ended_module.py
with
24 additions
and
4 deletions
common/lib/xmodule/xmodule/combined_open_ended_module.py
+
24
−
4
View file @
cee69bb7
...
...
@@ -578,14 +578,19 @@ class CombinedOpenEndedModule(XModule):
'
total
'
: get_max_score()}
"""
max_score
=
None
score
=
None
if
(
self
.
state
==
self
.
DONE
or
self
.
allow_reset
)
and
self
.
is_scored
:
last_response
=
self
.
get_last_response
(
self
.
current_task_number
-
1
)
last_response
=
self
.
get_last_response
(
self
.
current_task_number
)
max_score
=
last_response
[
'
max_score
'
]
score
=
last_response
[
'
score
'
]
return
{
log
.
debug
(
last_response
)
score_dict
=
{
'
score
'
:
score
,
'
total
'
:
max_score
,
}
}
return
score_dict
def
max_score
(
self
):
'''
Maximum score. Two notes:
...
...
@@ -595,10 +600,25 @@ class CombinedOpenEndedModule(XModule):
'''
max_score
=
None
if
(
self
.
state
==
self
.
DONE
or
self
.
allow_reset
)
and
self
.
is_scored
:
last_response
=
self
.
get_last_response
(
self
.
current_task_number
-
1
)
last_response
=
self
.
get_last_response
(
self
.
current_task_number
)
max_score
=
last_response
[
'
max_score
'
]
return
max_score
def
get_progress
(
self
):
'''
Return a progress.Progress object that represents how far the
student has gone in this module. Must be implemented to get correct
progress tracking behavior in nesting modules like sequence and
vertical.
If this module has no notion of progress, return None.
'''
progress_object
=
None
if
(
self
.
state
==
self
.
DONE
or
self
.
allow_reset
)
and
self
.
is_scored
:
score_dict
=
self
.
get_score
()
progress_object
=
Progress
(
score_dict
[
'
score
'
],
score_dict
[
'
total
'
])
return
progress_object
class
CombinedOpenEndedDescriptor
(
XmlDescriptor
,
EditingDescriptor
):
"""
...
...
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