{allCompleted ? 'Great job answering all the questions.' : (someCompleted ? `You've completed ${numberCompleted} of ${numberOfQuestions} questions.` : 'Begin working on the quiz.')}
-
-
- >
+ const buttonText = allCompleted || (numberCompleted === 0 && handleRetry) || (someCompleted && handleRetry) ? 'Next' : (someCompleted ? 'Continue' : 'Start');
+
+ const retryOrResume = allCompleted ? 'Retry Quiz' : 'Resume Quiz';
+ const unlimitedDone = "Attempts for this quiz are unlimited. Your highest score will be saved.";
+ const unlimitedCurrent = "You are in the middle of a quiz attempt. Attempts for this quiz are unlimited. Your highest score will be saved.";
+
+ // When allCompleted, clicking Retry/Resume should create a new attempt (handleRetry)
+ // When not completed, clicking Retry/Resume should resume (handleContinue)
+ const onRetryResumeClick = allCompleted
+ ? handleRetry
+ : handleContinue;
+
+ // if unlimited attempts (handleRetry) is active always show next button
+ // if all is completed show next button
+ // if not unlimited and incomplete show and handle continue
+ const onNextContinueClick = allCompleted || handleRetry
+ ? handleNext
+ : handleContinue;
+
+ return (
+ <>
+
+
+
+ {allCompleted
+ ? 'You are done.'
+ : (someCompleted ? 'Quiz is partially complete.' : 'No questions have been answered.')}
+
+
+ {handleRetry ? (
+
+ {allCompleted
+ ? 'Great job answering all the questions.'
+ : (someCompleted
+ ? `You've completed ${numberCompleted} of ${numberOfQuestions} questions.`
+ : 'Begin working on the quiz.')}
+