Added email notifications
This commit is contained in:
@ -75,25 +75,6 @@ def _result():
|
||||
tags_low = { tag: tag_result['max'] - tag_result['scored'] for tag, tag_result in entry.result['tags'].items() }
|
||||
sorted_low_tags = sorted(tags_low.items(), key=lambda x: x[1], reverse=True)
|
||||
tag_output = [ tag[0] for tag in sorted_low_tags[0:3] if tag[1] > 3]
|
||||
revision_plain = ''
|
||||
revision_html = ''
|
||||
if entry.result['grade'] == 'pass':
|
||||
flavour_text_plain = """Well done on successfully completing the refereeing theory exam. We really appreciate members of our community taking the time to get qualified to referee.
|
||||
"""
|
||||
elif entry.result['grade'] == 'merit':
|
||||
flavour_text_plain = """Congratulations on achieving a merit in the refereeing exam. We are delighted that members of our community work so hard with refereeing.
|
||||
"""
|
||||
elif entry.result['grade'] == 'fail':
|
||||
flavour_text_plain = """Unfortunately, you were not successful in passing the theory exam in this attempt. We hope that this does not dissuade you, and that you try again in the future.
|
||||
"""
|
||||
revision_plain = f"""Based on your answers, we would also suggest you brush up on the following topics for your next attempt:\n\n
|
||||
{','.join(tag_output)}\n\n
|
||||
"""
|
||||
revision_html = f"""<p>Based on your answers, we would also suggest you brush up on the following topics for your next attempt:</p>
|
||||
<ul>
|
||||
<li>{'</li><li>'.join(tag_output)}</li>
|
||||
</ul>
|
||||
"""
|
||||
if not entry.status == 'late':
|
||||
pass
|
||||
entry.notify_result()
|
||||
return render_template('/quiz/result.html', entry=entry, score=score, tag_output=tag_output)
|
Reference in New Issue
Block a user