@quesmed/types 2.6.210 → 2.6.211
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -94,19 +94,21 @@ const updateMarksheets = (cache, result, options) => {
|
|
|
94
94
|
try {
|
|
95
95
|
const { input } = variables;
|
|
96
96
|
for (let i = 0; i < input.length; i++) {
|
|
97
|
-
const
|
|
97
|
+
const inputData = input[i];
|
|
98
|
+
const savedMarks = saveMarksheets.find((m) => m.id === inputData.marksheetId)?.marks;
|
|
99
|
+
const savedData = savedMarks?.find((m) => m.id === inputData.markId);
|
|
98
100
|
cache.writeFragment({
|
|
99
101
|
id: cache.identify({
|
|
100
|
-
id:
|
|
102
|
+
id: inputData.markId,
|
|
101
103
|
__typename: 'MarksheetMark',
|
|
102
104
|
}),
|
|
103
105
|
data: {
|
|
104
|
-
timeTaken:
|
|
105
|
-
mark:
|
|
106
|
-
questionChoiceId:
|
|
106
|
+
timeTaken: savedData?.timeTaken || 0,
|
|
107
|
+
mark: savedData?.mark,
|
|
108
|
+
questionChoiceId: savedData?.questionChoiceId,
|
|
107
109
|
isAnswered: true,
|
|
108
|
-
result:
|
|
109
|
-
score:
|
|
110
|
+
result: savedData?.result,
|
|
111
|
+
score: savedData?.score,
|
|
110
112
|
},
|
|
111
113
|
fragment: marksheet_1.NEW_MARK_FIELDS,
|
|
112
114
|
});
|
|
@@ -91,19 +91,21 @@ export const updateMarksheets = (cache, result, options) => {
|
|
|
91
91
|
try {
|
|
92
92
|
const { input } = variables;
|
|
93
93
|
for (let i = 0; i < input.length; i++) {
|
|
94
|
-
const
|
|
94
|
+
const inputData = input[i];
|
|
95
|
+
const savedMarks = saveMarksheets.find((m) => m.id === inputData.marksheetId)?.marks;
|
|
96
|
+
const savedData = savedMarks?.find((m) => m.id === inputData.markId);
|
|
95
97
|
cache.writeFragment({
|
|
96
98
|
id: cache.identify({
|
|
97
|
-
id:
|
|
99
|
+
id: inputData.markId,
|
|
98
100
|
__typename: 'MarksheetMark',
|
|
99
101
|
}),
|
|
100
102
|
data: {
|
|
101
|
-
timeTaken:
|
|
102
|
-
mark:
|
|
103
|
-
questionChoiceId:
|
|
103
|
+
timeTaken: savedData?.timeTaken || 0,
|
|
104
|
+
mark: savedData?.mark,
|
|
105
|
+
questionChoiceId: savedData?.questionChoiceId,
|
|
104
106
|
isAnswered: true,
|
|
105
|
-
result:
|
|
106
|
-
score:
|
|
107
|
+
result: savedData?.result,
|
|
108
|
+
score: savedData?.score,
|
|
107
109
|
},
|
|
108
110
|
fragment: NEW_MARK_FIELDS,
|
|
109
111
|
});
|