@quesmed/types-rn 2.6.215 → 2.6.217
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/models/Marksheet.d.ts +13 -4
- package/models/MockTest.d.ts +2 -0
- package/package.json +1 -1
- package/resolvers/fragments/marksheet.d.ts +7 -0
- package/resolvers/fragments/marksheet.js +29 -1
- package/resolvers/fragments/mockTest.d.ts +9 -0
- package/resolvers/fragments/mockTest.js +32 -0
- package/resolvers/mutation/restricted/marksheet.d.ts +4 -2
- package/resolvers/mutation/restricted/marksheet.js +6 -2
- package/resolvers/mutation/restricted/mockTest.d.ts +2 -1
- package/resolvers/mutation/restricted/mockTest.js +14 -1
- package/resolvers/mutation/restricted/osce.d.ts +1 -1
- package/resolvers/query/restricted/marksheet.d.ts +24 -17
- package/resolvers/query/restricted/marksheet.js +61 -41
- package/resolvers/query/restricted/qBank.d.ts +1 -10
- package/resolvers/query/restricted/qBank.js +1 -0
- package/utils/evaluateMark.d.ts +2 -0
- package/utils/evaluateMark.js +58 -14
package/models/Marksheet.d.ts
CHANGED
|
@@ -56,6 +56,18 @@ export interface IMarksheetMember {
|
|
|
56
56
|
userId: Id;
|
|
57
57
|
user?: IUser | null;
|
|
58
58
|
}
|
|
59
|
+
export interface IMarksheetStats {
|
|
60
|
+
correct: number;
|
|
61
|
+
incorrect: number;
|
|
62
|
+
partial: number;
|
|
63
|
+
score: number;
|
|
64
|
+
maxPossibleScore: number;
|
|
65
|
+
percentage: number;
|
|
66
|
+
totalQuestions: number;
|
|
67
|
+
totalSets: number;
|
|
68
|
+
attempts: number;
|
|
69
|
+
timeTaken: number;
|
|
70
|
+
}
|
|
59
71
|
export interface IMarksheet {
|
|
60
72
|
id: Id;
|
|
61
73
|
createdAt: number | Date;
|
|
@@ -74,6 +86,7 @@ export interface IMarksheet {
|
|
|
74
86
|
marks: IMarksheetMark[];
|
|
75
87
|
mockTestId: number | null;
|
|
76
88
|
isTestMarksheet: boolean;
|
|
89
|
+
stats: IMarksheetStats;
|
|
77
90
|
correct?: number;
|
|
78
91
|
incorrect?: number;
|
|
79
92
|
partial?: number;
|
|
@@ -86,10 +99,6 @@ export interface IMarksheet {
|
|
|
86
99
|
users: IUser[];
|
|
87
100
|
activeUsers?: IUser[];
|
|
88
101
|
state: EMarksheetState;
|
|
89
|
-
/**
|
|
90
|
-
* @deprecated Use !!endedAt instead
|
|
91
|
-
* And for timed tests, check if (parent.endedAt && new Date(parent.endedAt) <= new Date());
|
|
92
|
-
*/
|
|
93
102
|
completed: boolean;
|
|
94
103
|
timeTaken: number;
|
|
95
104
|
currentMarkId?: number;
|
package/models/MockTest.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IMarksheet } from './Marksheet';
|
|
1
2
|
import { EProductType } from './Product';
|
|
2
3
|
import { IQuestion } from './Question';
|
|
3
4
|
import { Id } from './Type';
|
|
@@ -47,6 +48,7 @@ export interface IUserMockTest {
|
|
|
47
48
|
lastMarksheetId?: Id;
|
|
48
49
|
lastMarksheetStartedAt?: number | Date;
|
|
49
50
|
lastMarksheetEndedAt?: number | Date;
|
|
51
|
+
lastMarksheet?: IMarksheet;
|
|
50
52
|
}
|
|
51
53
|
export interface IMockTestQuestion {
|
|
52
54
|
id: Id;
|
package/package.json
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
export declare const MARKSHEET_STATS_FIELDS: import("@apollo/client").DocumentNode;
|
|
1
2
|
export declare const MARKSHEET_MARK_FIELDS: import("@apollo/client").DocumentNode;
|
|
2
3
|
export declare const BUILDER_CONFIG_FIELDS: import("@apollo/client").DocumentNode;
|
|
4
|
+
/**
|
|
5
|
+
* TODO:: Remove deperecated fields once mobile app is updated
|
|
6
|
+
*/
|
|
3
7
|
export declare const MARKSHEET_FIELDS: import("@apollo/client").DocumentNode;
|
|
4
8
|
/**
|
|
5
9
|
* All below fragments are used in cache updator
|
|
@@ -11,6 +15,9 @@ export declare const MODIFY_MARKSHEET_STATE_FRAGMENT: import("@apollo/client").D
|
|
|
11
15
|
export declare const MODIFY_TOPIC_SELECTION_FRAGMENT: import("@apollo/client").DocumentNode;
|
|
12
16
|
export declare const MODIFY_CURRENT_MARK_FRAGMENT: import("@apollo/client").DocumentNode;
|
|
13
17
|
export declare const MARK_FLAGGED_FIELD: import("@apollo/client").DocumentNode;
|
|
18
|
+
/**
|
|
19
|
+
* TODO:: Remove deperecated fields once mobile app is updated
|
|
20
|
+
*/
|
|
14
21
|
export declare const MODIFY_MARKSHEET_COMPLETED_FRAGMENT: import("@apollo/client").DocumentNode;
|
|
15
22
|
export declare const NEW_MARK_FIELDS: import("@apollo/client").DocumentNode;
|
|
16
23
|
export declare const DAILY_STACK_FIELDS: import("@apollo/client").DocumentNode;
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DAILY_STACK_FIELDS = exports.NEW_MARK_FIELDS = exports.MODIFY_MARKSHEET_COMPLETED_FRAGMENT = exports.MARK_FLAGGED_FIELD = exports.MODIFY_CURRENT_MARK_FRAGMENT = exports.MODIFY_TOPIC_SELECTION_FRAGMENT = exports.MODIFY_MARKSHEET_STATE_FRAGMENT = exports.MODIFY_MARKSHEET_MARK_STRIKED_FRAGMENT = exports.MODIFY_MARKSHEET_MARK_QUESTIONCHOICEID_FRAGMENT = exports.MODIFY_CURRENT_MARKSHEET_MARK_FRAGMENT = exports.MARKSHEET_FIELDS = exports.BUILDER_CONFIG_FIELDS = exports.MARKSHEET_MARK_FIELDS = void 0;
|
|
3
|
+
exports.DAILY_STACK_FIELDS = exports.NEW_MARK_FIELDS = exports.MODIFY_MARKSHEET_COMPLETED_FRAGMENT = exports.MARK_FLAGGED_FIELD = exports.MODIFY_CURRENT_MARK_FRAGMENT = exports.MODIFY_TOPIC_SELECTION_FRAGMENT = exports.MODIFY_MARKSHEET_STATE_FRAGMENT = exports.MODIFY_MARKSHEET_MARK_STRIKED_FRAGMENT = exports.MODIFY_MARKSHEET_MARK_QUESTIONCHOICEID_FRAGMENT = exports.MODIFY_CURRENT_MARKSHEET_MARK_FRAGMENT = exports.MARKSHEET_FIELDS = exports.BUILDER_CONFIG_FIELDS = exports.MARKSHEET_MARK_FIELDS = exports.MARKSHEET_STATS_FIELDS = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
5
|
const question_1 = require("./question");
|
|
6
|
+
exports.MARKSHEET_STATS_FIELDS = (0, client_1.gql) `
|
|
7
|
+
fragment MarksheetStatsFields on MarksheetStats {
|
|
8
|
+
correct
|
|
9
|
+
incorrect
|
|
10
|
+
partial
|
|
11
|
+
totalQuestions
|
|
12
|
+
totalSets
|
|
13
|
+
score
|
|
14
|
+
maxPossibleScore
|
|
15
|
+
percentage
|
|
16
|
+
attempts
|
|
17
|
+
timeTaken
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
6
20
|
exports.MARKSHEET_MARK_FIELDS = (0, client_1.gql) `
|
|
7
21
|
${question_1.QUESTION_FIELDS}
|
|
8
22
|
fragment MarksheetMarkFields on MarksheetMark {
|
|
@@ -35,9 +49,13 @@ exports.BUILDER_CONFIG_FIELDS = (0, client_1.gql) `
|
|
|
35
49
|
seenIncorrect
|
|
36
50
|
}
|
|
37
51
|
`;
|
|
52
|
+
/**
|
|
53
|
+
* TODO:: Remove deperecated fields once mobile app is updated
|
|
54
|
+
*/
|
|
38
55
|
exports.MARKSHEET_FIELDS = (0, client_1.gql) `
|
|
39
56
|
${exports.MARKSHEET_MARK_FIELDS}
|
|
40
57
|
${exports.BUILDER_CONFIG_FIELDS}
|
|
58
|
+
${exports.MARKSHEET_STATS_FIELDS}
|
|
41
59
|
fragment MarksheetFields on Marksheet {
|
|
42
60
|
id
|
|
43
61
|
topicConceptData
|
|
@@ -90,6 +108,9 @@ exports.MARKSHEET_FIELDS = (0, client_1.gql) `
|
|
|
90
108
|
marks {
|
|
91
109
|
...MarksheetMarkFields
|
|
92
110
|
}
|
|
111
|
+
stats {
|
|
112
|
+
...MarksheetStatsFields
|
|
113
|
+
}
|
|
93
114
|
}
|
|
94
115
|
`;
|
|
95
116
|
/**
|
|
@@ -131,7 +152,11 @@ exports.MARK_FLAGGED_FIELD = (0, client_1.gql) `
|
|
|
131
152
|
flagged
|
|
132
153
|
}
|
|
133
154
|
`;
|
|
155
|
+
/**
|
|
156
|
+
* TODO:: Remove deperecated fields once mobile app is updated
|
|
157
|
+
*/
|
|
134
158
|
exports.MODIFY_MARKSHEET_COMPLETED_FRAGMENT = (0, client_1.gql) `
|
|
159
|
+
${exports.MARKSHEET_STATS_FIELDS}
|
|
135
160
|
fragment MarksheetCompleted on Marksheet {
|
|
136
161
|
timeTaken
|
|
137
162
|
completed
|
|
@@ -139,6 +164,9 @@ exports.MODIFY_MARKSHEET_COMPLETED_FRAGMENT = (0, client_1.gql) `
|
|
|
139
164
|
incorrect
|
|
140
165
|
duration
|
|
141
166
|
endedAt
|
|
167
|
+
stats {
|
|
168
|
+
...MarksheetStatsFields
|
|
169
|
+
}
|
|
142
170
|
}
|
|
143
171
|
`;
|
|
144
172
|
exports.NEW_MARK_FIELDS = (0, client_1.gql) `
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TODO:: Remove deperecated fields once mobile app is updated
|
|
3
|
+
*/
|
|
1
4
|
export declare const MOCK_TEST_FIELDS: import("@apollo/client").DocumentNode;
|
|
2
5
|
/**
|
|
3
6
|
* All below fragments are used in cache updator
|
|
4
7
|
*/
|
|
5
8
|
export declare const MARK_FLAGGED_QUESTION: import("@apollo/client").DocumentNode;
|
|
9
|
+
/**
|
|
10
|
+
* TODO:: Remove deperecated fields once mobile app is updated
|
|
11
|
+
*/
|
|
6
12
|
export declare const COMPLETED_MOCK_TEST_MARKSHEET_FRAGMENT: import("@apollo/client").DocumentNode;
|
|
13
|
+
/**
|
|
14
|
+
* TODO:: Remove deperecated fields once mobile app is updated
|
|
15
|
+
*/
|
|
7
16
|
export declare const COMPLETED_MOCK_TESTS_FRAGMENT: import("@apollo/client").DocumentNode;
|
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.COMPLETED_MOCK_TESTS_FRAGMENT = exports.COMPLETED_MOCK_TEST_MARKSHEET_FRAGMENT = exports.MARK_FLAGGED_QUESTION = exports.MOCK_TEST_FIELDS = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
|
+
const marksheet_1 = require("./marksheet");
|
|
6
|
+
/**
|
|
7
|
+
* TODO:: Remove deperecated fields once mobile app is updated
|
|
8
|
+
*/
|
|
5
9
|
exports.MOCK_TEST_FIELDS = (0, client_1.gql) `
|
|
10
|
+
${marksheet_1.MARKSHEET_STATS_FIELDS}
|
|
6
11
|
fragment MockTestFields on MockTest {
|
|
7
12
|
id
|
|
8
13
|
demo
|
|
@@ -16,6 +21,14 @@ exports.MOCK_TEST_FIELDS = (0, client_1.gql) `
|
|
|
16
21
|
lastMarksheetEndedAt
|
|
17
22
|
lastMarksheetStartedAt
|
|
18
23
|
lastMarksheetId
|
|
24
|
+
lastMarksheet {
|
|
25
|
+
id
|
|
26
|
+
startedAt
|
|
27
|
+
endedAt
|
|
28
|
+
stats {
|
|
29
|
+
...MarksheetStatsFields
|
|
30
|
+
}
|
|
31
|
+
}
|
|
19
32
|
typeId
|
|
20
33
|
}
|
|
21
34
|
`;
|
|
@@ -27,7 +40,11 @@ exports.MARK_FLAGGED_QUESTION = (0, client_1.gql) `
|
|
|
27
40
|
flagged
|
|
28
41
|
}
|
|
29
42
|
`;
|
|
43
|
+
/**
|
|
44
|
+
* TODO:: Remove deperecated fields once mobile app is updated
|
|
45
|
+
*/
|
|
30
46
|
exports.COMPLETED_MOCK_TEST_MARKSHEET_FRAGMENT = (0, client_1.gql) `
|
|
47
|
+
${marksheet_1.MARKSHEET_STATS_FIELDS}
|
|
31
48
|
fragment MockTestCompleted on Marksheet {
|
|
32
49
|
completed
|
|
33
50
|
correct
|
|
@@ -35,14 +52,29 @@ exports.COMPLETED_MOCK_TEST_MARKSHEET_FRAGMENT = (0, client_1.gql) `
|
|
|
35
52
|
incorrect
|
|
36
53
|
duration
|
|
37
54
|
endedAt
|
|
55
|
+
stats {
|
|
56
|
+
...MarksheetStatsFields
|
|
57
|
+
}
|
|
38
58
|
}
|
|
39
59
|
`;
|
|
60
|
+
/**
|
|
61
|
+
* TODO:: Remove deperecated fields once mobile app is updated
|
|
62
|
+
*/
|
|
40
63
|
exports.COMPLETED_MOCK_TESTS_FRAGMENT = (0, client_1.gql) `
|
|
64
|
+
${marksheet_1.MARKSHEET_STATS_FIELDS}
|
|
41
65
|
fragment CompletedMockTestFragment on MockTest {
|
|
42
66
|
correct
|
|
43
67
|
incorrect
|
|
44
68
|
lastMarksheetEndedAt
|
|
45
69
|
lastMarksheetStartedAt
|
|
46
70
|
lastMarksheetId
|
|
71
|
+
lastMarksheet {
|
|
72
|
+
id
|
|
73
|
+
startedAt
|
|
74
|
+
endedAt
|
|
75
|
+
stats {
|
|
76
|
+
...MarksheetStatsFields
|
|
77
|
+
}
|
|
78
|
+
}
|
|
47
79
|
}
|
|
48
80
|
`;
|
|
@@ -188,6 +188,7 @@ export declare const optimisticModifyMarksheetBuilderConfig: (marksheetId: numbe
|
|
|
188
188
|
marks: IMarksheetMark[];
|
|
189
189
|
mockTestId: number | null;
|
|
190
190
|
isTestMarksheet: boolean;
|
|
191
|
+
stats: import("../../../models").IMarksheetStats;
|
|
191
192
|
correct?: number | undefined;
|
|
192
193
|
incorrect?: number | undefined;
|
|
193
194
|
partial?: number | undefined;
|
|
@@ -205,7 +206,7 @@ export declare const optimisticModifyMarksheetBuilderConfig: (marksheetId: numbe
|
|
|
205
206
|
currentMarkId?: number | undefined;
|
|
206
207
|
topicConceptData?: string | undefined;
|
|
207
208
|
preBuildData?: IPreBuildMarksheet | undefined;
|
|
208
|
-
entitlementId: import("../../../models").EProductType
|
|
209
|
+
entitlementId: EEntitlementType | import("../../../models").EProductType;
|
|
209
210
|
};
|
|
210
211
|
};
|
|
211
212
|
};
|
|
@@ -282,6 +283,7 @@ export declare const optimisticEndMarksheet: (marksheet: IMarksheet) => {
|
|
|
282
283
|
marks: IMarksheetMark[];
|
|
283
284
|
mockTestId: number | null;
|
|
284
285
|
isTestMarksheet: boolean;
|
|
286
|
+
stats: import("../../../models").IMarksheetStats;
|
|
285
287
|
correct?: number | undefined;
|
|
286
288
|
incorrect?: number | undefined;
|
|
287
289
|
partial?: number | undefined;
|
|
@@ -299,7 +301,7 @@ export declare const optimisticEndMarksheet: (marksheet: IMarksheet) => {
|
|
|
299
301
|
topicConceptData?: string | undefined;
|
|
300
302
|
preBuildData?: IPreBuildMarksheet | undefined;
|
|
301
303
|
builderConfig?: IBuildConfigData | undefined;
|
|
302
|
-
entitlementId: import("../../../models").EProductType
|
|
304
|
+
entitlementId: EEntitlementType | import("../../../models").EProductType;
|
|
303
305
|
__typename: string;
|
|
304
306
|
};
|
|
305
307
|
};
|
|
@@ -80,8 +80,6 @@ exports.SAVE_MARKSHEET = (0, client_1.gql) `
|
|
|
80
80
|
flagged
|
|
81
81
|
mark
|
|
82
82
|
}
|
|
83
|
-
correct
|
|
84
|
-
incorrect
|
|
85
83
|
}
|
|
86
84
|
}
|
|
87
85
|
}
|
|
@@ -406,6 +404,7 @@ exports.LEAVE_MARKSHEET = (0, client_1.gql) `
|
|
|
406
404
|
}
|
|
407
405
|
`;
|
|
408
406
|
exports.END_MARKSHEET = (0, client_1.gql) `
|
|
407
|
+
${marksheet_1.MARKSHEET_STATS_FIELDS}
|
|
409
408
|
mutation EndMarksheet($marksheetId: Int!) {
|
|
410
409
|
restricted {
|
|
411
410
|
endMarksheet(marksheetId: $marksheetId) {
|
|
@@ -419,6 +418,9 @@ exports.END_MARKSHEET = (0, client_1.gql) `
|
|
|
419
418
|
correct
|
|
420
419
|
incorrect
|
|
421
420
|
totalQuestions
|
|
421
|
+
stats {
|
|
422
|
+
...MarksheetStatsFields
|
|
423
|
+
}
|
|
422
424
|
}
|
|
423
425
|
}
|
|
424
426
|
}
|
|
@@ -439,7 +441,9 @@ const updateCacheOnEndMarksheet = (cache, result, options) => {
|
|
|
439
441
|
incorrect: endMarksheet.incorrect,
|
|
440
442
|
duration: endMarksheet.duration,
|
|
441
443
|
endedAt: endMarksheet.endedAt,
|
|
444
|
+
stats: endMarksheet.stats,
|
|
442
445
|
},
|
|
446
|
+
fragmentName: 'MarksheetCompleted',
|
|
443
447
|
fragment: marksheet_1.MODIFY_MARKSHEET_COMPLETED_FRAGMENT,
|
|
444
448
|
});
|
|
445
449
|
};
|
|
@@ -65,6 +65,7 @@ export declare const optimisticEndMockTest: (marksheet: IMarksheet) => {
|
|
|
65
65
|
marks: IMarksheetMark[];
|
|
66
66
|
mockTestId: number | null;
|
|
67
67
|
isTestMarksheet: boolean;
|
|
68
|
+
stats: import("../../../models").IMarksheetStats;
|
|
68
69
|
correct?: number | undefined;
|
|
69
70
|
incorrect?: number | undefined;
|
|
70
71
|
partial?: number | undefined;
|
|
@@ -82,7 +83,7 @@ export declare const optimisticEndMockTest: (marksheet: IMarksheet) => {
|
|
|
82
83
|
topicConceptData?: string | undefined;
|
|
83
84
|
preBuildData?: import("./marksheet").IPreBuildMarksheet | undefined;
|
|
84
85
|
builderConfig?: import("./marksheet").IBuildConfigData | undefined;
|
|
85
|
-
entitlementId: import("../../../models").
|
|
86
|
+
entitlementId: import("../../../models").EEntitlementType | import("../../../models").EProductType;
|
|
86
87
|
__typename: string;
|
|
87
88
|
};
|
|
88
89
|
};
|
|
@@ -56,6 +56,7 @@ const optimisticToggleFlaggedQuestion = (mark, flagged) => ({
|
|
|
56
56
|
});
|
|
57
57
|
exports.optimisticToggleFlaggedQuestion = optimisticToggleFlaggedQuestion;
|
|
58
58
|
exports.END_MOCK_TEST = (0, client_1.gql) `
|
|
59
|
+
${fragments_1.MARKSHEET_STATS_FIELDS}
|
|
59
60
|
mutation EndMockTest($marksheetId: Int!) {
|
|
60
61
|
restricted {
|
|
61
62
|
endMockTest(marksheetId: $marksheetId) {
|
|
@@ -64,11 +65,14 @@ exports.END_MOCK_TEST = (0, client_1.gql) `
|
|
|
64
65
|
startedAt
|
|
65
66
|
endedAt
|
|
66
67
|
mockTestId
|
|
68
|
+
duration
|
|
67
69
|
completed
|
|
68
70
|
correct
|
|
69
71
|
incorrect
|
|
70
72
|
totalQuestions
|
|
71
|
-
|
|
73
|
+
stats {
|
|
74
|
+
...MarksheetStatsFields
|
|
75
|
+
}
|
|
72
76
|
}
|
|
73
77
|
}
|
|
74
78
|
}
|
|
@@ -89,7 +93,9 @@ const updateCacheOnEndMockTest = (cache, result, options) => {
|
|
|
89
93
|
incorrect: endMockTest.incorrect,
|
|
90
94
|
duration: endMockTest.duration,
|
|
91
95
|
endedAt: endMockTest.endedAt,
|
|
96
|
+
stats: endMockTest.stats,
|
|
92
97
|
},
|
|
98
|
+
fragmentName: 'MockTestCompleted',
|
|
93
99
|
fragment: fragments_1.COMPLETED_MOCK_TEST_MARKSHEET_FRAGMENT,
|
|
94
100
|
});
|
|
95
101
|
cache.writeFragment({
|
|
@@ -100,7 +106,14 @@ const updateCacheOnEndMockTest = (cache, result, options) => {
|
|
|
100
106
|
lastMarksheetEndedAt: endMockTest.endedAt,
|
|
101
107
|
correct: endMockTest.correct,
|
|
102
108
|
incorrect: endMockTest.incorrect,
|
|
109
|
+
lastMarksheet: {
|
|
110
|
+
id: endMockTest.id,
|
|
111
|
+
startedAt: endMockTest.startedAt,
|
|
112
|
+
endedAt: endMockTest.endedAt,
|
|
113
|
+
stats: endMockTest.stats,
|
|
114
|
+
},
|
|
103
115
|
},
|
|
116
|
+
fragmentName: 'CompletedMockTestFragment',
|
|
104
117
|
fragment: fragments_1.COMPLETED_MOCK_TESTS_FRAGMENT,
|
|
105
118
|
});
|
|
106
119
|
};
|
|
@@ -131,7 +131,7 @@ export declare const optimisticEndOsceMarksheet: (marksheet: IOsceMarksheet) =>
|
|
|
131
131
|
members: import("../../../models").IOsceMarksheetMember[];
|
|
132
132
|
state: EOsceMarksheetState;
|
|
133
133
|
entitlement: import("../../../models").IEntitlement;
|
|
134
|
-
entitlementId:
|
|
134
|
+
entitlementId: EEntitlementType | EProductType;
|
|
135
135
|
isTimed: boolean;
|
|
136
136
|
__typename: string;
|
|
137
137
|
};
|
|
@@ -7,14 +7,6 @@ export interface IMarksheetVar {
|
|
|
7
7
|
}
|
|
8
8
|
export type IMarksheetData = RestrictedData<graphqlNormalize & IMarksheet, 'marksheet'>;
|
|
9
9
|
export declare const MARKSHEET: import("@apollo/client").DocumentNode;
|
|
10
|
-
export interface IMarksheetsVar {
|
|
11
|
-
options: {
|
|
12
|
-
limit: number;
|
|
13
|
-
order?: ESortOrder;
|
|
14
|
-
lastId?: number;
|
|
15
|
-
solo?: boolean;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
10
|
export interface IMarksheetsWindowVar {
|
|
19
11
|
filter: {
|
|
20
12
|
limit: number;
|
|
@@ -24,11 +16,6 @@ export interface IMarksheetsWindowVar {
|
|
|
24
16
|
period?: number;
|
|
25
17
|
};
|
|
26
18
|
}
|
|
27
|
-
export type IMarksheetsData = RestrictedData<{
|
|
28
|
-
results: (graphqlNormalize & IMarksheet)[];
|
|
29
|
-
total: number;
|
|
30
|
-
score: number;
|
|
31
|
-
}, 'marksheets'>;
|
|
32
19
|
export interface IMarksheetsDashboardData {
|
|
33
20
|
total: number;
|
|
34
21
|
score: number;
|
|
@@ -38,13 +25,33 @@ export interface IMarksheetsDashboardData {
|
|
|
38
25
|
}>;
|
|
39
26
|
}
|
|
40
27
|
export type IMarksheetsWindowData = RestrictedData<graphqlNormalize & IMarksheetsDashboardData, 'marksheetsWindow'>;
|
|
41
|
-
export
|
|
28
|
+
export declare const MARKSHEETS_WINDOW: import("@apollo/client").DocumentNode;
|
|
29
|
+
export interface IMarksheetsVar {
|
|
30
|
+
options: {
|
|
31
|
+
limit: number;
|
|
32
|
+
order?: ESortOrder;
|
|
33
|
+
lastId?: number;
|
|
34
|
+
solo?: boolean;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export type IMarksheetsData = RestrictedData<{
|
|
42
38
|
results: (graphqlNormalize & IMarksheet)[];
|
|
43
39
|
total: number;
|
|
44
|
-
|
|
45
|
-
}
|
|
40
|
+
}, 'marksheets'>;
|
|
46
41
|
export declare const MARKSHEETS: import("@apollo/client").DocumentNode;
|
|
47
|
-
export
|
|
42
|
+
export interface IMarksheetsTrackerVar {
|
|
43
|
+
options: {
|
|
44
|
+
order?: ESortOrder;
|
|
45
|
+
solo?: boolean;
|
|
46
|
+
period?: number;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export interface IMarksheetsTrackerItem {
|
|
50
|
+
date: Date | number;
|
|
51
|
+
result: IMarksheet[];
|
|
52
|
+
}
|
|
53
|
+
export type IMarksheetsTrackerData = RestrictedData<graphqlNormalize & IMarksheetsTrackerItem[], 'marksheetsTracker'>;
|
|
54
|
+
export declare const MARKSHEETS_TRACKER: import("@apollo/client").DocumentNode;
|
|
48
55
|
export type ILatestPastMarksheetIdVar = null;
|
|
49
56
|
export type ILatestPastMarksheetIdData = RestrictedData<number, 'latestPastMarksheetId'>;
|
|
50
57
|
export declare const LATEST_PAST_MARKSHEET_ID: import("@apollo/client").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PRE_BUILD_MARKSHEET = exports.HEARTBEAT_QBANK = exports.MARKSHEET_FEEDBACK = exports.FLAGGED_QUESTIONS_MARKSHEET = exports.FLAGGED_QUESTIONS = exports.LATEST_PAST_SESSION_ID = exports.LATEST_PAST_MARKSHEET_ID = exports.
|
|
3
|
+
exports.PRE_BUILD_MARKSHEET = exports.HEARTBEAT_QBANK = exports.MARKSHEET_FEEDBACK = exports.FLAGGED_QUESTIONS_MARKSHEET = exports.FLAGGED_QUESTIONS = exports.LATEST_PAST_SESSION_ID = exports.LATEST_PAST_MARKSHEET_ID = exports.MARKSHEETS_TRACKER = exports.MARKSHEETS = exports.MARKSHEETS_WINDOW = exports.MARKSHEET = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
5
|
const marksheet_1 = require("../../fragments/marksheet");
|
|
6
6
|
exports.MARKSHEET = (0, client_1.gql) `
|
|
@@ -13,47 +13,8 @@ exports.MARKSHEET = (0, client_1.gql) `
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
`;
|
|
16
|
-
exports.MARKSHEETS = (0, client_1.gql) `
|
|
17
|
-
query Marksheets($options: MarksheetOptions!) {
|
|
18
|
-
restricted {
|
|
19
|
-
marksheets(options: $options) {
|
|
20
|
-
results {
|
|
21
|
-
id
|
|
22
|
-
source
|
|
23
|
-
endedAt
|
|
24
|
-
topicNames
|
|
25
|
-
entitlement {
|
|
26
|
-
id
|
|
27
|
-
name
|
|
28
|
-
}
|
|
29
|
-
correct
|
|
30
|
-
incorrect
|
|
31
|
-
totalQuestions
|
|
32
|
-
isTestMarksheet
|
|
33
|
-
solo
|
|
34
|
-
completed
|
|
35
|
-
passingMark
|
|
36
|
-
duration
|
|
37
|
-
updatedAt
|
|
38
|
-
users {
|
|
39
|
-
id
|
|
40
|
-
displayName
|
|
41
|
-
}
|
|
42
|
-
marks {
|
|
43
|
-
question {
|
|
44
|
-
topic {
|
|
45
|
-
typeId
|
|
46
|
-
name
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
total
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
`;
|
|
56
16
|
exports.MARKSHEETS_WINDOW = (0, client_1.gql) `
|
|
17
|
+
${marksheet_1.MARKSHEET_STATS_FIELDS}
|
|
57
18
|
query MarksheetsWindow($filter: MarksheetWindowFilterInput!) {
|
|
58
19
|
restricted {
|
|
59
20
|
marksheetsWindow(filter: $filter) {
|
|
@@ -76,6 +37,9 @@ exports.MARKSHEETS_WINDOW = (0, client_1.gql) `
|
|
|
76
37
|
solo
|
|
77
38
|
completed
|
|
78
39
|
updatedAt
|
|
40
|
+
stats {
|
|
41
|
+
...MarksheetStatsFields
|
|
42
|
+
}
|
|
79
43
|
}
|
|
80
44
|
}
|
|
81
45
|
total
|
|
@@ -84,6 +48,62 @@ exports.MARKSHEETS_WINDOW = (0, client_1.gql) `
|
|
|
84
48
|
}
|
|
85
49
|
}
|
|
86
50
|
`;
|
|
51
|
+
exports.MARKSHEETS = (0, client_1.gql) `
|
|
52
|
+
${marksheet_1.MARKSHEET_STATS_FIELDS}
|
|
53
|
+
query Marksheets($options: MarksheetOptions!) {
|
|
54
|
+
restricted {
|
|
55
|
+
marksheets(options: $options) {
|
|
56
|
+
results {
|
|
57
|
+
id
|
|
58
|
+
source
|
|
59
|
+
endedAt
|
|
60
|
+
topicNames
|
|
61
|
+
typeId
|
|
62
|
+
entitlement {
|
|
63
|
+
id
|
|
64
|
+
name
|
|
65
|
+
}
|
|
66
|
+
stats {
|
|
67
|
+
...MarksheetStatsFields
|
|
68
|
+
}
|
|
69
|
+
isTestMarksheet
|
|
70
|
+
solo
|
|
71
|
+
completed
|
|
72
|
+
updatedAt
|
|
73
|
+
}
|
|
74
|
+
total
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
exports.MARKSHEETS_TRACKER = (0, client_1.gql) `
|
|
80
|
+
${marksheet_1.MARKSHEET_STATS_FIELDS}
|
|
81
|
+
query MarksheetsTracker($options: MarksheetTrackerOptions!) {
|
|
82
|
+
restricted {
|
|
83
|
+
marksheetsTracker(options: $options) {
|
|
84
|
+
date
|
|
85
|
+
result {
|
|
86
|
+
id
|
|
87
|
+
source
|
|
88
|
+
endedAt
|
|
89
|
+
topicNames
|
|
90
|
+
typeId
|
|
91
|
+
entitlement {
|
|
92
|
+
id
|
|
93
|
+
name
|
|
94
|
+
}
|
|
95
|
+
stats {
|
|
96
|
+
...MarksheetStatsFields
|
|
97
|
+
}
|
|
98
|
+
isTestMarksheet
|
|
99
|
+
solo
|
|
100
|
+
completed
|
|
101
|
+
updatedAt
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
`;
|
|
87
107
|
exports.LATEST_PAST_MARKSHEET_ID = (0, client_1.gql) `
|
|
88
108
|
query LatestPastMarksheetId {
|
|
89
109
|
restricted {
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PaginatedMarksheets } from './marksheet';
|
|
3
|
-
import { IUniversitiesRankSpeciality } from './university';
|
|
1
|
+
import { IUser } from '../../../models';
|
|
4
2
|
export interface IDashboardQBank {
|
|
5
3
|
restricted: {
|
|
6
4
|
latestSessionId: string;
|
|
7
5
|
latestPastMarksheetId: number;
|
|
8
6
|
user: IUser;
|
|
9
|
-
marksheets: PaginatedMarksheets;
|
|
10
|
-
dailyFeed: ITodo;
|
|
11
|
-
dailyProgress: IDailyProgressData[];
|
|
12
|
-
topics: ITopic[];
|
|
13
7
|
totalQuestions: number;
|
|
14
8
|
totalCards: number;
|
|
15
|
-
universityLeaderboard: {
|
|
16
|
-
month: IUniversitiesRankSpeciality[];
|
|
17
|
-
};
|
|
18
9
|
};
|
|
19
10
|
}
|
|
20
11
|
export declare const DASHBOARD_QBANK: import("@apollo/client").DocumentNode;
|
package/utils/evaluateMark.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ import { EMarkResult, EPsaSectionType, EQuestionType, IMarksheetMarkJSONB, IQues
|
|
|
2
2
|
export interface IEvaluateMarkData {
|
|
3
3
|
score: number;
|
|
4
4
|
result: EMarkResult;
|
|
5
|
+
maxScore: number;
|
|
5
6
|
}
|
|
7
|
+
export declare function getQuestionMaxScore(questionType: EQuestionType, psaSectionId: number | null): number;
|
|
6
8
|
export declare function evaluateMark({ mark, answer, questionTypeId, psaSectionId, choices, }: {
|
|
7
9
|
mark: IMarksheetMarkJSONB;
|
|
8
10
|
answer: IQuestionAnswer;
|
package/utils/evaluateMark.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.evaluateMark = void 0;
|
|
3
|
+
exports.evaluateMark = exports.getQuestionMaxScore = void 0;
|
|
4
4
|
const models_1 = require("../models");
|
|
5
5
|
function isPrescribeAnswer(data) {
|
|
6
6
|
return Object(data).hasOwnProperty('dose');
|
|
@@ -44,10 +44,55 @@ function deepParse(data) {
|
|
|
44
44
|
}
|
|
45
45
|
return parsed;
|
|
46
46
|
}
|
|
47
|
+
function getQuestionMaxScore(questionType, psaSectionId) {
|
|
48
|
+
switch (questionType) {
|
|
49
|
+
case models_1.EQuestionType.SINGLE_BEST_ANSWER:
|
|
50
|
+
if (psaSectionId) {
|
|
51
|
+
return 2;
|
|
52
|
+
}
|
|
53
|
+
return 1;
|
|
54
|
+
case models_1.EQuestionType.QUESTION_ANSWER:
|
|
55
|
+
if (psaSectionId) {
|
|
56
|
+
return 2;
|
|
57
|
+
}
|
|
58
|
+
return 1;
|
|
59
|
+
case models_1.EQuestionType.MULTIPLE_ANSWERS:
|
|
60
|
+
return 4;
|
|
61
|
+
case models_1.EQuestionType.PRESCRIPTION_ANSWER:
|
|
62
|
+
return 10;
|
|
63
|
+
case models_1.EQuestionType.EXTENDED_MATCHING_ANSWER:
|
|
64
|
+
return 1;
|
|
65
|
+
case models_1.EQuestionType.SELECT_THREE_ANSWER:
|
|
66
|
+
return 1;
|
|
67
|
+
case models_1.EQuestionType.RANKING_ANSWER:
|
|
68
|
+
return 1;
|
|
69
|
+
case models_1.EQuestionType.SBA_WITH_MULTIPLE_CHOICES:
|
|
70
|
+
return 1;
|
|
71
|
+
case models_1.EQuestionType.VERBAL_VERACITY:
|
|
72
|
+
return 1;
|
|
73
|
+
case models_1.EQuestionType.VERBAL_READING_COMPREHENSION:
|
|
74
|
+
return 1;
|
|
75
|
+
case models_1.EQuestionType.QUANTITATIVE_REASONING_SBA:
|
|
76
|
+
return 1;
|
|
77
|
+
case models_1.EQuestionType.DECISION_MAKING_SBA:
|
|
78
|
+
return 1;
|
|
79
|
+
case models_1.EQuestionType.DECISION_MAKING_YES_NO:
|
|
80
|
+
return 2;
|
|
81
|
+
case models_1.EQuestionType.SJT_SINGLE_CHOICE:
|
|
82
|
+
return 1;
|
|
83
|
+
case models_1.EQuestionType.SJT_TWO_ANSWERS:
|
|
84
|
+
return 1;
|
|
85
|
+
default:
|
|
86
|
+
return 1;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.getQuestionMaxScore = getQuestionMaxScore;
|
|
47
90
|
function evaluateMark({ mark, answer, questionTypeId, psaSectionId, choices, }) {
|
|
91
|
+
const maxScore = getQuestionMaxScore(questionTypeId, psaSectionId);
|
|
48
92
|
const data = {
|
|
49
93
|
score: 0,
|
|
50
94
|
result: models_1.EMarkResult.Incorrect,
|
|
95
|
+
maxScore,
|
|
51
96
|
};
|
|
52
97
|
if (!mark || !answer) {
|
|
53
98
|
return data;
|
|
@@ -64,7 +109,7 @@ function evaluateMark({ mark, answer, questionTypeId, psaSectionId, choices, })
|
|
|
64
109
|
case models_1.EQuestionType.DECISION_MAKING_SBA:
|
|
65
110
|
case models_1.EQuestionType.QUANTITATIVE_REASONING_SBA: {
|
|
66
111
|
if (flatAnswer === flatAttempt) {
|
|
67
|
-
data.score =
|
|
112
|
+
data.score = maxScore;
|
|
68
113
|
data.result = models_1.EMarkResult.Correct;
|
|
69
114
|
}
|
|
70
115
|
else {
|
|
@@ -86,8 +131,7 @@ function evaluateMark({ mark, answer, questionTypeId, psaSectionId, choices, })
|
|
|
86
131
|
!Number.isNaN(attemptNum) &&
|
|
87
132
|
answerNum === attemptNum;
|
|
88
133
|
if (isNumericMatch || normalizedAnswer === normalizedAttempt) {
|
|
89
|
-
|
|
90
|
-
data.score = psaSectionId ? 2 : 1;
|
|
134
|
+
data.score = maxScore;
|
|
91
135
|
data.result = models_1.EMarkResult.Correct;
|
|
92
136
|
}
|
|
93
137
|
else {
|
|
@@ -110,11 +154,11 @@ function evaluateMark({ mark, answer, questionTypeId, psaSectionId, choices, })
|
|
|
110
154
|
const isBMatch = answerB.length === attemptB.length &&
|
|
111
155
|
attemptB.every((x, i) => x === answerB[i]);
|
|
112
156
|
if (isAMatch && isBMatch) {
|
|
113
|
-
data.score =
|
|
157
|
+
data.score = maxScore;
|
|
114
158
|
data.result = models_1.EMarkResult.Correct;
|
|
115
159
|
}
|
|
116
160
|
else if (isAMatch || isBMatch) {
|
|
117
|
-
data.score = 2;
|
|
161
|
+
data.score = maxScore / 2;
|
|
118
162
|
data.result = models_1.EMarkResult.Partial;
|
|
119
163
|
}
|
|
120
164
|
else {
|
|
@@ -141,12 +185,12 @@ function evaluateMark({ mark, answer, questionTypeId, psaSectionId, choices, })
|
|
|
141
185
|
const totalStatements = answerA.length + answerB.length;
|
|
142
186
|
if (correctCount === totalStatements) {
|
|
143
187
|
// 5 / 5
|
|
144
|
-
data.score =
|
|
188
|
+
data.score = maxScore;
|
|
145
189
|
data.result = models_1.EMarkResult.Correct;
|
|
146
190
|
}
|
|
147
191
|
else if (correctCount === totalStatements - 1) {
|
|
148
192
|
// 4 / 5
|
|
149
|
-
data.score =
|
|
193
|
+
data.score = maxScore / 2;
|
|
150
194
|
data.result = models_1.EMarkResult.Partial;
|
|
151
195
|
}
|
|
152
196
|
else {
|
|
@@ -214,7 +258,7 @@ function evaluateMark({ mark, answer, questionTypeId, psaSectionId, choices, })
|
|
|
214
258
|
}
|
|
215
259
|
}
|
|
216
260
|
if (isCorrect) {
|
|
217
|
-
data.score =
|
|
261
|
+
data.score = maxScore;
|
|
218
262
|
data.result = models_1.EMarkResult.Correct;
|
|
219
263
|
}
|
|
220
264
|
else {
|
|
@@ -241,7 +285,7 @@ function evaluateMark({ mark, answer, questionTypeId, psaSectionId, choices, })
|
|
|
241
285
|
}
|
|
242
286
|
}
|
|
243
287
|
if (isCorrect) {
|
|
244
|
-
data.score =
|
|
288
|
+
data.score = maxScore;
|
|
245
289
|
data.result = models_1.EMarkResult.Correct;
|
|
246
290
|
}
|
|
247
291
|
else {
|
|
@@ -269,7 +313,7 @@ function evaluateMark({ mark, answer, questionTypeId, psaSectionId, choices, })
|
|
|
269
313
|
}
|
|
270
314
|
}
|
|
271
315
|
if (isCorrect) {
|
|
272
|
-
data.score =
|
|
316
|
+
data.score = maxScore;
|
|
273
317
|
data.result = models_1.EMarkResult.Correct;
|
|
274
318
|
}
|
|
275
319
|
else {
|
|
@@ -285,7 +329,7 @@ function evaluateMark({ mark, answer, questionTypeId, psaSectionId, choices, })
|
|
|
285
329
|
if (twoAnswer.length === 2 &&
|
|
286
330
|
attempt.length === 2 &&
|
|
287
331
|
twoAnswer.join(',') === attempt.join(',')) {
|
|
288
|
-
data.score =
|
|
332
|
+
data.score = maxScore;
|
|
289
333
|
data.result = models_1.EMarkResult.Correct;
|
|
290
334
|
}
|
|
291
335
|
else {
|
|
@@ -312,11 +356,11 @@ function evaluateMark({ mark, answer, questionTypeId, psaSectionId, choices, })
|
|
|
312
356
|
else {
|
|
313
357
|
const distance = Math.abs(answerIndex - attemptIndex);
|
|
314
358
|
if (distance === 0) {
|
|
315
|
-
data.score =
|
|
359
|
+
data.score = maxScore;
|
|
316
360
|
data.result = models_1.EMarkResult.Correct;
|
|
317
361
|
}
|
|
318
362
|
else if (distance === 1) {
|
|
319
|
-
data.score =
|
|
363
|
+
data.score = maxScore / 2;
|
|
320
364
|
data.result = models_1.EMarkResult.Partial;
|
|
321
365
|
}
|
|
322
366
|
else {
|