Skip to content

Commit

Permalink
Fixes issue where released grades aren't shown on handin page (#1171)
Browse files Browse the repository at this point in the history
* Changes to_i to a shorthand to change t to 1

* Uses is_truthy util to convert instead
  • Loading branch information
victorhuangwq committed May 31, 2020
1 parent 6e17604 commit a419a28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/assessments_controller.rb
Expand Up @@ -475,7 +475,7 @@ def history
.joins("LEFT JOIN scores ON
(submissions.id = scores.submission_id
AND problems.id = scores.problem_id)")

# Process them to get into a format we want.
@scores = {}
for result in results do
Expand All @@ -486,7 +486,7 @@ def history
score: result["score"].to_f,
feedback: result["feedback"],
score_id: result["score_id"].to_i,
released: result["released"].to_i
released: Utilities.is_truthy?(result["released"]) ? 1 : 0 # converts 't' to 1, "f" to 0
}
end

Expand Down

0 comments on commit a419a28

Please sign in to comment.