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
cee69bb7
Commit
cee69bb7
authored
Jan 23, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix return of score to progress tab
parent
252e54fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
common/lib/xmodule/xmodule/combined_open_ended_module.py
+24
-4
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
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
):
"""
...
...
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