Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with contest voting pooling #1000

Merged
merged 20 commits into from
Sep 17, 2023

Conversation

kjw142857
Copy link
Contributor

@kjw142857 kjw142857 commented Sep 14, 2023

PR to fix issue with the voting file only taking the entries submitted before point of upload and not until the contest closes.

One of these two "trigger events" will possibly release entries into the voting pool:

  • During upload of the voting file, the contest is checked to see if it is still open. If it is closed, immediate release of entries into the voting pool. If it is still open, release of entries into the voting pool is put on hold.
  • Every day at 00:01, batch job runs to check if any contest voting has not done the entry assignment yet. If there is, checks whether the corresponding contest has closed and if it has closed already, releases entries into the voting pool.

@coveralls
Copy link

coveralls commented Sep 15, 2023

Coverage Status

coverage: 95.388% (+0.03%) from 95.362% when pulling ed3949d on kjw142857:master into 04ec74b on source-academy:master.

@kjw142857 kjw142857 marked this pull request as ready for review September 15, 2023 16:27
Copy link
Member

@RichDom2185 RichDom2185 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks okay, but perhaps instead simply just modifying the existing test cases to account for this behaviour, could you create new test cases to explicitly account for this new change? The test coverage is dropping by 0.5% otherwise, which is quite significant.

Thanks!

@kjw142857
Copy link
Contributor Author

Update: have added the tests! Coverage is now -0.05%

Copy link
Member

@RichDom2185 RichDom2185 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. This does mean that if a contest closes in the middle of the day, voting for that contest cannot commence until at least the day after (unless the voting file is only uploaded after the assessment itself closes, then the voting will then begin immediately).

Thanks for the fix and the comprehensive tests!

lib/cadet/assessments/assessments.ex Show resolved Hide resolved
@RichDom2185 RichDom2185 merged commit fdeb111 into source-academy:master Sep 17, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants