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

Remove unnecessary evaluationFailed flag from evaluation details #104

Merged
merged 1 commit into from
Oct 17, 2017
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,6 @@ const EvaluationDetail = ({ evaluation, note = '' }) => (
</td>
</tr>

<tr>
<th>
<FormattedMessage
id="app.evaluationDetail.hasFinished"
defaultMessage="Evaluation process has finished:"
/>
</th>
<td className="text-center">
<MaybeSucceededIcon success={!evaluation.evaluationFailed} />
</td>
</tr>

<tr>
<th>
<FormattedMessage
Expand Down
73 changes: 35 additions & 38 deletions src/components/Submissions/EvaluationDetail/EvaluationDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,37 +56,28 @@ const EvaluationDetail = ({
/>
</th>
<td className="text-center">
{submittedAt < firstDeadline
? <Icon name="check" className="text-success" />
: <Icon name="times" className="text-danger" />}
{submittedAt < firstDeadline ? (
<Icon name="check" className="text-success" />
) : (
<Icon name="times" className="text-danger" />
)}
</td>
</tr>

{submittedAt >= firstDeadline &&
allowSecondDeadline === true &&
<tr>
<th>
<FormattedMessage
id="app.evaluationDetail.beforeSecondDeadline"
defaultMessage="Was submitted before the second deadline:"
/>
</th>
<td className="text-center">
<MaybeSucceededIcon success={submittedAt < secondDeadline} />
</td>
</tr>}

<tr>
<th>
<FormattedMessage
id="app.evaluationDetail.hasFinished"
defaultMessage="Evaluation process has finished:"
/>
</th>
<td className="text-center">
<MaybeSucceededIcon success={!evaluation.evaluationFailed} />
</td>
</tr>
allowSecondDeadline === true && (
<tr>
<th>
<FormattedMessage
id="app.evaluationDetail.beforeSecondDeadline"
defaultMessage="Was submitted before the second deadline:"
/>
</th>
<td className="text-center">
<MaybeSucceededIcon success={submittedAt < secondDeadline} />
</td>
</tr>
)}

<tr>
<th>
Expand Down Expand Up @@ -126,7 +117,9 @@ const EvaluationDetail = ({
'text-success': evaluation.isCorrect
})}
>
<b><FormattedNumber style="percent" value={evaluation.score} /></b>
<b>
<FormattedNumber style="percent" value={evaluation.score} />
</b>
</td>
</tr>
<tr>
Expand All @@ -139,17 +132,17 @@ const EvaluationDetail = ({
<td
className={classnames({
'text-center': true,
'text-danger': !evaluation.isCorrect &&
evaluation.bonusPoints === 0,
'text-success': evaluation.isCorrect &&
evaluation.bonusPoints === 0,
'text-danger':
!evaluation.isCorrect && evaluation.bonusPoints === 0,
'text-success':
evaluation.isCorrect && evaluation.bonusPoints === 0,
'text-bold': evaluation.bonusPoints === 0
})}
>
{evaluation.points}/{maxPoints}
</td>
</tr>
{evaluation.bonusPoints !== 0 &&
{evaluation.bonusPoints !== 0 && (
<tr>
<th>
<FormattedMessage
Expand All @@ -160,8 +153,9 @@ const EvaluationDetail = ({
<td className="text-center">
<BonusPoints bonus={evaluation.bonusPoints} />
</td>
</tr>}
{evaluation.bonusPoints !== 0 &&
</tr>
)}
{evaluation.bonusPoints !== 0 && (
<tr>
<th>
<FormattedMessage
Expand All @@ -172,17 +166,20 @@ const EvaluationDetail = ({
<td
className={classnames({
'text-center': true,
'text-danger': !evaluation.isCorrect ||
'text-danger':
!evaluation.isCorrect ||
evaluation.points + evaluation.bonusPoints <= 0,
'text-success': evaluation.isCorrect &&
'text-success':
evaluation.isCorrect &&
evaluation.points + evaluation.bonusPoints > 0
})}
>
<b>
{evaluation.points + evaluation.bonusPoints}/{maxPoints}
</b>
</td>
</tr>}
</tr>
)}
</tbody>
</Table>
</Box>
Expand Down