@quesmed/types 2.6.47 → 2.6.49

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.
@@ -24,7 +24,8 @@ export declare enum EQuestionType {
24
24
  PRESCRIPTION_ANSWER = 4,
25
25
  EXTENDED_MATCHING_ANSWER = 5,
26
26
  SELECT_THREE_ANSWER = 6,
27
- RANKING_ANSWER = 7
27
+ RANKING_ANSWER = 7,
28
+ SBA_WITH_MULTIPLE_CHOICES = 8
28
29
  }
29
30
  export declare enum EQuestionLike {
30
31
  NONE = 0,
@@ -21,6 +21,7 @@ var EQuestionType;
21
21
  EQuestionType[EQuestionType["EXTENDED_MATCHING_ANSWER"] = 5] = "EXTENDED_MATCHING_ANSWER";
22
22
  EQuestionType[EQuestionType["SELECT_THREE_ANSWER"] = 6] = "SELECT_THREE_ANSWER";
23
23
  EQuestionType[EQuestionType["RANKING_ANSWER"] = 7] = "RANKING_ANSWER";
24
+ EQuestionType[EQuestionType["SBA_WITH_MULTIPLE_CHOICES"] = 8] = "SBA_WITH_MULTIPLE_CHOICES";
24
25
  })(EQuestionType = exports.EQuestionType || (exports.EQuestionType = {}));
25
26
  var EQuestionLike;
26
27
  (function (EQuestionLike) {
@@ -29,7 +30,10 @@ var EQuestionLike;
29
30
  EQuestionLike[EQuestionLike["DISLIKE"] = 2] = "DISLIKE";
30
31
  })(EQuestionLike = exports.EQuestionLike || (exports.EQuestionLike = {}));
31
32
  function isQuestionSBA(data) {
32
- return data.typeId === EQuestionType.SINGLE_BEST_ANSWER;
33
+ return [
34
+ EQuestionType.SINGLE_BEST_ANSWER,
35
+ EQuestionType.SBA_WITH_MULTIPLE_CHOICES,
36
+ ].includes(data.typeId);
33
37
  }
34
38
  exports.isQuestionSBA = isQuestionSBA;
35
39
  function isQuestionQA(data) {
@@ -33,6 +33,7 @@ exports.getLikeData = getLikeData;
33
33
  const getQuestionTypeName = (typeId) => {
34
34
  const mappedObj = {
35
35
  [models_1.EQuestionType.SINGLE_BEST_ANSWER]: 'QuestionSBA',
36
+ [models_1.EQuestionType.SBA_WITH_MULTIPLE_CHOICES]: 'QuestionSBA',
36
37
  [models_1.EQuestionType.QUESTION_ANSWER]: 'QuestionQA',
37
38
  [models_1.EQuestionType.MULTIPLE_ANSWERS]: 'QuestionMultiA',
38
39
  [models_1.EQuestionType.PRESCRIPTION_ANSWER]: 'QuestionPrescription',
@@ -51,7 +51,10 @@ function correctMark(mark) {
51
51
  const flatAnswer = answer[0];
52
52
  const jsonAnswer = typeof mark.mark === 'string' ? JSON.parse(mark.mark) : mark.mark;
53
53
  const flatAttempt = jsonAnswer[0];
54
- if (models_1.EQuestionType.SINGLE_BEST_ANSWER === mark.question.typeId) {
54
+ if ([
55
+ models_1.EQuestionType.SINGLE_BEST_ANSWER,
56
+ models_1.EQuestionType.SBA_WITH_MULTIPLE_CHOICES,
57
+ ].includes(mark.question.typeId)) {
55
58
  const answer = flatAnswer;
56
59
  const attempt = flatAttempt;
57
60
  if (answer === attempt) {
@@ -24,7 +24,8 @@ export declare enum EQuestionType {
24
24
  PRESCRIPTION_ANSWER = 4,
25
25
  EXTENDED_MATCHING_ANSWER = 5,
26
26
  SELECT_THREE_ANSWER = 6,
27
- RANKING_ANSWER = 7
27
+ RANKING_ANSWER = 7,
28
+ SBA_WITH_MULTIPLE_CHOICES = 8
28
29
  }
29
30
  export declare enum EQuestionLike {
30
31
  NONE = 0,
@@ -18,6 +18,7 @@ export var EQuestionType;
18
18
  EQuestionType[EQuestionType["EXTENDED_MATCHING_ANSWER"] = 5] = "EXTENDED_MATCHING_ANSWER";
19
19
  EQuestionType[EQuestionType["SELECT_THREE_ANSWER"] = 6] = "SELECT_THREE_ANSWER";
20
20
  EQuestionType[EQuestionType["RANKING_ANSWER"] = 7] = "RANKING_ANSWER";
21
+ EQuestionType[EQuestionType["SBA_WITH_MULTIPLE_CHOICES"] = 8] = "SBA_WITH_MULTIPLE_CHOICES";
21
22
  })(EQuestionType || (EQuestionType = {}));
22
23
  export var EQuestionLike;
23
24
  (function (EQuestionLike) {
@@ -26,7 +27,10 @@ export var EQuestionLike;
26
27
  EQuestionLike[EQuestionLike["DISLIKE"] = 2] = "DISLIKE";
27
28
  })(EQuestionLike || (EQuestionLike = {}));
28
29
  export function isQuestionSBA(data) {
29
- return data.typeId === EQuestionType.SINGLE_BEST_ANSWER;
30
+ return [
31
+ EQuestionType.SINGLE_BEST_ANSWER,
32
+ EQuestionType.SBA_WITH_MULTIPLE_CHOICES,
33
+ ].includes(data.typeId);
30
34
  }
31
35
  export function isQuestionQA(data) {
32
36
  return data.typeId === EQuestionType.QUESTION_ANSWER;
@@ -29,6 +29,7 @@ export const getLikeData = (like, item) => {
29
29
  export const getQuestionTypeName = (typeId) => {
30
30
  const mappedObj = {
31
31
  [EQuestionType.SINGLE_BEST_ANSWER]: 'QuestionSBA',
32
+ [EQuestionType.SBA_WITH_MULTIPLE_CHOICES]: 'QuestionSBA',
32
33
  [EQuestionType.QUESTION_ANSWER]: 'QuestionQA',
33
34
  [EQuestionType.MULTIPLE_ANSWERS]: 'QuestionMultiA',
34
35
  [EQuestionType.PRESCRIPTION_ANSWER]: 'QuestionPrescription',
@@ -46,7 +46,10 @@ export function correctMark(mark) {
46
46
  const flatAnswer = answer[0];
47
47
  const jsonAnswer = typeof mark.mark === 'string' ? JSON.parse(mark.mark) : mark.mark;
48
48
  const flatAttempt = jsonAnswer[0];
49
- if (EQuestionType.SINGLE_BEST_ANSWER === mark.question.typeId) {
49
+ if ([
50
+ EQuestionType.SINGLE_BEST_ANSWER,
51
+ EQuestionType.SBA_WITH_MULTIPLE_CHOICES,
52
+ ].includes(mark.question.typeId)) {
50
53
  const answer = flatAnswer;
51
54
  const attempt = flatAttempt;
52
55
  if (answer === attempt) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "2.6.47",
3
+ "version": "2.6.49",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",