tango-app-api-trax 3.9.52 → 3.9.53

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-trax",
3
- "version": "3.9.52",
3
+ "version": "3.9.53",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -552,11 +552,21 @@ function mapSectionsFromQuestionAnswer( questionAnswer ) {
552
552
  }
553
553
 
554
554
 
555
- const max = q.compliance ? Math.max( ...q?.answers.map( ( o ) => o?.complianceScore ?? Math.max( o?.matchedCount ?? 0, o?.notMatchedCount ?? 0 ) ) ) : 0;
556
-
555
+ let max = q.compliance ? Math.max( ...q?.answers.map( ( o ) => o?.complianceScore ?? Math.max( o?.matchedCount ?? 0, o?.notMatchedCount ?? 0 ) ) ) : 0;
557
556
 
558
557
  let score = q.compliance ? Math.max( ...q?.userAnswer?.map( ( o ) => o?.complianceScore ?? 0 ) ) : 0;
559
558
 
559
+ // Single-choice questions answered 'NA' / 'N/A' (case-insensitive) are
560
+ // excluded from scoring entirely: both score and max are 0, so they add
561
+ // nothing to the section/total numerator or denominator.
562
+ if ( q.answerType === 'multiplechoicesingle' ) {
563
+ const naAnswer = ( ua?.answer || '' ).toString().trim().toLowerCase();
564
+ if ( naAnswer === 'na' || naAnswer === 'n/a' ) {
565
+ score = 0;
566
+ max = 0;
567
+ }
568
+ }
569
+
560
570
 
561
571
  if ( q.compliance && ( q.answerType === 'image' || q.answerType === 'image/video' ) ) {
562
572
  // image/video questions mix image + video entries in userAnswer, so only score the images.