Your Moodle version

Assignment feedbacks: PDF feedback

Maintained by Davo Davo Smith
This allows a teacher to annotate and return PDF files that have been submitted by students. Teachers can add and position comments and draw lines, ovals, stamps, rectangles and highlights onto the student's work, from within the browser.


This plugin is part of set Assignment: PDF.

This is part of the PDF annotation plugin for Moodle assignments.

Full instructions and information can be found in the submission part of this assignment plugin at:




Davo Smith (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Davo
    Tue, Mar 12, 2013, 9:21 PM
    I do not know what the ghostscript application is called on Mac.
    In linux, the application is called 'gs', so the full path to it would usually be:

    Under windows it is called gswin32c.exe, so the full path will be something like:

    You need to make sure you include the name of the ghostscript executable in the path, otherwise my code doesn't know what application to run. Try looking in the installation directory to see what is in there.
  • Picture of J Stringer
    Tue, Mar 12, 2013, 10:11 PM
    Hi Davo,

    Thanks for the quick response. I found the path, it's /usr/local/bin/gs. However, now it's giving me a new error:

    Unable to generate image - details: Command:/usr/local/bin/gs -q -sDEVICE=png16m -dSAFER -dBATCH -dNOPAUSE -r100 -dFirstPage=1 -
    dLastPage=1 -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -
    "/Applications/MAMP/data/moodle23/temp/assignfeedback_pdf/b49f17770402a698f61964a1db139b2a5b023d6a/sub/submission.pdf" 2>&1
    Result: in /usr/lib/libcups.2.dylib

    I feel like I'm getting closer though smile
  • Davo
    Tue, Mar 12, 2013, 10:22 PM
    I suggest you try and run the above command via the command line and check the error message it gives (you may find that the temporary files have been cleaned up, in which case, copy the PDF to another location and adjust the command line to point at the correct location).

    It looks like ghostscript is giving an error when trying to generate an image from the PDF you have uploaded. If that is the case, then there's not a lot I can do about it - you may want to make sure you have the latest version of ghostscript and then report a bug to the developers.
  • Picture of J Stringer
    Wed, Mar 13, 2013, 11:57 AM
    Hi Davo,

    I was able to use ghostscript to generate the image directly from the PDF. I'm thinking it has something to do with two different versions of libcups.2.dylib. One in the lib folder, one in the MAMP folder. The other possibility is that by default the Mac gs file is a shortcut to gs-x11. There's another version gs-nox11. I'd like to try that, but now I'm getting a new error when I try to create an assignment:

    Strict Standards: Declaration of assign_submission_pdf::get_files() should be compatible with assign_plugin::get_files(stdClass $submissionorgrade) in /Applications/MAMP/htdocs/moodle23/mod/assign/submission/pdf/locallib.php on line 789

    Do you know what might be causing this? Thanks again for your help. I'm a newbie at Moodle.
  • Davo
    Wed, Mar 13, 2013, 4:14 PM
    The function definition for assign_plugin::get_files() changed between Moodle 2.3 and Moodle 2.4. However, this shouldn't really matter - either ignore the message, turn off debugging or upgrade to Moodle 2.4.
  • Picture of J Stringer
    Tue, Apr 16, 2013, 12:31 PM
    Hi Davo,

    I have recently gotten back to setting up our Moodle server and I'm still getting the same errors for PDF Feedback. When I run the command directly on the server it works "/usr/local/bin/gs-X11 -q -sDEVICE=png16m -dSAFER -dBATCH -dNOPAUSE -r100 -dFirstPage=1 -dLastPage=1 -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -sOutputFile="/Applications/MAMP/data/moodle23/temp/assignfeedback_pdf/517e3a15ed98f10c079c7f0873e7c8656a57dbe1/img/image_page1.png" "/Applications/MAMP/data/moodle23/temp/assignfeedback_pdf/517e3a15ed98f10c079c7f0873e7c8656a57dbe1/sub/submission.pdf" 2>&1".

    The png file is generated and saved in "/Applications/MAMP/data/moodle23/temp/assignfeedback_pdf/517e3a15ed98f10c079c7f0873e7c8656a57dbe1/img/"

    When I try through Moodle I get the message "Unable to generate image" "Result: in /usr/lib/libcups.2.dylib". Do you this may have something to do with permissions?

    Thanks again,

  • Davo
    Tue, Apr 16, 2013, 3:19 PM
    I guess it will have something to do with permissions. I have no idea what though. If the command works properly when copied & pasted into the command line and the identical command fails to work when called via PHP, then there must be a problem with your web server configuration or the permissions.
  • Picture of J Stringer
    Tue, Apr 16, 2013, 3:32 PM
    Hi Davo,

    It had something to do with two different versions of the libcups.2.dylib file. One in the MAMP folder the other in the usr folder with GS. I've temporarily replaced the usr folder version with the version from the MAMP folder. It's now working, just hope the switch doesn't cause any unforeseen issues.
  • Picture of Monjur Morshed Bappy
    Sun, Jun 16, 2013, 3:18 PM
    Hi, I install both of PDF Submission and PDF Plugin. When I click Test ghostscript path, it says Internal Server Error.
    any kind of help is appreciated.
  • Davo
    Sun, Jun 16, 2013, 3:50 PM
    Hi. There's no need to post the same message on both parts of the plugin. Please can you turn on debugging on your server and then check for any error messages (either on screen or in you Web server logs).
  • Richard
    Sun, Feb 2, 2014, 12:36 PM
    Since I've installed the PDF Feedback plugin I've been unable to backup my courses in which I've used the plugin. I keep getting an "error/baseelementexisting" when making a backup. I read somewhere that someone thought it was a php error so my tech guys upgraded php to 5.5.8 but I still get the error. I would appreciate any suggestions here. I've got many hours into these courses but no way to back them up.
  • Davo
    Mon, Feb 3, 2014, 4:03 AM
    Richard - I'll see if I can reproduce that error message, but first can you check that backing up a course without any assignments using my plugin works? Also can you check that you can backup a course which uses my plugin by not including that assignment in the backup?

    Turning on debugging on your site ( ), to generate a longer error message, could also be helpful.
  • Richard
    Mon, Feb 3, 2014, 10:24 PM
    Davo, I no longer think it is your plugin, it will not make a backup when I add an assignment to a course no matter the type. Thanks for the quick response. I'll look elsewhere and see what I can find.
  • Picture of Andrew Houston
    Thu, Mar 20, 2014, 6:40 PM
    Hi. Our teachers live the plugin smile I was just wondering though, some of them are using the plugin where students submit the upto assignment 3 times, they have a standard feedback sheet that leaves space for feedback from all 3 attempts. Is there a way to carry feedback across from previous attempts onto the new attempt ?
  • Davo
    Thu, Mar 20, 2014, 7:33 PM
    Andrew - I'm afraid there is no way to carry feedback across from one attempt to the next (the 'create new submission based on last submission' code only supports 'submission' plugins, not feedback plugin). I am not sure it would work well, even if it were supported - if a new submission had a different number of pages from the old submission, or the pages were in a different order, then the feedback would no longer match the pages on which it was found.
1 2
Please login to post comments