@quesmed/types-rn 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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types-rn",
3
- "version": "2.6.47",
3
+ "version": "2.6.49",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",
@@ -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) {