Skip to content

Commit

Permalink
Merge pull request #13100 from AlexVelezLl/fix-individual-learners-re…
Browse files Browse the repository at this point in the history
…port

Add individual learners as recipient type in quiz report
  • Loading branch information
AlexVelezLl authored Feb 24, 2025
2 parents c78ad24 + 566c205 commit 64a2ab4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion kolibri/plugins/coach/assets/src/csv/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ const FieldsMixinStrings = createTranslator('FieldsMixinStrings', {
message: 'Assigned to',
context: 'Column header for the quiz report exported as CSV',
},
individualLearners: {
message: 'Individual learners',
context:
'One of the options in the quiz report exported as CSV indicating that a quiz or a lesson has been assigned to individual learners.',
},
groupsAndIndividuals: {
message: 'Both individual learners and groups',
context:
Expand Down Expand Up @@ -168,7 +173,10 @@ export function recipients(className) {
if (recipientNames.length === 0 && row.hasAssignments) {
return FieldsMixinStrings.$tr('wholeClass');
} else {
const numGroups = get(row, 'groupNames.length', -1);
const numGroups = get(row, 'groupNames.length', 0);
if (!numGroups) {
return FieldsMixinStrings.$tr('individualLearners');
}
// If there are more recipients than groups, then there must be some individual learners
return recipientNames.length > numGroups
? FieldsMixinStrings.$tr('groupsAndIndividuals') // At least one individual recipient
Expand Down

0 comments on commit 64a2ab4

Please sign in to comment.