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

File conversion API should be a plugin interface

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      Pre-requisites
      1. unoconv installed and working on the host system
      2. ghostscript installed and working on the host system
      3. ghostscript configured in Moodle
      4. A range of documents (.doc, .docx, .xls, .xlsx, .html) including some with several files, images, etc.
      Upgrade test 1
      1. Before upgrade, ensure that $CFG->pathtounoconv is (validly) set
      2. Perform the upgrade
        1. Confirm that after upgrade, the fileconverter_unoconv plugin is enabled
      Upgrade test 2
      1. Before upgrade, ensure that $CFG->pathtounoconv is set invalidly in some way (i.e. an old version of unoconv)
      2. Perform the upgrade
        1. Confirm that after upgrade, the fileconverter_unoconv plugin is disabled
      Upgrade test 3
      1. Before upgrade, ensure that $CFG->pathtounoconv is not set at all
      2. Perform the upgrade
        1. Confirm that after upgrade, the fileconverter_unoconv plugin is disabled
      Admin UI tests
      1. Install the attached fileconverter_example test plugin
      2. Install the attached fileconverter_drive test plugin
      3. Navigate to https://console.developers.google.com/apis
        1. create a new project
        2. enable the Drive API
        3. configure the consent screen
        4. obtain an oauth key using the "Other" option
        5. Download the key and place it in files/converter/drive/client_secret.json
        6. In CLI run php files/converter/drive/login.php and follow directions
      4. Navigate to the Document converters section of the Site administration -> Plugins
      5. Use the up/down enable/disable links
        1. Confirm that the admin UI behaves as expected
      Edit PDF tests
      1. Set up an editpdf assignment
      2. Upload PDFs for a couple of users
      3. View the grading interface and confirm that:
        1. PDFs are generated correctly
        2. All pages can be navigated through
        3. Annotations can be stored, saved, and fetched
      4. View a user who has not uploaded anything yet
        1. Confirm that an empty image is shown
      5. Upload a PDF for that user but do not view it in the UI
      6. Run the CLI task for submission conversion:

        php admin/tool/task/cli/schedule_task.php --execute="\assignfeedback_editpdf\task\convert_submissions"
        

        1. Confirm that no errors were shown
      7. View it in the grading interface
        1. Confirm that it was shown pretty quickly
      8. Upload a large document
      9. Open grading interface and open the Network tab in your developer tools
      10. Navigate to the user's PDF and wait for the images to be generated
      11. Examine each network call that was made and check how the polling proceeded
        1. Confirm that there were no errors
      12. Create a new assignment and enable text input instead of file upload
      13. Enter some text for various users
        1. Confirm that the PDFs can be generated correctly for the uploaded text (Note: we don't support conversion of media uploaded with the HTML to be included*
      14. For both assignments, enter grades and release the assignments
      15. As each user, view the PDF complete with annotations.
      Further testing
      1. General smoke test
      Show
      Pre-requisites unoconv installed and working on the host system ghostscript installed and working on the host system ghostscript configured in Moodle A range of documents (.doc, .docx, .xls, .xlsx, .html) including some with several files, images, etc. Upgrade test 1 Before upgrade, ensure that $CFG->pathtounoconv is (validly) set Perform the upgrade Confirm that after upgrade, the fileconverter_unoconv plugin is enabled Upgrade test 2 Before upgrade, ensure that $CFG->pathtounoconv is set invalidly in some way (i.e. an old version of unoconv) Perform the upgrade Confirm that after upgrade, the fileconverter_unoconv plugin is disabled Upgrade test 3 Before upgrade, ensure that $CFG->pathtounoconv is not set at all Perform the upgrade Confirm that after upgrade, the fileconverter_unoconv plugin is disabled Admin UI tests Install the attached fileconverter_example test plugin Install the attached fileconverter_drive test plugin Navigate to https://console.developers.google.com/apis create a new project enable the Drive API configure the consent screen obtain an oauth key using the "Other" option Download the key and place it in files/converter/drive/client_secret.json In CLI run php files/converter/drive/login.php and follow directions Navigate to the Document converters section of the Site administration -> Plugins Use the up/down enable/disable links Confirm that the admin UI behaves as expected Edit PDF tests Set up an editpdf assignment Upload PDFs for a couple of users View the grading interface and confirm that: PDFs are generated correctly All pages can be navigated through Annotations can be stored, saved, and fetched View a user who has not uploaded anything yet Confirm that an empty image is shown Upload a PDF for that user but do not view it in the UI Run the CLI task for submission conversion: php admin/tool/task/cli/schedule_task.php --execute="\assignfeedback_editpdf\task\convert_submissions" Confirm that no errors were shown View it in the grading interface Confirm that it was shown pretty quickly Upload a large document Open grading interface and open the Network tab in your developer tools Navigate to the user's PDF and wait for the images to be generated Examine each network call that was made and check how the polling proceeded Confirm that there were no errors Create a new assignment and enable text input instead of file upload Enter some text for various users Confirm that the PDFs can be generated correctly for the uploaded text (Note: we don't support conversion of media uploaded with the HTML to be included* For both assignments, enter grades and release the assignments As each user, view the PDF complete with annotations. Further testing General smoke test
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull Master Branch:
      MDL-55528-master

      Description

      In 3.1, the File API added the ability to convert files, but local unoconv was a requirement.

      There are various web services and different applications that can do this conversion work.

      I would be really good if the file conversion was handled by a plugin interface, so sites can easily install different conversion services.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                41 Vote for this issue
                Watchers:
                38 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  15/May/17