@quesmed/types 1.4.6 → 1.4.10
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/Author.d.ts +2 -2
- package/models/Book.d.ts +3 -3
- package/models/Card.d.ts +2 -2
- package/models/Chapter.d.ts +2 -2
- package/models/Concept.d.ts +2 -2
- package/models/Feedback.d.ts +1 -1
- package/models/File.d.ts +2 -2
- package/models/Marksheet.d.ts +3 -3
- package/models/MockTest.d.ts +2 -2
- package/models/OsceMarksheet.d.ts +5 -5
- package/models/OsceStation.d.ts +2 -2
- package/models/Picture.d.ts +2 -2
- package/models/Promo.d.ts +2 -2
- package/models/Subscription.d.ts +1 -1
- package/models/Todo.d.ts +2 -2
- package/models/User.d.ts +13 -13
- package/models/Video.d.ts +8 -8
- package/package.json +1 -1
- package/resolvers/fragments/osce.js +1 -5
- package/resolvers/fragments/osce.mjs +1 -5
- package/resolvers/mutation/restricted/osce.d.ts +1 -1
- package/resolvers/mutation/restricted/osce.js +22 -5
- package/resolvers/mutation/restricted/osce.mjs +23 -6
- package/resolvers/mutation/restricted/users.d.ts +1 -1
- package/resolvers/query/restricted/marksheet.d.ts +2 -2
- package/resolvers/query/restricted/osce.js +8 -0
- package/resolvers/query/restricted/osce.mjs +8 -0
- package/resolvers/query/restricted/university.d.ts +1 -1
- package/resolvers/query/restricted/user.d.ts +1 -1
- package/utils/commonFunctions.d.ts +1 -1
- package/utils/commonFunctions.js +23 -10
- package/utils/commonFunctions.mjs +23 -10
package/models/Author.d.ts
CHANGED
package/models/Book.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ import { IAuthor } from './Author';
|
|
|
2
2
|
import { Id } from './Type';
|
|
3
3
|
export interface IBook {
|
|
4
4
|
id: Id;
|
|
5
|
-
createdAt: number;
|
|
6
|
-
updatedAt: number;
|
|
5
|
+
createdAt: number | Date;
|
|
6
|
+
updatedAt: number | Date;
|
|
7
7
|
name: string;
|
|
8
8
|
publisher: string;
|
|
9
|
-
publishDate: number;
|
|
9
|
+
publishDate: number | Date;
|
|
10
10
|
pages: number;
|
|
11
11
|
format: string;
|
|
12
12
|
language: string;
|
package/models/Card.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { ITopic } from './Topic';
|
|
|
4
4
|
import { Id } from './Type';
|
|
5
5
|
export interface ICard {
|
|
6
6
|
id: Id;
|
|
7
|
-
createdAt:
|
|
8
|
-
updatedAt:
|
|
7
|
+
createdAt: number | Date;
|
|
8
|
+
updatedAt: number | Date;
|
|
9
9
|
topic: ITopic;
|
|
10
10
|
conceptId: Id;
|
|
11
11
|
concept: IConcept;
|
package/models/Chapter.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { ETopicType } from './Topic';
|
|
|
4
4
|
import { Id } from './Type';
|
|
5
5
|
export interface IChapter {
|
|
6
6
|
id: Id;
|
|
7
|
-
createdAt: number;
|
|
8
|
-
updatedAt: number;
|
|
7
|
+
createdAt: number | Date;
|
|
8
|
+
updatedAt: number | Date;
|
|
9
9
|
explanation: string | null;
|
|
10
10
|
typeId: ETopicType | null;
|
|
11
11
|
pictures: IChapterPicture[];
|
package/models/Concept.d.ts
CHANGED
package/models/Feedback.d.ts
CHANGED
package/models/File.d.ts
CHANGED
package/models/Marksheet.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { IPrescribeMark, IQuestion, IQuestionQAAnswer } from './Question';
|
|
|
2
2
|
import { Id } from './Type';
|
|
3
3
|
export interface IMarksheet {
|
|
4
4
|
id: Id;
|
|
5
|
-
createdAt:
|
|
6
|
-
endedAt:
|
|
5
|
+
createdAt: number | Date;
|
|
6
|
+
endedAt: number | Date;
|
|
7
7
|
source: string;
|
|
8
8
|
marks: IMarksheetMark[];
|
|
9
9
|
mockTestId: number | null;
|
|
@@ -32,7 +32,7 @@ export interface IMarksheetMark {
|
|
|
32
32
|
export interface IDiscussion {
|
|
33
33
|
username: string;
|
|
34
34
|
userId: Id;
|
|
35
|
-
createdAt:
|
|
35
|
+
createdAt: number | Date;
|
|
36
36
|
comment: string;
|
|
37
37
|
like: number;
|
|
38
38
|
dislike: number;
|
package/models/MockTest.d.ts
CHANGED
|
@@ -16,6 +16,6 @@ export interface IUserMockTest {
|
|
|
16
16
|
incorrect: number;
|
|
17
17
|
totalQuestions: number;
|
|
18
18
|
lastMarksheetId?: Id;
|
|
19
|
-
lastMarksheetStartedAt?:
|
|
20
|
-
lastMarksheetEndedAt?:
|
|
19
|
+
lastMarksheetStartedAt?: number | Date;
|
|
20
|
+
lastMarksheetEndedAt?: number | Date;
|
|
21
21
|
}
|
|
@@ -3,7 +3,7 @@ import { Id } from './Type';
|
|
|
3
3
|
import { IUser } from './User';
|
|
4
4
|
export interface IOsceMarksheetUser {
|
|
5
5
|
id: Id | null;
|
|
6
|
-
createdAt:
|
|
6
|
+
createdAt: number | Date | null;
|
|
7
7
|
osceMarksheetId: Id;
|
|
8
8
|
userId: Id | null;
|
|
9
9
|
user: IUser | null;
|
|
@@ -38,8 +38,8 @@ export declare enum EOsceMarksheetAction {
|
|
|
38
38
|
}
|
|
39
39
|
export interface IOsceMarksheet {
|
|
40
40
|
id: Id;
|
|
41
|
-
createdAt:
|
|
42
|
-
updatedAt:
|
|
41
|
+
createdAt: number | Date;
|
|
42
|
+
updatedAt: number | Date;
|
|
43
43
|
timeTaken: number;
|
|
44
44
|
osceStationId: Id;
|
|
45
45
|
osceStation?: IOsceStation;
|
|
@@ -53,8 +53,8 @@ export interface IOsceMarksheet {
|
|
|
53
53
|
readingTime: number;
|
|
54
54
|
stationTime: number;
|
|
55
55
|
feedbackTime: number;
|
|
56
|
-
startedAt:
|
|
57
|
-
endedAt:
|
|
56
|
+
startedAt: number | Date;
|
|
57
|
+
endedAt: number | Date;
|
|
58
58
|
timeRemaining: number;
|
|
59
59
|
marks: IOsceMarksheetMark[];
|
|
60
60
|
users: IOsceMarksheetUser[];
|
package/models/OsceStation.d.ts
CHANGED
|
@@ -24,8 +24,8 @@ export declare enum EOsceType {
|
|
|
24
24
|
}
|
|
25
25
|
export interface IOsceStation {
|
|
26
26
|
id: Id;
|
|
27
|
-
createdAt:
|
|
28
|
-
updatedAt:
|
|
27
|
+
createdAt: number | Date;
|
|
28
|
+
updatedAt: number | Date;
|
|
29
29
|
name: string;
|
|
30
30
|
osceTypeId: Id;
|
|
31
31
|
osceType?: IOsceType;
|
package/models/Picture.d.ts
CHANGED
package/models/Promo.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Id } from './Type';
|
|
2
2
|
export interface ICoupon {
|
|
3
3
|
id: Id;
|
|
4
|
-
createdAt: number;
|
|
4
|
+
createdAt: number | Date;
|
|
5
5
|
name: string;
|
|
6
6
|
affiliateId: Id;
|
|
7
7
|
}
|
|
8
8
|
export interface IPromoReport {
|
|
9
9
|
id: Id;
|
|
10
|
-
date: number;
|
|
10
|
+
date: number | Date;
|
|
11
11
|
couponId: Id;
|
|
12
12
|
userId: Id;
|
|
13
13
|
subscriptionId: Id;
|
package/models/Subscription.d.ts
CHANGED
package/models/Todo.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { ICard } from './Card';
|
|
|
2
2
|
import { Id } from './Type';
|
|
3
3
|
export interface ITodo {
|
|
4
4
|
id: Id;
|
|
5
|
-
createdAt:
|
|
6
|
-
updatedAt:
|
|
5
|
+
createdAt: number | Date;
|
|
6
|
+
updatedAt: number | Date;
|
|
7
7
|
userId: Id;
|
|
8
8
|
dailyTask: boolean;
|
|
9
9
|
marks: ITodoMark[];
|
package/models/User.d.ts
CHANGED
|
@@ -26,26 +26,26 @@ export interface IUser {
|
|
|
26
26
|
classYear: IClassYear;
|
|
27
27
|
graduationYear: number;
|
|
28
28
|
universityId: number;
|
|
29
|
-
examDate:
|
|
29
|
+
examDate: number | Date | null;
|
|
30
30
|
stripeCustomerId: string;
|
|
31
31
|
qBankSubscriptionId: Id | null;
|
|
32
32
|
qBankSubscription: ISubscription | null;
|
|
33
|
-
stripeQBankSubscriptionEndDate:
|
|
33
|
+
stripeQBankSubscriptionEndDate: number | Date | null;
|
|
34
34
|
osceSubscriptionId: Id | null;
|
|
35
35
|
osceSubscription: ISubscription | null;
|
|
36
|
-
stripeOsceSubscriptionEndDate:
|
|
36
|
+
stripeOsceSubscriptionEndDate: number | Date | null;
|
|
37
37
|
bundleSubscriptionId: Id | null;
|
|
38
38
|
bundleSubscription: ISubscription | null;
|
|
39
|
-
stripeBundleSubscriptionEndDate:
|
|
39
|
+
stripeBundleSubscriptionEndDate: number | Date | null;
|
|
40
40
|
subscriptionId: Id | null;
|
|
41
41
|
subscription?: ISubscription | null;
|
|
42
|
-
stripeSubscriptionEndDate:
|
|
42
|
+
stripeSubscriptionEndDate: number | Date | null;
|
|
43
43
|
stripePriceNickname: string | null;
|
|
44
44
|
}
|
|
45
45
|
export interface IUserCompletedQuestions {
|
|
46
46
|
id: Id;
|
|
47
|
-
createdAt:
|
|
48
|
-
updatedAt:
|
|
47
|
+
createdAt: number | Date;
|
|
48
|
+
updatedAt: number | Date;
|
|
49
49
|
questionId: Id;
|
|
50
50
|
userId: Id;
|
|
51
51
|
correct: boolean;
|
|
@@ -55,22 +55,22 @@ export interface IUserCompletedQuestions {
|
|
|
55
55
|
}
|
|
56
56
|
export interface IUserCompletedCards {
|
|
57
57
|
id: Id;
|
|
58
|
-
createdAt:
|
|
59
|
-
updatedAt:
|
|
58
|
+
createdAt: number | Date;
|
|
59
|
+
updatedAt: number | Date;
|
|
60
60
|
cardId: Id;
|
|
61
61
|
card: ICard;
|
|
62
62
|
userId: Id;
|
|
63
63
|
topic: ITopic;
|
|
64
64
|
concept: IConcept;
|
|
65
|
-
lastSeen:
|
|
65
|
+
lastSeen: number | Date;
|
|
66
66
|
score: number;
|
|
67
67
|
iteration: number;
|
|
68
68
|
optimalFactor: number;
|
|
69
69
|
}
|
|
70
70
|
export interface IUserFlaggedQuestions {
|
|
71
71
|
id: Id;
|
|
72
|
-
createdAt:
|
|
73
|
-
updatedAt:
|
|
72
|
+
createdAt: number | Date;
|
|
73
|
+
updatedAt: number | Date;
|
|
74
74
|
questionId: Id;
|
|
75
75
|
question: IQuestion;
|
|
76
76
|
userId: Id;
|
|
@@ -79,7 +79,7 @@ export interface IUserFlaggedQuestions {
|
|
|
79
79
|
}
|
|
80
80
|
export interface IUserProgress {
|
|
81
81
|
id: Id;
|
|
82
|
-
date:
|
|
82
|
+
date: number | Date;
|
|
83
83
|
userId: Id;
|
|
84
84
|
topicId: Id;
|
|
85
85
|
count: number;
|
package/models/Video.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ import { IFile } from './File';
|
|
|
3
3
|
import { Id } from './Type';
|
|
4
4
|
export interface IVideo {
|
|
5
5
|
id: Id;
|
|
6
|
-
createdAt: number;
|
|
7
|
-
updatedAt: number;
|
|
8
|
-
startTime: number;
|
|
9
|
-
endTime: number;
|
|
6
|
+
createdAt: number | Date;
|
|
7
|
+
updatedAt: number | Date;
|
|
8
|
+
startTime: number | Date;
|
|
9
|
+
endTime: number | Date;
|
|
10
10
|
title: string;
|
|
11
11
|
museId: string;
|
|
12
12
|
thumbnail: string;
|
|
@@ -16,8 +16,8 @@ export interface IVideo {
|
|
|
16
16
|
duration: number;
|
|
17
17
|
concepts: IConcept[];
|
|
18
18
|
files: IFile[];
|
|
19
|
-
send1hrPushAt: number | null;
|
|
20
|
-
sent1hrPushAt: number | null;
|
|
21
|
-
send24hrPushAt: number | null;
|
|
22
|
-
sent24hrPushAt: number | null;
|
|
19
|
+
send1hrPushAt: number | Date | null;
|
|
20
|
+
sent1hrPushAt: number | Date | null;
|
|
21
|
+
send24hrPushAt: number | Date | null;
|
|
22
|
+
sent24hrPushAt: number | Date | null;
|
|
23
23
|
}
|
package/package.json
CHANGED
|
@@ -75,7 +75,7 @@ exports.OSCE_STATION_FIELDS = (0, client_1.gql) `
|
|
|
75
75
|
exports.OSCE_MARKSHEET_USER_FIELDS = (0, client_1.gql) `
|
|
76
76
|
${user_1.USER_FIELDS}
|
|
77
77
|
fragment OsceMarksheetUserFields on OsceMarksheetUser {
|
|
78
|
-
id
|
|
78
|
+
# id - do not pass otherwise all unassigned roles = candidate
|
|
79
79
|
osceMarksheetId
|
|
80
80
|
userId
|
|
81
81
|
user {
|
|
@@ -98,7 +98,6 @@ exports.OSCE_MARKSHEET_MARK_FIELDS = (0, client_1.gql) `
|
|
|
98
98
|
}
|
|
99
99
|
`;
|
|
100
100
|
exports.OSCE_MARKSHEET_FIELDS = (0, client_1.gql) `
|
|
101
|
-
${exports.OSCE_STATION_FIELDS}
|
|
102
101
|
${exports.OSCE_MARKSHEET_MARK_FIELDS}
|
|
103
102
|
${exports.OSCE_MARKSHEET_USER_FIELDS}
|
|
104
103
|
fragment OsceMarksheetFields on OsceMarksheet {
|
|
@@ -107,9 +106,6 @@ exports.OSCE_MARKSHEET_FIELDS = (0, client_1.gql) `
|
|
|
107
106
|
updatedAt
|
|
108
107
|
timeTaken
|
|
109
108
|
osceStationId
|
|
110
|
-
osceStation {
|
|
111
|
-
...OsceStationFields
|
|
112
|
-
}
|
|
113
109
|
userId
|
|
114
110
|
solo
|
|
115
111
|
role
|
|
@@ -72,7 +72,7 @@ export const OSCE_STATION_FIELDS = gql `
|
|
|
72
72
|
export const OSCE_MARKSHEET_USER_FIELDS = gql `
|
|
73
73
|
${USER_FIELDS}
|
|
74
74
|
fragment OsceMarksheetUserFields on OsceMarksheetUser {
|
|
75
|
-
id
|
|
75
|
+
# id - do not pass otherwise all unassigned roles = candidate
|
|
76
76
|
osceMarksheetId
|
|
77
77
|
userId
|
|
78
78
|
user {
|
|
@@ -95,7 +95,6 @@ export const OSCE_MARKSHEET_MARK_FIELDS = gql `
|
|
|
95
95
|
}
|
|
96
96
|
`;
|
|
97
97
|
export const OSCE_MARKSHEET_FIELDS = gql `
|
|
98
|
-
${OSCE_STATION_FIELDS}
|
|
99
98
|
${OSCE_MARKSHEET_MARK_FIELDS}
|
|
100
99
|
${OSCE_MARKSHEET_USER_FIELDS}
|
|
101
100
|
fragment OsceMarksheetFields on OsceMarksheet {
|
|
@@ -104,9 +103,6 @@ export const OSCE_MARKSHEET_FIELDS = gql `
|
|
|
104
103
|
updatedAt
|
|
105
104
|
timeTaken
|
|
106
105
|
osceStationId
|
|
107
|
-
osceStation {
|
|
108
|
-
...OsceStationFields
|
|
109
|
-
}
|
|
110
106
|
userId
|
|
111
107
|
solo
|
|
112
108
|
role
|
|
@@ -34,7 +34,7 @@ export interface IChangeOsceRoleVar {
|
|
|
34
34
|
export declare type IChangeOsceRoleData = RestrictedData<graphqlNormalize & IOsceMarksheet, 'changeOsceRole'>;
|
|
35
35
|
export declare const MARK_OSCE_MARKSHEET_MARK: import("@apollo/client").DocumentNode;
|
|
36
36
|
export interface IMarkOsceMarksheetMarkVar {
|
|
37
|
-
|
|
37
|
+
osceMarksheetMarkId: Id;
|
|
38
38
|
mark: boolean;
|
|
39
39
|
}
|
|
40
40
|
export declare type IMarkOsceMarksheetMarkData = RestrictedData<graphqlNormalize & Partial<IOsceMarksheetMark>, 'markOsceMarksheetMark'>;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LEAVE_OSCE_MARKSHEET = exports.END_OSCE_MARKSHEET = exports.OSCE_MARKSHEET_ACTIONS = exports.SAVE_OSCE_MARKSHEET = exports.PRESTART_OSCE_MARKSHEET = exports.START_OSCE_MARKSHEET = exports.SELECT_OSCE_STATION = exports.optimisticMarkOsceMarksheetMark = exports.MARK_OSCE_MARKSHEET_MARK = exports.CHANGE_OSCE_ROLE = exports.BUILD_OSCE_MARKSHEET = exports.CANCEL_OSCE_MATCHMAKING = exports.CHECK_OSCE_MATCHMAKING = exports.ACCEPT_OSCE_MATCHMAKING = exports.START_OSCE_MATCHMAKING = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
5
|
const osce_1 = require("../../fragments/osce");
|
|
6
|
+
const osce_2 = require("./../../fragments/osce");
|
|
6
7
|
exports.START_OSCE_MATCHMAKING = (0, client_1.gql) `
|
|
7
8
|
mutation StartOsceMatchmaking($agoraId: String!) {
|
|
8
9
|
restricted {
|
|
@@ -35,6 +36,7 @@ exports.CANCEL_OSCE_MATCHMAKING = (0, client_1.gql) `
|
|
|
35
36
|
}
|
|
36
37
|
`;
|
|
37
38
|
exports.BUILD_OSCE_MARKSHEET = (0, client_1.gql) `
|
|
39
|
+
${osce_2.OSCE_STATION_FIELDS}
|
|
38
40
|
${osce_1.OSCE_MARKSHEET_FIELDS}
|
|
39
41
|
mutation BuildOsceMarksheet(
|
|
40
42
|
$osceStationId: Int
|
|
@@ -48,6 +50,9 @@ exports.BUILD_OSCE_MARKSHEET = (0, client_1.gql) `
|
|
|
48
50
|
solo: $solo
|
|
49
51
|
) {
|
|
50
52
|
...OsceMarksheetFields
|
|
53
|
+
osceStation {
|
|
54
|
+
...OsceStationFields
|
|
55
|
+
}
|
|
51
56
|
}
|
|
52
57
|
}
|
|
53
58
|
}
|
|
@@ -63,14 +68,14 @@ exports.CHANGE_OSCE_ROLE = (0, client_1.gql) `
|
|
|
63
68
|
}
|
|
64
69
|
`;
|
|
65
70
|
exports.MARK_OSCE_MARKSHEET_MARK = (0, client_1.gql) `
|
|
66
|
-
${
|
|
67
|
-
mutation MarkOsceMarksheetMark($osceStationMarkId: Int!, $mark: Boolean!) {
|
|
71
|
+
mutation MarkOsceMarksheetMark($osceMarksheetMarkId: Int!, $mark: Boolean!) {
|
|
68
72
|
restricted {
|
|
69
73
|
markOsceMarksheetMark(
|
|
70
|
-
|
|
74
|
+
osceMarksheetMarkId: $osceMarksheetMarkId
|
|
71
75
|
mark: $mark
|
|
72
76
|
) {
|
|
73
|
-
|
|
77
|
+
id
|
|
78
|
+
mark
|
|
74
79
|
}
|
|
75
80
|
}
|
|
76
81
|
}
|
|
@@ -79,7 +84,7 @@ const optimisticMarkOsceMarksheetMark = (variables) => {
|
|
|
79
84
|
return {
|
|
80
85
|
restricted: {
|
|
81
86
|
markOsceMarksheetMark: {
|
|
82
|
-
id: variables.
|
|
87
|
+
id: variables.osceMarksheetMarkId,
|
|
83
88
|
mark: variables.mark,
|
|
84
89
|
__typename: 'OsceMarksheetMark',
|
|
85
90
|
},
|
|
@@ -88,6 +93,7 @@ const optimisticMarkOsceMarksheetMark = (variables) => {
|
|
|
88
93
|
};
|
|
89
94
|
exports.optimisticMarkOsceMarksheetMark = optimisticMarkOsceMarksheetMark;
|
|
90
95
|
exports.SELECT_OSCE_STATION = (0, client_1.gql) `
|
|
96
|
+
${osce_2.OSCE_STATION_FIELDS}
|
|
91
97
|
${osce_1.OSCE_MARKSHEET_FIELDS}
|
|
92
98
|
mutation SelectOsceMarksheetStation(
|
|
93
99
|
$osceMarksheetId: Int!
|
|
@@ -99,21 +105,29 @@ exports.SELECT_OSCE_STATION = (0, client_1.gql) `
|
|
|
99
105
|
osceStationId: $osceStationId
|
|
100
106
|
) {
|
|
101
107
|
...OsceMarksheetFields
|
|
108
|
+
osceStation {
|
|
109
|
+
...OsceStationFields
|
|
110
|
+
}
|
|
102
111
|
}
|
|
103
112
|
}
|
|
104
113
|
}
|
|
105
114
|
`;
|
|
106
115
|
exports.START_OSCE_MARKSHEET = (0, client_1.gql) `
|
|
116
|
+
${osce_2.OSCE_STATION_FIELDS}
|
|
107
117
|
${osce_1.OSCE_MARKSHEET_FIELDS}
|
|
108
118
|
mutation StartOsceMarksheet($osceMarksheetId: Int!) {
|
|
109
119
|
restricted {
|
|
110
120
|
startOsceMarksheet(osceMarksheetId: $osceMarksheetId) {
|
|
111
121
|
...OsceMarksheetFields
|
|
122
|
+
osceStation {
|
|
123
|
+
...OsceStationFields
|
|
124
|
+
}
|
|
112
125
|
}
|
|
113
126
|
}
|
|
114
127
|
}
|
|
115
128
|
`;
|
|
116
129
|
exports.PRESTART_OSCE_MARKSHEET = (0, client_1.gql) `
|
|
130
|
+
${osce_2.OSCE_STATION_FIELDS}
|
|
117
131
|
${osce_1.OSCE_MARKSHEET_FIELDS}
|
|
118
132
|
mutation PrestartOsceMarksheet(
|
|
119
133
|
$osceMarksheetId: Int!
|
|
@@ -129,6 +143,9 @@ exports.PRESTART_OSCE_MARKSHEET = (0, client_1.gql) `
|
|
|
129
143
|
feedbackTime: $feedbackTime
|
|
130
144
|
) {
|
|
131
145
|
...OsceMarksheetFields
|
|
146
|
+
osceStation {
|
|
147
|
+
...OsceStationFields
|
|
148
|
+
}
|
|
132
149
|
}
|
|
133
150
|
}
|
|
134
151
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { gql } from '@apollo/client';
|
|
2
|
-
import { OSCE_MARKSHEET_FIELDS,
|
|
2
|
+
import { OSCE_MARKSHEET_FIELDS, OSCE_MATCHMAKING_ACTION_FIELDS, } from '../../fragments/osce';
|
|
3
|
+
import { OSCE_STATION_FIELDS } from './../../fragments/osce';
|
|
3
4
|
export const START_OSCE_MATCHMAKING = gql `
|
|
4
5
|
mutation StartOsceMatchmaking($agoraId: String!) {
|
|
5
6
|
restricted {
|
|
@@ -32,6 +33,7 @@ export const CANCEL_OSCE_MATCHMAKING = gql `
|
|
|
32
33
|
}
|
|
33
34
|
`;
|
|
34
35
|
export const BUILD_OSCE_MARKSHEET = gql `
|
|
36
|
+
${OSCE_STATION_FIELDS}
|
|
35
37
|
${OSCE_MARKSHEET_FIELDS}
|
|
36
38
|
mutation BuildOsceMarksheet(
|
|
37
39
|
$osceStationId: Int
|
|
@@ -45,6 +47,9 @@ export const BUILD_OSCE_MARKSHEET = gql `
|
|
|
45
47
|
solo: $solo
|
|
46
48
|
) {
|
|
47
49
|
...OsceMarksheetFields
|
|
50
|
+
osceStation {
|
|
51
|
+
...OsceStationFields
|
|
52
|
+
}
|
|
48
53
|
}
|
|
49
54
|
}
|
|
50
55
|
}
|
|
@@ -60,14 +65,14 @@ export const CHANGE_OSCE_ROLE = gql `
|
|
|
60
65
|
}
|
|
61
66
|
`;
|
|
62
67
|
export const MARK_OSCE_MARKSHEET_MARK = gql `
|
|
63
|
-
${
|
|
64
|
-
mutation MarkOsceMarksheetMark($osceStationMarkId: Int!, $mark: Boolean!) {
|
|
68
|
+
mutation MarkOsceMarksheetMark($osceMarksheetMarkId: Int!, $mark: Boolean!) {
|
|
65
69
|
restricted {
|
|
66
70
|
markOsceMarksheetMark(
|
|
67
|
-
|
|
71
|
+
osceMarksheetMarkId: $osceMarksheetMarkId
|
|
68
72
|
mark: $mark
|
|
69
73
|
) {
|
|
70
|
-
|
|
74
|
+
id
|
|
75
|
+
mark
|
|
71
76
|
}
|
|
72
77
|
}
|
|
73
78
|
}
|
|
@@ -76,7 +81,7 @@ export const optimisticMarkOsceMarksheetMark = (variables) => {
|
|
|
76
81
|
return {
|
|
77
82
|
restricted: {
|
|
78
83
|
markOsceMarksheetMark: {
|
|
79
|
-
id: variables.
|
|
84
|
+
id: variables.osceMarksheetMarkId,
|
|
80
85
|
mark: variables.mark,
|
|
81
86
|
__typename: 'OsceMarksheetMark',
|
|
82
87
|
},
|
|
@@ -84,6 +89,7 @@ export const optimisticMarkOsceMarksheetMark = (variables) => {
|
|
|
84
89
|
};
|
|
85
90
|
};
|
|
86
91
|
export const SELECT_OSCE_STATION = gql `
|
|
92
|
+
${OSCE_STATION_FIELDS}
|
|
87
93
|
${OSCE_MARKSHEET_FIELDS}
|
|
88
94
|
mutation SelectOsceMarksheetStation(
|
|
89
95
|
$osceMarksheetId: Int!
|
|
@@ -95,21 +101,29 @@ export const SELECT_OSCE_STATION = gql `
|
|
|
95
101
|
osceStationId: $osceStationId
|
|
96
102
|
) {
|
|
97
103
|
...OsceMarksheetFields
|
|
104
|
+
osceStation {
|
|
105
|
+
...OsceStationFields
|
|
106
|
+
}
|
|
98
107
|
}
|
|
99
108
|
}
|
|
100
109
|
}
|
|
101
110
|
`;
|
|
102
111
|
export const START_OSCE_MARKSHEET = gql `
|
|
112
|
+
${OSCE_STATION_FIELDS}
|
|
103
113
|
${OSCE_MARKSHEET_FIELDS}
|
|
104
114
|
mutation StartOsceMarksheet($osceMarksheetId: Int!) {
|
|
105
115
|
restricted {
|
|
106
116
|
startOsceMarksheet(osceMarksheetId: $osceMarksheetId) {
|
|
107
117
|
...OsceMarksheetFields
|
|
118
|
+
osceStation {
|
|
119
|
+
...OsceStationFields
|
|
120
|
+
}
|
|
108
121
|
}
|
|
109
122
|
}
|
|
110
123
|
}
|
|
111
124
|
`;
|
|
112
125
|
export const PRESTART_OSCE_MARKSHEET = gql `
|
|
126
|
+
${OSCE_STATION_FIELDS}
|
|
113
127
|
${OSCE_MARKSHEET_FIELDS}
|
|
114
128
|
mutation PrestartOsceMarksheet(
|
|
115
129
|
$osceMarksheetId: Int!
|
|
@@ -125,6 +139,9 @@ export const PRESTART_OSCE_MARKSHEET = gql `
|
|
|
125
139
|
feedbackTime: $feedbackTime
|
|
126
140
|
) {
|
|
127
141
|
...OsceMarksheetFields
|
|
142
|
+
osceStation {
|
|
143
|
+
...OsceStationFields
|
|
144
|
+
}
|
|
128
145
|
}
|
|
129
146
|
}
|
|
130
147
|
}
|
|
@@ -31,8 +31,8 @@ export interface IDashboardPastQuizzesInfoRes {
|
|
|
31
31
|
totalQuestions: number;
|
|
32
32
|
totalMarksheet: number;
|
|
33
33
|
isTestMarksheet: boolean;
|
|
34
|
-
startedAt:
|
|
35
|
-
endedAt:
|
|
34
|
+
startedAt: number | Date;
|
|
35
|
+
endedAt: number | Date;
|
|
36
36
|
}
|
|
37
37
|
export declare type IDashboardPastQuizzesInfoData = IDashboardPastQuizzesInfoRes[];
|
|
38
38
|
export declare type ILatestPastMarksheetIdVar = null;
|
|
@@ -25,21 +25,29 @@ exports.DASHBOARD_OSCE = (0, client_1.gql) `
|
|
|
25
25
|
}
|
|
26
26
|
`;
|
|
27
27
|
exports.OSCE_MARKSHEETS = (0, client_1.gql) `
|
|
28
|
+
${osce_2.OSCE_STATION_FIELDS}
|
|
28
29
|
${osce_1.OSCE_MARKSHEET_FIELDS}
|
|
29
30
|
query OsceMarksheets($solo: Boolean!) {
|
|
30
31
|
restricted {
|
|
31
32
|
osceMarksheets(solo: $solo) {
|
|
32
33
|
...OsceMarksheetFields
|
|
34
|
+
osceStation {
|
|
35
|
+
...OsceStationFields
|
|
36
|
+
}
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
40
|
`;
|
|
37
41
|
exports.OSCE_MARKSHEET = (0, client_1.gql) `
|
|
42
|
+
${osce_2.OSCE_STATION_FIELDS}
|
|
38
43
|
${osce_1.OSCE_MARKSHEET_FIELDS}
|
|
39
44
|
query OsceMarksheet($id: Int!) {
|
|
40
45
|
restricted {
|
|
41
46
|
osceMarksheet(id: $id) {
|
|
42
47
|
...OsceMarksheetFields
|
|
48
|
+
osceStation {
|
|
49
|
+
...OsceStationFields
|
|
50
|
+
}
|
|
43
51
|
}
|
|
44
52
|
}
|
|
45
53
|
}
|
|
@@ -22,21 +22,29 @@ export const DASHBOARD_OSCE = gql `
|
|
|
22
22
|
}
|
|
23
23
|
`;
|
|
24
24
|
export const OSCE_MARKSHEETS = gql `
|
|
25
|
+
${OSCE_STATION_FIELDS}
|
|
25
26
|
${OSCE_MARKSHEET_FIELDS}
|
|
26
27
|
query OsceMarksheets($solo: Boolean!) {
|
|
27
28
|
restricted {
|
|
28
29
|
osceMarksheets(solo: $solo) {
|
|
29
30
|
...OsceMarksheetFields
|
|
31
|
+
osceStation {
|
|
32
|
+
...OsceStationFields
|
|
33
|
+
}
|
|
30
34
|
}
|
|
31
35
|
}
|
|
32
36
|
}
|
|
33
37
|
`;
|
|
34
38
|
export const OSCE_MARKSHEET = gql `
|
|
39
|
+
${OSCE_STATION_FIELDS}
|
|
35
40
|
${OSCE_MARKSHEET_FIELDS}
|
|
36
41
|
query OsceMarksheet($id: Int!) {
|
|
37
42
|
restricted {
|
|
38
43
|
osceMarksheet(id: $id) {
|
|
39
44
|
...OsceMarksheetFields
|
|
45
|
+
osceStation {
|
|
46
|
+
...OsceStationFields
|
|
47
|
+
}
|
|
40
48
|
}
|
|
41
49
|
}
|
|
42
50
|
}
|
|
@@ -7,7 +7,7 @@ export interface IUniversitiesRankSpeciality {
|
|
|
7
7
|
rank: number;
|
|
8
8
|
}
|
|
9
9
|
export interface IUniversityLeaderboard {
|
|
10
|
-
updatedAt:
|
|
10
|
+
updatedAt: number | Date | null;
|
|
11
11
|
month: IUniversitiesRankSpeciality[];
|
|
12
12
|
quarter: IUniversitiesRankSpeciality[];
|
|
13
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ISubscription, IUser } from '../../../models';
|
|
2
2
|
export declare type IDashboardUserVar = null;
|
|
3
3
|
export interface IDashboardUserData {
|
|
4
|
-
examDate:
|
|
4
|
+
examDate: number | Date;
|
|
5
5
|
totalQuestions: number;
|
|
6
6
|
completedQuestionsCount: number;
|
|
7
7
|
completedCorrectQuestionsCount: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IMarksheetMark, IPrescribeAnswer, IPrescribeMark } from '../models';
|
|
2
2
|
export declare function mapPrescribeMarkToAnswer(obj: IPrescribeMark): IPrescribeAnswer;
|
|
3
|
-
export declare function formatPrescribeAnswer(
|
|
3
|
+
export declare function formatPrescribeAnswer(baseAnswer: IPrescribeAnswer): IPrescribeAnswer;
|
|
4
4
|
export interface ICorrectMarkData {
|
|
5
5
|
correct: boolean;
|
|
6
6
|
incorrect: boolean;
|
package/utils/commonFunctions.js
CHANGED
|
@@ -34,9 +34,13 @@ function mapPrescribeMarkToAnswer(obj) {
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
exports.mapPrescribeMarkToAnswer = mapPrescribeMarkToAnswer;
|
|
37
|
-
function formatPrescribeAnswer(
|
|
37
|
+
function formatPrescribeAnswer(baseAnswer) {
|
|
38
|
+
const obj = Object.assign(Object.assign({}, baseAnswer), { drug: Object.assign({}, baseAnswer.drug), dose: Object.assign({}, baseAnswer.dose), units: Object.assign({}, baseAnswer.units), route: Object.assign({}, baseAnswer.route), frequency: Object.assign({}, baseAnswer.frequency), duration: Object.assign({}, baseAnswer.duration) });
|
|
38
39
|
obj.drug.value = obj.drug.value.toLowerCase().replace(/\s/g, '');
|
|
39
|
-
obj.route.value = obj.route.value
|
|
40
|
+
obj.route.value = obj.route.value
|
|
41
|
+
.toLowerCase()
|
|
42
|
+
.replace(/\s/g, '')
|
|
43
|
+
.replace(/\//g, '');
|
|
40
44
|
if (obj.route.value === 'oral') {
|
|
41
45
|
obj.route.value = 'po';
|
|
42
46
|
}
|
|
@@ -62,7 +66,8 @@ function formatPrescribeAnswer(obj) {
|
|
|
62
66
|
if (obj.units.value === 'milligram' || obj.units.value === 'milligrams') {
|
|
63
67
|
obj.units.value = 'mg';
|
|
64
68
|
}
|
|
65
|
-
else if (obj.units.value === 'microgram' ||
|
|
69
|
+
else if (obj.units.value === 'microgram' ||
|
|
70
|
+
obj.units.value === 'micrograms') {
|
|
66
71
|
obj.units.value = 'mcg';
|
|
67
72
|
}
|
|
68
73
|
else if (obj.units.value === 'gram' || obj.units.value === 'grams') {
|
|
@@ -91,17 +96,20 @@ function formatPrescribeAnswer(obj) {
|
|
|
91
96
|
if (obj.frequency.value === 'once-off') {
|
|
92
97
|
obj.frequency.value = 'stat';
|
|
93
98
|
}
|
|
94
|
-
else if (obj.frequency.value.includes('once') ||
|
|
99
|
+
else if (obj.frequency.value.includes('once') ||
|
|
100
|
+
(frequencyIncHourly && hourlyFreqInt === 24)) {
|
|
95
101
|
obj.frequency.value = 'od';
|
|
96
102
|
}
|
|
97
|
-
else if (obj.frequency.value.includes('nightly') ||
|
|
103
|
+
else if (obj.frequency.value.includes('nightly') ||
|
|
104
|
+
obj.frequency.value === 'on') {
|
|
98
105
|
obj.frequency.value = 'od';
|
|
99
106
|
}
|
|
100
107
|
else if (obj.frequency.value.includes('twice') ||
|
|
101
108
|
(frequencyIncHourly && hourlyFreqInt === 12)) {
|
|
102
109
|
obj.frequency.value = 'bd';
|
|
103
110
|
}
|
|
104
|
-
else if (obj.frequency.value.includes('trice') ||
|
|
111
|
+
else if (obj.frequency.value.includes('trice') ||
|
|
112
|
+
(frequencyIncHourly && hourlyFreqInt === 8)) {
|
|
105
113
|
obj.frequency.value = 'tds';
|
|
106
114
|
}
|
|
107
115
|
else if (frequencyIncHourly && hourlyFreqInt === 6) {
|
|
@@ -140,7 +148,9 @@ function correctMark(mark) {
|
|
|
140
148
|
}
|
|
141
149
|
}
|
|
142
150
|
else if (models_1.EQuestionType.QUESTION_ANSWER === mark.question.typeId) {
|
|
143
|
-
const answer = flatAnswer.dose
|
|
151
|
+
const answer = flatAnswer.dose
|
|
152
|
+
.toLowerCase()
|
|
153
|
+
.replace(/\s/g, '');
|
|
144
154
|
let attempt = '';
|
|
145
155
|
if (flatAttempt) {
|
|
146
156
|
attempt = flatAttempt.toLowerCase().replace(/\s/g, '');
|
|
@@ -161,7 +171,8 @@ function correctMark(mark) {
|
|
|
161
171
|
Array.isArray(mark.mark[1])) {
|
|
162
172
|
[attemptA, attemptB] = mark.mark.map((x) => x.sort());
|
|
163
173
|
}
|
|
164
|
-
if (answerA.length !== attemptA.length ||
|
|
174
|
+
if (answerA.length !== attemptA.length ||
|
|
175
|
+
answerB.length !== attemptB.length) {
|
|
165
176
|
data.incorrect = true;
|
|
166
177
|
}
|
|
167
178
|
else if (attemptA.every((x, i) => x === answerA[i]) &&
|
|
@@ -182,7 +193,8 @@ function correctMark(mark) {
|
|
|
182
193
|
frequency: '',
|
|
183
194
|
duration: '',
|
|
184
195
|
}));
|
|
185
|
-
if (typeof flatAttempt === 'object' &&
|
|
196
|
+
if (typeof flatAttempt === 'object' &&
|
|
197
|
+
Object.keys(flatAttempt).length === 6) {
|
|
186
198
|
attempt = formatPrescribeAnswer(mapPrescribeMarkToAnswer(flatAttempt));
|
|
187
199
|
}
|
|
188
200
|
let foundCorrect = false;
|
|
@@ -192,7 +204,8 @@ function correctMark(mark) {
|
|
|
192
204
|
const drugCorrect = answer.drug.display || answer.drug.value === attempt.drug.value;
|
|
193
205
|
const durationCorrect = answer.duration.display ||
|
|
194
206
|
answer.duration.value.split(',').includes(attempt.duration.value);
|
|
195
|
-
const frequencyCorrect = answer.frequency.display ||
|
|
207
|
+
const frequencyCorrect = answer.frequency.display ||
|
|
208
|
+
answer.frequency.value === attempt.frequency.value;
|
|
196
209
|
const routeCorrect = answer.route.display || answer.route.value === attempt.route.value;
|
|
197
210
|
const unitsCorrect = answer.units.display || answer.units.value === attempt.units.value;
|
|
198
211
|
if (doseCorrect &&
|
|
@@ -30,9 +30,13 @@ export function mapPrescribeMarkToAnswer(obj) {
|
|
|
30
30
|
},
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
export function formatPrescribeAnswer(
|
|
33
|
+
export function formatPrescribeAnswer(baseAnswer) {
|
|
34
|
+
const obj = Object.assign(Object.assign({}, baseAnswer), { drug: Object.assign({}, baseAnswer.drug), dose: Object.assign({}, baseAnswer.dose), units: Object.assign({}, baseAnswer.units), route: Object.assign({}, baseAnswer.route), frequency: Object.assign({}, baseAnswer.frequency), duration: Object.assign({}, baseAnswer.duration) });
|
|
34
35
|
obj.drug.value = obj.drug.value.toLowerCase().replace(/\s/g, '');
|
|
35
|
-
obj.route.value = obj.route.value
|
|
36
|
+
obj.route.value = obj.route.value
|
|
37
|
+
.toLowerCase()
|
|
38
|
+
.replace(/\s/g, '')
|
|
39
|
+
.replace(/\//g, '');
|
|
36
40
|
if (obj.route.value === 'oral') {
|
|
37
41
|
obj.route.value = 'po';
|
|
38
42
|
}
|
|
@@ -58,7 +62,8 @@ export function formatPrescribeAnswer(obj) {
|
|
|
58
62
|
if (obj.units.value === 'milligram' || obj.units.value === 'milligrams') {
|
|
59
63
|
obj.units.value = 'mg';
|
|
60
64
|
}
|
|
61
|
-
else if (obj.units.value === 'microgram' ||
|
|
65
|
+
else if (obj.units.value === 'microgram' ||
|
|
66
|
+
obj.units.value === 'micrograms') {
|
|
62
67
|
obj.units.value = 'mcg';
|
|
63
68
|
}
|
|
64
69
|
else if (obj.units.value === 'gram' || obj.units.value === 'grams') {
|
|
@@ -87,17 +92,20 @@ export function formatPrescribeAnswer(obj) {
|
|
|
87
92
|
if (obj.frequency.value === 'once-off') {
|
|
88
93
|
obj.frequency.value = 'stat';
|
|
89
94
|
}
|
|
90
|
-
else if (obj.frequency.value.includes('once') ||
|
|
95
|
+
else if (obj.frequency.value.includes('once') ||
|
|
96
|
+
(frequencyIncHourly && hourlyFreqInt === 24)) {
|
|
91
97
|
obj.frequency.value = 'od';
|
|
92
98
|
}
|
|
93
|
-
else if (obj.frequency.value.includes('nightly') ||
|
|
99
|
+
else if (obj.frequency.value.includes('nightly') ||
|
|
100
|
+
obj.frequency.value === 'on') {
|
|
94
101
|
obj.frequency.value = 'od';
|
|
95
102
|
}
|
|
96
103
|
else if (obj.frequency.value.includes('twice') ||
|
|
97
104
|
(frequencyIncHourly && hourlyFreqInt === 12)) {
|
|
98
105
|
obj.frequency.value = 'bd';
|
|
99
106
|
}
|
|
100
|
-
else if (obj.frequency.value.includes('trice') ||
|
|
107
|
+
else if (obj.frequency.value.includes('trice') ||
|
|
108
|
+
(frequencyIncHourly && hourlyFreqInt === 8)) {
|
|
101
109
|
obj.frequency.value = 'tds';
|
|
102
110
|
}
|
|
103
111
|
else if (frequencyIncHourly && hourlyFreqInt === 6) {
|
|
@@ -135,7 +143,9 @@ export function correctMark(mark) {
|
|
|
135
143
|
}
|
|
136
144
|
}
|
|
137
145
|
else if (EQuestionType.QUESTION_ANSWER === mark.question.typeId) {
|
|
138
|
-
const answer = flatAnswer.dose
|
|
146
|
+
const answer = flatAnswer.dose
|
|
147
|
+
.toLowerCase()
|
|
148
|
+
.replace(/\s/g, '');
|
|
139
149
|
let attempt = '';
|
|
140
150
|
if (flatAttempt) {
|
|
141
151
|
attempt = flatAttempt.toLowerCase().replace(/\s/g, '');
|
|
@@ -156,7 +166,8 @@ export function correctMark(mark) {
|
|
|
156
166
|
Array.isArray(mark.mark[1])) {
|
|
157
167
|
[attemptA, attemptB] = mark.mark.map((x) => x.sort());
|
|
158
168
|
}
|
|
159
|
-
if (answerA.length !== attemptA.length ||
|
|
169
|
+
if (answerA.length !== attemptA.length ||
|
|
170
|
+
answerB.length !== attemptB.length) {
|
|
160
171
|
data.incorrect = true;
|
|
161
172
|
}
|
|
162
173
|
else if (attemptA.every((x, i) => x === answerA[i]) &&
|
|
@@ -177,7 +188,8 @@ export function correctMark(mark) {
|
|
|
177
188
|
frequency: '',
|
|
178
189
|
duration: '',
|
|
179
190
|
}));
|
|
180
|
-
if (typeof flatAttempt === 'object' &&
|
|
191
|
+
if (typeof flatAttempt === 'object' &&
|
|
192
|
+
Object.keys(flatAttempt).length === 6) {
|
|
181
193
|
attempt = formatPrescribeAnswer(mapPrescribeMarkToAnswer(flatAttempt));
|
|
182
194
|
}
|
|
183
195
|
let foundCorrect = false;
|
|
@@ -187,7 +199,8 @@ export function correctMark(mark) {
|
|
|
187
199
|
const drugCorrect = answer.drug.display || answer.drug.value === attempt.drug.value;
|
|
188
200
|
const durationCorrect = answer.duration.display ||
|
|
189
201
|
answer.duration.value.split(',').includes(attempt.duration.value);
|
|
190
|
-
const frequencyCorrect = answer.frequency.display ||
|
|
202
|
+
const frequencyCorrect = answer.frequency.display ||
|
|
203
|
+
answer.frequency.value === attempt.frequency.value;
|
|
191
204
|
const routeCorrect = answer.route.display || answer.route.value === attempt.route.value;
|
|
192
205
|
const unitsCorrect = answer.units.display || answer.units.value === attempt.units.value;
|
|
193
206
|
if (doseCorrect &&
|