fnp
/
edumed.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d93fe7b
)
no Nones in exam form
author
Jan Szejko
<janek37@gmail.com>
Fri, 14 Oct 2016 15:16:44 +0000
(17:16 +0200)
committer
Jan Szejko
<janek37@gmail.com>
Fri, 14 Oct 2016 15:16:44 +0000
(17:16 +0200)
wtem/views.py
patch
|
blob
|
history
diff --git
a/wtem/views.py
b/wtem/views.py
index
504fa5b
..
0696174
100644
(file)
--- a/
wtem/views.py
+++ b/
wtem/views.py
@@
-54,11
+54,11
@@
def form_during(request, key):
else:
answers = {}
for exercise in exercises_with_answers:
else:
answers = {}
for exercise in exercises_with_answers:
- exercise['saved_answer'] = answers.get(str(exercise['id']),
{}
)
+ exercise['saved_answer'] = answers.get(str(exercise['id']),
''
)
if exercise['type'] == 'open' and exercise.get('fields'):
field_answers = {field['id']: field['text'] for field in exercise['saved_answer']}
for field in exercise['fields']:
if exercise['type'] == 'open' and exercise.get('fields'):
field_answers = {field['id']: field['text'] for field in exercise['saved_answer']}
for field in exercise['fields']:
- field['saved_answer'] = field_answers.get(field['id'])
+ field['saved_answer'] = field_answers.get(field['id']
, ''
)
if request.method == 'GET':
return render(request, 'wtem/main.html', {'exercises': exercises_with_answers, 'end_time': submission.end_time})
elif request.method == 'POST':
if request.method == 'GET':
return render(request, 'wtem/main.html', {'exercises': exercises_with_answers, 'end_time': submission.end_time})
elif request.method == 'POST':