Skip to content

Commit

Permalink
Merge pull request #407 from yeatmanlab/fluency-colombia-prep
Browse files Browse the repository at this point in the history
Prep Roam Fluency for Colombia
  • Loading branch information
ksmontville authored Mar 11, 2024
2 parents f0d333b + eabd0b5 commit 956b40b
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 103 deletions.
6 changes: 2 additions & 4 deletions cypress/e2e/participant/default-tests/playFluency-ARF.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Test playthrough of Fluency as a participant', () => {

cy.selectAdministration(Cypress.env('testRoarAppsAdministration'));

cy.get('.p-tabview').contains('ROAM - Fluency ARF');
cy.get('.p-tabview').contains('ROAM - Single-Digit');
cy.visit(`/game/fluency-arf`);

// Click jspsych button to begin
Expand All @@ -28,8 +28,6 @@ describe('Test playthrough of Fluency as a participant', () => {
cy.visit('/');
cy.wait(0.2 * timeout);
cy.selectAdministration(Cypress.env('testRoarAppsAdministration'));
cy.get('.tabview-nav-link-label')
.contains('ROAM - Fluency ARF')
.should('have.attr', 'data-game-status', 'complete');
cy.get('.tabview-nav-link-label').contains('ROAM - Single-Digit').should('exist');
});
});
4 changes: 3 additions & 1 deletion cypress/e2e/participant/default-tests/playSWR.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ describe('Testing playthrough of SWR as a participant', () => {
cy.get('.p-tabview').contains('ROAR - Word');
cy.visit(`/game/swr`);

cy.get('.jspsych-btn', { timeout: timeout }).should('be.visible').click();
cy.get('.jspsych-btn', { timeout: 3 * timeout })
.should('be.visible')
.click();

// handles error where full screen throws a permissions error
cy.wait(0.1 * timeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('Test playthrough of Fluency as a participant', () => {

cy.selectAdministration(Cypress.env('testRoarAppsAdministration'));

cy.get('.p-tabview', { timeout: timeout }).contains('ROAM - Fluency ARF');
cy.get('.p-tabview', { timeout: timeout }).contains('ROAM - Single-Digit');
cy.visit(`/game/fluency-arf`);

// Click jspsych button to begin
Expand All @@ -21,12 +21,11 @@ describe('Test playthrough of Fluency as a participant', () => {

playFluency(endText);

// Check if game is marked as complete on the dashboard
// Check if game is marked as complete on the dashboard
cy.visit('/');
cy.wait(0.2 * timeout);
cy.selectAdministration(Cypress.env('testRoarAppsAdministration'));
cy.get('.tabview-nav-link-label', { timeout: timeout })
.contains('ROAM - Fluency ARF')
.should('have.attr', 'data-game-status', 'complete');
cy.get('.tabview-nav-link-label').contains('ROAM - Single-Digit').should('exist');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('Test playthrough of Fluency as a participant', () => {

cy.selectAdministration(Cypress.env('testRoarAppsAdministration'));

cy.get('.p-tabview', { timeout: timeout }).contains('ROAM - Fluency ARF');
cy.get('.p-tabview', { timeout: timeout }).contains('ROAM - Single-Digit');
cy.visit(`/game/fluency-arf`);

// Click jspsych button to begin
Expand All @@ -21,12 +21,11 @@ describe('Test playthrough of Fluency as a participant', () => {

playFluency(endText);

// Check if game is marked as complete on the dashboard
// Check if game is marked as complete on the dashboard
cy.visit('/');
cy.wait(0.2 * timeout);
cy.selectAdministration(Cypress.env('testRoarAppsAdministration'));
cy.get('.tabview-nav-link-label', { timeout: timeout })
.contains('ROAM - Fluency ARF')
.should('have.attr', 'data-game-status', 'complete');
cy.get('.tabview-nav-link-label').contains('ROAM - Single-Digit').should('exist');
});
});
43 changes: 0 additions & 43 deletions cypress/e2e/participant/playPA.cy.js

This file was deleted.

28 changes: 15 additions & 13 deletions cypress/support/helper-functions/roam-fluency/fluencyHelpers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const timeout = Cypress.env('timeout');
const participantId = '123456789';
const practiceNumber = '1';
const questionInput = '42';

function typeEnter() {
Expand All @@ -16,31 +15,35 @@ function playFluencyIntro() {

// Click textbox and enter random participantId
cy.get('#input-0', { timeout: timeout }).type(`${participantId} {enter}`);
typeEnter();

// Input any number
cy.get('#practice_number', { timeout: timeout }).type(practiceNumber);

// Click enter
waitTimeout();
typeEnter();
waitTimeout();

// Click enter
typeEnter();
// Click enter
cy.get('body').type('1 {enter}');
waitTimeout();

// Click enter
typeEnter();
waitTimeout();

// Click backspace
cy.get('body').type('{backspace}');
waitTimeout();

// Enter x2
cy.get('body').type('x2 {enter}');
// Input example number, enter x1
cy.get('#practice_number').type('10');
waitTimeout();

cy.get('#practice_number').type('{enter}');
typeEnter();
waitTimeout();

// Enter x2
//cy.get("body").type("x2 {enter}");
typeEnter();
typeEnter();
//waitTimeout();

// Type 4, enter x2
cy.get('#question_input_key').type('4');
waitTimeout();
Expand Down Expand Up @@ -80,7 +83,6 @@ function checkGameComplete(endText) {
cy.get('body').type('{enter}');
});
cy.log('Game complete.');
cy.get('body', { timeout: timeout }).type('{enter}');
} else {
cy.log('Continuing game...');
playFluencyLoop();
Expand Down
42 changes: 21 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
"version": "npm run format && git add -A"
},
"dependencies": {
"@bdelab/roam-fluency": "^1.9.14",
"@bdelab/roam-fluency": "^1.10.5",
"@bdelab/roar-firekit": "^4.8.7",
"@bdelab/roar-letter": "^1.6.7",
"@bdelab/roar-multichoice": "^1.9.4",
"@bdelab/roar-pa": "^1.6.4",
"@bdelab/roar-sre": "^1.11.4",
"@bdelab/roar-swr": "^1.8.4",
"@bdelab/roar-swr": "^1.8.7",
"@bdelab/roar-utils": "^1.0.18",
"@bdelab/roar-vocab": "^1.6.10",
"@bdelab/roar-vocab": "^1.6.11",
"@sentry/browser": "^7.103.0",
"@sentry/integrations": "^7.103.0",
"@sentry/vite-plugin": "^2.14.2",
Expand Down
1 change: 1 addition & 0 deletions src/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ const toggleMenu = (event) => {
};
import ROARLogo from '@/assets/RoarLogo.vue';
import LanguageSelector from './LanguageSelector.vue';
</script>
<style scoped></style>
4 changes: 3 additions & 1 deletion src/components/tasks/TaskFluency.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import _get from 'lodash/get';
import { fetchDocById } from '@/helpers/query/utils';
const props = defineProps({
taskId: { type: String, required: true, default: 'fluency' },
taskId: { type: String, required: true, default: 'fluency-arf' },
language: { type: String, required: true, default: 'en' },
});
const taskId = props.taskId;
Expand Down Expand Up @@ -79,6 +80,7 @@ async function startTask() {
grade: _get(userData.value, 'studentData.grade'),
birthMonth: userDateObj.getMonth() + 1,
birthYear: userDateObj.getFullYear(),
language: props.language,
};
const gameParams = { ...appKit._taskInfo.variantParams };
Expand Down
5 changes: 2 additions & 3 deletions src/pages/IndividualReport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,18 @@ const exportToPdf = async () => {
}
const supportGraphic = document.getElementById('support-graphic');
if (supportGraphic !== null) {
yCounter = await addElementToPdf(supportGraphic, doc, yCounter);
await addElementToPdf(supportGraphic, doc, yCounter);
}
doc.save(`IndividualScoreReport_${studentFirstName.value}${studentLastName.value}.pdf`),
(exportLoading.value = false);
return;
};
const tasks = computed(() => taskData?.value?.map((assignment) => assignment.taskId));
const formattedTasks = computed(() => {
return (
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
tasks?.value
.sort((a, b) => {
if (Object.keys(taskDisplayNames).includes(a) && Object.keys(taskDisplayNames).includes(b)) {
Expand Down
12 changes: 6 additions & 6 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,42 +97,42 @@ const routes = [
path: '/game/fluency-arf',
name: 'Fluency-ARF',
component: () => import('../components/tasks/TaskFluency.vue'),
props: { taskId: 'fluency-arf' },
props: { taskId: 'fluency-arf', language: 'en' },
meta: { pageTitle: 'Fluency-ARF' },
},
{
path: '/game/fluency-arf-es',
name: 'Fluency-ARF-ES',
component: () => import('../components/tasks/TaskFluency.vue'),
props: { taskId: 'fluency-arf-es' },
props: { taskId: 'fluency-arf-es', language: 'es' },
meta: { pageTitle: 'Fluency-ARF ES' },
},
{
path: '/game/fluency-calf',
name: 'Fluency-CALF',
component: () => import('../components/tasks/TaskFluency.vue'),
props: { taskId: 'fluency-calf' },
props: { taskId: 'fluency-calf', language: 'en' },
meta: { pageTitle: 'Fluency-CALF' },
},
{
path: '/game/fluency-calf-es',
name: 'Fluency-CALF-ES',
component: () => import('../components/tasks/TaskFluency.vue'),
props: { taskId: 'fluency-calf-es' },
props: { taskId: 'fluency-calf-es', language: 'es' },
meta: { pageTitle: 'Fluency-CALF ES' },
},
{
path: '/game/fluency-alpaca',
name: 'Fluency-Alpaca',
component: () => import('../components/tasks/TaskFluency.vue'),
props: { taskId: 'fluency-alpaca' },
props: { taskId: 'fluency-alpaca', language: 'en' },
meta: { pageTitle: 'Fluency-Alpaca' },
},
{
path: '/game/fluency-alpaca-es',
name: 'Fluency-Alpaca-ES',
component: () => import('../components/tasks/TaskFluency.vue'),
props: { taskId: 'fluency-alpaca-es' },
props: { taskId: 'fluency-alpaca-es', language: 'es' },
meta: { pageTitle: 'Fluency-Alpaca ES' },
},
{
Expand Down

0 comments on commit 956b40b

Please sign in to comment.