Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
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-ora2
Commits
03d2e51f
Commit
03d2e51f
authored
Jun 22, 2017
by
Awais Jibran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix unable to view ORA responses (files) in leaderboard
EDUCATOR-560
parent
93e0ca47
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
9 deletions
+28
-9
AUTHORS
+1
-0
openassessment/xblock/leaderboard_mixin.py
+27
-9
openassessment/xblock/test/test_leaderboard.py
+0
-0
No files found.
AUTHORS
View file @
03d2e51f
...
...
@@ -28,3 +28,4 @@ Mushtaq Ali <mushtaak@gmail.com>
Dmitry Viskov <dmitry.viskov@webenterprise.ru>
Jeff LaJoie <jlajoie@edx.org>
Albert St. Aubin Jr. <astaubin@edx.org>
Awais Jibran <awaisdar001@gmail.com>
openassessment/xblock/leaderboard_mixin.py
View file @
03d2e51f
...
...
@@ -76,16 +76,18 @@ class LeaderboardMixin(object):
for
score
in
scores
:
score
[
'files'
]
=
[]
if
'file_keys'
in
score
[
'content'
]:
f
or
key
in
score
[
'content'
][
'file_keys'
]:
url
=
''
try
:
url
=
file_upload_api
.
get
_download_url
(
key
)
except
FileUploadError
:
pass
if
url
:
score
[
'files'
]
.
append
(
url
)
f
ile_keys
=
score
[
'content'
]
.
get
(
'file_keys'
,
[])
descriptions
=
score
[
'content'
]
.
get
(
'files_descriptions'
,
[])
for
idx
,
key
in
enumerate
(
file_keys
)
:
file_download_url
=
self
.
_get_file
_download_url
(
key
)
if
file_download_url
:
file_description
=
descriptions
[
idx
]
if
idx
<
len
(
descriptions
)
else
''
score
[
'files'
]
.
append
((
file_download_url
,
file_description
))
elif
'file_key'
in
score
[
'content'
]:
score
[
'files'
]
.
append
(
file_upload_api
.
get_download_url
(
score
[
'content'
][
'file_key'
]))
file_download_url
=
self
.
_get_file_download_url
(
score
[
'content'
][
'file_key'
])
if
file_download_url
:
score
[
'files'
]
.
append
((
file_download_url
,
''
))
if
'text'
in
score
[
'content'
]
or
'parts'
in
score
[
'content'
]:
submission
=
{
'answer'
:
score
.
pop
(
'content'
)}
score
[
'submission'
]
=
create_submission_dict
(
submission
,
self
.
prompts
)
...
...
@@ -112,3 +114,19 @@ class LeaderboardMixin(object):
template_path (string), tuple of context (dict)
"""
return
'openassessmentblock/leaderboard/oa_leaderboard_waiting.html'
,
{
'xblock_id'
:
self
.
get_xblock_id
()}
def
_get_file_download_url
(
self
,
file_key
):
"""
Internal function for retrieving the download url at which the file that corresponds
to the file_key can be downloaded.
Arguments:
file_key (string): Corresponding file key.
Returns:
file_download_url (string) or empty string in case of error.
"""
try
:
file_download_url
=
file_upload_api
.
get_download_url
(
file_key
)
except
FileUploadError
:
file_download_url
=
''
return
file_download_url
openassessment/xblock/test/test_leaderboard.py
View file @
03d2e51f
This diff is collapsed.
Click to expand it.
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