@quesmed/types-rn 2.2.36 → 2.2.39
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.
package/package.json
CHANGED
|
@@ -117,6 +117,50 @@ export interface IModifyMarksheetInfo {
|
|
|
117
117
|
input: IQbankInfoInput;
|
|
118
118
|
}
|
|
119
119
|
export declare type IModifyMarksheetData = RestrictedData<graphqlNormalize & IMarksheet, 'modifyMarksheetInfo'>;
|
|
120
|
+
export declare const optimisticModifyMarksheetBuilderConfig: (marksheetId: number, builderConfig: IBuildConfigData, client?: ApolloClient<any> | undefined) => {
|
|
121
|
+
restricted: {
|
|
122
|
+
__typename: string;
|
|
123
|
+
modifyMarksheetInfo: {
|
|
124
|
+
builderConfig: {
|
|
125
|
+
numberOfQuestions?: number | undefined;
|
|
126
|
+
difficulty?: number[] | undefined;
|
|
127
|
+
unseen?: boolean | undefined;
|
|
128
|
+
seenIncorrect?: boolean | undefined;
|
|
129
|
+
seenCorrect?: boolean | undefined;
|
|
130
|
+
secondsPerQuestion?: number | undefined;
|
|
131
|
+
isTest?: boolean | undefined;
|
|
132
|
+
};
|
|
133
|
+
__typename?: string | undefined;
|
|
134
|
+
id: number;
|
|
135
|
+
createdAt: number | Date;
|
|
136
|
+
updatedAt: number | Date;
|
|
137
|
+
deletedAt: number | Date;
|
|
138
|
+
startedAt: number | Date;
|
|
139
|
+
type: import("../../../models").EMarksheetType;
|
|
140
|
+
endedAt: number | Date;
|
|
141
|
+
topicIds: number[];
|
|
142
|
+
topicNames?: string[] | undefined;
|
|
143
|
+
source: string;
|
|
144
|
+
userId: number;
|
|
145
|
+
user?: IUser | undefined;
|
|
146
|
+
marks: import("../../../models").IMarksheetMark[];
|
|
147
|
+
mockTestId: number | null;
|
|
148
|
+
correct?: number | undefined;
|
|
149
|
+
incorrect?: number | undefined;
|
|
150
|
+
totalQuestions?: number | undefined;
|
|
151
|
+
isTestMarksheet?: boolean | undefined;
|
|
152
|
+
solo: boolean;
|
|
153
|
+
agoraId: string;
|
|
154
|
+
users: IUser[];
|
|
155
|
+
state: EMarksheetState;
|
|
156
|
+
completed: boolean;
|
|
157
|
+
timeTaken: number;
|
|
158
|
+
currentMarkId?: number | undefined;
|
|
159
|
+
topicConceptData?: string | undefined;
|
|
160
|
+
preBuildData?: IPreBuildMarksheet | undefined;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
};
|
|
120
164
|
export declare const MODIFY_MARKSHEET_INFO: import("@apollo/client").DocumentNode;
|
|
121
165
|
/**
|
|
122
166
|
* leaveMarksheet
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.END_MARKSHEET = exports.LEAVE_MARKSHEET = exports.MODIFY_MARKSHEET_INFO = exports.START_OR_JOIN_MARKSHEET = exports.REMOVE_FLAGGED_QUESTION = exports.ADD_FLAGGED_QUESTION = exports.optimisticSaveMarksheets = exports.updateMarksheets = exports.SAVE_MARKSHEET = exports.RE_BUILD_MARKSHEET = exports.BUILD_MARKSHEET = void 0;
|
|
3
|
+
exports.END_MARKSHEET = exports.LEAVE_MARKSHEET = exports.MODIFY_MARKSHEET_INFO = exports.optimisticModifyMarksheetBuilderConfig = exports.START_OR_JOIN_MARKSHEET = exports.REMOVE_FLAGGED_QUESTION = exports.ADD_FLAGGED_QUESTION = exports.optimisticSaveMarksheets = exports.updateMarksheets = exports.SAVE_MARKSHEET = exports.RE_BUILD_MARKSHEET = exports.BUILD_MARKSHEET = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
5
|
const restricted_1 = require("../../query/restricted");
|
|
6
6
|
exports.BUILD_MARKSHEET = (0, client_1.gql) `
|
|
@@ -14,6 +14,10 @@ exports.BUILD_MARKSHEET = (0, client_1.gql) `
|
|
|
14
14
|
agoraId
|
|
15
15
|
topicIds
|
|
16
16
|
completed
|
|
17
|
+
topicIds
|
|
18
|
+
topicNames
|
|
19
|
+
mockTestId
|
|
20
|
+
totalQuestions
|
|
17
21
|
solo
|
|
18
22
|
state
|
|
19
23
|
currentMarkId
|
|
@@ -1247,9 +1251,17 @@ exports.START_OR_JOIN_MARKSHEET = (0, client_1.gql) `
|
|
|
1247
1251
|
topicConceptData
|
|
1248
1252
|
currentMarkId
|
|
1249
1253
|
completed
|
|
1254
|
+
topicIds
|
|
1255
|
+
topicNames
|
|
1256
|
+
mockTestId
|
|
1257
|
+
totalQuestions
|
|
1250
1258
|
solo
|
|
1251
1259
|
agoraId
|
|
1252
1260
|
state
|
|
1261
|
+
user {
|
|
1262
|
+
id
|
|
1263
|
+
displayName
|
|
1264
|
+
}
|
|
1253
1265
|
users {
|
|
1254
1266
|
id
|
|
1255
1267
|
displayName
|
|
@@ -1788,6 +1800,25 @@ exports.START_OR_JOIN_MARKSHEET = (0, client_1.gql) `
|
|
|
1788
1800
|
}
|
|
1789
1801
|
}
|
|
1790
1802
|
`;
|
|
1803
|
+
const optimisticModifyMarksheetBuilderConfig = (marksheetId, builderConfig, client) => {
|
|
1804
|
+
const data = client?.readQuery({
|
|
1805
|
+
variables: { id: Number(marksheetId) },
|
|
1806
|
+
query: restricted_1.MARKSHEET,
|
|
1807
|
+
});
|
|
1808
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1809
|
+
const { marksheet } = data.restricted;
|
|
1810
|
+
const newBuilderConfig = { ...marksheet.builderConfig, ...builderConfig };
|
|
1811
|
+
return {
|
|
1812
|
+
restricted: {
|
|
1813
|
+
__typename: 'RestrictedMutation',
|
|
1814
|
+
modifyMarksheetInfo: {
|
|
1815
|
+
...marksheet,
|
|
1816
|
+
builderConfig: newBuilderConfig,
|
|
1817
|
+
},
|
|
1818
|
+
},
|
|
1819
|
+
};
|
|
1820
|
+
};
|
|
1821
|
+
exports.optimisticModifyMarksheetBuilderConfig = optimisticModifyMarksheetBuilderConfig;
|
|
1791
1822
|
exports.MODIFY_MARKSHEET_INFO = (0, client_1.gql) `
|
|
1792
1823
|
mutation ModifyMarksheetInfo($input: ModifyMarksheetInfoInput) {
|
|
1793
1824
|
restricted {
|
|
@@ -10,9 +10,17 @@ exports.MARKSHEET = (0, client_1.gql) `
|
|
|
10
10
|
topicConceptData
|
|
11
11
|
currentMarkId
|
|
12
12
|
completed
|
|
13
|
+
topicIds
|
|
14
|
+
topicNames
|
|
15
|
+
mockTestId
|
|
16
|
+
totalQuestions
|
|
13
17
|
solo
|
|
14
18
|
agoraId
|
|
15
19
|
state
|
|
20
|
+
user {
|
|
21
|
+
id
|
|
22
|
+
displayName
|
|
23
|
+
}
|
|
16
24
|
users {
|
|
17
25
|
id
|
|
18
26
|
displayName
|
|
@@ -565,6 +573,10 @@ exports.MARKSHEETS = (0, client_1.gql) `
|
|
|
565
573
|
solo
|
|
566
574
|
completed
|
|
567
575
|
updatedAt
|
|
576
|
+
users {
|
|
577
|
+
id
|
|
578
|
+
displayName
|
|
579
|
+
}
|
|
568
580
|
}
|
|
569
581
|
total
|
|
570
582
|
score
|