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

Add individual learners as recipient type in quiz report #13100

Merged
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
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
Loading