From eee562fb3f411752818091b4e49f113854a45034 Mon Sep 17 00:00:00 2001 From: Devesh Tiwari <70621864+dtiwarATS@users.noreply.github.com> Date: Fri, 13 Dec 2024 05:54:48 +0530 Subject: [PATCH] [ENHANCEMENT] [MER-4019] Update "Restart Lesson" Button Text for Scored Assignments in Student Mode (#5299) --- .../src/apps/delivery/layouts/deck/RestartLessonDialog.tsx | 2 +- .../delivery/layouts/deck/components/HistoryNavigation.tsx | 7 +++++-- .../apps/delivery/layouts/deck/components/OptionsPanel.tsx | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/assets/src/apps/delivery/layouts/deck/RestartLessonDialog.tsx b/assets/src/apps/delivery/layouts/deck/RestartLessonDialog.tsx index 1426d086305..a68b24a452b 100644 --- a/assets/src/apps/delivery/layouts/deck/RestartLessonDialog.tsx +++ b/assets/src/apps/delivery/layouts/deck/RestartLessonDialog.tsx @@ -113,7 +113,7 @@ const RestartLessonDialog: React.FC = ({ onRestart }) }} >
-

Restart Lesson

+

{graded ? 'Submit Attempt' : 'Restart Lesson'}

)} diff --git a/assets/src/apps/delivery/layouts/deck/components/OptionsPanel.tsx b/assets/src/apps/delivery/layouts/deck/components/OptionsPanel.tsx index 78a313be8ed..378434a8617 100644 --- a/assets/src/apps/delivery/layouts/deck/components/OptionsPanel.tsx +++ b/assets/src/apps/delivery/layouts/deck/components/OptionsPanel.tsx @@ -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, @@ -14,6 +15,7 @@ export interface OptionsPanelProps { const OptionsPanel: React.FC = ({ open }) => { const dispatch = useDispatch(); + const graded = useSelector(selectIsGraded); const enableHistory = useSelector(selectEnableHistory); const showHistory = useSelector(selectShowHistory); const isPreviewMode = useSelector(selectPreviewMode); @@ -65,7 +67,7 @@ const OptionsPanel: React.FC = ({ open }) => { aria-label="Open restart lesson window" onClick={handleRestartLesson} > - Restart Lesson + {graded ? 'Submit Attempt' : 'Restart Lesson'}