Fixing some regex issues and adding additional API tests

This commit is contained in:
Jonathan Putney
2020-02-04 15:14:42 -05:00
parent b272dda384
commit 0357442e93
7 changed files with 56 additions and 27 deletions

View File

@@ -272,7 +272,7 @@ export default class Scorm2004API extends BaseAPI {
}
const response_type = correct_responses[interaction_type];
if (typeof response_type.limit !== 'undefined' || interaction_count <
if (typeof response_type.limit === 'undefined' || interaction_count <=
response_type.limit) {
let nodes = [];
if (response_type?.delimiter) {

View File

@@ -51,8 +51,8 @@ const scorm2004 = {
CMISInteger: '^-?([0-9]+)$',
CMIDecimal: '^-?([0-9]{1,5})(\\.[0-9]{1,18})?$',
CMIIdentifier: '^\\S{1,250}[a-zA-Z0-9]$',
CMIShortIdentifier: '^[\\w\.]{1,250}$', // eslint-disable-line
CMILongIdentifier: '^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000})$',
CMIShortIdentifier: '^[\\w\\.\\-\\_]{1,250}$', // eslint-disable-line
CMILongIdentifier: '^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$', // need to re-examine this
CMIFeedback: '^.*$', // This must be redefined
CMIIndex: '[._](\\d+).',
CMIIndexStore: '.N(\\d+).',