Skip to content

Commit

Permalink
Merge pull request #6467 from pretendWhale/v2.2.3
Browse files Browse the repository at this point in the history
V2.2.3
  • Loading branch information
pretendWhale authored Feb 9, 2023
2 parents c4b62e5 + a2c8f90 commit e4d5b71
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

## [v2.2.3]
- Fix bug where in some circumstances the wrong result would be displayed to students (#6465)

## [v2.2.2]
- Apply course maximum file size to feedback files (#6430)
Expand Down
2 changes: 1 addition & 1 deletion app/MARKUS_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION=v2.2.2,PATCH_LEVEL=DEV
VERSION=v2.2.3,PATCH_LEVEL=DEV
2 changes: 1 addition & 1 deletion app/models/submission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def get_latest_result
# then return the original result instead since that one should be visible while the remark
# request is being processed
def get_visible_result
non_pr_results.order(id: :desc).where(released_to_students: true).first || get_original_result
non_pr_results.reorder(id: :desc).where(released_to_students: true).first || get_original_result
end

# Sets marks when automated tests are run
Expand Down
9 changes: 9 additions & 0 deletions spec/models/submission_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,14 @@
expect(submission.get_visible_result).to eq submission.get_original_result
end
end
context 'when there are multiple results released to students' do
before do
released_result
released_remark_result
end
it 'should return the remark' do
expect(submission.get_visible_result).to eq released_remark_result
end
end
end
end

0 comments on commit e4d5b71

Please sign in to comment.