Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-54575

mod_scorm_mod_form typo fix

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.2, 3.1.2
    • Fix Version/s: 3.1.3
    • Component/s: SCORM
    • Labels:
    • Testing Instructions:
      Hide

      I'm not sure how best to test this - if height is set, so will the width, so it won't present as an issue, just a typo.
      Probably safe to test creating a scorm package with display set to new window, and the height/width to values under 100 and make sure it works as expected.

      Regression test instructions:

      1. Create a new scorm activity but before saving:
        • Expand the 'Appearance' section
        • Set 'Display package' to 'New window'
        • Click more to show more options
        • Enter '50' into both the width and height boxes
      2. Save the activity
      3. Edit the activity and Confirm that both the 'width' and 'height' field you edited before now have a '%' sign appended to them. E.g. '50%'
      4. Exit the edit page and view the activity. Preview mode is fine.
      5. Confirm that the new window is 50% of the screen width and height.
      6. Edit the activity again and set the height and width to 200.
      7. Save the activity and edit it again.
      8. Confirm that no percentage sign has been appended to the height and width. Eg. '200' is all you see.
      9. Exit edit mode and view the activity again - preview mode is fine.
      10. Confirm that the new window is now smaller (200px by 200px).
      Show
      I'm not sure how best to test this - if height is set, so will the width, so it won't present as an issue, just a typo. Probably safe to test creating a scorm package with display set to new window, and the height/width to values under 100 and make sure it works as expected. Regression test instructions: Create a new scorm activity but before saving: Expand the 'Appearance' section Set 'Display package' to 'New window' Click more to show more options Enter '50' into both the width and height boxes Save the activity Edit the activity and Confirm that both the 'width' and 'height' field you edited before now have a '%' sign appended to them. E.g. '50%' Exit the edit page and view the activity. Preview mode is fine. Confirm that the new window is 50% of the screen width and height. Edit the activity again and set the height and width to 200. Save the activity and edit it again. Confirm that no percentage sign has been appended to the height and width. Eg. '200' is all you see. Exit edit mode and view the activity again - preview mode is fine. Confirm that the new window is now smaller (200px by 200px).
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull Master Branch:
      master_MDL-54575

      Description

      In the mod_scorm_mod_form::data_preprocessing() function ( vide moodle\mod\scorm\mod_form.php ), the intention is to append a percent sign to the displayed width and height values when certain conditions are met.  However, for the height value, there is a typo that should be fixed.

        // Fix:  in isset(), check for keyword 'height' instead of 'width'
        if ( isset($defaultvalues['width'] )
          && (strpos($defaultvalues['height'], '%') === false)
          && ($defaultvalues['height'] <= 100) ) 
        {
          $defaultvalues['height'] .= '%';
        }
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Nov/16