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

wip/Optional Assessments on Individual Reports #426

Merged
merged 36 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
0227cfe
format'
ksmontville Mar 14, 2024
a031e61
add getStatus function, update tests.
ksmontville Mar 14, 2024
a8de335
refactor optional assessments queries
ksmontville Mar 26, 2024
03acb0f
Merge branch 'main' into optional-individual-reports
ksmontville Mar 26, 2024
c5b628a
merge to main, update tests
ksmontville Mar 26, 2024
ac1e358
resolve merge conflicts.
ksmontville Mar 26, 2024
87e75e0
format
ksmontville Mar 26, 2024
eb844ba
add env variable for test list
ksmontville Mar 26, 2024
ac636bd
Merge branch 'main' into optional-individual-reports
ksmontville Mar 27, 2024
a554a56
initial commit
ksmontville Mar 26, 2024
982e923
add conditional url to register task
ksmontville Mar 26, 2024
ec63953
refactor functions for adding new variants
ksmontville Mar 26, 2024
c2e2956
Remove redundant computed property
ksmontville Mar 26, 2024
48f9b79
updated card titles
ksmontville Mar 26, 2024
b4ac25a
remove html br tags
lucasxsong Mar 26, 2024
b78fd2a
Up limit to prevent uploading too many students at once
kellyel Mar 27, 2024
c3ba0d1
update individual score report for test
lucasxsong Mar 28, 2024
5f87398
update roar apps
ksmontville Mar 28, 2024
c70ad60
cypress PA
Emily-ejag Mar 28, 2024
7ccbdb2
prettier
Emily-ejag Mar 28, 2024
924b8a4
Add embedded link to next steps pdf for individual score report export
lucasxsong Mar 28, 2024
8ceeec2
add w-full to wrapping div
lucasxsong Mar 28, 2024
03549d0
update fluency calf es test
ksmontville Mar 29, 2024
58da1eb
Update roar-firebase-functions submodule
richford Mar 28, 2024
32241d4
2.1.0
richford Mar 28, 2024
ac621ae
Update firestore indexes
richford Mar 28, 2024
aa403b4
additional test changes
ksmontville Mar 29, 2024
20c3953
add optional status to progress reports, progress report exports
ksmontville Mar 13, 2024
428cb51
refactor isOptional and optionalAssessments functions
ksmontville Mar 13, 2024
56e199e
remove console logs
ksmontville Mar 14, 2024
0f51fd1
Delete old files
ksmontville Mar 14, 2024
db5bfaa
check for optional status on assignment level rather than administrat…
ksmontville Mar 20, 2024
3b78a89
query for a single assignment rather than assignment collection
ksmontville Apr 1, 2024
c727743
update queryKey for assignments data
ksmontville Apr 1, 2024
8f79feb
update cypress tests, roar apps, and format
ksmontville Apr 2, 2024
4f146ba
fix merge conflicts
ksmontville Apr 2, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('Testing play through of vocab, cva, letter, and multichoice games as a
cy.selectAdministration(Cypress.env('testRoarAppsAdministration'));
cy.get('.tabview-nav-link-label', { timeout: 5 * timeout })
.contains(game.name)
.should('have.attr', 'data-game-status', 'complete');
.should('exist');
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion roar-firebase-functions
5 changes: 5 additions & 0 deletions src/components/reports/IndividualScoreReportTask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<div class="flex flex-column md:flex-row align-items-center">
<div class="flex flex-column justify-content-center align-items-center mt-2">
<div class="header-task-name">{{ taskDisplayNames[task.taskId]?.extendedTitle }}</div>
<div class="m-2">Status: {{ getStatus(task) }}</div>
<div class="text-xs uppercase font-thin mb-2 text-gray-400">
<div v-if="!rawOnlyTasks.includes(task.taskId)" class="scoring-type">
{{ grade >= 6 ? 'Standard Score' : 'Percentile Score' }}
Expand Down Expand Up @@ -177,6 +178,10 @@ const computedTaskData = computed(() => {
});
});

const getStatus = (_task) => {
return _task.optional ? 'Optional' : 'Required';
};

const formattedScoreAttributeMap = {
wjPercentile: 'Percentile Score',
sprPercentile: 'Percentile Score',
Expand Down
38 changes: 36 additions & 2 deletions src/pages/IndividualReport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@
<script setup>
import { fetchDocById } from '../helpers/query/utils';
import { runPageFetcher } from '../helpers/query/runs';
import { useQuery } from '@tanstack/vue-query';
import { computed, onMounted, ref } from 'vue';
import { useQuery, useQueryClient } from '@tanstack/vue-query';
import { computed, onMounted, ref, watch } from 'vue';
import { storeToRefs } from 'pinia';
import { useAuthStore } from '../store/auth';
import { taskDisplayNames, addElementToPdf } from '@/helpers/reports';
Expand Down Expand Up @@ -174,6 +174,14 @@ const { data: studentData } = useQuery({
staleTime: 5 * 60 * 1000,
});

const { data: assignmentData } = useQuery({
queryKey: ['assignments', props.userId, props.administrationId],
queryFn: () => fetchDocById('users', `${props.userId}/assignments/${props.administrationId}`),
enabled: initialized,
keepPreviousData: true,
staleTime: 5 * 60 * 1000,
});

const { data: taskData } = useQuery({
queryKey: ['runs', props.administrationId, props.userId, props.orgType, props.orgId],
queryFn: () =>
Expand Down Expand Up @@ -253,6 +261,31 @@ const exportToPdf = async () => {
(exportLoading.value = false);
};

const optionalAssessments = computed(() => {
return assignmentData?.value?.assessments.filter((assessment) => assessment.optional);
});

// Calling the query client to update the cached taskData with the new optional tasks
const queryClient = useQueryClient();

const updateTaskData = () => {
const updatedTasks = taskData?.value?.map((task) => {
const isOptional = optionalAssessments?.value?.some((assessment) => assessment.taskId === task.taskId);
return isOptional ? { ...task, optional: true } : task;
});

queryClient.setQueryData(['runs', props.administrationId, props.userId, props.orgType, props.orgId], updatedTasks);
};

// Watch for changes in taskData and update the taskData with the new optional tasks
watch(
() => taskData.value,
() => {
updateTaskData();
},
{ deep: true },
);

const tasks = computed(() => taskData?.value?.map((assignment) => assignment.taskId));

const formattedTasks = computed(() => {
Expand Down Expand Up @@ -316,6 +349,7 @@ onMounted(async () => {
if (roarfirekit.value.restConfig) {
refresh();
}
updateTaskData();
});
</script>

Expand Down
Loading