Moodle
  1. Moodle
  2. MDL-29766

Add drag and drop capabilities to the Filemanager element

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.3
    • Fix Version/s: 2.3
    • Component/s: Files API
    • Labels:
    • Testing Instructions:
      Hide

      Test 1A: (Browser Detection)
      1. Verify that the upload repository is enabled and visible in site settings
      2. Go to a Forum
      3. Create a new post
      4. In attachment area see if 'You can drag and drop files...' is displayed continue..

      Expected Result
      • Visible on Google Chrome and Firefox (continue with tests 1B onwards) and IE10 Preview
      • Invisible on IE (less than 10), Safari, Opera (continue with test 2A)

      Test 1B: (Basic Functionality)
      1. Drag an image from your desktop (or a folder) into the attachments area and drop
      2. Submit the forum post

      Expected Result
      • Attachments area should change colour when dragged into box and then dropped and the file appear in the listing
      • When viewing the submitted post, the file should be attached and displayed

      Test 1C: (File Management)
      1. Drag an image from your desktop (or a folder) into the attachments area and drop
      2. Attempt to delete the file from the filemanager
      3. Drag and drop another file into the attachments area
      4. Rename the file

      Expected Result
      • Files renamed and deleted without problems

      Test 1D: (Max Filesize)
      1. Change the forum settings to set max file size of only 10KB
      2. Go to forum and drag and drop a file more than 10KB
      3. Go to forum and drag and drop a file less than 10KB

      Expected Result
      • Large file is not uploaded and an error message is returned informing the user its larger than max file size
      • Small file is uploaded successfully

      Test 1E: (Repository settings)
      1. Disable upload file repository in site settings
      2. Verify the You can drag and drop files...' message is not displayed
      3. Attempt to drag a file into the attachments box

      Expected Result
      • Drag and drop message is not displayed
      • When dragging files over the attachments box, the browser does not attempt to upload the file

      Test 1F: (Filepicker)
      1. Edit your  a user profile
      2. Scroll down to the user picture section
      3. In attachment area see if 'You can drag and drop files...' is displayed?
      4. Drag a picture into the box and submit form
      Expected Result
      • Picture is uploaded succesfully and displayed

      Test 1G: (Invalid file type)
      1. Go to Admin > Users > Accounts > Upload User Pictures
      2. Drag and drop a text file to the file attachment box
      Expected Result
      • An error message is reported that a text file is not accepted in this field

      Test 1H: (Subfolders)
      1. Add a folder resource to a course
      2. Drag and drop a file into the file area
      3. Click the 'create folder' button to create a subfolder, give it a name and press OK
      4. Click on the created folder
      5. Add some files in the created folder
      6. Click on the 'files' link to come out of the subfolder
      7. Drag and drop some more files into the top level folder
      8. Submit the folder resource
      Expected Result
      • All files should be uploaded and in place in the correct folders

      Test 2A: (Unsupported Browsers)
      1. Go to a Forum
      2. Create a new post
      3. In attachment area verify that 'You can drag and drop files...' is not displaed
      4. Upload a file using the repository plugins
      5. Try to delete files and rename files as normal,
      Expected Result
      • All behaviour works as previously to drag/drop

      Show
      Test 1A: (Browser Detection) 1. Verify that the upload repository is enabled and visible in site settings 2. Go to a Forum 3. Create a new post 4. In attachment area see if 'You can drag and drop files...' is displayed continue.. Expected Result • Visible on Google Chrome and Firefox (continue with tests 1B onwards) and IE10 Preview • Invisible on IE (less than 10), Safari, Opera (continue with test 2A) Test 1B: (Basic Functionality) 1. Drag an image from your desktop (or a folder) into the attachments area and drop 2. Submit the forum post Expected Result • Attachments area should change colour when dragged into box and then dropped and the file appear in the listing • When viewing the submitted post, the file should be attached and displayed Test 1C: (File Management) 1. Drag an image from your desktop (or a folder) into the attachments area and drop 2. Attempt to delete the file from the filemanager 3. Drag and drop another file into the attachments area 4. Rename the file Expected Result • Files renamed and deleted without problems Test 1D: (Max Filesize) 1. Change the forum settings to set max file size of only 10KB 2. Go to forum and drag and drop a file more than 10KB 3. Go to forum and drag and drop a file less than 10KB Expected Result • Large file is not uploaded and an error message is returned informing the user its larger than max file size • Small file is uploaded successfully Test 1E: (Repository settings) 1. Disable upload file repository in site settings 2. Verify the You can drag and drop files...' message is not displayed 3. Attempt to drag a file into the attachments box Expected Result • Drag and drop message is not displayed • When dragging files over the attachments box, the browser does not attempt to upload the file • Test 1F: (Filepicker) 1. Edit your  a user profile 2. Scroll down to the user picture section 3. In attachment area see if 'You can drag and drop files...' is displayed? 4. Drag a picture into the box and submit form Expected Result • Picture is uploaded succesfully and displayed Test 1G: (Invalid file type) 1. Go to Admin > Users > Accounts > Upload User Pictures 2. Drag and drop a text file to the file attachment box Expected Result • An error message is reported that a text file is not accepted in this field Test 1H: (Subfolders) 1. Add a folder resource to a course 2. Drag and drop a file into the file area 3. Click the 'create folder' button to create a subfolder, give it a name and press OK 4. Click on the created folder 5. Add some files in the created folder 6. Click on the 'files' link to come out of the subfolder 7. Drag and drop some more files into the top level folder 8. Submit the folder resource Expected Result • All files should be uploaded and in place in the correct folders Test 2A: (Unsupported Browsers) 1. Go to a Forum 2. Create a new post 3. In attachment area verify that 'You can drag and drop files...' is not displaed 4. Upload a file using the repository plugins 5. Try to delete files and rename files as normal, Expected Result • All behaviour works as previously to drag/drop
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      dragdrop-for-master
    • Rank:
      1294

      Description

      Allow the filemanager element to accept files dragged and dropped from the desktop (using new HTML 5 features)

        Issue Links

          Activity

            People

            • Votes:
              10 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: