Fix Assignment bug

This commit is contained in:
Lorenz Padberg 2024-03-20 14:25:30 +01:00
parent ad5a7824ba
commit b7a009972f
3 changed files with 6 additions and 8 deletions

View File

@ -315,8 +315,6 @@ const createHighlight = createHighlightCurry({
const isNested = computed(() => props.contentBlock.root); // if it's nested, a the parent has the root propert
onMounted(() => {
log.debug('onMounted ContentBlock called');
const element = contentBlockDiv.value;
if (element !== null) {

View File

@ -58,7 +58,7 @@
</template>
<script setup lang="ts">
import { defineAsyncComponent, nextTick, onMounted, ref, watch } from 'vue';
import { defineAsyncComponent, nextTick, onMounted, reactive, ref, watch } from 'vue';
import { useRoute } from 'vue-router';
import { useMutation, useQuery } from '@vue/apollo-composable';
import { graphql } from '@/__generated__';
@ -91,7 +91,7 @@ const initialSubmission = {
document: '',
final: false,
};
const assignment = ref({ submission: initialSubmission });
const assignment = reactive({ submission: initialSubmission });
const corrections = ref('');
const unsaved = ref(false);
const saving = ref(0);
@ -392,9 +392,9 @@ const saveInput = (answer: string) => {
corrections.value = '';
unsaved.value = true;
/*
We update the assignment on this component, so the changes are reflected on it. The server does not return
the updated entity, to prevent the UI to update when the user is entering his input
*/
We update the assignment on this component, so the changes are reflected on it. The server does not return
the updated entity, to prevent the UI to update when the user is entering his input
*/
assignment.value.submission.text = answer;
_save(assignment.value.submission);

View File

@ -12,7 +12,7 @@ const languageVar = makeVar('de');
const idToRefFactory =
(__typename: string) =>
(_, { args, toReference }) => {
log.debug(`Referencing ${__typename} with ${args.id}`);
//log.debug(`Referencing ${__typename} with ${args.id}`);
return toReference({
__typename,
id: args.id,