@quesmed/types-rn 2.0.4
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/gql_input_output_types/User.d.ts +12 -0
- package/gql_input_output_types/User.js +2 -0
- package/gql_input_output_types/index.d.ts +75 -0
- package/gql_input_output_types/index.js +2 -0
- package/index.d.ts +22 -0
- package/index.js +124 -0
- package/models/Author.d.ts +14 -0
- package/models/Author.js +2 -0
- package/models/Blog.d.ts +15 -0
- package/models/Blog.js +2 -0
- package/models/Book.d.ts +22 -0
- package/models/Book.js +2 -0
- package/models/Card.d.ts +16 -0
- package/models/Card.js +2 -0
- package/models/Chapter.d.ts +15 -0
- package/models/Chapter.js +2 -0
- package/models/Concept.d.ts +15 -0
- package/models/Concept.js +2 -0
- package/models/Difficulty.d.ts +6 -0
- package/models/Difficulty.js +10 -0
- package/models/Feedback.d.ts +8 -0
- package/models/Feedback.js +2 -0
- package/models/File.d.ts +10 -0
- package/models/File.js +2 -0
- package/models/Marksheet.d.ts +36 -0
- package/models/Marksheet.js +2 -0
- package/models/MockTest.d.ts +22 -0
- package/models/MockTest.js +2 -0
- package/models/OsceMarksheet.d.ts +105 -0
- package/models/OsceMarksheet.js +103 -0
- package/models/OsceStation.d.ts +54 -0
- package/models/OsceStation.js +45 -0
- package/models/Picture.d.ts +14 -0
- package/models/Picture.js +2 -0
- package/models/Promo.d.ts +14 -0
- package/models/Promo.js +2 -0
- package/models/Question.d.ts +115 -0
- package/models/Question.js +43 -0
- package/models/Subscription.d.ts +17 -0
- package/models/Subscription.js +9 -0
- package/models/Todo.d.ts +33 -0
- package/models/Todo.js +2 -0
- package/models/Token.d.ts +9 -0
- package/models/Token.js +2 -0
- package/models/Topic.d.ts +32 -0
- package/models/Topic.js +13 -0
- package/models/Type.d.ts +7 -0
- package/models/Type.js +2 -0
- package/models/University.d.ts +5 -0
- package/models/University.js +2 -0
- package/models/User.d.ts +119 -0
- package/models/User.js +70 -0
- package/models/Video.d.ts +26 -0
- package/models/Video.js +2 -0
- package/models/index.d.ts +24 -0
- package/models/index.js +36 -0
- package/package.json +35 -0
- package/resolvers/apollo.d.ts +8 -0
- package/resolvers/apollo.js +2 -0
- package/resolvers/fragments/blog.d.ts +1 -0
- package/resolvers/fragments/blog.js +17 -0
- package/resolvers/fragments/chapter.d.ts +1 -0
- package/resolvers/fragments/chapter.js +25 -0
- package/resolvers/fragments/concept.d.ts +3 -0
- package/resolvers/fragments/concept.js +79 -0
- package/resolvers/fragments/index.d.ts +7 -0
- package/resolvers/fragments/index.js +19 -0
- package/resolvers/fragments/osce.d.ts +5 -0
- package/resolvers/fragments/osce.js +139 -0
- package/resolvers/fragments/picture.d.ts +1 -0
- package/resolvers/fragments/picture.js +22 -0
- package/resolvers/fragments/user.d.ts +1 -0
- package/resolvers/fragments/user.js +39 -0
- package/resolvers/fragments/video.d.ts +2 -0
- package/resolvers/fragments/video.js +58 -0
- package/resolvers/index.d.ts +12 -0
- package/resolvers/index.js +38 -0
- package/resolvers/mutation/admin/algoliaSync.d.ts +9 -0
- package/resolvers/mutation/admin/algoliaSync.js +2 -0
- package/resolvers/mutation/admin/index.d.ts +2 -0
- package/resolvers/mutation/admin/index.js +14 -0
- package/resolvers/mutation/admin/token.d.ts +25 -0
- package/resolvers/mutation/admin/token.js +2 -0
- package/resolvers/mutation/index.d.ts +5 -0
- package/resolvers/mutation/index.js +30 -0
- package/resolvers/mutation/restricted/agora.d.ts +10 -0
- package/resolvers/mutation/restricted/agora.js +11 -0
- package/resolvers/mutation/restricted/contactUs.d.ts +17 -0
- package/resolvers/mutation/restricted/contactUs.js +2 -0
- package/resolvers/mutation/restricted/index.d.ts +10 -0
- package/resolvers/mutation/restricted/index.js +22 -0
- package/resolvers/mutation/restricted/marksheet.d.ts +41 -0
- package/resolvers/mutation/restricted/marksheet.js +2 -0
- package/resolvers/mutation/restricted/mockTest.d.ts +16 -0
- package/resolvers/mutation/restricted/mockTest.js +2 -0
- package/resolvers/mutation/restricted/osce.d.ts +87 -0
- package/resolvers/mutation/restricted/osce.js +222 -0
- package/resolvers/mutation/restricted/questionDiscussion.d.ts +24 -0
- package/resolvers/mutation/restricted/questionDiscussion.js +2 -0
- package/resolvers/mutation/restricted/todo.d.ts +32 -0
- package/resolvers/mutation/restricted/todo.js +2 -0
- package/resolvers/mutation/restricted/token.d.ts +21 -0
- package/resolvers/mutation/restricted/token.js +2 -0
- package/resolvers/mutation/restricted/users.d.ts +29 -0
- package/resolvers/mutation/restricted/users.js +11 -0
- package/resolvers/mutation/restricted/video.d.ts +6 -0
- package/resolvers/mutation/restricted/video.js +2 -0
- package/resolvers/mutation/stripe.d.ts +11 -0
- package/resolvers/mutation/stripe.js +2 -0
- package/resolvers/mutation/users.d.ts +32 -0
- package/resolvers/mutation/users.js +2 -0
- package/resolvers/mutation/validUserToken/index.d.ts +1 -0
- package/resolvers/mutation/validUserToken/index.js +13 -0
- package/resolvers/mutation/validUserToken/user.d.ts +14 -0
- package/resolvers/mutation/validUserToken/user.js +2 -0
- package/resolvers/query/admin/getUserToken.d.ts +5 -0
- package/resolvers/query/admin/getUserToken.js +2 -0
- package/resolvers/query/admin/index.d.ts +1 -0
- package/resolvers/query/admin/index.js +13 -0
- package/resolvers/query/author.d.ts +3 -0
- package/resolvers/query/author.js +2 -0
- package/resolvers/query/blog.d.ts +15 -0
- package/resolvers/query/blog.js +36 -0
- package/resolvers/query/book.d.ts +8 -0
- package/resolvers/query/book.js +2 -0
- package/resolvers/query/feedback.d.ts +3 -0
- package/resolvers/query/feedback.js +2 -0
- package/resolvers/query/index.d.ts +11 -0
- package/resolvers/query/index.js +36 -0
- package/resolvers/query/restricted/index.d.ts +10 -0
- package/resolvers/query/restricted/index.js +22 -0
- package/resolvers/query/restricted/marksheet.d.ts +47 -0
- package/resolvers/query/restricted/marksheet.js +2 -0
- package/resolvers/query/restricted/mockTests.d.ts +10 -0
- package/resolvers/query/restricted/mockTests.js +2 -0
- package/resolvers/query/restricted/osce.d.ts +45 -0
- package/resolvers/query/restricted/osce.js +118 -0
- package/resolvers/query/restricted/quesBook.d.ts +7 -0
- package/resolvers/query/restricted/quesBook.js +17 -0
- package/resolvers/query/restricted/replication.d.ts +32 -0
- package/resolvers/query/restricted/replication.js +184 -0
- package/resolvers/query/restricted/todos.d.ts +15 -0
- package/resolvers/query/restricted/todos.js +2 -0
- package/resolvers/query/restricted/topics.d.ts +10 -0
- package/resolvers/query/restricted/topics.js +2 -0
- package/resolvers/query/restricted/university.d.ts +15 -0
- package/resolvers/query/restricted/university.js +2 -0
- package/resolvers/query/restricted/user.d.ts +13 -0
- package/resolvers/query/restricted/user.js +2 -0
- package/resolvers/query/restricted/video.d.ts +11 -0
- package/resolvers/query/restricted/video.js +2 -0
- package/resolvers/query/sample.d.ts +26 -0
- package/resolvers/query/sample.js +98 -0
- package/resolvers/query/subscription.d.ts +3 -0
- package/resolvers/query/subscription.js +2 -0
- package/resolvers/query/university.d.ts +6 -0
- package/resolvers/query/university.js +2 -0
- package/resolvers/query/user.d.ts +13 -0
- package/resolvers/query/user.js +2 -0
- package/resolvers/query/video.d.ts +15 -0
- package/resolvers/query/video.js +2 -0
- package/resolvers/subscription/index.d.ts +1 -0
- package/resolvers/subscription/index.js +13 -0
- package/resolvers/subscription/osce.d.ts +66 -0
- package/resolvers/subscription/osce.js +108 -0
- package/resolvers/types.d.ts +10 -0
- package/resolvers/types.js +2 -0
- package/utils/commonFunctions.d.ts +9 -0
- package/utils/commonFunctions.js +256 -0
- package/utils/index.d.ts +9 -0
- package/utils/index.js +42 -0
- package/utils/lightgallery.d.ts +9 -0
- package/utils/lightgallery.js +88 -0
- package/utils/offlineLink.d.ts +64 -0
- package/utils/offlineLink.js +221 -0
- package/utils/random.d.ts +1 -0
- package/utils/random.js +20 -0
- package/utils/uuid4.d.ts +107 -0
- package/utils/uuid4.js +282 -0
- package/utils/webSocketLink.d.ts +7 -0
- package/utils/webSocketLink.js +22 -0
- package/utils/wordsToNumber.d.ts +1 -0
- package/utils/wordsToNumber.js +48 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SAMPLE_OSCE_MARKSHEET = exports.SAMPLE_TODO = exports.SAMPLE_MARKSHEET = exports.SAMPLE_CONTENT = void 0;
|
|
4
|
+
const client_1 = require("@apollo/client");
|
|
5
|
+
const fragments_1 = require("../fragments");
|
|
6
|
+
exports.SAMPLE_CONTENT = (0, client_1.gql) `
|
|
7
|
+
query SampleContent {
|
|
8
|
+
sampleContent {
|
|
9
|
+
marksheets {
|
|
10
|
+
id
|
|
11
|
+
source
|
|
12
|
+
}
|
|
13
|
+
todos {
|
|
14
|
+
id
|
|
15
|
+
source
|
|
16
|
+
}
|
|
17
|
+
osceMarksheets {
|
|
18
|
+
id
|
|
19
|
+
osceStation {
|
|
20
|
+
name
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
exports.SAMPLE_MARKSHEET = (0, client_1.gql) `
|
|
27
|
+
query SampleMarksheet($marksheetId: Int!) {
|
|
28
|
+
sampleMarksheet(marksheetId: $marksheetId) {
|
|
29
|
+
id
|
|
30
|
+
endedAt
|
|
31
|
+
source
|
|
32
|
+
marks {
|
|
33
|
+
id
|
|
34
|
+
index
|
|
35
|
+
questionChoiceId
|
|
36
|
+
timeTaken
|
|
37
|
+
question {
|
|
38
|
+
id
|
|
39
|
+
typeId
|
|
40
|
+
conceptId
|
|
41
|
+
concept {
|
|
42
|
+
name
|
|
43
|
+
chapter {
|
|
44
|
+
explanation
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
question
|
|
48
|
+
totalVotes
|
|
49
|
+
choices {
|
|
50
|
+
id
|
|
51
|
+
name
|
|
52
|
+
explanation
|
|
53
|
+
label
|
|
54
|
+
answer
|
|
55
|
+
votes
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
exports.SAMPLE_TODO = (0, client_1.gql) `
|
|
63
|
+
query SampleTodo($todoId: Int!) {
|
|
64
|
+
sampleTodo(todoId: $todoId) {
|
|
65
|
+
id
|
|
66
|
+
dailyTask
|
|
67
|
+
source
|
|
68
|
+
marks {
|
|
69
|
+
id
|
|
70
|
+
cardId
|
|
71
|
+
score
|
|
72
|
+
timeTaken
|
|
73
|
+
card {
|
|
74
|
+
id
|
|
75
|
+
question
|
|
76
|
+
concept {
|
|
77
|
+
name
|
|
78
|
+
chapter {
|
|
79
|
+
explanation
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
`;
|
|
87
|
+
exports.SAMPLE_OSCE_MARKSHEET = (0, client_1.gql) `
|
|
88
|
+
${fragments_1.OSCE_STATION_FIELDS}
|
|
89
|
+
${fragments_1.OSCE_MARKSHEET_FIELDS}
|
|
90
|
+
query SampleOsceMarksheet($osceMarksheetId: Int!) {
|
|
91
|
+
sampleOsceMarksheet(osceMarksheetId: $osceMarksheetId) {
|
|
92
|
+
...OsceMarksheetFields
|
|
93
|
+
osceStation {
|
|
94
|
+
...OsceStationFields
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RootData } from '../types';
|
|
2
|
+
export interface IUsernameAvailableVar {
|
|
3
|
+
username: string;
|
|
4
|
+
}
|
|
5
|
+
export declare type IUsernameAvailableData = RootData<boolean, 'usernameAvailable'>;
|
|
6
|
+
export interface IUsernameProvisionedVar {
|
|
7
|
+
username: string;
|
|
8
|
+
}
|
|
9
|
+
export declare type IUsernameProvisionedData = RootData<boolean, 'usernameProvisioned'>;
|
|
10
|
+
export interface IValidateResetPasswordTokenVar {
|
|
11
|
+
token: string;
|
|
12
|
+
}
|
|
13
|
+
export declare type IValidateResetPasswordTokenData = RootData<string, 'validateResetPasswordToken'>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Id, IVideo } from '../../models';
|
|
2
|
+
import { graphqlNormalize, RootData } from '../types';
|
|
3
|
+
export interface IVideosVar {
|
|
4
|
+
filter: 'new' | 'popular' | 'personal' | 'live';
|
|
5
|
+
limit: number;
|
|
6
|
+
}
|
|
7
|
+
export declare type IVideosData = RootData<(graphqlNormalize & IVideo)[], 'videos'>;
|
|
8
|
+
export interface IVideoVar {
|
|
9
|
+
id: Id;
|
|
10
|
+
}
|
|
11
|
+
export declare type IVideoData = RootData<graphqlNormalize & IVideo, 'video'>;
|
|
12
|
+
export interface IZoomSignatureVar {
|
|
13
|
+
meetingNumber: string;
|
|
14
|
+
}
|
|
15
|
+
export declare type IZoomSignatureData = RootData<graphqlNormalize & string, 'zoomSignature'>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './osce';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./osce"), exports);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { EClassYearGroup, EOsceMarksheetAction, EOsceRoles, IAccessLevel, IClassYear, Id, IOsceMarksheetTimer, IOsceMarksheetUser, IUser } from '../../models';
|
|
2
|
+
import { RootData } from '../types';
|
|
3
|
+
export declare const OSCE_ROLE_CHANGE_KEY = "OSCE_ROLE_CHANGE";
|
|
4
|
+
export declare const OSCE_MARKSHEET_ACTION_KEY = "OSCE_MARKSHEET_ACTION";
|
|
5
|
+
export declare const OSCE_MARKSHEET_TIMER_KEY = "OSCE_MARKSHEET_TIMER";
|
|
6
|
+
export declare const OSCE_MATCHMAKING_KEY = "OSCE_MATCHMAKING";
|
|
7
|
+
export declare const OSCE_MATCHMAKING_USERS_KEY = "OSCE_MATCHMAKING_USERS";
|
|
8
|
+
export interface IOsceGroupMember {
|
|
9
|
+
role: EOsceRoles;
|
|
10
|
+
user: IUser | null;
|
|
11
|
+
}
|
|
12
|
+
export interface IOsceGroup {
|
|
13
|
+
osceMarksheetId: Id;
|
|
14
|
+
agoraId: string;
|
|
15
|
+
members: IOsceMarksheetUser[];
|
|
16
|
+
users: IUser[];
|
|
17
|
+
}
|
|
18
|
+
export declare const OsceGroupInit: (osceMarksheetId: number) => IOsceMarksheetUser[];
|
|
19
|
+
export declare const OSCE_ROLE_CHANGE: import("@apollo/client").DocumentNode;
|
|
20
|
+
export interface IOsceRoleChangedVar {
|
|
21
|
+
osceMarksheetId: Id;
|
|
22
|
+
}
|
|
23
|
+
export declare type IOsceRoleChangedData = RootData<IOsceGroup, 'osceRoleChange'>;
|
|
24
|
+
export declare const OSCE_MARKSHEET_ACTION: import("@apollo/client").DocumentNode;
|
|
25
|
+
export interface IOsceMarksheetActionVar {
|
|
26
|
+
osceMarksheetId: Id;
|
|
27
|
+
}
|
|
28
|
+
export interface IOsceMarksheetAction {
|
|
29
|
+
osceMarksheetId: Id;
|
|
30
|
+
agoraId: string;
|
|
31
|
+
userId: Id;
|
|
32
|
+
user: IUser;
|
|
33
|
+
startedAt: Date | null;
|
|
34
|
+
endedAt: Date | null;
|
|
35
|
+
action: EOsceMarksheetAction;
|
|
36
|
+
}
|
|
37
|
+
export declare type IOsceMarksheetActionData = RootData<IOsceMarksheetAction, 'osceMarksheetAction'>;
|
|
38
|
+
export declare const OSCE_MATCHMAKING: import("@apollo/client").DocumentNode;
|
|
39
|
+
export interface IOsceMatchmakingAction {
|
|
40
|
+
osceMarksheetId: Id;
|
|
41
|
+
agoraId: string;
|
|
42
|
+
matchedUsers: number;
|
|
43
|
+
userId: Id;
|
|
44
|
+
classYear: IClassYear;
|
|
45
|
+
classYearGroup: EClassYearGroup;
|
|
46
|
+
accessLevel: IAccessLevel;
|
|
47
|
+
lastSyncAt: number;
|
|
48
|
+
startedAt: number;
|
|
49
|
+
grouped: boolean;
|
|
50
|
+
completed: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface IOsceMatchmakingVar {
|
|
53
|
+
userId: Id;
|
|
54
|
+
}
|
|
55
|
+
export declare type IOsceMatchmakingData = RootData<IOsceMatchmakingAction, 'osceMatchmaking'>;
|
|
56
|
+
export declare const OSCE_MATCHMAKING_USERS: import("@apollo/client").DocumentNode;
|
|
57
|
+
export declare type IOsceMatchmakingUsersVar = null;
|
|
58
|
+
export declare type IOsceMatchmakingUsersData = RootData<[
|
|
59
|
+
number,
|
|
60
|
+
number
|
|
61
|
+
], 'osceMatchmakingUsers'>;
|
|
62
|
+
export declare const OSCE_MARKSHEET_TIMER: import("@apollo/client").DocumentNode;
|
|
63
|
+
export interface IOsceMarksheetTimerVar {
|
|
64
|
+
osceMarksheetId: number;
|
|
65
|
+
}
|
|
66
|
+
export declare type IOsceMarksheetTimerData = RootData<IOsceMarksheetTimer, 'osceMarksheetTimer'>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OSCE_MARKSHEET_TIMER = exports.OSCE_MATCHMAKING_USERS = exports.OSCE_MATCHMAKING = exports.OSCE_MARKSHEET_ACTION = exports.OSCE_ROLE_CHANGE = exports.OsceGroupInit = exports.OSCE_MATCHMAKING_USERS_KEY = exports.OSCE_MATCHMAKING_KEY = exports.OSCE_MARKSHEET_TIMER_KEY = exports.OSCE_MARKSHEET_ACTION_KEY = exports.OSCE_ROLE_CHANGE_KEY = void 0;
|
|
4
|
+
const client_1 = require("@apollo/client");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
const fragments_1 = require("../fragments");
|
|
7
|
+
exports.OSCE_ROLE_CHANGE_KEY = 'OSCE_ROLE_CHANGE';
|
|
8
|
+
exports.OSCE_MARKSHEET_ACTION_KEY = 'OSCE_MARKSHEET_ACTION';
|
|
9
|
+
exports.OSCE_MARKSHEET_TIMER_KEY = 'OSCE_MARKSHEET_TIMER';
|
|
10
|
+
exports.OSCE_MATCHMAKING_KEY = 'OSCE_MATCHMAKING';
|
|
11
|
+
exports.OSCE_MATCHMAKING_USERS_KEY = 'OSCE_MATCHMAKING_USERS';
|
|
12
|
+
const OsceGroupInit = (osceMarksheetId) => [
|
|
13
|
+
{
|
|
14
|
+
id: null,
|
|
15
|
+
createdAt: null,
|
|
16
|
+
osceMarksheetId,
|
|
17
|
+
userId: null,
|
|
18
|
+
user: null,
|
|
19
|
+
role: models_1.EOsceRoles.CANDIDATE,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: null,
|
|
23
|
+
createdAt: null,
|
|
24
|
+
osceMarksheetId,
|
|
25
|
+
userId: null,
|
|
26
|
+
user: null,
|
|
27
|
+
role: models_1.EOsceRoles.EXAMINER,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: null,
|
|
31
|
+
createdAt: null,
|
|
32
|
+
osceMarksheetId,
|
|
33
|
+
userId: null,
|
|
34
|
+
user: null,
|
|
35
|
+
role: models_1.EOsceRoles.ACTOR,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: null,
|
|
39
|
+
createdAt: null,
|
|
40
|
+
osceMarksheetId,
|
|
41
|
+
userId: null,
|
|
42
|
+
user: null,
|
|
43
|
+
role: models_1.EOsceRoles.OBSERVER,
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
exports.OsceGroupInit = OsceGroupInit;
|
|
47
|
+
exports.OSCE_ROLE_CHANGE = (0, client_1.gql) `
|
|
48
|
+
subscription osceRoleChangeSubscription($osceMarksheetId: Int!) {
|
|
49
|
+
osceRoleChange(osceMarksheetId: $osceMarksheetId) {
|
|
50
|
+
osceMarksheetId
|
|
51
|
+
agoraId
|
|
52
|
+
members {
|
|
53
|
+
osceMarksheetId
|
|
54
|
+
userId
|
|
55
|
+
user {
|
|
56
|
+
id
|
|
57
|
+
displayName
|
|
58
|
+
}
|
|
59
|
+
role
|
|
60
|
+
}
|
|
61
|
+
users {
|
|
62
|
+
id
|
|
63
|
+
displayName
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
exports.OSCE_MARKSHEET_ACTION = (0, client_1.gql) `
|
|
69
|
+
subscription OsceMarksheetAction($osceMarksheetId: Int!) {
|
|
70
|
+
osceMarksheetAction(osceMarksheetId: $osceMarksheetId) {
|
|
71
|
+
osceMarksheetId
|
|
72
|
+
agoraId
|
|
73
|
+
userId
|
|
74
|
+
user {
|
|
75
|
+
id
|
|
76
|
+
displayName
|
|
77
|
+
universityId
|
|
78
|
+
}
|
|
79
|
+
startedAt
|
|
80
|
+
endedAt
|
|
81
|
+
action
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
`;
|
|
85
|
+
exports.OSCE_MATCHMAKING = (0, client_1.gql) `
|
|
86
|
+
${fragments_1.OSCE_MATCHMAKING_ACTION_FIELDS}
|
|
87
|
+
subscription OsceMatchmaking($userId: Int!) {
|
|
88
|
+
osceMatchmaking(userId: $userId) {
|
|
89
|
+
...OsceMatchmakingActionFields
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
`;
|
|
93
|
+
exports.OSCE_MATCHMAKING_USERS = (0, client_1.gql) `
|
|
94
|
+
subscription OsceMatchmakingUsers {
|
|
95
|
+
osceMatchmakingUsers
|
|
96
|
+
}
|
|
97
|
+
`;
|
|
98
|
+
exports.OSCE_MARKSHEET_TIMER = (0, client_1.gql) `
|
|
99
|
+
subscription OsceMarksheetTimer($osceMarksheetId: Int!) {
|
|
100
|
+
osceMarksheetTimer(osceMarksheetId: $osceMarksheetId) {
|
|
101
|
+
osceMarksheetId
|
|
102
|
+
timeRemaining
|
|
103
|
+
totalStationTime
|
|
104
|
+
stage
|
|
105
|
+
state
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
`;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface graphqlNormalize {
|
|
2
|
+
__typename?: string;
|
|
3
|
+
}
|
|
4
|
+
export declare type RestrictedData<T, K extends keyof any> = {
|
|
5
|
+
restricted: Record<K, T>;
|
|
6
|
+
};
|
|
7
|
+
export declare type AdminData<T, K extends keyof any> = {
|
|
8
|
+
admin: Record<K, T>;
|
|
9
|
+
};
|
|
10
|
+
export declare type RootData<T, K extends keyof any> = Record<K, T>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IMarksheetMark, IPrescribeAnswer, IPrescribeMark } from '../models';
|
|
2
|
+
export declare function mapPrescribeMarkToAnswer(obj: IPrescribeMark): IPrescribeAnswer;
|
|
3
|
+
export declare function formatPrescribeAnswer(baseAnswer: IPrescribeAnswer): IPrescribeAnswer;
|
|
4
|
+
export interface ICorrectMarkData {
|
|
5
|
+
correct: boolean;
|
|
6
|
+
incorrect: boolean;
|
|
7
|
+
correctIndex: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function correctMark(mark: IMarksheetMark): ICorrectMarkData;
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.correctMark = exports.formatPrescribeAnswer = exports.mapPrescribeMarkToAnswer = void 0;
|
|
4
|
+
const models_1 = require("../models");
|
|
5
|
+
const wordsToNumber_1 = require("./wordsToNumber");
|
|
6
|
+
const floatRegex = /([0-9]*[.])?[0-9]+/gm;
|
|
7
|
+
const ACCEPTED_FREQ = ['stat', 'od', 'bd', 'tds', 'qds'];
|
|
8
|
+
function mapPrescribeMarkToAnswer(obj) {
|
|
9
|
+
return {
|
|
10
|
+
drug: {
|
|
11
|
+
value: obj.drug,
|
|
12
|
+
display: false,
|
|
13
|
+
},
|
|
14
|
+
dose: {
|
|
15
|
+
value: parseFloat(obj.dose),
|
|
16
|
+
display: false,
|
|
17
|
+
},
|
|
18
|
+
units: {
|
|
19
|
+
value: obj.units,
|
|
20
|
+
display: false,
|
|
21
|
+
},
|
|
22
|
+
route: {
|
|
23
|
+
value: obj.route,
|
|
24
|
+
display: false,
|
|
25
|
+
},
|
|
26
|
+
frequency: {
|
|
27
|
+
value: obj.frequency,
|
|
28
|
+
display: false,
|
|
29
|
+
},
|
|
30
|
+
duration: {
|
|
31
|
+
value: obj.duration,
|
|
32
|
+
display: false,
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
exports.mapPrescribeMarkToAnswer = mapPrescribeMarkToAnswer;
|
|
37
|
+
function formatPrescribeAnswer(baseAnswer) {
|
|
38
|
+
const obj = {
|
|
39
|
+
...baseAnswer,
|
|
40
|
+
drug: {
|
|
41
|
+
...baseAnswer.drug,
|
|
42
|
+
},
|
|
43
|
+
dose: {
|
|
44
|
+
...baseAnswer.dose,
|
|
45
|
+
},
|
|
46
|
+
units: {
|
|
47
|
+
...baseAnswer.units,
|
|
48
|
+
},
|
|
49
|
+
route: {
|
|
50
|
+
...baseAnswer.route,
|
|
51
|
+
},
|
|
52
|
+
frequency: {
|
|
53
|
+
...baseAnswer.frequency,
|
|
54
|
+
},
|
|
55
|
+
duration: {
|
|
56
|
+
...baseAnswer.duration,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
obj.drug.value = obj.drug.value.toLowerCase().replace(/\s/g, '');
|
|
60
|
+
obj.route.value = obj.route.value
|
|
61
|
+
.toLowerCase()
|
|
62
|
+
.replace(/\s/g, '')
|
|
63
|
+
.replace(/\//g, '');
|
|
64
|
+
if (obj.route.value.includes('oral')) {
|
|
65
|
+
obj.route.value = 'po';
|
|
66
|
+
}
|
|
67
|
+
else if (obj.route.value.includes('intravenous')) {
|
|
68
|
+
obj.route.value = 'iv';
|
|
69
|
+
}
|
|
70
|
+
else if (obj.route.value.includes('intramuscular')) {
|
|
71
|
+
obj.route.value = 'im';
|
|
72
|
+
}
|
|
73
|
+
else if (obj.route.value.includes('subcutaneous')) {
|
|
74
|
+
obj.route.value = 'sc';
|
|
75
|
+
}
|
|
76
|
+
else if (obj.route.value.includes('inhale')) {
|
|
77
|
+
obj.route.value = 'inh';
|
|
78
|
+
}
|
|
79
|
+
else if (obj.route.value.includes('nebuli')) {
|
|
80
|
+
obj.route.value = 'neb';
|
|
81
|
+
}
|
|
82
|
+
else if (obj.route.value.includes('topical')) {
|
|
83
|
+
obj.route.value = 'top';
|
|
84
|
+
}
|
|
85
|
+
obj.units.value = obj.units.value.toLowerCase().replace(/\s/g, '');
|
|
86
|
+
if (obj.units.value === 'milligram' || obj.units.value === 'milligrams') {
|
|
87
|
+
obj.units.value = 'mg';
|
|
88
|
+
}
|
|
89
|
+
else if (obj.units.value === 'microgram' ||
|
|
90
|
+
obj.units.value === 'micrograms') {
|
|
91
|
+
obj.units.value = 'mcg';
|
|
92
|
+
}
|
|
93
|
+
else if (obj.units.value === 'gram' || obj.units.value === 'grams') {
|
|
94
|
+
obj.units.value = 'g';
|
|
95
|
+
}
|
|
96
|
+
else if (obj.units.value === 'unit') {
|
|
97
|
+
obj.units.value = 'units';
|
|
98
|
+
}
|
|
99
|
+
let m;
|
|
100
|
+
const durationMatches = new Set();
|
|
101
|
+
while ((m = floatRegex.exec(obj.duration.value)) !== null) {
|
|
102
|
+
if (m.index === floatRegex.lastIndex) {
|
|
103
|
+
floatRegex.lastIndex++;
|
|
104
|
+
}
|
|
105
|
+
m.forEach((match) => durationMatches.add(match));
|
|
106
|
+
}
|
|
107
|
+
const durationWords = (0, wordsToNumber_1.wordsToNumber)(obj.duration.value, false);
|
|
108
|
+
if (durationWords !== 0) {
|
|
109
|
+
durationMatches.add(durationWords.toString());
|
|
110
|
+
}
|
|
111
|
+
obj.duration.value = [...durationMatches].filter((x) => !!x).join(',');
|
|
112
|
+
const orgFrequencyValue = obj.frequency.value.toLowerCase();
|
|
113
|
+
obj.frequency.value = orgFrequencyValue.replace(/\s/g, '');
|
|
114
|
+
const frequencyIncHourly = obj.frequency.value.includes('hour');
|
|
115
|
+
const hourlyFreqInt = parseInt(obj.frequency.value);
|
|
116
|
+
if (obj.frequency.value === 'once-off') {
|
|
117
|
+
obj.frequency.value = 'stat';
|
|
118
|
+
}
|
|
119
|
+
else if (obj.frequency.value.includes('once') ||
|
|
120
|
+
(frequencyIncHourly && hourlyFreqInt === 24)) {
|
|
121
|
+
obj.frequency.value = 'od';
|
|
122
|
+
}
|
|
123
|
+
else if (obj.frequency.value.includes('nightly') ||
|
|
124
|
+
obj.frequency.value === 'on') {
|
|
125
|
+
obj.frequency.value = 'od';
|
|
126
|
+
}
|
|
127
|
+
else if (obj.frequency.value.includes('twice') ||
|
|
128
|
+
(frequencyIncHourly && hourlyFreqInt === 12)) {
|
|
129
|
+
obj.frequency.value = 'bd';
|
|
130
|
+
}
|
|
131
|
+
else if (obj.frequency.value.includes('trice') ||
|
|
132
|
+
(frequencyIncHourly && hourlyFreqInt === 8)) {
|
|
133
|
+
obj.frequency.value = 'tds';
|
|
134
|
+
}
|
|
135
|
+
else if (frequencyIncHourly && hourlyFreqInt === 6) {
|
|
136
|
+
obj.frequency.value = 'qds';
|
|
137
|
+
}
|
|
138
|
+
else if (!ACCEPTED_FREQ.includes(obj.frequency.value)) {
|
|
139
|
+
obj.frequency.value = (0, wordsToNumber_1.wordsToNumber)(orgFrequencyValue, true).toString();
|
|
140
|
+
}
|
|
141
|
+
return obj;
|
|
142
|
+
}
|
|
143
|
+
exports.formatPrescribeAnswer = formatPrescribeAnswer;
|
|
144
|
+
const answerRegex = /answer/gi;
|
|
145
|
+
function correctMark(mark) {
|
|
146
|
+
const data = {
|
|
147
|
+
correct: false,
|
|
148
|
+
incorrect: false,
|
|
149
|
+
correctIndex: -1,
|
|
150
|
+
};
|
|
151
|
+
if (!mark || !mark.mark) {
|
|
152
|
+
return data;
|
|
153
|
+
}
|
|
154
|
+
try {
|
|
155
|
+
const qKeys = Object.keys(mark.question);
|
|
156
|
+
const answerKey = qKeys.find((k) => answerRegex.exec(k)) || 'answer';
|
|
157
|
+
const answer = mark.question[answerKey];
|
|
158
|
+
const flatAnswer = answer[0];
|
|
159
|
+
const flatAttempt = mark.mark[0];
|
|
160
|
+
if (models_1.EQuestionType.SINGLE_BEST_ANSWER === mark.question.typeId) {
|
|
161
|
+
const answer = flatAnswer;
|
|
162
|
+
const attempt = flatAttempt;
|
|
163
|
+
if (answer === attempt) {
|
|
164
|
+
data.correct = true;
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
data.incorrect = true;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
else if (models_1.EQuestionType.QUESTION_ANSWER === mark.question.typeId) {
|
|
171
|
+
const answer = flatAnswer.dose
|
|
172
|
+
.toLowerCase()
|
|
173
|
+
.replace(/\s/g, '');
|
|
174
|
+
let attempt = '';
|
|
175
|
+
if (flatAttempt) {
|
|
176
|
+
attempt = flatAttempt.toLowerCase().replace(/\s/g, '');
|
|
177
|
+
}
|
|
178
|
+
if (answer === attempt) {
|
|
179
|
+
data.correct = true;
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
data.incorrect = true;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
else if (models_1.EQuestionType.MULTIPLE_ANSWERS === mark.question.typeId) {
|
|
186
|
+
const [answerA, answerB] = answer.map((x) => x.sort());
|
|
187
|
+
let [attemptA, attemptB] = [[], []];
|
|
188
|
+
if (Array.isArray(mark.mark) &&
|
|
189
|
+
mark.mark.length === 2 &&
|
|
190
|
+
Array.isArray(mark.mark[0]) &&
|
|
191
|
+
Array.isArray(mark.mark[1])) {
|
|
192
|
+
[attemptA, attemptB] = mark.mark.map((x) => x.sort());
|
|
193
|
+
}
|
|
194
|
+
if (answerA.length !== attemptA.length ||
|
|
195
|
+
answerB.length !== attemptB.length) {
|
|
196
|
+
data.incorrect = true;
|
|
197
|
+
}
|
|
198
|
+
else if (attemptA.every((x, i) => x === answerA[i]) &&
|
|
199
|
+
attemptB.every((x, i) => x === answerB[i])) {
|
|
200
|
+
data.correct = true;
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
data.incorrect = true;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
else if (models_1.EQuestionType.PRESCRIPTION_ANSWER === mark.question.typeId) {
|
|
207
|
+
const answers = answer.map(formatPrescribeAnswer);
|
|
208
|
+
let attempt = formatPrescribeAnswer(mapPrescribeMarkToAnswer({
|
|
209
|
+
drug: '',
|
|
210
|
+
dose: -1,
|
|
211
|
+
units: '',
|
|
212
|
+
route: '',
|
|
213
|
+
frequency: '',
|
|
214
|
+
duration: '',
|
|
215
|
+
}));
|
|
216
|
+
if (typeof flatAttempt === 'object' &&
|
|
217
|
+
Object.keys(flatAttempt).length === 6) {
|
|
218
|
+
attempt = formatPrescribeAnswer(mapPrescribeMarkToAnswer(flatAttempt));
|
|
219
|
+
}
|
|
220
|
+
let foundCorrect = false;
|
|
221
|
+
let index = 0;
|
|
222
|
+
for (const answer of answers) {
|
|
223
|
+
const doseCorrect = answer.dose.display || answer.dose.value === attempt.dose.value;
|
|
224
|
+
const drugCorrect = answer.drug.display || answer.drug.value === attempt.drug.value;
|
|
225
|
+
const durationCorrect = answer.duration.display ||
|
|
226
|
+
answer.duration.value.split(',').includes(attempt.duration.value);
|
|
227
|
+
const frequencyCorrect = answer.frequency.display ||
|
|
228
|
+
answer.frequency.value === attempt.frequency.value;
|
|
229
|
+
const routeCorrect = answer.route.display || answer.route.value === attempt.route.value;
|
|
230
|
+
const unitsCorrect = answer.units.display || answer.units.value === attempt.units.value;
|
|
231
|
+
if (doseCorrect &&
|
|
232
|
+
drugCorrect &&
|
|
233
|
+
durationCorrect &&
|
|
234
|
+
frequencyCorrect &&
|
|
235
|
+
routeCorrect &&
|
|
236
|
+
unitsCorrect) {
|
|
237
|
+
foundCorrect = true;
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
index++;
|
|
241
|
+
}
|
|
242
|
+
if (foundCorrect) {
|
|
243
|
+
data.correct = true;
|
|
244
|
+
data.correctIndex = index;
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
data.incorrect = true;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
catch (e) {
|
|
252
|
+
console.error(e);
|
|
253
|
+
}
|
|
254
|
+
return data;
|
|
255
|
+
}
|
|
256
|
+
exports.correctMark = correctMark;
|
package/utils/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './commonFunctions';
|
|
2
|
+
export * from './lightgallery';
|
|
3
|
+
export * from './offlineLink';
|
|
4
|
+
export * from './random';
|
|
5
|
+
export * from './webSocketLink';
|
|
6
|
+
export * from './wordsToNumber';
|
|
7
|
+
import uuid from './uuid4';
|
|
8
|
+
export declare const Uuid4: typeof uuid;
|
|
9
|
+
export declare function printDuration(duration: number): string;
|
package/utils/index.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.printDuration = exports.Uuid4 = void 0;
|
|
17
|
+
__exportStar(require("./commonFunctions"), exports);
|
|
18
|
+
__exportStar(require("./lightgallery"), exports);
|
|
19
|
+
__exportStar(require("./offlineLink"), exports);
|
|
20
|
+
__exportStar(require("./random"), exports);
|
|
21
|
+
__exportStar(require("./webSocketLink"), exports);
|
|
22
|
+
__exportStar(require("./wordsToNumber"), exports);
|
|
23
|
+
const uuid4_1 = __importDefault(require("./uuid4"));
|
|
24
|
+
exports.Uuid4 = uuid4_1.default;
|
|
25
|
+
function printDuration(duration) {
|
|
26
|
+
let timeRemainingMins = Math.floor(duration / 60);
|
|
27
|
+
if (timeRemainingMins < 0) {
|
|
28
|
+
timeRemainingMins = 0;
|
|
29
|
+
}
|
|
30
|
+
const timeRemainingMinsStr = timeRemainingMins >= 10
|
|
31
|
+
? timeRemainingMins.toString()
|
|
32
|
+
: `0${timeRemainingMins}`;
|
|
33
|
+
let timeRemainingSecs = duration % 60;
|
|
34
|
+
if (timeRemainingSecs < 0) {
|
|
35
|
+
timeRemainingSecs = 0;
|
|
36
|
+
}
|
|
37
|
+
const timeRemainingSecsStr = timeRemainingSecs >= 10
|
|
38
|
+
? timeRemainingSecs.toString()
|
|
39
|
+
: `0${timeRemainingSecs}`;
|
|
40
|
+
return `${timeRemainingMinsStr}:${timeRemainingSecsStr}`;
|
|
41
|
+
}
|
|
42
|
+
exports.printDuration = printDuration;
|