@quesmed/types 2.6.75 → 2.6.76

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.
@@ -19,3 +19,4 @@ export declare const handleSampleChapterHighlights: (client: ApolloClient<any>,
19
19
  export declare const handleSampleQuestionHighlights: (client: ApolloClient<any>, highlights: IHighlightNode[], questionId: number, questionTypeId: EQuestionType) => void;
20
20
  export declare const startSampleStationTimer: (client: ApolloClient<any>, osceMarkhseetId?: number) => void;
21
21
  export declare const strikeSampleChoice: (client: ApolloClient<any>, id: number, striked: number[]) => void;
22
+ export declare const toggleSampleFlaggedState: (client: ApolloClient<any>, markId: number, flagged: boolean) => void;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.strikeSampleChoice = exports.startSampleStationTimer = exports.handleSampleQuestionHighlights = exports.handleSampleChapterHighlights = exports.endSampleStation = exports.endSampleMarksheet = exports.checkSampleOsceMark = exports.MARK_OSCE_MARK_FRAGMENT = exports.changeSampleQuestion = exports.saveSampleTodoMark = exports.saveSampleMarksheets = void 0;
3
+ exports.toggleSampleFlaggedState = exports.strikeSampleChoice = exports.startSampleStationTimer = exports.handleSampleQuestionHighlights = exports.handleSampleChapterHighlights = exports.endSampleStation = exports.endSampleMarksheet = exports.checkSampleOsceMark = exports.MARK_OSCE_MARK_FRAGMENT = exports.changeSampleQuestion = exports.saveSampleTodoMark = exports.saveSampleMarksheets = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  const fragments_1 = require("../fragments");
6
6
  const marksheet_1 = require("../fragments/marksheet");
@@ -246,3 +246,16 @@ const strikeSampleChoice = (client, id, striked) => {
246
246
  });
247
247
  };
248
248
  exports.strikeSampleChoice = strikeSampleChoice;
249
+ const toggleSampleFlaggedState = (client, markId, flagged) => {
250
+ client.cache.writeFragment({
251
+ id: client.cache.identify({
252
+ id: Number(markId),
253
+ __typename: 'MarksheetMark',
254
+ }),
255
+ data: {
256
+ flagged: !flagged,
257
+ },
258
+ fragment: marksheet_1.MARK_FLAGGED_FIELD,
259
+ });
260
+ };
261
+ exports.toggleSampleFlaggedState = toggleSampleFlaggedState;
@@ -19,3 +19,4 @@ export declare const handleSampleChapterHighlights: (client: ApolloClient<any>,
19
19
  export declare const handleSampleQuestionHighlights: (client: ApolloClient<any>, highlights: IHighlightNode[], questionId: number, questionTypeId: EQuestionType) => void;
20
20
  export declare const startSampleStationTimer: (client: ApolloClient<any>, osceMarkhseetId?: number) => void;
21
21
  export declare const strikeSampleChoice: (client: ApolloClient<any>, id: number, striked: number[]) => void;
22
+ export declare const toggleSampleFlaggedState: (client: ApolloClient<any>, markId: number, flagged: boolean) => void;
@@ -1,6 +1,6 @@
1
1
  import { gql } from '@apollo/client';
2
2
  import { CHAPTER_WITH_HIGHLIGHT_FIELDS, QUESTION_WITH_HIGHLIGHT_FIELDS, } from '../fragments';
3
- import { MODIFY_CURRENT_MARKSHEET_MARK_FRAGMENT, MODIFY_MARKSHEET_MARK_STRIKED_FRAGMENT, } from '../fragments/marksheet';
3
+ import { MARK_FLAGGED_FIELD, MODIFY_CURRENT_MARKSHEET_MARK_FRAGMENT, MODIFY_MARKSHEET_MARK_STRIKED_FRAGMENT, } from '../fragments/marksheet';
4
4
  import { SAMPLE_MARKSHEET, SAMPLE_OSCE_MARKSHEET, } from '../query';
5
5
  import { MARKSHEET, } from '../query/restricted/marksheet';
6
6
  import { getQuestionTypeName, } from './restricted';
@@ -233,3 +233,15 @@ export const strikeSampleChoice = (client, id, striked) => {
233
233
  fragment: MODIFY_MARKSHEET_MARK_STRIKED_FRAGMENT,
234
234
  });
235
235
  };
236
+ export const toggleSampleFlaggedState = (client, markId, flagged) => {
237
+ client.cache.writeFragment({
238
+ id: client.cache.identify({
239
+ id: Number(markId),
240
+ __typename: 'MarksheetMark',
241
+ }),
242
+ data: {
243
+ flagged: !flagged,
244
+ },
245
+ fragment: MARK_FLAGGED_FIELD,
246
+ });
247
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "2.6.75",
3
+ "version": "2.6.76",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",