@quesmed/types-rn 2.6.132 → 2.6.133
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/Product.d.ts +2 -1
- package/models/Product.js +1 -0
- package/models/Question.d.ts +9 -32
- package/models/Question.js +14 -2
- package/models/Ucat.d.ts +0 -7
- package/models/User.d.ts +2 -0
- package/models/User.js +2 -0
- package/package.json +1 -1
- package/resolvers/fragments/question.d.ts +1 -0
- package/resolvers/fragments/question.js +21 -1
- package/resolvers/fragments/user.js +3 -0
- package/resolvers/mutation/restricted/questionDiscussion.js +7 -7
package/models/Product.d.ts
CHANGED
package/models/Product.js
CHANGED
|
@@ -95,6 +95,7 @@ var EAppType;
|
|
|
95
95
|
EAppType[EAppType["INTERVIEW"] = 4] = "INTERVIEW";
|
|
96
96
|
EAppType[EAppType["MSRA"] = 5] = "MSRA";
|
|
97
97
|
EAppType[EAppType["PLAB"] = 6] = "PLAB";
|
|
98
|
+
EAppType[EAppType["UCAT"] = 7] = "UCAT";
|
|
98
99
|
})(EAppType = exports.EAppType || (exports.EAppType = {}));
|
|
99
100
|
var EProductDuration;
|
|
100
101
|
(function (EProductDuration) {
|
package/models/Question.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ export interface IQuestionCommentLike {
|
|
|
76
76
|
likeTrueDislikeFalse: boolean;
|
|
77
77
|
}
|
|
78
78
|
export type IQuestionAnswer = string | [string] | [IQuestionQAAnswer] | [string[], string[]] | IPrescribeMark[] | [string, string][] | [string, string, string] | string[] | [string, string];
|
|
79
|
-
export type IQuestionAll = IQuestion | IQuestionSBA | IQuestionQA | IQuestionMultiQ | IQuestionPrescribe | IQuestionEMQ | IQuestionSelect3 | IQuestionRanking |
|
|
79
|
+
export type IQuestionAll = IQuestion | IQuestionSBA | IQuestionQA | IQuestionMultiQ | IQuestionPrescribe | IQuestionEMQ | IQuestionSelect3 | IQuestionRanking | IQuestionSjtTwoAnswer;
|
|
80
80
|
export interface IQuestion {
|
|
81
81
|
id: Id;
|
|
82
82
|
createdAt: Date | number;
|
|
@@ -87,7 +87,7 @@ export interface IQuestion {
|
|
|
87
87
|
conceptId: Id;
|
|
88
88
|
stemId: Id | null;
|
|
89
89
|
public: boolean;
|
|
90
|
-
stem?:
|
|
90
|
+
stem?: IChapter;
|
|
91
91
|
themes?: ITheme[];
|
|
92
92
|
concept?: IConcept;
|
|
93
93
|
conditions?: ICondition[];
|
|
@@ -173,15 +173,10 @@ export interface IQuestionQAAnswer {
|
|
|
173
173
|
dose: string;
|
|
174
174
|
units: string;
|
|
175
175
|
}
|
|
176
|
-
export declare function isQuestionQA(data: IQuestionAll): data is IQuestionQA;
|
|
177
176
|
export interface IQuestionQA extends IQuestion {
|
|
178
177
|
answer: [IQuestionQAAnswer];
|
|
179
178
|
qaAnswer: [IQuestionQAAnswer];
|
|
180
179
|
}
|
|
181
|
-
export declare function isQuestionMultiQ(data: IQuestionAll): data is IQuestionMultiQ;
|
|
182
|
-
export declare function isQuestionEMQ(data: IQuestionAll): data is IQuestionEMQ;
|
|
183
|
-
export declare function isQuestionSelect3(data: IQuestionAll): data is IQuestionSelect3;
|
|
184
|
-
export declare function isQuestionRanking(data: IQuestionAll): data is IQuestionRanking;
|
|
185
180
|
export interface IQuestionMultiQ extends IQuestion {
|
|
186
181
|
answer: [string[], string[]];
|
|
187
182
|
multiAnswer: [string[], string[]];
|
|
@@ -198,35 +193,10 @@ export interface IQuestionRanking extends IQuestion {
|
|
|
198
193
|
answer: string[];
|
|
199
194
|
rankingAnswer: string[];
|
|
200
195
|
}
|
|
201
|
-
export interface IQuestionVerbalVeracity extends IQuestion {
|
|
202
|
-
answer: [string];
|
|
203
|
-
verbalVeracityAnswer: [string];
|
|
204
|
-
}
|
|
205
|
-
export interface IQuestionVerbalReading extends IQuestion {
|
|
206
|
-
answer: [string];
|
|
207
|
-
verbalReadingAnswer: [string];
|
|
208
|
-
}
|
|
209
|
-
export interface IQuestionQuantitativeSBA extends IQuestion {
|
|
210
|
-
answer: [string];
|
|
211
|
-
quantitativeSbaAnswer: [string];
|
|
212
|
-
}
|
|
213
|
-
export interface IQuestionDecisionSBA extends IQuestion {
|
|
214
|
-
answer: [string];
|
|
215
|
-
decisionSbaAnswer: [string];
|
|
216
|
-
}
|
|
217
|
-
export interface IQuestionDecisionYesNo extends IQuestion {
|
|
218
|
-
answer: [string[], string[]];
|
|
219
|
-
decisionYesNoAnswer: [string];
|
|
220
|
-
}
|
|
221
|
-
export interface IQuestionSjtSingleChoice extends IQuestion {
|
|
222
|
-
answer: [string];
|
|
223
|
-
sjtSingleChoiceAnswer: [string];
|
|
224
|
-
}
|
|
225
196
|
export interface IQuestionSjtTwoAnswer extends IQuestion {
|
|
226
197
|
answer: [string, string];
|
|
227
198
|
sjtTwoAnswer: [string, string];
|
|
228
199
|
}
|
|
229
|
-
export declare function isQuestionPrescribe(data: IQuestionAll): data is IQuestionPrescribe;
|
|
230
200
|
export interface IQuestionPrescribe extends IQuestion {
|
|
231
201
|
answer: IPrescribeMark[];
|
|
232
202
|
prescribeAnswer: IPrescribeAnswer[];
|
|
@@ -236,6 +206,13 @@ export type IPrescribeAnswerData = {
|
|
|
236
206
|
visible: boolean;
|
|
237
207
|
label: string;
|
|
238
208
|
};
|
|
209
|
+
export declare function isQuestionQA(data: IQuestionAll): data is IQuestionQA;
|
|
210
|
+
export declare function isQuestionMultiQ(data: IQuestionAll): data is IQuestionMultiQ;
|
|
211
|
+
export declare function isQuestionEMQ(data: IQuestionAll): data is IQuestionEMQ;
|
|
212
|
+
export declare function isQuestionSelect3(data: IQuestionAll): data is IQuestionSelect3;
|
|
213
|
+
export declare function isQuestionRanking(data: IQuestionAll): data is IQuestionRanking;
|
|
214
|
+
export declare function isQuestionSjtTwoAnswer(data: IQuestionAll): data is IQuestionSjtTwoAnswer;
|
|
215
|
+
export declare function isQuestionPrescribe(data: IQuestionAll): data is IQuestionPrescribe;
|
|
239
216
|
export interface IPrescribeAnswer {
|
|
240
217
|
drug: IPrescribeAnswerData;
|
|
241
218
|
dose: IPrescribeAnswerData;
|
package/models/Question.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isQuestionPrescribe = exports.isQuestionRanking = exports.isQuestionSelect3 = exports.isQuestionEMQ = exports.isQuestionMultiQ = exports.isQuestionQA = exports.isQuestionSBA = exports.EQuestionLike = exports.EQuestionType = exports.EVeracityAnswer = exports.EPsaSectionType = void 0;
|
|
3
|
+
exports.isQuestionPrescribe = exports.isQuestionSjtTwoAnswer = exports.isQuestionRanking = exports.isQuestionSelect3 = exports.isQuestionEMQ = exports.isQuestionMultiQ = exports.isQuestionQA = exports.isQuestionSBA = exports.EQuestionLike = exports.EQuestionType = exports.EVeracityAnswer = exports.EPsaSectionType = void 0;
|
|
4
4
|
var EPsaSectionType;
|
|
5
5
|
(function (EPsaSectionType) {
|
|
6
6
|
EPsaSectionType[EPsaSectionType["PRESCRIBING"] = 1] = "PRESCRIBING";
|
|
@@ -46,6 +46,11 @@ function isQuestionSBA(data) {
|
|
|
46
46
|
return [
|
|
47
47
|
EQuestionType.SINGLE_BEST_ANSWER,
|
|
48
48
|
EQuestionType.SBA_WITH_MULTIPLE_CHOICES,
|
|
49
|
+
EQuestionType.VERBAL_VERACITY,
|
|
50
|
+
EQuestionType.VERBAL_READING_COMPREHENSION,
|
|
51
|
+
EQuestionType.DECISION_MAKING_SBA,
|
|
52
|
+
EQuestionType.QUANTITATIVE_REASONING_SBA,
|
|
53
|
+
EQuestionType.SJT_SINGLE_CHOICE,
|
|
49
54
|
].includes(data.typeId);
|
|
50
55
|
}
|
|
51
56
|
exports.isQuestionSBA = isQuestionSBA;
|
|
@@ -54,7 +59,10 @@ function isQuestionQA(data) {
|
|
|
54
59
|
}
|
|
55
60
|
exports.isQuestionQA = isQuestionQA;
|
|
56
61
|
function isQuestionMultiQ(data) {
|
|
57
|
-
return
|
|
62
|
+
return [
|
|
63
|
+
EQuestionType.MULTIPLE_ANSWERS,
|
|
64
|
+
EQuestionType.DECISION_MAKING_YES_NO,
|
|
65
|
+
].includes(data.typeId);
|
|
58
66
|
}
|
|
59
67
|
exports.isQuestionMultiQ = isQuestionMultiQ;
|
|
60
68
|
function isQuestionEMQ(data) {
|
|
@@ -69,6 +77,10 @@ function isQuestionRanking(data) {
|
|
|
69
77
|
return data.typeId === EQuestionType.RANKING_ANSWER;
|
|
70
78
|
}
|
|
71
79
|
exports.isQuestionRanking = isQuestionRanking;
|
|
80
|
+
function isQuestionSjtTwoAnswer(data) {
|
|
81
|
+
return data.typeId === EQuestionType.SJT_TWO_ANSWERS;
|
|
82
|
+
}
|
|
83
|
+
exports.isQuestionSjtTwoAnswer = isQuestionSjtTwoAnswer;
|
|
72
84
|
function isQuestionPrescribe(data) {
|
|
73
85
|
return data.typeId === EQuestionType.PRESCRIPTION_ANSWER;
|
|
74
86
|
}
|
package/models/Ucat.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { EEntitlementType, IEntitlement } from './Product';
|
|
2
|
-
export interface IQuestionStem {
|
|
3
|
-
id: number;
|
|
4
|
-
explanation: string;
|
|
5
|
-
public: boolean;
|
|
6
|
-
createdAt: number | Date;
|
|
7
|
-
updatedAt: number | Date;
|
|
8
|
-
}
|
|
9
2
|
export interface ITheme {
|
|
10
3
|
id: number;
|
|
11
4
|
name: string;
|
package/models/User.d.ts
CHANGED
|
@@ -75,6 +75,7 @@ export interface IPayload {
|
|
|
75
75
|
paediatricsInterviewSubscriptionEndDate: number | null;
|
|
76
76
|
plab1SubscriptionEndDate: number | null;
|
|
77
77
|
plab2SubscriptionEndDate: number | null;
|
|
78
|
+
ucatSubscriptionEndDate: number | null;
|
|
78
79
|
ver: number;
|
|
79
80
|
}
|
|
80
81
|
export interface IDailyProgressVar {
|
|
@@ -182,6 +183,7 @@ export interface IUser {
|
|
|
182
183
|
paediatricsInterviewSubscriptionEndDate: number | Date | null;
|
|
183
184
|
plab1SubscriptionEndDate: number | Date | null;
|
|
184
185
|
plab2SubscriptionEndDate: number | Date | null;
|
|
186
|
+
ucatSubscriptionEndDate: number | Date | null;
|
|
185
187
|
settings: IUserSettings;
|
|
186
188
|
}
|
|
187
189
|
export declare function currentClassYear(createdAtUnix: number, classYear: IClassYear, compareUnix?: number): IClassYear;
|
package/models/User.js
CHANGED
|
@@ -46,6 +46,7 @@ exports.subscriptionDates = [
|
|
|
46
46
|
'paediatricsInterviewSubscriptionEndDate',
|
|
47
47
|
'plab1SubscriptionEndDate',
|
|
48
48
|
'plab2SubscriptionEndDate',
|
|
49
|
+
'ucatSubscriptionEndDate',
|
|
49
50
|
];
|
|
50
51
|
exports.dateProductMapping = {
|
|
51
52
|
qbankSubscriptionEndDate: Product_1.EProductType.QBANK,
|
|
@@ -65,6 +66,7 @@ exports.dateProductMapping = {
|
|
|
65
66
|
paediatricsInterviewSubscriptionEndDate: Product_1.EProductType.INTERVIEW_PAEDIATRICS,
|
|
66
67
|
plab1SubscriptionEndDate: Product_1.EProductType.PLAB1,
|
|
67
68
|
plab2SubscriptionEndDate: Product_1.EProductType.PLAB2,
|
|
69
|
+
ucatSubscriptionEndDate: Product_1.EProductType.UCAT,
|
|
68
70
|
};
|
|
69
71
|
var EClassYearGroup;
|
|
70
72
|
(function (EClassYearGroup) {
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const QUESTION_COMMENT_FIELDS: import("@apollo/client").DocumentNode;
|
|
2
2
|
export declare const QUESTION_UKMLA_FIELDS: import("@apollo/client").DocumentNode;
|
|
3
|
+
export declare const QUESTION_UCAT_FIELDS: import("@apollo/client").DocumentNode;
|
|
3
4
|
export declare const QUESTION_CATEGORY_FIELDS: import("@apollo/client").DocumentNode;
|
|
4
5
|
export declare const QUESTION_FIELDS: import("@apollo/client").DocumentNode;
|
|
5
6
|
export declare const QUESTION_WITH_HIGHLIGHT_FIELDS: import("@apollo/client").DocumentNode;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QUESTION_WITH_LEARNING_FIELDS = exports.QUESTION_WITH_COMMENT_FIELDS = exports.QUESTION_WITH_HIGHLIGHT_FIELDS = exports.QUESTION_FIELDS = exports.QUESTION_CATEGORY_FIELDS = exports.QUESTION_UKMLA_FIELDS = exports.QUESTION_COMMENT_FIELDS = void 0;
|
|
3
|
+
exports.QUESTION_WITH_LEARNING_FIELDS = exports.QUESTION_WITH_COMMENT_FIELDS = exports.QUESTION_WITH_HIGHLIGHT_FIELDS = exports.QUESTION_FIELDS = exports.QUESTION_CATEGORY_FIELDS = exports.QUESTION_UCAT_FIELDS = exports.QUESTION_UKMLA_FIELDS = exports.QUESTION_COMMENT_FIELDS = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
|
+
const chapter_1 = require("./chapter");
|
|
5
6
|
const concept_1 = require("./concept");
|
|
6
7
|
const highlight_1 = require("./highlight");
|
|
7
8
|
const picture_1 = require("./picture");
|
|
@@ -59,6 +60,23 @@ exports.QUESTION_UKMLA_FIELDS = (0, client_1.gql) `
|
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
`;
|
|
63
|
+
exports.QUESTION_UCAT_FIELDS = (0, client_1.gql) `
|
|
64
|
+
${chapter_1.CHAPTER_FIELDS}
|
|
65
|
+
fragment QuestionUcatFields on Question {
|
|
66
|
+
themes {
|
|
67
|
+
id
|
|
68
|
+
name
|
|
69
|
+
entitlementId
|
|
70
|
+
entitlement {
|
|
71
|
+
id
|
|
72
|
+
name
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
stem {
|
|
76
|
+
...ChapterFields
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
62
80
|
exports.QUESTION_CATEGORY_FIELDS = (0, client_1.gql) `
|
|
63
81
|
fragment QuestionCategoryFields on Question {
|
|
64
82
|
... on QuestionSBA {
|
|
@@ -121,6 +139,7 @@ exports.QUESTION_CATEGORY_FIELDS = (0, client_1.gql) `
|
|
|
121
139
|
}
|
|
122
140
|
`;
|
|
123
141
|
exports.QUESTION_FIELDS = (0, client_1.gql) `
|
|
142
|
+
${exports.QUESTION_UCAT_FIELDS}
|
|
124
143
|
${exports.QUESTION_UKMLA_FIELDS}
|
|
125
144
|
${highlight_1.HIGHLIGHT_FIELDS}
|
|
126
145
|
${exports.QUESTION_CATEGORY_FIELDS}
|
|
@@ -168,6 +187,7 @@ exports.QUESTION_FIELDS = (0, client_1.gql) `
|
|
|
168
187
|
}
|
|
169
188
|
...QuestionUkmlaFields
|
|
170
189
|
...QuestionCategoryFields
|
|
190
|
+
...QuestionUcatFields
|
|
171
191
|
}
|
|
172
192
|
`;
|
|
173
193
|
// used in cache updator
|
|
@@ -40,13 +40,13 @@ const getQuestionTypeName = (typeId) => {
|
|
|
40
40
|
[models_1.EQuestionType.EXTENDED_MATCHING_ANSWER]: 'QuestionEMQ',
|
|
41
41
|
[models_1.EQuestionType.RANKING_ANSWER]: 'QuestionRanking',
|
|
42
42
|
[models_1.EQuestionType.SELECT_THREE_ANSWER]: 'QuestionSelect3',
|
|
43
|
-
[models_1.EQuestionType.VERBAL_READING_COMPREHENSION]: '
|
|
44
|
-
[models_1.EQuestionType.VERBAL_VERACITY]: '
|
|
45
|
-
[models_1.EQuestionType.
|
|
46
|
-
[models_1.EQuestionType.
|
|
47
|
-
[models_1.EQuestionType.
|
|
48
|
-
[models_1.EQuestionType.SJT_SINGLE_CHOICE]: '
|
|
49
|
-
[models_1.EQuestionType.SJT_TWO_ANSWERS]: '
|
|
43
|
+
[models_1.EQuestionType.VERBAL_READING_COMPREHENSION]: 'QuestionSBA',
|
|
44
|
+
[models_1.EQuestionType.VERBAL_VERACITY]: 'QuestionSBA',
|
|
45
|
+
[models_1.EQuestionType.QUANTITATIVE_REASONING_SBA]: 'QuestionSBA',
|
|
46
|
+
[models_1.EQuestionType.DECISION_MAKING_SBA]: 'QuestionSBA',
|
|
47
|
+
[models_1.EQuestionType.DECISION_MAKING_YES_NO]: 'QuestionMultiA',
|
|
48
|
+
[models_1.EQuestionType.SJT_SINGLE_CHOICE]: 'QuestionSBA',
|
|
49
|
+
[models_1.EQuestionType.SJT_TWO_ANSWERS]: 'QuestionSelect3',
|
|
50
50
|
};
|
|
51
51
|
return mappedObj[typeId] ?? 'QuestionSBA';
|
|
52
52
|
};
|