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
91fb2874
Commit
91fb2874
authored
Jan 28, 2015
by
muzaffaryousaf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor code refactoring after PR review.
TNL-836
parent
e3fe2cbf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
23 deletions
+26
-23
openassessment/xblock/openassessmentblock.py
+1
-1
openassessment/xblock/staff_info_mixin.py
+25
-22
No files found.
openassessment/xblock/openassessmentblock.py
View file @
91fb2874
...
@@ -224,7 +224,7 @@ class OpenAssessmentBlock(
...
@@ -224,7 +224,7 @@ class OpenAssessmentBlock(
See also: submissions.api for details.
See also: submissions.api for details.
Args:
Args:
anonymous_user_id(str):
anonymous_user_id(str):
A unique anonymous_user_id for (user, course) pair.
Returns:
Returns:
(dict): The student item associated with this XBlock instance. This
(dict): The student item associated with this XBlock instance. This
includes the student id, item id, and course id.
includes the student id, item id, and course id.
...
...
openassessment/xblock/staff_info_mixin.py
View file @
91fb2874
...
@@ -234,33 +234,36 @@ class StaffInfoMixin(object):
...
@@ -234,33 +234,36 @@ class StaffInfoMixin(object):
submission_uuid
=
None
submission_uuid
=
None
submission
=
None
submission
=
None
assessment_steps
=
self
.
assessment_steps
assessment_steps
=
self
.
assessment_steps
anonymous_user_id
=
None
submissions
=
None
student_item
=
None
if
student_username
:
if
student_username
:
anonymous_user_id
=
self
.
get_anonymous_user_id
(
student_username
,
self
.
course_id
)
anonymous_user_id
=
self
.
get_anonymous_user_id
(
student_username
,
self
.
course_id
)
student_item
=
self
.
get_student_item_dict
(
anonymous_user_id
=
anonymous_user_id
)
student_item
=
self
.
get_student_item_dict
(
anonymous_user_id
=
anonymous_user_id
)
if
anonymous_user_id
:
if
anonymous_user_id
:
# If there is a submission available for the requested student, present
# If there is a submission available for the requested student, present
# it. If not, there will be no other information to collect.
# it. If not, there will be no other information to collect.
submissions
=
submission_api
.
get_submissions
(
student_item
,
1
)
submissions
=
submission_api
.
get_submissions
(
student_item
,
1
)
if
submissions
:
if
submissions
:
submission_uuid
=
submissions
[
0
][
'uuid'
]
submission_uuid
=
submissions
[
0
][
'uuid'
]
submission
=
submissions
[
0
]
submission
=
submissions
[
0
]
if
'file_key'
in
submission
.
get
(
'answer'
,
{}):
if
'file_key'
in
submission
.
get
(
'answer'
,
{}):
file_key
=
submission
[
'answer'
][
'file_key'
]
file_key
=
submission
[
'answer'
][
'file_key'
]
try
:
try
:
submission
[
'image_url'
]
=
file_api
.
get_download_url
(
file_key
)
submission
[
'image_url'
]
=
file_api
.
get_download_url
(
file_key
)
except
file_api
.
FileUploadError
:
except
file_api
.
FileUploadError
:
# Log the error, but do not prevent the rest of the student info
# Log the error, but do not prevent the rest of the student info
# from being displayed.
# from being displayed.
msg
=
(
msg
=
(
u"Could not retrieve image URL for staff debug page. "
u"Could not retrieve image URL for staff debug page. "
u"The student username is '{student_username}', and the file key is {file_key}"
u"The student username is '{student_username}', and the file key is {file_key}"
)
.
format
(
student_username
=
student_username
,
file_key
=
file_key
)
)
.
format
(
student_username
=
student_username
,
file_key
=
file_key
)
logger
.
exception
(
msg
)
logger
.
exception
(
msg
)
example_based_assessment
=
None
example_based_assessment
=
None
self_assessment
=
None
self_assessment
=
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