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

Drag-drop question types: remove the hard-coded maximum size limit on images

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Set up

      1. Log in as teacher or admin.
      2. Create a test course (or use an existing one)
      3. Open the Course cog menu and choose "More..."
      4. Under question bank, choose "Import"
      5. Import both of the attached XML files:
        1. drag-drop-marker.xml
        2. drag-drop-onto-image.xml

      Testing Drag-drop Marker

      1. In the question bank, for the imported question 'Pin the tail on the aardvark', click 'Edit -> Edit question'.
      2. Press Choose a file..
      3. Select the feedforward-big.jpg file
      4. Press upload this file.
      5. Verify the background image will not be scaled to 800x600px
      6. Save changes
      7. Go back to question bank, for the imported question 'Pin the tail on the aardvark', click 'Edit -> Preview'.
      8. Verify the background image will not be scale to 800x600px

      Testing Drag-drop onto image

      1. In the question bank, for the imported question 'Pin the tail on the aardvark 2', click 'Edit -> Edit question'.
      2. Press Choose a file..
      3. Select the feedforward-big.jpg file
      4. Press upload this file.
      5. Verify the background image will not be scaled to 800x600px
      6. Save changes
      7. Go back to question bank, for the imported question 'Pin the tail on the aardvark 2', click 'Edit -> Preview'.
      8. Verify the background image will not be scale to 800x600px
      Show
      Set up Log in as teacher or admin. Create a test course (or use an existing one) Open the Course cog menu and choose "More..." Under question bank, choose "Import" Import both of the attached XML files: drag-drop-marker.xml drag-drop-onto-image.xml Testing Drag-drop Marker In the question bank, for the imported question 'Pin the tail on the aardvark', click 'Edit -> Edit question'. Press Choose a file.. Select the feedforward-big.jpg file Press upload this file. Verify  the background image will not be scaled to 800x600px Save changes Go back to question bank, for the imported question 'Pin the tail on the aardvark', click 'Edit -> Preview'. Verify the background image will not be scale to 800x600px Testing Drag-drop onto image In the question bank, for the imported question 'Pin the tail on the aardvark 2', click 'Edit -> Edit question'. Press Choose a file.. Select the feedforward-big.jpg file Press upload this file. Verify  the background image will not be scaled to 800x600px Save changes Go back to question bank, for the imported question 'Pin the tail on the aardvark 2', click 'Edit -> Preview'. Verify the background image will not be scale to 800x600px
    • Affected Branches:
      MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_39_STABLE
    • Pull Master Branch:

      Description

      Since they were first created, the drag drop onto image question types have had a hard-coded maximum size limit on the background image (constants QTYPE_DDMARKER_BGIMAGE_MAXWIDTH/HEIGHT, QTYPE_DDIMAGEORTEXT_BGIMAGE_MAXWIDTH/HEIGHT and QTYPE_DDIMAGEORTEXT_DRAGIMAGE_MAXWIDTH/HEIGHT) used in calls to constrain_image_size_in_draft_area.

      Now that we have good responsive design (thanks to MDL-58645 and MDL-68382) these hard limits are not appropriate. We will just leave it up to the teacher to judge what sizes are appropraite (although we should probably prevent tacher from uploading drag-item images that are bigger than the background image - but probably the best place to detect that is in the form valdiation.)

      So, remove those constants, and the code that refers to them, and once that is done, it should be possible to create versions of the two attached questions (in .xml format) but using the full-sized backgroun image.

        Attachments

        1. drag-drop-markers-question.xml
          49 kB
        2. drag-drop-onto-image.xml
          49 kB
        3. feedforward-big.jpg
          feedforward-big.jpg
          259 kB
        4. Screenshot_1.png
          Screenshot_1.png
          675 kB
        5. Screenshot_2.png
          Screenshot_2.png
          566 kB

          Issue Links

            Activity

              People

              Assignee:
              HuongNV Huong Nguyen
              Reporter:
              timhunt Tim Hunt
              Peer reviewer:
              Tim Hunt
              Integrator:
              Andrew Nicols
              Tester:
              Janelle Barcega
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/Jun/20

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours, 50 minutes
                  2h 50m