Skip to content

Commit

Permalink
[ENHANCEMENT] [MER-4019] Update "Restart Lesson" Button Text for Scor…
Browse files Browse the repository at this point in the history
…ed Assignments in Student Mode (#5299)
  • Loading branch information
dtiwarATS authored Dec 13, 2024
1 parent b364c47 commit eee562f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const RestartLessonDialog: React.FC<RestartLessonDialogProps> = ({ onRestart })
}}
>
<div className="modal-header">
<h3>Restart Lesson</h3>
<h3>{graded ? 'Submit Attempt' : 'Restart Lesson'}</h3>
<button
type="button"
className="close"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { navigateToActivity } from '../../../store/features/groups/actions/deck'
import { selectSequence } from '../../../store/features/groups/selectors/deck';
import {
selectEnableHistory,
selectIsGraded,
selectShowHistory,
setShowHistory,
} from '../../../store/features/page/slice';
Expand All @@ -30,7 +31,7 @@ const HistoryNavigation: React.FC = () => {
const enableHistory = useSelector(selectEnableHistory);
const showHistory = useSelector(selectShowHistory);
const isHistoryMode = useSelector(selectHistoryNavigationActivity);

const graded = useSelector(selectIsGraded);
const sequences = useSelector(selectSequence);
const dispatch = useDispatch();

Expand Down Expand Up @@ -168,7 +169,9 @@ const HistoryNavigation: React.FC = () => {
<button onClick={restartHandler} className="theme-no-history-restart">
<span>
<div className="theme-no-history-restart__icon" />
<span className="theme-no-history-restart__label">Restart Lesson</span>
<span className="theme-no-history-restart__label">
{graded ? 'Submit Attempt' : 'Restart Lesson'}
</span>
</span>
</button>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useDispatch, useSelector } from 'react-redux';
import { setRestartLesson } from 'apps/delivery/store/features/adaptivity/slice';
import {
selectEnableHistory,
selectIsGraded,
selectPreviewMode,
selectShowHistory,
setShowHistory,
Expand All @@ -14,6 +15,7 @@ export interface OptionsPanelProps {

const OptionsPanel: React.FC<OptionsPanelProps> = ({ open }) => {
const dispatch = useDispatch();
const graded = useSelector(selectIsGraded);
const enableHistory = useSelector(selectEnableHistory);
const showHistory = useSelector(selectShowHistory);
const isPreviewMode = useSelector(selectPreviewMode);
Expand Down Expand Up @@ -65,7 +67,7 @@ const OptionsPanel: React.FC<OptionsPanelProps> = ({ open }) => {
aria-label="Open restart lesson window"
onClick={handleRestartLesson}
>
Restart Lesson
{graded ? 'Submit Attempt' : 'Restart Lesson'}
</button>
</div>
<div className="option logoutOption displayNone">
Expand Down

0 comments on commit eee562f

Please sign in to comment.