Skip to content
Open
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
10 changes: 5 additions & 5 deletions src/commons/assessment/Assessment.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
Button,
Button,
Collapse,
Dialog,
DialogBody,
Expand Down Expand Up @@ -79,7 +79,8 @@

const sortAssessments = (assessments: AssessmentOverview[]) => sortBy(assessments, [a => -a.id]);

const makeSubmissionButton = (overview: AssessmentOverview) => (

const makeSubmissionButton = (overview: AssessmentOverview) => (

Check failure on line 83 in src/commons/assessment/Assessment.tsx

View workflow job for this annotation

GitHub Actions / lint (build)

'makeSubmissionButton' is declared but its value is never read.

Check failure on line 83 in src/commons/assessment/Assessment.tsx

View workflow job for this annotation

GitHub Actions / lint (tsc)

'makeSubmissionButton' is declared but its value is never read.
<Tooltip
disabled={overview.status === AssessmentStatuses.attempted}
content={'You can finalize after saving an answer for each question!'}
Expand Down Expand Up @@ -160,7 +161,6 @@
overview={overview}
renderAttemptButton={role !== Role.Student}
renderGradingTooltip={false}
makeSubmissionButton={makeSubmissionButton}
/>
)
);
Expand All @@ -178,7 +178,6 @@
overview={overview}
renderAttemptButton
renderGradingTooltip={false}
makeSubmissionButton={makeSubmissionButton}
/>
));

Expand All @@ -193,7 +192,6 @@
overview={overview}
renderAttemptButton
renderGradingTooltip
makeSubmissionButton={makeSubmissionButton}
/>
));

Expand Down Expand Up @@ -228,6 +226,8 @@
);
}



// Define the warning text when finalising submissions
const hasBonusXp = (betchaAssessment?.earlySubmissionXp as number) > 0;
const warningText = hasBonusXp ? (
Expand Down
9 changes: 3 additions & 6 deletions src/commons/assessment/AssessmentOverviewCard.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { Card, Elevation, H4, H6, Icon, Intent, Position, Text, Tooltip } from '@blueprintjs/core';

Check failure on line 1 in src/commons/assessment/AssessmentOverviewCard.tsx

View workflow job for this annotation

GitHub Actions / lint (eslint)

Run autofix to sort these imports!
import { IconName, IconNames } from '@blueprintjs/icons';
import classNames from 'classnames';

import classes from 'src/styles/Academy.module.scss';

Check failure on line 5 in src/commons/assessment/AssessmentOverviewCard.tsx

View workflow job for this annotation

GitHub Actions / lint (build)

'classes' is declared but its value is never read.

Check failure on line 5 in src/commons/assessment/AssessmentOverviewCard.tsx

View workflow job for this annotation

GitHub Actions / lint (tsc)

'classes' is declared but its value is never read.
import { JSX } from 'react';

Check failure on line 6 in src/commons/assessment/AssessmentOverviewCard.tsx

View workflow job for this annotation

GitHub Actions / lint (build)

'JSX' is declared but its value is never read.

Check failure on line 6 in src/commons/assessment/AssessmentOverviewCard.tsx

View workflow job for this annotation

GitHub Actions / lint (tsc)

'JSX' is declared but its value is never read.


import defaultCoverImage from '../../assets/default_cover_image.jpg';
import Markdown from '../Markdown';
import NotificationBadge from '../notificationBadge/NotificationBadge';
Expand All @@ -18,15 +21,13 @@
/** Will only render the attempt button if true, regardless of attempt status. */
renderAttemptButton: boolean;
renderGradingTooltip: boolean;
makeSubmissionButton: (overview: AssessmentOverview) => JSX.Element;
};

/** A card to display `AssessmentOverview`s. */
const AssessmentOverviewCard: React.FC<AssessmentOverviewCardProps> = ({
overview,
renderAttemptButton,
renderGradingTooltip,
makeSubmissionButton
}) => {
const { isMobileBreakpoint } = useResponsive();
return (
Expand All @@ -48,7 +49,6 @@
<AssessmentOverviewCardTitle
overview={overview}
renderProgressStatus={renderGradingTooltip}
makeSubmissionButton={makeSubmissionButton}
/>
<div className="listing-description">
<Markdown content={overview.shortSummary} />
Expand Down Expand Up @@ -90,13 +90,11 @@
type AssessmentOverviewCardTitleProps = {
overview: AssessmentOverview;
renderProgressStatus: boolean;
makeSubmissionButton: (overview: AssessmentOverview) => JSX.Element;
};

const AssessmentOverviewCardTitle: React.FC<AssessmentOverviewCardTitleProps> = ({
overview,
renderProgressStatus,
makeSubmissionButton
}) => (
<div className="listing-header">
<Text ellipsize={true}>
Expand All @@ -113,7 +111,6 @@
{renderProgressStatus ? showGradingTooltip(overview.isGradingPublished) : null}
</H4>
</Text>
<div className="listing-button">{makeSubmissionButton(overview)}</div>
</div>
);

Expand Down
Loading
Loading