diff --git a/src/components/Assignments/Assignment/AssignmentDetails/AssignmentDetails.js b/src/components/Assignments/Assignment/AssignmentDetails/AssignmentDetails.js index 33e3370be..82f9119c2 100644 --- a/src/components/Assignments/Assignment/AssignmentDetails/AssignmentDetails.js +++ b/src/components/Assignments/Assignment/AssignmentDetails/AssignmentDetails.js @@ -128,11 +128,15 @@ const AssignmentDetails = ({ defaultMessage="Solutions submitted before the first deadline are considered to be on time and graded with full points. Submissions made between the deadlines are considered to be late but still worth some points. Submissions made after the second deadline are evaluated, but awarded no points. Open the graph to see in detail how the deadlines affect the awarded points." /> -
- + {(maxPointsBeforeFirstDeadline !== 0 || maxPointsBeforeSecondDeadline !== 0) && ( + <> +
+ + + )} ) : ( <> @@ -303,7 +307,7 @@ const AssignmentDetails = ({ - {allowSecondDeadline && ( + {(maxPointsBeforeFirstDeadline !== 0 || (allowSecondDeadline && maxPointsBeforeSecondDeadline !== 0)) && ( setOpen(false)} size="xl"> diff --git a/src/components/Solutions/SolutionStatus/SolutionStatus.js b/src/components/Solutions/SolutionStatus/SolutionStatus.js index 1a1d78fbc..3210367cc 100644 --- a/src/components/Solutions/SolutionStatus/SolutionStatus.js +++ b/src/components/Solutions/SolutionStatus/SolutionStatus.js @@ -458,38 +458,42 @@ class SolutionStatus extends Component {

)} -
+ {(maxPointsBeforeFirstDeadline !== 0 || (allowSecondDeadline && maxPointsBeforeSecondDeadline !== 0)) && ( + <> +
-
- - {(overriddenPoints !== null || evaluation.score * 100 < pointsPercentualThreshold) && ( - <> - {' '} +
- - )} - : -
- -
- -
+ {(overriddenPoints !== null || evaluation.score * 100 < pointsPercentualThreshold) && ( + <> + {' '} + + + )} + : +
+ +
+ +
+ + )}
)} diff --git a/src/components/forms/EditAssignmentForm/DeadlinesGraphDialog.js b/src/components/forms/EditAssignmentForm/DeadlinesGraphDialog.js index d4a1df6ed..de828ed95 100644 --- a/src/components/forms/EditAssignmentForm/DeadlinesGraphDialog.js +++ b/src/components/forms/EditAssignmentForm/DeadlinesGraphDialog.js @@ -8,19 +8,27 @@ import { PointsGraphIcon } from '../../icons'; import Button from '../../widgets/TheButton'; import { deadlinesAndPontsAreValid } from './deadlineHelpers'; -const DeadlinesGraphDialog = ({ deadlines, ...props }) => { +const DeadlinesGraphDialog = ({ deadlines, maxPointsBeforeFirstDeadline, maxPointsBeforeSecondDeadline, ...props }) => { const [open, setOpen] = useState(false); - const valid = deadlinesAndPontsAreValid({ deadlines, ...props }); + const valid = deadlinesAndPontsAreValid({ + deadlines, + maxPointsBeforeFirstDeadline, + maxPointsBeforeSecondDeadline, + ...props, + }); + const trivial = maxPointsBeforeFirstDeadline === 0 && (deadlines === 'single' || maxPointsBeforeSecondDeadline === 0); return ( <> - + {!trivial && ( + + )} setOpen(false)} size={deadlines === 'single' ? 'lg' : 'xl'}> @@ -39,6 +47,8 @@ const DeadlinesGraphDialog = ({ deadlines, ...props }) => { allowSecondDeadline={deadlines !== 'single'} maxPointsDeadlineInterpolation={deadlines === 'interpolated'} viewportAspectRatio={deadlines === 'single' ? 1 / 3 : 1 / 2} + maxPointsBeforeFirstDeadline={maxPointsBeforeFirstDeadline} + maxPointsBeforeSecondDeadline={maxPointsBeforeSecondDeadline} {...props} /> )}