Skip to content

Commit fa8b337

Browse files
committed
Cleanup
1 parent f316902 commit fa8b337

File tree

1 file changed

+6
-9
lines changed
  • src/shared/components/challenge-detail/Submissions

1 file changed

+6
-9
lines changed

src/shared/components/challenge-detail/Submissions/index.jsx

+6-9
Original file line numberDiff line numberDiff line change
@@ -105,26 +105,23 @@ class SubmissionsComponent extends React.Component {
105105
/**
106106
* Returns the value of the "Initial Score" shown on the submissions tab
107107
* We have to check a couple things because sometimes we're running code challenges that
108-
* likely should be marathon matches (PS-295)
108+
* likely should be marathon matches (PS-295), so the logic is a bit more complex.
109109
*
110-
* Marathon matches place the initial score in submission.score
110+
* We want to show provisional scores _during_ Innovation Challenges, even if run
111+
* as a code challenge, with MM scoring, but for a normal code challenge we don't
112+
* want to show provisional review scores until the challenge completes, so that
113+
* competitors don't have access to scores during appeals.
111114
*
112-
* Code challenges place the initial score in submission.review[x].score
113-
*
114-
* We need to check both places
115115
* @param {Object} submission The submission to return the score for
116116
*/
117117
getInitialScore(submission) {
118118
let score = 'N/A';
119119
const { challenge } = this.props;
120-
121120
if (!_.isEmpty(submission.review)
122121
&& !_.isEmpty(submission.review[0])
123122
&& submission.review[0].score
124-
&& challenge.status === 'Completed') {
123+
&& (challenge.status === 'Completed' || _.includes(challenge.tags, 'Innovation Challenge'))) {
125124
score = Number(submission.review[0].score).toFixed(2);
126-
} else if (!_.isEmpty(submission.score)) {
127-
score = Number(submission.score).toFixed(2);
128125
}
129126
return score;
130127
}

0 commit comments

Comments
 (0)