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

Assignfeedback_editpdf sending infinite request when page ready is not equal to page number of combined pdf

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Development in progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.6.6, 3.7.2
    • Fix Version/s: None
    • Component/s: Assignment
    • Testing Instructions:
      Hide
      1. Create an assignment with assignfeedback_editpdf turned on, and file submissions
      2. Open an SQL connection to your database
      3. Do a SELECT * FROM mdl_files ORDER BY id DESC;
      4. You should get the list of the most recent files
      5. Submit a file to the assignment
      6. Do a SELECT * FROM mdl_files ORDER BY id DESC;
      7. You should see the file appear
      8. Go into the assignment and open the grading interface for the submission, and you should see a Generating PDF message
      9. Let the PDF generation complete
      10. Do a SELECT * FROM mdl_files ORDER BY id DESC;
      11. You should now see a file entry, that shares the same context id, in the assignfeedback_editpdf component, for combined.pdf, as  well as files in the pages file area (one per page in the combined PDF)
      12.  Delete one or more pages entries from mdl_files, for example: Do a  DELETE FROM mdl_files WHERE contenthash='d97dcc4ffb23caf011a5e834a941d409c5d83746' AND filearea='pages'; Replace the contenthash with yours
      13.  Instead of seeing less image pages than the actual document has, this screen should take a bit longer to re-generate the pages and the number of pages should be the same as the actual pdf has. 
      Show
      Create an assignment with assignfeedback_editpdf turned on, and file submissions Open an SQL connection to your database Do a SELECT * FROM mdl_files ORDER BY id DESC; You should get the list of the most recent files Submit a file to the assignment Do a SELECT * FROM mdl_files ORDER BY id DESC; You should see the file appear Go into the assignment and open the grading interface for the submission, and you should see a Generating PDF message Let the PDF generation complete Do a SELECT * FROM mdl_files ORDER BY id DESC; You should now see a file entry, that shares the same context id, in the assignfeedback_editpdf component, for combined.pdf, as  well as files in the pages file area (one per page in the combined PDF)  Delete one or more pages entries from mdl_files, for example: Do a  DELETE FROM mdl_files WHERE contenthash='d97dcc4ffb23caf011a5e834a941d409c5d83746' AND filearea='pages'; Replace the contenthash with yours  Instead of seeing less image pages than the actual document has, this screen should take a bit longer to re-generate the pages and the number of pages should be the same as the actual pdf has. 
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull from Repository:
    • Pull 3.6 Branch:
      MOODLE_36_STABLE-MDL-66626
    • Pull 3.7 Branch:
      MOODLE_37_STABLE-MDL-66626
    • Pull Master Branch:
      master-MDL-66626

      Description

      Not sure how it went in to this state, but it is happening.  On grading screen (http://localhost/mod/assign/view.php?id=2&rownum=0&action=grader&userid=3) , it shows there are 4 pages. but if we download the actual submission document which is a pdf. This pdf has 7 pages.  We are only able to see first 4 pages on the grading screen. For some reasons, the last 3 pages were failed to be converted to pages. We also noticed this request 

      http://localhost/mod/assign/feedback/editpdf/ajax.php?sesskey=411DWR792Y&action=pollconversions&userid=3&attemptnumber=0&assignmentid=1&readonly=0

      pageready is less than page count. page count number is comming from combined pdf, and the page ready is from file storage. Then, the web page run into infinite requests 

      http://localhost/mod/assign/feedback/editpdf/ajax_progress.php?sesskey=411DWR792Y&action=conversionstatus&userid=3&attemptnumber=0&assignmentid=1

      and this request keeps returning the number of page ready, and the grading screen never self-correct/recover the missing 3 pages. 

       

      Again, we are not sure about how some pages failed to convert in the first place. But here are the steps to replicate this bug:

      1. Create an assignment with assignfeedback_editpdf turned on, and file submissions
      2. Open an SQL connection to your database
      3. Do a SELECT * FROM mdl_files ORDER BY id DESC;
      4. You should get the list of the most recent files
      5. Submit a file to the assignment
      6. Do a SELECT * FROM mdl_files ORDER BY id DESC;
      7. You should see the file appear
      8. Go into the assignment and open the grading interface for the submission, and you should see a Generating PDF message
      9. Let the PDF generation complete
      10. Do a SELECT * FROM mdl_files ORDER BY id DESC;
      11. You should now see a file entry, that shares the same context id, in the assignfeedback_editpdf component, for combined.pdf, as  well as files in the pages file area (one per page in the combined PDF)
      12.  Delete one or more pages entries from mdl_files, for example: Do a  DELETE FROM mdl_files WHERE contenthash='d97dcc4ffb23caf011a5e834a941d409c5d83746' AND filearea='pages'; Replace the contenthash with yours
      13. Go back to the grading screen of the assignment. You should see the pages are less than pages in the actual submission file. 

      Not sure about the best way to address this. In current version of editpdf. The js does take this situation into account

      https://github.com/moodle/moodle/blob/master/mod/assign/feedback/editpdf/yui/src/editor/js/editor.js#L501

      However, seems relying on the same backend action to correct the pages? calling 'pollconversions'

      https://github.com/moodle/moodle/blob/master/mod/assign/feedback/editpdf/yui/src/editor/js/editor.js#L531

       

      This might be related to MDL-63540 and this MDL-63425 might be better. It seems removing the the combined pdf record in mdl_files can re-trigger the whole page generation, not sure if this is the way we should go.  Please help verify. 

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                yao9394 John Yao
                Reporter:
                yao9394 John Yao
                Peer reviewer:
                Peter Dias
                Participants:
                Component watchers:
                Damyon Wiese, Adrian Greeve, Mihail Geshoski, Peter Dias
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 minute
                  1m