Possibly related and/or duplicative of MDL-62626, MDL-63425, and MDL-64801: It appears that the functionality introduced in
MDL-56122 is no longer functioning on current supported versions of Moodle. In my test I have Unoocnv listener and soffice setup correctly/enabled and Unoconv does work to convert my test document on the first attempt when the listener is running on M35. However if I shut the listener off and visit the grading page to generate a blank PDF, then start the listener and revisit the page it should detect the blank PDF value and attempt to regenerate it from the submitted .docx assignment according to the changes that were made in that issue. However it is not doing this on Moodle 3.5.11+ (Build: 20200312) or 3.7.5 (Build: 20200309), at least partially because the hash value of 'combined.pdf' which is retrieved does not match the one defined in the constant BLANK_PDF_HASH within /mod/assign/feedback/editpdf/classes/document_services.php per blank-document-contenthash-mismatch.png. I've traced through this some and it appears that the list_compatible_submission_files_for_attempt() function called from within get_combined_document_for_attempt() does not return the blank PDF with given hash value - the only place the related BLANK_PDF_BASE64 value is used to output a blank PDF is at ./mod/assign/feedback/editpdf/classes/combined_document.php:364 within the store_empty_document() function, which doesn't seem to be called when the document conversion request is done through the grading preview pane.
Steps to reproduce on Ubuntu 16.04.6 LTS are:
- Install Unoconv and dependencies - note this installs unoconv 0.7 on my system:
- Place following contents in new systemd file at /etc/systemd/system/unoconv.service for running unoconv as a service per https://moodle.org/mod/forum/discuss.php?d=359239 (may need to confirm UNO_PATH matches correct location of libreoffice on your system):
- Start Unoconv listener
- Confirm listener running:
- Enable unoconv document conversion in site-wide settings under Site Administration -> Plugins -> Document converters -> Manage document converters
- Login as the site admin and create a test course with two enrolled test students
- Create a test assignment with the following settings:
- Under Submission types check both Online text and File submissions
- Under Feedback types check Annotate PDF
- Login as the first test user and submit a valid .docx file to complete the assignment, such as the "testassignment1.docx" one attached
- Login as the second test student and submit some online text to complete the assignment
- HERE IS A GOOD PLACE TO TAKE A SNAPSHOT OF YOUR VM IF POSSIBLE FOR REPEATED TESTING
- Stop the Unoconv listener:
- Login as the site admin and click on the test assignment, then click View all submissions, then click the Grade button on the first (File upload) assignment - the Grading page should load with the preview pane and fail to create a PDF of the document, generating a blank PDF instead.
- Click the next arrow to move to the second submission
- Restart the Unoconv listener on the server:
- Go back into the grading preview pane and navigate between the assignments, which will regenerate the PDFs (i.e. only the blank PDF will continue to display for both assignments)
A few other notes:
- When I try to download the test PDF from the Unoconv settings page, it results in the following error - this is strange to me because I'm certain that I successfully downloaded and viewed it at some point during testing, but all I'm getting at present is the following error:
- On 3.7.5 (Build: 20200309) the uploaded .docx submission is now failing to convert on the first try in the grading preview pane even when the listener is running, although this was working previously and I'm testing on the exact same saved snapshot I was using yesterday. Another thing to note is that an online text submission convert successfully on the first try.
- I'm seeing some conflicting information based on the fact that this functionality definitely seems to have existed in Moodle previously, but there are newer feature requests asking for functionality to manually re-convert to PDF in the preview pane. So just to clarify my expectations, is automated re-conversion in the preview pane something that we should expect to work at present? Or was this feature removed at some point?