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

Online text submissions causing PDF conversion problems when using google drive converter

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.3.2
    • Fix Version/s: 3.3.3
    • Component/s: Assignment
    • Labels:
    • Testing Instructions:
      Hide

      Test Prerequisites:

      • Ensure OAuth 2 services is setup and a system account is connected.
      • Ensure the Google Drive document converter is setup, enabled, and working (use the test page on the converter settings page to confirm)
      • Ensure unoconv is disabled. Remove the path in settings.
      • Ensure Annotate PDF in Assignment Feedback plugins is enabled.
      • Ensure the default editor is the Atto HTML editor

      Only files (regression test)

      1. Create an assignment with file submission enabled and online text submission disabled.
      2. Have a test student submit an html file in the assignment.
      3. Have a test teacher grade the submission and make sure the converted html file shows up in the Annotate PDF area.

      Files and text

      1. Now, as the teacher, enable online text submission in the assignment.
      2. As the student edit your submission so that it includes both online text and the html file and submit.
      3. Have the test teacher grade the submission and make sure the online submission and file are both converted and can be seen in the grader view.
      4. Have the student edit their submission to remove the text in the online submission.
      5. Have the test teacher grade the submission. Currently the PDF should contain a blank page and then the converted html. In the future it might contain only the converted html. See MDL-55789
      6. Have the test student delete the html file and add some text to the online text area.
      7. As the teacher, when graded make sure the online text is converted.

      Text Only

      1. As the teacher, edit the assignment and disable file submissions, leaving online text enabled.
      2. As the student, edit your submission, adding some new text to the online text area.
      3. As the teacher, confirm you see the single converted page of online text.

      Different editors (HTML vs plain text)

      Now, as admin, change the default editor to the plain text editor and repeat all tests steps listed above.

      Show
      Test Prerequisites: Ensure OAuth 2 services is setup and a system account is connected. Ensure the Google Drive document converter is setup, enabled, and working (use the test page on the converter settings page to confirm) Ensure unoconv is disabled. Remove the path in settings. Ensure Annotate PDF in Assignment Feedback plugins is enabled. Ensure the default editor is the Atto HTML editor Only files (regression test) Create an assignment with file submission enabled and online text submission disabled. Have a test student submit an html file in the assignment. Have a test teacher grade the submission and make sure the converted html file shows up in the Annotate PDF area. Files and text Now, as the teacher, enable online text submission in the assignment. As the student edit your submission so that it includes both online text and the html file and submit. Have the test teacher grade the submission and make sure the online submission and file are both converted and can be seen in the grader view. Have the student edit their submission to remove the text in the online submission. Have the test teacher grade the submission. Currently the PDF should contain a blank page and then the converted html. In the future it might contain only the converted html. See  MDL-55789 Have the test student delete the html file and add some text to the online text area. As the teacher, when graded make sure the online text is converted. Text Only As the teacher, edit the assignment and disable file submissions, leaving online text enabled. As the student, edit your submission, adding some new text to the online text area. As the teacher, confirm you see the single converted page of online text. Different editors (HTML vs plain text) Now, as admin, change the default editor to the plain text editor and repeat all tests steps listed above.
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-60319-master-google-converter-bug

      Description

      The google converter function in Moodle is not converting the plain-text in the Online text submission. It will be nice to add this functionality. I opened the discussion at https://moodle.org/mod/forum/discuss.php?d=359324 and here is my solution

      I edited the file

      files/converter/googledrive/classes/converter.php 

      and edited the converter class. I added the txt extension

      private static $imports = [
              'doc' => 'application/vnd.google-apps.document',
              'docx' => 'application/vnd.google-apps.document',
              'rtf' => 'application/vnd.google-apps.document',
              'xls' => 'application/vnd.google-apps.spreadsheet',
              'xlsx' => 'application/vnd.google-apps.spreadsheet',
              'ppt' => 'application/vnd.google-apps.presentation',
              'pptx' => 'application/vnd.google-apps.presentation',
              'txt' => 'application/vnd.google-apps.document'
          ];

      and also added txt in the array of get_supported_conversions(), line 269

       public function get_supported_conversions() {
              return implode(', ', ['rtf', 'doc', 'xls', 'docx', 'xlsx', 'ppt', 'pptx', 'pdf', 'txt']);
      {{    }}}

      I checked the code and it works without any problem.

       

      Added by Jake Dallimore:

      In addition to the above problem, any files submitted (assuming file submissions AND online text are both enabled on the assignment) are not displayed either because of the online text conversion failure. This is reported in MDL-60251 but I'm hopeful changes here will resolve that too. Please see This comment for a full list of what's not working with the g drive converter.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mspall Michael Spall
              Reporter:
              petko81 Peter Svec
              Peer reviewer:
              Jake Dallimore
              Integrator:
              Andrew Nicols
              Tester:
              Sara Arjona (@sarjona)
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/Nov/17