Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.9
    • Fix Version/s: 1.9.11
    • Component/s: SCORM
    • Labels:
      None
    • Environment:
      Debian Linux, Apache, Moodle 1.9.9
    • Database:
      MySQL
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      1349

      Description

      During the hand-in phase of our SCORM 2004 3rd Edition content Moodle presents a "not enough choices: cmi.interactions.N6.correct_responses.N0.pattern" JavaScript alert box and then many consequential ones such as error 408 "Data Model Element Collection Set Out Of Order".

      The first alert box appears within Moodle's validation when setting the CMI data model property cmi.interactions.N6.correct_responses.N0.pattern

      This happens with a multiple choice question (4 choices) with a single correct response ("D").

      elementmodel = "cmi.interactions.n.correct_responses.n.pattern"
      element = "cmi.interactions.N6.correct_responses.N0.pattern"
      value = "D";
      interactiontype = "choice"

      The code presenting the error uses the following logic, given that the nodes array in this case represents the possible correct responses of which a single item is sufficient to fulfil the multiple-choice interaction type:

      if (interactiontype == 'choice' && nodes.length == 1) {
      alert('not enough choices: ' + element);
      }

      To replicate, try the attached package on the Moodle demo site or a local instance and proceed to the final page from the combo-box at the bottom. Click the 'Submit' button on the right, agree to Hand-in and await the errors.

      The faulting code resides within /mod/scorm/datamodels/scorm_13.js.php (around line 582)

        Issue Links

          Activity

          Hide
          Peter Chamberlin added a comment -

          The follow-up JavaScript data model errors occur because the regular expression pattern for "cmi.interactions.n.id" is "^\S

          {0,4000}

          [a-zA-Z0-9]$" in Moodle's SCORM 2004 support.

          The cmi.interactions.n.id data model property is of type long_identifier_type - a URI (RFC 3986), or a recommended URN (RFC 2141) - subject to condition that it is not an empty string, does not consist of all white space, and that at least 4,000 character storage is provided.

          It seems that the current regular expression could be better written to enforce the minimum bound without limiting the validation pattern for the final character, i.e. "^\S

          {1,4000}

          $"

          Show
          Peter Chamberlin added a comment - The follow-up JavaScript data model errors occur because the regular expression pattern for "cmi.interactions.n.id" is "^\S {0,4000} [a-zA-Z0-9] $" in Moodle's SCORM 2004 support. The cmi.interactions.n.id data model property is of type long_identifier_type - a URI (RFC 3986), or a recommended URN (RFC 2141) - subject to condition that it is not an empty string, does not consist of all white space, and that at least 4,000 character storage is provided. It seems that the current regular expression could be better written to enforce the minimum bound without limiting the validation pattern for the final character, i.e. "^\S {1,4000} $"
          Hide
          Dan Marsden added a comment -

          Thanks Peter - this sounds similar to MDL-24529 as well

          I've got my head in lots of work at the moment - will try to have a look at your comments sometime next week - remind me again if I haven't updated this by end of next week!

          thanks

          Show
          Dan Marsden added a comment - Thanks Peter - this sounds similar to MDL-24529 as well I've got my head in lots of work at the moment - will try to have a look at your comments sometime next week - remind me again if I haven't updated this by end of next week! thanks
          Hide
          Dan Marsden added a comment -

          Hi Peter,

          thanks for the great report! - I've fixed the regex and removed the code which displays the alert - I wonder if the code was supposed to check if the length <> 1 and throw a debugging notice if it doesn't match? - in any case using an alert is silly as it interferes with the user experience so I've removed the code completely for now - If/when we get funding for 2004 work we might need to add some form of validation check for "choice" type interactions to make sure they contain 1 response.

          thanks,

          Show
          Dan Marsden added a comment - Hi Peter, thanks for the great report! - I've fixed the regex and removed the code which displays the alert - I wonder if the code was supposed to check if the length <> 1 and throw a debugging notice if it doesn't match? - in any case using an alert is silly as it interferes with the user experience so I've removed the code completely for now - If/when we get funding for 2004 work we might need to add some form of validation check for "choice" type interactions to make sure they contain 1 response. thanks,

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: