Skip to content

Commit

Permalink
fix dojo admin csv download
Browse files Browse the repository at this point in the history
  • Loading branch information
robwaz committed Oct 17, 2024
1 parent f36be4e commit b1a30fc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dojo_plugin/pages/course.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ def assessment_name(dojo, assessment):
return f"{module_names[assessment['id']]} Checkpoint"
if assessment["type"] == "due":
return module_names[assessment["id"]]
if assessment["type"] == "helpfulness":
return assessment.get("name", "Discord Helpfulness")
if assessment["type"] == "memes":
return assessment.get("name", "Discord Memes")
return assessment["name"]


Expand Down Expand Up @@ -271,7 +275,7 @@ def clamp_extra(user_id):
max_credit = assessment.get("max_credit") or 1.00
unique_messages = assessment.get("unique") or False
assessment_grades.append(dict(
name=assessment.get("name") or "Discord Helpfulness",
name=assessment_name(dojo, assessment),
progress=get_thanks_progress(dojo, user_id, unique_messages),
credit=get_thanks_credit(dojo, user_id, method, max_credit, unique_messages)
))
Expand All @@ -280,7 +284,7 @@ def clamp_extra(user_id):
max_credit = assessment.get("max_credit") or 1.00
credit = get_meme_credit(dojo, user_id, max_credit)
assessment_grades.append(dict(
name=assessment.get("name") or "Discord Memes",
name=assessment_name(dojo, assessment),
progress=get_meme_progress(dojo, user_id),
credit=credit
))
Expand Down

0 comments on commit b1a30fc

Please sign in to comment.