Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only show attempts column in lesson reports for practice quizzes #13046

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<th v-if="anyScore">
{{ coreString('scoreLabel') }}
</th>
<th v-if="anyTries">
<th v-if="showTries">
{{ coachString('attemptsLabel') }}
</th>
<th v-if="anyTimeSpent">
Expand Down Expand Up @@ -78,7 +78,7 @@
:diff="getDiff(tableRow)"
/>
</td>
<td v-if="anyTries">
<td v-if="showTries">
{{ tableRow.statusObj.tries }}
</td>
<td v-if="anyTimeSpent">
Expand All @@ -100,6 +100,7 @@

<script>

import Modalities from 'kolibri-constants/Modalities';
import isUndefined from 'lodash/isUndefined';
import commonCoreStrings from 'kolibri/uiText/commonCoreStrings';
import commonCoach from '../../common';
Expand Down Expand Up @@ -141,9 +142,17 @@
anyTimeSpent() {
return this.entries.some(entry => !isUndefined(entry.statusObj.time_spent));
},
// Presumes this is a Lesson report table as exerciseId is only present in lesson routes
showTries() {
return (
this.anyTries &&
this.contentMap[this.$route.params.exerciseId]?.options?.modality === Modalities.QUIZ
);
},
anyTries() {
return this.entries.some(entry => !isUndefined(entry.statusObj.tries));
},
// Presumes this is a Lesson report table as quizId is only present in quiz routes
Copy link
Member Author

@nucleogenesis nucleogenesis Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This got me a bit confused initially, thought this might help future-me (or someone else) because I was trying to use this.exam to get the currently-viewed resource and didn't realize the need to handle varying route params

exam() {
return this.examMap[this.$route.params.quizId];
},
Expand Down