@quesmed/types-rn 2.6.280 → 2.6.290
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.
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { IMarksheetMark } from './Marksheet';
|
|
2
|
+
import { EProductType } from './Product';
|
|
3
|
+
import { Id } from './Type';
|
|
1
4
|
export { CoverageTier, PostQuizBand } from '../resolvers/enums';
|
|
2
5
|
export interface ISampleQuizMarkInput {
|
|
3
6
|
id: number;
|
|
@@ -30,8 +33,17 @@ export interface ISampleQuizTopicBreakdown {
|
|
|
30
33
|
percentage: number;
|
|
31
34
|
eligible: boolean;
|
|
32
35
|
}
|
|
36
|
+
export interface SampleQuizMark {
|
|
37
|
+
id: IMarksheetMark['id'];
|
|
38
|
+
result: IMarksheetMark['result'];
|
|
39
|
+
questionChoiceId: IMarksheetMark['questionId'];
|
|
40
|
+
mark: IMarksheetMark['mark'];
|
|
41
|
+
timeTaken: IMarksheetMark['timeTaken'];
|
|
42
|
+
}
|
|
33
43
|
export interface ISampleQuizReport {
|
|
34
44
|
id: string;
|
|
45
|
+
marksheetId: Id;
|
|
46
|
+
productId: EProductType;
|
|
35
47
|
paperLength: number;
|
|
36
48
|
attempted: number;
|
|
37
49
|
correct: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApolloCache } from '@apollo/client';
|
|
2
2
|
import { ApolloUpdateOptions, ApolloUpdateResultRestricted } from '../..';
|
|
3
|
-
import { IClinicalDataModule, Id, IOsceStation, IOsceStationPhaseTimer, IStationExaminerQuestion } from '../../../models';
|
|
3
|
+
import { IClinicalDataModule, Id, IOsceStation, IOsceStationPhaseTimer, IResultData, IStationExaminerQuestion } from '../../../models';
|
|
4
4
|
import { IAssetBinding } from '../../../models/Picture';
|
|
5
5
|
import { graphqlNormalize, RestrictedData } from '../../types';
|
|
6
6
|
import { EOsceType } from '../../../models';
|
|
@@ -68,6 +68,12 @@ export interface IUpdateStationVar {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
export declare const updateCacheOnUpdateStation: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpdateStationData>, options: ApolloUpdateOptions<IUpdateStationVar>) => void;
|
|
71
|
+
export declare const DELETE_STATION: import("@apollo/client").DocumentNode;
|
|
72
|
+
export interface IDeleteStationVar {
|
|
73
|
+
stationId: Id;
|
|
74
|
+
}
|
|
75
|
+
export type IDeleteStationData = RestrictedData<graphqlNormalize & IResultData, 'deleteStation'>;
|
|
76
|
+
export declare const updateCacheOnDeleteStation: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IDeleteStationData>, options: ApolloUpdateOptions<IDeleteStationVar>) => void;
|
|
71
77
|
export interface IGenerateStationSession {
|
|
72
78
|
sessionId: string;
|
|
73
79
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GENERATE_STATION = exports.updateCacheOnUpdateStation = exports.UPDATE_STATION = exports.updateCacheOnCreateStation = exports.CREATE_STATION = void 0;
|
|
3
|
+
exports.GENERATE_STATION = exports.updateCacheOnDeleteStation = exports.DELETE_STATION = exports.updateCacheOnUpdateStation = exports.UPDATE_STATION = exports.updateCacheOnCreateStation = exports.CREATE_STATION = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
5
|
const osce_1 = require("../../fragments/osce");
|
|
6
6
|
const restricted_1 = require("../../query/restricted");
|
|
@@ -79,6 +79,54 @@ const updateCacheOnUpdateStation = (cache, result, options) => {
|
|
|
79
79
|
});
|
|
80
80
|
};
|
|
81
81
|
exports.updateCacheOnUpdateStation = updateCacheOnUpdateStation;
|
|
82
|
+
exports.DELETE_STATION = (0, client_1.gql) `
|
|
83
|
+
mutation DeleteStation($stationId: Int!) {
|
|
84
|
+
restricted {
|
|
85
|
+
deleteStation(stationId: $stationId) {
|
|
86
|
+
recordIds
|
|
87
|
+
logFile
|
|
88
|
+
batchId
|
|
89
|
+
status
|
|
90
|
+
data
|
|
91
|
+
message
|
|
92
|
+
errors
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
`;
|
|
97
|
+
const updateCacheOnDeleteStation = (cache, result, options) => {
|
|
98
|
+
const { deleteStation } = result?.data?.restricted || {};
|
|
99
|
+
const { variables } = options || {};
|
|
100
|
+
if (!variables || !deleteStation) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
cache.evict({
|
|
104
|
+
id: cache.identify({
|
|
105
|
+
id: variables.stationId,
|
|
106
|
+
__typename: 'OsceStation',
|
|
107
|
+
}),
|
|
108
|
+
});
|
|
109
|
+
cache.gc();
|
|
110
|
+
const prevData = cache.readQuery({
|
|
111
|
+
variables: { solo: false },
|
|
112
|
+
query: restricted_1.OSCE_STATIONS,
|
|
113
|
+
});
|
|
114
|
+
if (prevData) {
|
|
115
|
+
const { osceStations } = prevData.restricted || {};
|
|
116
|
+
cache.writeQuery({
|
|
117
|
+
query: restricted_1.OSCE_STATIONS,
|
|
118
|
+
variables: { solo: false },
|
|
119
|
+
data: {
|
|
120
|
+
...prevData,
|
|
121
|
+
restricted: {
|
|
122
|
+
...prevData.restricted,
|
|
123
|
+
osceStations: osceStations?.filter((station) => station.id !== variables.stationId),
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
exports.updateCacheOnDeleteStation = updateCacheOnDeleteStation;
|
|
82
130
|
exports.GENERATE_STATION = (0, client_1.gql) `
|
|
83
131
|
mutation GenerateStation($input: GenerateStationInput!) {
|
|
84
132
|
restricted {
|
|
@@ -108,6 +108,8 @@ exports.SAMPLE_QUIZ_REPORT = (0, client_1.gql) `
|
|
|
108
108
|
id
|
|
109
109
|
paperLength
|
|
110
110
|
attempted
|
|
111
|
+
marksheetId
|
|
112
|
+
productId
|
|
111
113
|
correct
|
|
112
114
|
scorePercentage
|
|
113
115
|
coverageTier
|
|
@@ -129,6 +131,13 @@ exports.SAMPLE_QUIZ_REPORT = (0, client_1.gql) `
|
|
|
129
131
|
percentage
|
|
130
132
|
eligible
|
|
131
133
|
}
|
|
134
|
+
marks {
|
|
135
|
+
id
|
|
136
|
+
result
|
|
137
|
+
questionChoiceId
|
|
138
|
+
mark
|
|
139
|
+
timeTaken
|
|
140
|
+
}
|
|
132
141
|
recommendedFocus
|
|
133
142
|
createdAt
|
|
134
143
|
promoCode
|