Skip to content

Commit

Permalink
Revert "fix: address review comments" as it was for a different branch
Browse files Browse the repository at this point in the history
This reverts commit d6c473e.
  • Loading branch information
EshaanAgg committed Mar 1, 2024
1 parent d6c473e commit 67af17e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions kolibri/core/assets/src/views/ExamReport/TriesOverview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 67af17e

Please sign in to comment.