Skip to content

Cleanup #6994

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

Merged
merged 1 commit into from
Jul 9, 2024
Merged

Cleanup #6994

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions src/shared/components/challenge-detail/Submissions/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,26 +105,23 @@ class SubmissionsComponent extends React.Component {
/**
* Returns the value of the "Initial Score" shown on the submissions tab
* We have to check a couple things because sometimes we're running code challenges that
* likely should be marathon matches (PS-295)
* likely should be marathon matches (PS-295), so the logic is a bit more complex.
*
* Marathon matches place the initial score in submission.score
* We want to show provisional scores _during_ Innovation Challenges, even if run
* as a code challenge, with MM scoring, but for a normal code challenge we don't
* want to show provisional review scores until the challenge completes, so that
* competitors don't have access to scores during appeals.
*
* Code challenges place the initial score in submission.review[x].score
*
* We need to check both places
* @param {Object} submission The submission to return the score for
*/
getInitialScore(submission) {
let score = 'N/A';
const { challenge } = this.props;

if (!_.isEmpty(submission.review)
&& !_.isEmpty(submission.review[0])
&& submission.review[0].score
&& challenge.status === 'Completed') {
&& (challenge.status === 'Completed' || _.includes(challenge.tags, 'Innovation Challenge'))) {
score = Number(submission.review[0].score).toFixed(2);
} else if (!_.isEmpty(submission.score)) {
score = Number(submission.score).toFixed(2);
}
return score;
}
Expand Down
Loading