From 4821ffc7cd194c82f9ba416cab21c3eecb958817 Mon Sep 17 00:00:00 2001 From: Richard Tibbles Date: Wed, 3 Jul 2024 12:06:25 -0700 Subject: [PATCH 1/4] Add in submit quiz button for non-large screen sizes. --- .../learn/assets/src/views/ExamPage/index.vue | 33 +++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/kolibri/plugins/learn/assets/src/views/ExamPage/index.vue b/kolibri/plugins/learn/assets/src/views/ExamPage/index.vue index 10bcc8dea1f..9b249e4fc86 100644 --- a/kolibri/plugins/learn/assets/src/views/ExamPage/index.vue +++ b/kolibri/plugins/learn/assets/src/views/ExamPage/index.vue @@ -132,13 +132,12 @@ - + @@ -168,7 +167,22 @@ /> - + + + +
Date: Wed, 3 Jul 2024 13:23:44 -0700 Subject: [PATCH 2/4] Fixes bug in section change handling. --- kolibri/plugins/learn/assets/src/views/ExamPage/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kolibri/plugins/learn/assets/src/views/ExamPage/index.vue b/kolibri/plugins/learn/assets/src/views/ExamPage/index.vue index 9b249e4fc86..783b2909b9f 100644 --- a/kolibri/plugins/learn/assets/src/views/ExamPage/index.vue +++ b/kolibri/plugins/learn/assets/src/views/ExamPage/index.vue @@ -487,7 +487,7 @@ if (index === this.currentSectionIndex) { return; } - this.goToQuestion(this.sections.startQuestionNumber); + this.goToQuestion(this.sections[index].startQuestionNumber); }, handleQuestionOptionChange(opt) { const index = opt.value; From 9148fe0d5e7dfd250f5a8af601aea935159739e4 Mon Sep 17 00:00:00 2001 From: Richard Tibbles Date: Wed, 3 Jul 2024 13:44:11 -0700 Subject: [PATCH 3/4] Revert change to class. --- .../plugins/learn/assets/src/views/ExamPage/AnswerHistory.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kolibri/plugins/learn/assets/src/views/ExamPage/AnswerHistory.vue b/kolibri/plugins/learn/assets/src/views/ExamPage/AnswerHistory.vue index 09ec8d3f184..ff87a711182 100644 --- a/kolibri/plugins/learn/assets/src/views/ExamPage/AnswerHistory.vue +++ b/kolibri/plugins/learn/assets/src/views/ExamPage/AnswerHistory.vue @@ -77,7 +77,7 @@ > From 9b9b0ca332814afaa09e68ebf312a6b03b494a69 Mon Sep 17 00:00:00 2001 From: Richard Tibbles Date: Wed, 3 Jul 2024 13:44:44 -0700 Subject: [PATCH 4/4] Add answered/unanswered state indicators to KSelects. --- .../learn/assets/src/views/ExamPage/index.vue | 106 +++++++++++++++++- 1 file changed, 104 insertions(+), 2 deletions(-) diff --git a/kolibri/plugins/learn/assets/src/views/ExamPage/index.vue b/kolibri/plugins/learn/assets/src/views/ExamPage/index.vue index 783b2909b9f..79e9a1821f4 100644 --- a/kolibri/plugins/learn/assets/src/views/ExamPage/index.vue +++ b/kolibri/plugins/learn/assets/src/views/ExamPage/index.vue @@ -68,7 +68,24 @@ :value="currentSectionOption" :options="sectionSelectOptions" @select="handleSectionOptionChange" - /> + > + + +

+ > + + +

a.answer).map(a => a.item); + return this.sections.reduce((acc, { questions }, index) => { + acc[index] = questions + .filter(q => answeredAttemptItems.includes(q.item)) + .map(q => q.item); + + return acc; + }, {}); + }, gridStyle() { if (!this.windowIsSmall) { return { @@ -482,6 +555,31 @@ }); }, methods: { + sectionQuestionsIconColor(index) { + const answered = this.sectionCompletionMap[index].length; + const total = this.sections[index].questions.length; + if (answered === total) { + return this.$themeTokens.progress; + } else if (answered > 0) { + return this.$themeTokens.progress; + } + return this.$themeTokens.textDisabled; + }, + sectionQuestionsIcon(index) { + const answered = this.sectionCompletionMap[index].length; + const total = this.sections[index].questions.length; + if (answered === total) { + return 'unpublishedResource'; + } else if (answered > 0) { + return 'unpublishedChange'; + } + return 'unpublishedChange'; + }, + isAnswered(questionIndex) { + const question = this.questions[questionIndex]; + const attempt = this.pastattempts.find(attempt => attempt.item === question.item); + return attempt && attempt.answer; + }, handleSectionOptionChange(opt) { const index = opt.value; if (index === this.currentSectionIndex) { @@ -774,4 +872,8 @@ border: 0; } + .dot { + margin-right: 5px; + } +