Skip to content

Commit

Permalink
allow answered ques to also be set for review apriori
Browse files Browse the repository at this point in the history
  • Loading branch information
suryabulusu committed Jun 25, 2024
1 parent cf5869d commit 521b47c
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/components/Questions/QuestionModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,6 @@ To attempt this question, unselect an answer to another question in this section
state.localResponses[props.currentQuestionIndex].answer =
state.draftResponses[props.currentQuestionIndex]
context.emit("submit-question")
if (isQuizAssessment.value && state.localResponses[props.currentQuestionIndex].marked_for_review) {
state.localResponses[props.currentQuestionIndex].marked_for_review = false
context.emit("update-review-status")
}
}
function clearAnswer() {
Expand Down Expand Up @@ -419,18 +415,18 @@ To attempt this question, unselect an answer to another question in this section
function endTest() {
if (!props.hasQuizEnded && state.hasEndTestBeenClickedOnce) {
let attemptedQuestions = 0;
let markedForReviewQuestions = 0;
let markedForReviewAndUnansweredQuestions = 0;
for (const response of props.responses) {
if (response.answer != null) {
attemptedQuestions += 1;
}
if (response.marked_for_review == true) {
markedForReviewQuestions += 1
if (response.marked_for_review == true && response.answer == null) {
markedForReviewAndUnansweredQuestions += 1
}
}
state.toast.success(
`You have answered ${attemptedQuestions} out of ${props.numQuestions} questions. Click on the Question Palette to review unanswered questions before submitting the test. Click the End Test button again to make the final submission.
ALERT: ${markedForReviewQuestions} questions which are marked for review are also unanswered.`,
`You have answered ${attemptedQuestions} out of ${props.numQuestions} questions. ${markedForReviewAndUnansweredQuestions} questions which are marked for review are unanswered.
Click on the Question Palette to view unanswered questions before submitting the test. Click the End Test button again to make the final submission.`,
{
position: POSITION.TOP_CENTER,
timeout: 5000,
Expand Down

0 comments on commit 521b47c

Please sign in to comment.