Skip to content

Commit

Permalink
Merge pull request #283 from yeatmanlab/enh/headers-score-report
Browse files Browse the repository at this point in the history
Filter out tasks on the exclude lists
  • Loading branch information
richford authored Jan 12, 2024
2 parents 82e7488 + 3ef8020 commit ab0e40b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/helpers/reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ export const taskDisplayNames = {
fluency: { name: 'Fluency', order: 9 },
ExternalTask: { name: 'External Task', order: 9 },
ExternalTest: { name: 'External Test', order: 10 },
cva: { name: 'Written-Vocab', order: 11 },
};

export const excludedTasks = ['cva', 'morphology'];

export const supportLevelColors = {
above: 'green',
some: '#edc037',
Expand Down
13 changes: 10 additions & 3 deletions src/pages/ScoreReport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ import _find from 'lodash/find';
import _head from 'lodash/head';
import _tail from 'lodash/tail';
import _isEmpty from 'lodash/isEmpty';
import _filter from 'lodash/filter';
import _pickBy from 'lodash/pickBy';
import { useAuthStore } from '@/store/auth';
import { useQuery } from '@tanstack/vue-query';
import AdministratorSidebar from '@/components/AdministratorSidebar.vue';
Expand All @@ -221,7 +223,7 @@ import { assignmentPageFetcher, assignmentCounter, assignmentFetchAll } from '@/
import { orgFetcher } from '@/helpers/query/orgs';
import { runPageFetcher } from '@/helpers/query/runs';
import { pluralizeFirestoreCollection } from '@/helpers';
import { taskDisplayNames, supportLevelColors, getSupportLevel } from '@/helpers/reports.js';
import { taskDisplayNames, excludedTasks, supportLevelColors, getSupportLevel } from '@/helpers/reports.js';
import TaskReport from '@/components/reports/tasks/TaskReport.vue';
import DistributionChartOverview from '@/components/reports/DistributionChartOverview.vue';
Expand Down Expand Up @@ -672,7 +674,10 @@ const tableData = computed(() => {
const allTasks = computed(() => {
if (tableData.value.length > 0) {
return tableData.value[0].assignment.assessments.map((assessment) => assessment.taskId);
let ids = tableData.value[0].assignment.assessments.map((assessment) => assessment.taskId);
return _filter(ids, (taskId) => {
return !excludedTasks.includes(taskId);
});
} else return [];
});
Expand Down Expand Up @@ -742,7 +747,9 @@ const runsByTaskId = computed(() => {
computedScores[run.taskId] = [run];
}
}
return computedScores;
return _pickBy(computedScores, (scores, taskId) => {
return !excludedTasks.includes(taskId);
});
});
let unsubscribe;
Expand Down

0 comments on commit ab0e40b

Please sign in to comment.