Skip to content

Commit ba95084

Browse files
authored
Merge pull request #952 from sahitya-chandra/nasa-tlx-patch
fix: nasa-tlx answer object not being updated in task answers fixed
2 parents c7a9008 + fab8450 commit ba95084

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/components/atoms/SusForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class="my-2"
1111
>
1212
<v-col>
13-
<span>{{ susQuestions[i] }}</span>
13+
<span>{{ susQuestions[i-1] }}</span>
1414
<v-divider class="my-2" />
1515
<v-radio-group
1616
:model-value="susAnswers[i - 1]"

src/components/atoms/nasaTlxForm.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ watch(() => props.nasaTlx, (newVal) => {
5656
});
5757
5858
watch(localNasaTlx, () => {
59-
emit('update:nasaTlx', { ...localNasaTlx });
59+
const fullUpdate = {};
60+
for (const key in labels) {
61+
fullUpdate[key] = localNasaTlx[key] ?? 0;
62+
}
63+
emit('update:nasaTlx', fullUpdate);
6064
}, { deep: true });
6165
6266
let valid = ref(false);

src/views/public/UserTestView.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,12 @@
688688
justify="center"
689689
>
690690
<v-col cols="12">
691-
<nasaTlxForm v-model:nasa-tlx="localTestAnswer.tasks[taskIndex].nasaTlxAnswers" />
691+
<nasaTlxForm
692+
:nasa-tlx="localTestAnswer.tasks[taskIndex].nasaTlxAnswers"
693+
@update:nasaTlx="val => {
694+
Object.assign(localTestAnswer.tasks[taskIndex].nasaTlxAnswers, val);
695+
}"
696+
/>
692697
</v-col>
693698
</v-row>
694699

0 commit comments

Comments
 (0)