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 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
9 changes: 6 additions & 3 deletions src/pages/ScoreReport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -597,9 +597,12 @@ const computeAssignmentAndRunData = computed(() => {
for (const { assignment, user } of assignmentData.value) {
// 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

// compute schoolName. Use the schoolId from the assignment's assigningOrgs, as this should be correct even when the
// user is unenrolled. The assigningOrgs should be up to date and persistant. Fallback to the student's current schools.
let schoolName = '';
const schoolId = user?.schools?.current[0];
const assigningSchool = assignment?.assigningOrgs?.schools;
const schoolId = assigningSchool[0] ?? user?.schools?.current[0];
if (schoolId) {
schoolName = schoolNameDictionary.value[schoolId];
}
Expand Down Expand Up @@ -783,7 +786,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