Skip to content

Commit

Permalink
Merge pull request #744 from yeatmanlab/enh/isr-add-letter
Browse files Browse the repository at this point in the history
Enh/isr add letter
  • Loading branch information
richford authored Aug 16, 2024
2 parents 551e769 + 33b4e1c commit 54c459c
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/components/reports/IndividualScoreReportTask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<PvAccordion class="my-2 w-full" :active-index="expanded ? 0 : null">
<PvAccordionTab :header="$t('scoreReports.scoreBreakdown')">
<div v-for="[key, rawScore, rangeMin, rangeMax] in task.scoresArray" :key="key">
<div class="flex justify-content-between score-table">
<div v-if="!isNaN(rawScore)" class="flex justify-content-between score-table">
<div class="mr-2">
<b>{{ key }}</b
><span v-if="rangeMax" class="text-500">({{ rangeMin }}-{{ rangeMax }}):</span> <span v-else>:</span>
Expand Down Expand Up @@ -188,10 +188,17 @@ const computedTaskData = computed(() => {
for (const { taskId, scores, reliable, optional, engagementFlags } of props.taskData) {
const { percentileScoreKey, standardScoreKey, rawScoreKey } = getScoreKeys(taskId, grade.value);
const compositeScores = scores?.composite;
const rawScore =
!taskId.includes('vocab') && !taskId.includes('letter') && !taskId.includes('es')
? _get(compositeScores, rawScoreKey)
: compositeScores;
let rawScore = null;
if (!taskId.includes('vocab') && !taskId.includes('es')) {
// letter's raw score is a percentage expressed as a float, so we need to multiply by 100.
if (taskId.includes('letter')) {
rawScore = _get(compositeScores, 'totalCorrect');
} else {
rawScore = _get(compositeScores, rawScoreKey);
}
} else {
rawScore = compositeScores;
}
if (!isNaN(rawScore) && !tasksBlacklist.includes(taskId)) {
const percentileScore = _get(compositeScores, percentileScoreKey);
const standardScore = _get(compositeScores, standardScoreKey);
Expand Down

0 comments on commit 54c459c

Please sign in to comment.