Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
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
OpenEdx
problem-builder
Commits
484131cf
Commit
484131cf
authored
Oct 05, 2016
by
Sven Marnach
Committed by
GitHub
Oct 05, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #124 from open-craft/smarnach/anonymous-id
Handle unresolvable anonymous ids gracefully.
parents
efe6f231
4c79a376
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
+7
-1
problem_builder/tasks.py
+7
-1
No files found.
problem_builder/tasks.py
View file @
484131cf
...
...
@@ -178,10 +178,16 @@ def _get_submissions(course_key_str, block, user_id):
def
_get_username
(
submission
,
user_id
):
"""
Return username of student who provided `submission`.
If the anonymous id of the submission can't be resolved into a username, the anonymous
id is returned.
"""
# If the student ID key doesn't exist, we're dealing with a single student and know the ID already.
student_id
=
submission
.
get
(
'student_id'
,
user_id
)
return
user_by_anonymous_id
(
student_id
)
.
username
user
=
user_by_anonymous_id
(
student_id
)
if
user
is
None
:
return
student_id
return
user
.
username
def
_get_answer
(
block
,
submission
,
answer_cache
):
...
...
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