Skip to content
Open
Show file tree
Hide file tree
Changes from 5 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 Assessment: React.FC = () => {

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

const makeSubmissionButton = (overview: AssessmentOverview) => (

const makeSubmissionButton = (overview: AssessmentOverview) => (
<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 @@ const Assessment: React.FC = () => {
overview={overview}
renderAttemptButton={role !== Role.Student}
renderGradingTooltip={false}
makeSubmissionButton={makeSubmissionButton}
/>
)
);
Expand All @@ -178,7 +178,6 @@ const Assessment: React.FC = () => {
overview={overview}
renderAttemptButton
renderGradingTooltip={false}
makeSubmissionButton={makeSubmissionButton}
/>
));

Expand All @@ -193,7 +192,6 @@ const Assessment: React.FC = () => {
overview={overview}
renderAttemptButton
renderGradingTooltip
makeSubmissionButton={makeSubmissionButton}
/>
));

Expand Down Expand Up @@ -228,6 +226,8 @@ const Assessment: React.FC = () => {
);
}



// Define the warning text when finalising submissions
const hasBonusXp = (betchaAssessment?.earlySubmissionXp as number) > 0;
const warningText = hasBonusXp ? (
Expand Down
7 changes: 0 additions & 7 deletions src/commons/assessment/AssessmentOverviewCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Card, Elevation, H4, H6, Icon, Intent, Position, Text, Tooltip } from '@blueprintjs/core';
import { IconName, IconNames } from '@blueprintjs/icons';
import classNames from 'classnames';
import { JSX } from 'react';
import classes from 'src/styles/Academy.module.scss';

import defaultCoverImage from '../../assets/default_cover_image.jpg';
Expand All @@ -19,15 +18,13 @@ type AssessmentOverviewCardProps = {
/** 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 @@ -49,7 +46,6 @@ const AssessmentOverviewCard: React.FC<AssessmentOverviewCardProps> = ({
<AssessmentOverviewCardTitle
overview={overview}
renderProgressStatus={renderGradingTooltip}
makeSubmissionButton={makeSubmissionButton}
/>
<div className={classes['listing-xp']}>
<H6>
Expand Down Expand Up @@ -105,13 +101,11 @@ const AssessmentOverviewCard: React.FC<AssessmentOverviewCardProps> = ({
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 @@ -128,7 +122,6 @@ const AssessmentOverviewCardTitle: React.FC<AssessmentOverviewCardTitleProps> =
{renderProgressStatus ? showGradingTooltip(overview.isGradingPublished) : null}
</H4>
</Text>
<div className="listing-button">{makeSubmissionButton(overview)}</div>
</div>
);

Expand Down
Loading