diff --git a/kolibri/core/assets/src/views/ExamReport/TriesOverview.vue b/kolibri/core/assets/src/views/ExamReport/TriesOverview.vue index 55c8b4d3aed..83a3b85a4ff 100644 --- a/kolibri/core/assets/src/views/ExamReport/TriesOverview.vue +++ b/kolibri/core/assets/src/views/ExamReport/TriesOverview.vue @@ -126,11 +126,9 @@ return this.pastTries.length ? Math.max(...this.pastTries.map(t => t.correct)) : null; }, bestScore() { - const bestScoreAttempt = this.pastTries.find(t => t.correct === this.maxQuestionsCorrect); - if (!bestScoreAttempt) { - return null; - } - return bestScoreAttempt.time_spent; + return this.maxQuestionsCorrect !== null + ? this.maxQuestionsCorrect / this.totalQuestions + : null; }, suggestedTimeAnnotation() { if (!this.suggestedTime || this.bestTimeSpent === null) { diff --git a/kolibri/core/assets/src/views/ExamReport/__tests__/TriesOverview.spec.js b/kolibri/core/assets/src/views/ExamReport/__tests__/TriesOverview.spec.js index 83066bc85b9..05acce0b770 100644 --- a/kolibri/core/assets/src/views/ExamReport/__tests__/TriesOverview.spec.js +++ b/kolibri/core/assets/src/views/ExamReport/__tests__/TriesOverview.spec.js @@ -59,7 +59,7 @@ describe('TriesOverview', () => { }); test('renders progress icon and not started label when there are no past tries', () => { - renderComponent({ pastTries: [] }); + renderComponent(); expect(screen.getByTestId('progress-icon-0')).toBeInTheDocument(); expect(screen.getByText('notStartedLabel')).toBeInTheDocument();