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

Fix 'view by school' distribution graph #864

Merged
merged 6 commits into from
Oct 17, 2024
Merged
Changes from 1 commit
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: 8 additions & 2 deletions src/pages/ScoreReport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -577,11 +577,17 @@ const computeAssignmentAndRunData = computed(() => {
const runsByTaskIdAcc = {};

for (const { assignment, user } of assignmentData.value) {
// We can't garentee that the user's school is still in the current list of schools
// So we'll find the school both in the 'all' list as well as assignment.readOrgs
const userSchools = user.schools?.all;
const assignmentOrgs = assignment.readOrgs.schools;
const matchingSchools = userSchools?.filter((schoolId) => assignmentOrgs.includes(schoolId));

// for each row, compute: username, firstName, lastName, assessmentPID, grade, school, all the scores, and routeParams for report link
const grade = user.studentData?.grade;
// compute schoolName
let schoolName = '';
const schoolId = user?.schools?.current[0];
const schoolId = matchingSchools[0];
kellyel marked this conversation as resolved.
Show resolved Hide resolved
if (schoolId) {
schoolName = schoolNameDictionary.value[schoolId];
}
Expand Down Expand Up @@ -765,7 +771,7 @@ const computeAssignmentAndRunData = computed(() => {
taskId,
user: {
grade: grade,
schoolName: schoolsDictWithGrade.value[schoolId],
schoolName: schoolsDictWithGrade.value[schoolId] ?? '0 Unknown School',
},
tag_color: tag_color,
};
Expand Down