Skip to content

Commit

Permalink
Added some more information to each record saved
Browse files Browse the repository at this point in the history
  • Loading branch information
guydav committed Jan 22, 2024
1 parent 06ba084 commit ecdb728
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/components/debrief/DebriefPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const DEBRIEF_QUESTIONS = [
'label': 'Do you have any comments or questions for us?',
'help': 'Do you have any comments or questions for us?',
'placeholder': '...',
'validation': '',
'rows:': 3,
},
];
Expand All @@ -67,7 +68,7 @@ const ID_TO_QUESTION = Object.fromEntries(DEBRIEF_QUESTIONS.map((question) => [q
console.log(ID_TO_QUESTION)
const answers = reactive(Object.fromEntries(DEBRIEF_QUESTIONS.map((question) => [question.id, ''])))
const complete = computed(() => Object.keys(answers).every((key) => (answers[key] !== '' && answers[key] !== 0) || ('invisible' in ID_TO_QUESTION[key]) ));
const complete = computed(() => Object.keys(answers).every((key) => (answers[key] !== '' && answers[key] !== 0) || ('invisible' in ID_TO_QUESTION[key]) || ('validation' in ID_TO_QUESTION[key] && !ID_TO_QUESTION[key].validation) ));
function finish(goto) {
smilestore.recordDebriefResponses(answers);
Expand All @@ -81,10 +82,10 @@ function finish(goto) {

<template>
<div class="page">
<h1 class="title is-3">Thank you for your participation</h1>
<h1 class="title is-size-3">Thank you for your participation</h1>
<DebriefText />

<h2 class="title is-3">A few final questions</h2>
<h2 class="title is-size-3">A few final questions</h2>
<div class="debrief">
<FormKit
type="form"
Expand Down
9 changes: 6 additions & 3 deletions src/components/tasks/Task1Page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,16 @@ const participantGames = sampleGames();
const gameIndex = ref(0);
async function finish(goto) {
async function finish(goto) {
console.log(`finish called with game index ${gameIndex.value}`);
const captchaResponse = await execute();
const gameDesc = { ...participantGames[gameIndex.value] };
if ('text' in gameDesc) delete gameDesc.text;
// smilestore.saveData()
smilestore.recordSingleGameResults({
id: participantGames[gameIndex.value].id,
// TODO: Any other information we need to add here?
...gameDesc,
captchaResponse,
...judgementRef.value.answers,
});
Expand Down

0 comments on commit ecdb728

Please sign in to comment.