@quesmed/types 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/dist/cjs/resolvers/mutation/restricted/marksheet.d.ts +44 -0
- package/dist/cjs/resolvers/mutation/restricted/marksheet.js +32 -1
- package/dist/cjs/resolvers/query/restricted/marksheet.js +12 -0
- package/dist/mjs/resolvers/mutation/restricted/marksheet.d.ts +44 -0
- package/dist/mjs/resolvers/mutation/restricted/marksheet.js +30 -0
- package/dist/mjs/resolvers/query/restricted/marksheet.js +12 -0
- package/package.json +1 -1
|
@@ -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
|
|
@@ -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
|
|
@@ -11,6 +11,10 @@ export const BUILD_MARKSHEET = gql `
|
|
|
11
11
|
agoraId
|
|
12
12
|
topicIds
|
|
13
13
|
completed
|
|
14
|
+
topicIds
|
|
15
|
+
topicNames
|
|
16
|
+
mockTestId
|
|
17
|
+
totalQuestions
|
|
14
18
|
solo
|
|
15
19
|
state
|
|
16
20
|
currentMarkId
|
|
@@ -1242,9 +1246,17 @@ export const START_OR_JOIN_MARKSHEET = gql `
|
|
|
1242
1246
|
topicConceptData
|
|
1243
1247
|
currentMarkId
|
|
1244
1248
|
completed
|
|
1249
|
+
topicIds
|
|
1250
|
+
topicNames
|
|
1251
|
+
mockTestId
|
|
1252
|
+
totalQuestions
|
|
1245
1253
|
solo
|
|
1246
1254
|
agoraId
|
|
1247
1255
|
state
|
|
1256
|
+
user {
|
|
1257
|
+
id
|
|
1258
|
+
displayName
|
|
1259
|
+
}
|
|
1248
1260
|
users {
|
|
1249
1261
|
id
|
|
1250
1262
|
displayName
|
|
@@ -1783,6 +1795,24 @@ export const START_OR_JOIN_MARKSHEET = gql `
|
|
|
1783
1795
|
}
|
|
1784
1796
|
}
|
|
1785
1797
|
`;
|
|
1798
|
+
export const optimisticModifyMarksheetBuilderConfig = (marksheetId, builderConfig, client) => {
|
|
1799
|
+
const data = client?.readQuery({
|
|
1800
|
+
variables: { id: Number(marksheetId) },
|
|
1801
|
+
query: MARKSHEET,
|
|
1802
|
+
});
|
|
1803
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1804
|
+
const { marksheet } = data.restricted;
|
|
1805
|
+
const newBuilderConfig = { ...marksheet.builderConfig, ...builderConfig };
|
|
1806
|
+
return {
|
|
1807
|
+
restricted: {
|
|
1808
|
+
__typename: 'RestrictedMutation',
|
|
1809
|
+
modifyMarksheetInfo: {
|
|
1810
|
+
...marksheet,
|
|
1811
|
+
builderConfig: newBuilderConfig,
|
|
1812
|
+
},
|
|
1813
|
+
},
|
|
1814
|
+
};
|
|
1815
|
+
};
|
|
1786
1816
|
export const MODIFY_MARKSHEET_INFO = gql `
|
|
1787
1817
|
mutation ModifyMarksheetInfo($input: ModifyMarksheetInfoInput) {
|
|
1788
1818
|
restricted {
|
|
@@ -7,9 +7,17 @@ export const MARKSHEET = gql `
|
|
|
7
7
|
topicConceptData
|
|
8
8
|
currentMarkId
|
|
9
9
|
completed
|
|
10
|
+
topicIds
|
|
11
|
+
topicNames
|
|
12
|
+
mockTestId
|
|
13
|
+
totalQuestions
|
|
10
14
|
solo
|
|
11
15
|
agoraId
|
|
12
16
|
state
|
|
17
|
+
user {
|
|
18
|
+
id
|
|
19
|
+
displayName
|
|
20
|
+
}
|
|
13
21
|
users {
|
|
14
22
|
id
|
|
15
23
|
displayName
|
|
@@ -562,6 +570,10 @@ export const MARKSHEETS = gql `
|
|
|
562
570
|
solo
|
|
563
571
|
completed
|
|
564
572
|
updatedAt
|
|
573
|
+
users {
|
|
574
|
+
id
|
|
575
|
+
displayName
|
|
576
|
+
}
|
|
565
577
|
}
|
|
566
578
|
total
|
|
567
579
|
score
|