From 5e65ad84bf554efed9ff72de411443c3a5026234 Mon Sep 17 00:00:00 2001 From: Liana Harris <46411498+LianaHarris360@users.noreply.github.com> Date: Mon, 17 Mar 2025 13:17:25 -0500 Subject: [PATCH] Add computed property to return attempt logs for specific sections + questions when not in mobile view --- .../quizzes/QuizReport/AttemptLogList.vue | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/kolibri-common/components/quizzes/QuizReport/AttemptLogList.vue b/packages/kolibri-common/components/quizzes/QuizReport/AttemptLogList.vue index 8d74f0aa347..d1b7aaf04ee 100644 --- a/packages/kolibri-common/components/quizzes/QuizReport/AttemptLogList.vue +++ b/packages/kolibri-common/components/quizzes/QuizReport/AttemptLogList.vue @@ -134,9 +134,9 @@ " > @@ -198,10 +198,17 @@ return sections.value[currentSectionIndex.value]; }); - // Computed property for attempt logs of the current section + // Computed property for the attempt logs for each section + const attemptLogsBySection = computed(() => { + return sections.value.map(section => { + const start = section.startQuestionNumber; + return props.attemptLogs.slice(start, start + section.questions.length); + }); + }); + + // For mobile view: returns attempt log for currently selected section const attemptLogsForCurrentSection = computed(() => { - const start = currentSection.value.startQuestionNumber; - return props.attemptLogs.slice(start, start + currentSection.value.questions.length); + return attemptLogsBySection.value[currentSectionIndex.value]; }); const questionSelectOptions = computed(() => { @@ -257,6 +264,7 @@ selectedQuestion, questionSelectOptions, attemptLogsForCurrentSection, + attemptLogsBySection, selectedAttemptLog, }; },