@quesmed/types 2.6.273 → 2.6.275

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.
@@ -103,9 +103,9 @@ exports.MARK_OSCE_MARKSHEET_MARK = (0, client_1.gql) `
103
103
  `;
104
104
  const getStationScore = (marks) => {
105
105
  const MarkMap = {
106
- 1: 2,
107
- 2: 1,
108
- 3: 0,
106
+ [models_1.EPaceMarkType.SATISFACTORY]: 2,
107
+ [models_1.EPaceMarkType.BORDERLINE]: 1,
108
+ [models_1.EPaceMarkType.UN_SATISFACTORY]: 0,
109
109
  };
110
110
  if (!marks?.length) {
111
111
  return {
@@ -115,11 +115,9 @@ const getStationScore = (marks) => {
115
115
  }
116
116
  const { total, userScore } = marks.reduce((acc, mark) => {
117
117
  const choices = mark.osceStationMark?.choices;
118
- const multiplier = mark.secondaryMark ? 2 : 1;
118
+ const isDualMark = mark.secondaryMark != null;
119
119
  // Maximum possible score
120
- acc.total += choices?.length
121
- ? choices.reduce((sum, choice) => sum + multiplier * choice.score, 0)
122
- : 1;
120
+ acc.total += isDualMark ? 4 : choices?.length ? 2 : 1;
123
121
  if (choices) {
124
122
  // paces product
125
123
  acc.userScore += MarkMap[mark.mark] ?? 0;
@@ -1,5 +1,5 @@
1
1
  import { gql } from '@apollo/client';
2
- import { EProductType, } from '../../../models';
2
+ import { EPaceMarkType, EProductType, } from '../../../models';
3
3
  import { COMPLETED_OSCE_STATION_FRAGMENT, OSCE_MARKSHEET_FIELDS, OSCE_MATCHMAKING_ACTION_FIELDS, OSCE_STATION_FIELDS, } from '../../fragments';
4
4
  export const START_OSCE_MATCHMAKING = gql `
5
5
  mutation StartOsceMatchmaking($sessionId: String!) {
@@ -100,9 +100,9 @@ export const MARK_OSCE_MARKSHEET_MARK = gql `
100
100
  `;
101
101
  export const getStationScore = (marks) => {
102
102
  const MarkMap = {
103
- 1: 2,
104
- 2: 1,
105
- 3: 0,
103
+ [EPaceMarkType.SATISFACTORY]: 2,
104
+ [EPaceMarkType.BORDERLINE]: 1,
105
+ [EPaceMarkType.UN_SATISFACTORY]: 0,
106
106
  };
107
107
  if (!marks?.length) {
108
108
  return {
@@ -112,11 +112,9 @@ export const getStationScore = (marks) => {
112
112
  }
113
113
  const { total, userScore } = marks.reduce((acc, mark) => {
114
114
  const choices = mark.osceStationMark?.choices;
115
- const multiplier = mark.secondaryMark ? 2 : 1;
115
+ const isDualMark = mark.secondaryMark != null;
116
116
  // Maximum possible score
117
- acc.total += choices?.length
118
- ? choices.reduce((sum, choice) => sum + multiplier * choice.score, 0)
119
- : 1;
117
+ acc.total += isDualMark ? 4 : choices?.length ? 2 : 1;
120
118
  if (choices) {
121
119
  // paces product
122
120
  acc.userScore += MarkMap[mark.mark] ?? 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "2.6.273",
3
+ "version": "2.6.275",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",