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
825821ae
Commit
825821ae
authored
Jan 04, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix key generation
parent
fc02e7e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
common/lib/xmodule/xmodule/open_ended_module.py
+10
-4
No files found.
common/lib/xmodule/xmodule/open_ended_module.py
View file @
825821ae
...
...
@@ -263,14 +263,12 @@ class OpenEndedModule():
# Generate header
queuekey
=
xqueue_interface
.
make_hashkey
(
str
(
system
.
seed
)
+
qtime
+
anonymous_student_id
+
1
)
str
(
len
(
self
.
history
))
)
xheader
=
xqueue_interface
.
make_xheader
(
lms_callback_url
=
system
.
xqueue
[
'callback_url'
],
lms_key
=
queuekey
,
queue_name
=
self
.
queue_name
)
self
.
context
.
update
({
'submission'
:
submission
})
contents
=
self
.
payload
.
copy
()
# Metadata related to the student submission revealed to the external grader
...
...
@@ -657,13 +655,21 @@ class OpenEndedModule():
"""
return
self
.
_max_score
def
get_score_value
(
self
):
"""
Returns the last score in the list
"""
score
=
self
.
latest_score
()
return
{
'score'
:
score
if
score
is
not
None
else
0
,
'total'
:
self
.
_max_score
}
def
get_progress
(
self
):
'''
For now, just return last score / max_score
'''
if
self
.
_max_score
>
0
:
try
:
return
Progress
(
self
.
get_score
()[
'score'
],
self
.
_max_score
)
return
Progress
(
self
.
get_score
_value
()[
'score'
],
self
.
_max_score
)
except
Exception
as
err
:
log
.
exception
(
"Got bad progress"
)
return
None
...
...
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