Fix Assignment bug
This commit is contained in:
parent
ad5a7824ba
commit
b7a009972f
|
|
@ -315,8 +315,6 @@ const createHighlight = createHighlightCurry({
|
||||||
|
|
||||||
const isNested = computed(() => props.contentBlock.root); // if it's nested, a the parent has the root propert
|
const isNested = computed(() => props.contentBlock.root); // if it's nested, a the parent has the root propert
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
log.debug('onMounted ContentBlock called');
|
|
||||||
|
|
||||||
const element = contentBlockDiv.value;
|
const element = contentBlockDiv.value;
|
||||||
|
|
||||||
if (element !== null) {
|
if (element !== null) {
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<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 { useRoute } from 'vue-router';
|
||||||
import { useMutation, useQuery } from '@vue/apollo-composable';
|
import { useMutation, useQuery } from '@vue/apollo-composable';
|
||||||
import { graphql } from '@/__generated__';
|
import { graphql } from '@/__generated__';
|
||||||
|
|
@ -91,7 +91,7 @@ const initialSubmission = {
|
||||||
document: '',
|
document: '',
|
||||||
final: false,
|
final: false,
|
||||||
};
|
};
|
||||||
const assignment = ref({ submission: initialSubmission });
|
const assignment = reactive({ submission: initialSubmission });
|
||||||
const corrections = ref('');
|
const corrections = ref('');
|
||||||
const unsaved = ref(false);
|
const unsaved = ref(false);
|
||||||
const saving = ref(0);
|
const saving = ref(0);
|
||||||
|
|
@ -392,9 +392,9 @@ const saveInput = (answer: string) => {
|
||||||
corrections.value = '';
|
corrections.value = '';
|
||||||
unsaved.value = true;
|
unsaved.value = true;
|
||||||
/*
|
/*
|
||||||
We update the assignment on this component, so the changes are reflected on it. The server does not return
|
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
|
the updated entity, to prevent the UI to update when the user is entering his input
|
||||||
*/
|
*/
|
||||||
assignment.value.submission.text = answer;
|
assignment.value.submission.text = answer;
|
||||||
_save(assignment.value.submission);
|
_save(assignment.value.submission);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ const languageVar = makeVar('de');
|
||||||
const idToRefFactory =
|
const idToRefFactory =
|
||||||
(__typename: string) =>
|
(__typename: string) =>
|
||||||
(_, { args, toReference }) => {
|
(_, { args, toReference }) => {
|
||||||
log.debug(`Referencing ${__typename} with ${args.id}`);
|
//log.debug(`Referencing ${__typename} with ${args.id}`);
|
||||||
return toReference({
|
return toReference({
|
||||||
__typename,
|
__typename,
|
||||||
id: args.id,
|
id: args.id,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue