@quesmed/types 2.6.213 → 2.6.214

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.
@@ -80,7 +80,12 @@ function evaluateMark({ mark, answer, questionTypeId, psaSectionId, choices, })
80
80
  const normalizedAttempt = flatAttempt
81
81
  ? flatAttempt.toLowerCase().replace(/\s/g, '')
82
82
  : '';
83
- if (normalizedAnswer === normalizedAttempt) {
83
+ const answerNum = Number.parseFloat(normalizedAnswer);
84
+ const attemptNum = Number.parseFloat(normalizedAttempt);
85
+ const isNumericMatch = !Number.isNaN(answerNum) &&
86
+ !Number.isNaN(attemptNum) &&
87
+ answerNum === attemptNum;
88
+ if (isNumericMatch || normalizedAnswer === normalizedAttempt) {
84
89
  // for psa section, we give 2 marks for correct answer
85
90
  data.score = psaSectionId ? 2 : 1;
86
91
  data.result = models_1.EMarkResult.Correct;
@@ -77,7 +77,12 @@ export function evaluateMark({ mark, answer, questionTypeId, psaSectionId, choic
77
77
  const normalizedAttempt = flatAttempt
78
78
  ? flatAttempt.toLowerCase().replace(/\s/g, '')
79
79
  : '';
80
- if (normalizedAnswer === normalizedAttempt) {
80
+ const answerNum = Number.parseFloat(normalizedAnswer);
81
+ const attemptNum = Number.parseFloat(normalizedAttempt);
82
+ const isNumericMatch = !Number.isNaN(answerNum) &&
83
+ !Number.isNaN(attemptNum) &&
84
+ answerNum === attemptNum;
85
+ if (isNumericMatch || normalizedAnswer === normalizedAttempt) {
81
86
  // for psa section, we give 2 marks for correct answer
82
87
  data.score = psaSectionId ? 2 : 1;
83
88
  data.result = EMarkResult.Correct;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "2.6.213",
3
+ "version": "2.6.214",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",