Online PDF marking/annotation assignment module

Online PDF marking/annotation assignment module

by Davo Smith -
Number of replies: 54
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I'm looking for some people who would be willing to try out and give me feedback on a new module I've developed for marking PDF files online.

It allows you to pull up each page of the PDF as an image in a web browser window, to add annotations to the page and then return the newly-annotated PDF to the student.

It works on the server with a combination of ghostscript, FPDI and TCPDF, with some Mootools thrown in on the client. There is no need for any plugins to be installed on the client side.

It is yet not ready for a production server (I've only just finished it after a couple of weeks work) and there are a few ideas I haven't yet implemented (automated coversheet adding being the main one, as well as alternative annotation colours and possibly boxes / lines).

Any suggestions / bug reports / fixes would be very welcome...

As it is a bit too large to attach to this post (due to the TCPDF library which I have included to save a separate download), you can find it here:

http://dl.getdropbox.com/u/933969/uploadpdf.zip


I've tested it with Moodle 1.8 and 1.9.

Oh and I haven't put and License info in it yet, but I'm sure I'll be putting it out under the GPL (once I've double-checked all the licenses for the files I'm bundling with it).
Average of ratings: -
In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by shen yiching -
It`s absolutely terrific teaching tool. But as I open student`s file(submission.pdf),the chinese texts disply serious distortion. I edit some annotation and save it,the chinese texts change to "???"  when I open the file (response.pdf ).
In reply to shen yiching

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Just to be clear - are you talking about the Chinese text in the original document, or in the comments?

If there are problems with the text when you first view it, then that is an issue with GhostScript. First, could you make sure you have the most up-to-date version of GhostScript installed.

Second, can you try the running following command line:

(For Windows):
<path to ghostscript install>/gswin32c -sDEVICE=png16m -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -sOutputFile=image%d.png <name of PDF to test>

(For Linux)
gs -sDEVICE=png16m -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -sOutputFile=image%d.png <name of PDF to test>

(Where <name of PDF to test> should, obviously, be replaced with the name of a PDF).

Look at the images produced (which should be called image1.png, image2.png, and so on for each page) and see if they are alright. If not, see if you can file a bug report on the GhostScript website.

If there are problems with the comments added to the file, then I will have to check out whether my code is properly supporting UTF8 (which it is supposed to be doing).
If you move to a different page in the document (whilst editing comments) then move back to the previous page, do all the comments display correctly?
Are there problems with the main text of the final file? (or just the comments?)
Problems with the output will be down to the FPDI/TCPDF libraries I have used.

Are you able to attach a small example of a PDF that does not work (and possibly an example of the result produced)?
In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by shen yiching -
I use the acrobat 8 professional and did not install ghostscript . Attachfile is my 2 pdf files diplaying windows.
In reply to shen yiching

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
If ghostscript is not installed on your Moodle Server, then my plugin would not be working at all (it uses GhostScript to create the pictures that you add annotations to).

From what I could make out in your attached file, the ghostscript side of things seems to be working, but not the export (is everything OK in the top part of the picture?)

I may be able to fix the question marks in the comment output, by switching to a different font, but I have no way of testing this as I am unable to enter (or understand) Chinese characters.

As for the distortion in the original text, I don't really have any control over that at all, my code just calls the FPDI library to load the original PDF and copy each page, one at a time - the only modifications I make are using the TCPDF library to add the extra annotations on top. Maybe you could try and find out if that is a known problem with those libraries (again, without any PDFs in Chinese, it is difficult for me to attempt a fix).
In reply to shen yiching

Re: Online PDF marking/annotation assignment module

by ray chan -

I have the problem when using the uploadpdf module. It display "??" for the chinese character in the response.pdf. Please advise the solution.

By the way, I find the chinese.php, chinese-unicode.php files that can make fpdi support unicode. But I don't know how to manipulate it. 

In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by ray chan -

Actually this plugin is good for onscreen marking. I can only draw straight line using the plugin. If I would like to draw other symbol like circle, tick, insert (i.e. /\) etc. Is it difficult to modify the code to get that? Which file in your plugin should I modify?

In reply to ray chan

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I did not add any other forms of drawing as I wanted to keep the user interface simple & quick to use - n/p to choose page, click to add text, ctrl+click to add a line.

However, if you want to add other shapes to your local version, you will need to edit the following files (off the top of my head - I don't have any code in front of me at the moment):

  • assignment.class.php - add any extra UI elements to select the shape, add code to handle the new shape data coming back from the client + save to the database, add code to pass the new shapes onto the PDF drawing routines
  • lang/en_utf8/assignment_uploadpdf.php - add any extra language strings needed by the UI
  • scripts/annotate.js - add code to allow drawing of the shapes (probably the largest bit of work) and communicate the data back to the server
  • mypdflib.php - add code to draw all the shapes onto the PDF

If you can come up with a neat way of adding this without overcomplicating the UI, then I might be interested in updating the module, but I don't want to add anything unnecessary to it.

Average of ratings: Useful (1)
In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by ray chan -
I have found some tick, cross symbol in png format and decide to put it into the pdf. But is there any functions in your module I can call to do it? If not, do you mind if give me some instruction on doing it? The sourcecode is quite complicated and seems difficult to me.

One way I think is to edit the annotate.js by adding another function for inserting the graphics onto the pdf.
In reply to ray chan

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I have tried to make the source code as clear as possible, but unfortunately there is a lot that it needs to do, so there is a limit to how clear I can make it.

There are quite a few parts to the changes that you will need to make:

  1. Change the page layout to add the interface for adding ticks, crosses, etc. (this is in 'assignment.class.php' - function 'edit_comment_page')
  2. Add code to annotate.js to allow the positioning of the symbols (you should read up on MooTools, as that is the javascript library I used, before I realised that Moodle uses YUI)
  3. Add code to annotate.js to send this information back to the server.
  4. Add code to 'assignment.class.php' - function 'update_comment_page' to handle this and save to database (you might want to just use the 'addannotation' code and send a different 'type' in step 3 - e.g. 'tick' or 'cross' for the type, this would mean you could miss out step 4 altogether).
  5. Create a new function in mypdflib.php that will draw the images into the PDF (you will have to look at the TCPDF documentation for this, as I've not tried to do that)
  6. Adjust the code in 'assignment.class.php' - function 'create_response_pdf' to call the function created in step 5, if the annotation type is something other than 'line'

Please feel free to ask any more questions, or email me directly on moodle AT davosmith DOT co DOT uk, if you want more help.

In reply to ray chan

Re: Online PDF marking/annotation assignment module

by ray chan -

Hi David,

  I found that I cannot grade the exercise after students' submission. I try to give marks, comments and then click "save changes" to save the mark/grade. But the page refreshes and show nothing in the comment text box, and the marks cannot be updated in the grade column.

  Please advise if it's the problem on the module or my moodle site.

In reply to ray chan

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I've using that feature, without any problems, for the last year or so (and the code that generates that page is part of the Moodle standard assignment code, rather than being part of my plugin).

However, it may still be something I've done wrong, somewhere along the line. Please could you tell me exactly where it is going wrong - are you using the 'view all submissions' page (with the big table showing all of the submissions), or the 'grade one submission' view (which shows just a single submission, in a separate window)?

Could you try running updating the comments via the other method and see if that works (either the 'single' or 'all submissions' view, depending on which you have already tried)?

Also, could you try setting the debug level to 'All' and see if any error messages appear?
In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by Nicolas Dunand -
Picture of Core developers Picture of Plugin developers
Hello David,

Thanks for this, I just installed it without any problems and played with it a little.

The only problem I encountered so far is that, when creating/updating the assignment, clicking one of the validation buttons ("Save and return to course" or "Save and display") leads to a blank page. Navigating back and reloading the course page or module page shows that the creation/modification actually occured without any problems. Could there be missing an HTTP redirect ?

besides all is working perfectly well on my Moodle 1.9.2 / Apache 2.0.52 / PHP 5.2.9 / Debian Linux 4 / "gs" package installed.

I shall hopefully post further comments in a few weeks, as soon as my colleagues have the time to have a look at it.

Regards,

Nicolas.
In reply to Nicolas Dunand

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The annotation screen should have opened up in a new window, which should then close when you click either button (taking you back to the main page). Will try adding a redirect as well to my local version, to cover every eventuality.

Edit: Just re-read your original post and realised you were talking about the comment form, not my 'annotation' form. Will have to have a closer look at that.

I am currently working on a number of fixes/changes, which I will hopefully upload once they are done. Including:

1. Retaining the upload order of the files (so the combined PDF is in the right order).
2. Allowing non-PDF files to be uploaded as well (so that interactive elements, e.g. a working spreadsheet, can be checked alongside the 'printout').
3. Adding coversheets, with templates to insert student name, submission date and initials, to indicate 'this is all my own work'.
In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by alan murtagh -
This looks great and I really would like to try it out.
It installs fine but when I try to edit templates I get the error message "your site is not configured correctly".
I'm not that good technically - i use Apache and Linux
I've installed ghostscript in the public html directory and written the path $CFG->gs_path='http://www.mysite.net/gs';
Have you any idea where I could figure out how to install the ghostscript
Thanks
alan
In reply to alan murtagh

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I spotted the 'your site is not configured correctly' bug when we tried it out in college today.
It does work if you save the assignment then click on 'update this assignment'. But to avoid having to do that, there is a new, fixed version available here:

http://tracker.moodle.org/secure/attachment/17033/uploadpdf.zip

(Which also fixes an issue with marking an assignment, then clicking 'revert to draft' and a couple of issues with the 'templates' list on the settings page not updating immediately when you create/delete a template).

As for installing ghostscript, it depends what type of server you are on.

If it is a Debian/Ubuntu Linux server, type on the command line: sudo apt-get install ghostscript
For a Red Hat or Fedora version, it will be something like: su -c 'yum install ghostscript' (note I have no real experience of Red Hat/Fedora Linux versions, so that might be slightly wrong).

Either way you should be able to run ghostscript just by typing 'gs' on the command line. If that works, then the correct setting in uploadpdf_config.php should be:

$CFG->gs_path = 'gs';
(Side note: this tells my plugin where to find the ghostscript program on your local computer, not how to find it from the web server)

I hope that helps to clarify the situation - please feel free to ask for any extra help.
In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by alan murtagh -
HI David
Many thanks for that
I'll try that out
Best regards
alan
In reply to alan murtagh

نظر در مورد: Re: Online PDF marking/annotation assignment module

by لیلا حسینی -

Hi

 

I download the uploadpdf tool for moodle. I follow the instructions in readme file. when I click on "submisson.pdf" I get the following error:

 

"C:\Program Files\Ghostscript\gs8.64\bin\gswin32c.exe -q -sDEVICE=png16m -dBATCH -dNOPAUSE -r100 -dFirstPage=1 -dLastPage=1 -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -sOutputFile="C:\xampp\htdocs/moodledata/2/moddata/assignment/1/5/images/image_page1.png" "C:\xampp\htdocs/moodledata/2/moddata/assignment/1/5/submission/submission.pdf" 2>&1
operable program or batch file."

Unable to generate image from PDF - check ghostscript is installed and this module has been configured to use it

 

I install Ghostscript and I set the path in uploadpdf_config.php  file. to "C:\Program Files\Ghostscript\gs8.64\bin\ gswin32c.exe \

 

please help me with this issue.

 

Regards,

leila

In reply to لیلا حسینی

Re: نظر در مورد: Re: Online PDF marking/annotation assignment module

by justin isaf -
I just ran into the same problem.

I think it has to do with the space in \Program Files\

I moved the \gs\ folder to \xampp\gs\ and edited the config file accordingly and now it works.

Hope that helps you!

Justin
In reply to justin isaf

Re: نظر در مورد: Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Ooops.. sorry. I'd sorted out Leila's problem by email (exactly the same solution you suggested), but forgot to also reply to her message on the board.

I'll try to fix the README.txt and config.php files to reflect this information.

Davo
In reply to Davo Smith

Re: نظر در مورد: Re: Online PDF marking/annotation assignment module

by Claire Browne -
Hi.

I have the same error message.

How can i resolve this.
In reply to Claire Browne

Re: نظر در مورد: Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
@claire - Firstly, make sure you have the latest version of the plugin, downloaded from this page:
http://moodle.org/mod/data/view.php?d=13&rid=2350

Secondly, make sure you have installed Ghostscript to somewhere that does not have a space in the pathname (e.g. in Windows, make sure the path is 'c:\gs' NOT 'c:\Program files\gs') and make sure the 'uploadpf_config.php' file is set correctly.

Please see the above link for more detailed install instructions.

If that does not work, please could you copy & paste the line out of 'uploadpdf_config.php' that shows what you have set the path to as well as the full error message that you see from the plugin.

Thanks
In reply to Davo Smith

Re: نظر در مورد: Re: Online PDF marking/annotation assignment module

by james james -

hi have the same problem i have no spaces in the config file,

can some talk me thoruh seting it up with php

In reply to james james

Re: نظر در مورد: Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

You will need to copy & paste the error message, before I can suggest any ways to fix it.

In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
In case anyone wants to have a play with the latest version of this (any testers out there would be great!)

http://tracker.moodle.org/secure/attachment/17018/uploadpdf.zip


In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by Fritz Richter -
Hi David,

could you maybe post a screen shot of the annotation screen. Does the annotation feature allow freehand annotations made with a Tablet PC?

Many thanks

best Fritz
In reply to Fritz Richter

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

There is a screenshot on the plugins page (but I'm not sure if that has been aproved by the moderator yet).

I've linked to the screenshot below:

Screenshot-uploadpdf.png

I'm afraid that tablet annotation is out - this works with Javascript and that is not very good for capturing drawings (maybe things will improve it IE ever implements the Canvas tab, but I can't see that happening anytime soon). (Plus, half the point of this plugin was to get away from my terrible handwriting on printed assignments! smile )

The annotations in this plugin are all text boxes.

In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Whilst I think of it, now that this plugin has been accepted into the contrib section of Moodle CVS, all future versions of it will be found here:

http://download.moodle.org/download.php/plugins/mod/assignment/type/uploadpdf.zip

With bugs / suggestions going here:

http://tracker.moodle.org/browse/CONTRIB/component/10461

In reply to Davo Smith

Problem install moodle-weekly-19 on local server xampp-win32-1.5.4-installer.exe

by Rahmad Fuad Riadi -

Hallo every body,

I am Indonesian, and I am still newbie about moodle. when I install moodle-weekly-19 in on local server xampp-win32-1.5.4-installer.exe, there is problem under

 gmbr

The PHP memory limit is set quite low ... you may run into problems later.

 

Where I can get the local server to solve the problem can you help me. please 

In reply to Rahmad Fuad Riadi

Re: Problem install moodle-weekly-19 on local server xampp-win32-1.5.4-installer.exe

by Nicolas Dunand -
Picture of Core developers Picture of Plugin developers
Rahmad,

You should post your question (or maybe find the answer already posted here) in the adequate forum : "Installation problems".

You also can find general information about Moodle installation here : http://docs.moodle.org/en/Installing_Moodle
In reply to Nicolas Dunand

Re: Problem install moodle-weekly-19 on local server xampp-win32-1.5.4-installer.exe

by Nicolas Dunand -
Picture of Core developers Picture of Plugin developers
Hi again David,

I just wanted to test the new version of this assignment module you provided in you last post, and encountered repeatedly the same problem : when the student submits his work ("Validate for evaluation"), he (after confirmation) always gets the following error :
TCPDF ERROR: Unable to find pointer to xref table

Any ideas ?

Regards,
Nicolas.
In reply to Nicolas Dunand

Re: Problem install moodle-weekly-19 on local server xampp-win32-1.5.4-installer.exe

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
It looks like the FPDI library is unable to read the PDF.

I don't know anything about the internals of that library - I just use it to load the PDFs for editing. However, it would be helpful if you could let me know the following information:

* What software did the student use to create the PDF?
* What PDF version number was it? (open the PDF in Adobe Reader, click File, Properties and that should tell you)

Davo
In reply to Davo Smith

Re: Problem install moodle-weekly-19 on local server xampp-win32-1.5.4-installer.exe

by Nicolas Dunand -
Picture of Core developers Picture of Plugin developers
Hello David,

One file is a "PDF version 1.4 (Acrobat 5.x)" generated by Adobe Acrobat Pro, while the other one is a "PDF vetrsion 1.3 (Acrobat 4.x)" generated by Mac OS X 10.5.

Regards,
N.-
In reply to Nicolas Dunand

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Odd... I was just about to post up that the error was due to a feature added to PDF version 1.5 (object streams).

Is there any chance you could create a PDF that doesn't work (using Acrobat Pro or Mac OS X) and attach it to this bug report: http://tracker.moodle.org/browse/CONTRIB-1286 ?

I quite understand if you don't want to post a student's original work.

Alternatively, I have had great success using PDFCreator (free download) to print PDFs that work with UploadPDF.

Davo
In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by Nicolas Dunand -
Picture of Core developers Picture of Plugin developers
Hi David,

My second example actually was generated only for testing this module by my Mac-using colleague, so I attached it to your module's tracker.
In reply to Nicolas Dunand

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I'm afraid I have been unable to reproduce the problem with the PDF you attached. On my local testing server, it uploads fine. (Although I have found a version 1.6 PDF that gives the same error, but that is due to a new way of handling xrefs, that was introduced in version 1.5 of the PDF standard).

Are you attaching a coversheet to the submissions? Could that be the file that the upload is struggling with?
In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by Nicolas Dunand -
Picture of Core developers Picture of Plugin developers
Hi David,

I'm not using any coversheet. I'll double-check all the internals on my server and let you know if anything comes out.
In reply to Fritz Richter

Re: Online PDF marking/annotation assignment module

by Kathy Morello -
I just created a Word document and worked a problem out using tablet stylus in the word document then save it as a pdf and uploaded it to pdf assignment and the inking showed perfectly.  Does not allow use of pen in making comments but students can use pen when doing assignment.  Hope this is helpful.
In reply to Kathy Morello

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Recent addition allows for simple line annotations, by holding down Ctrl and clicking (still not the same as drawing with a tablet pen, but not quite sure how I'd manage to do that).
In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
New version, for anyone who wants to try it:

http://download.moodle.org/download.php/plugins/mod/assignment/type/uploadpdf.zip

Main difference is that old generated image files are now cleared out using a cron job (to save cluttering up the moodle data folders).

There are a few more minor tweaks and fixes on the way (search on tracker.moodle.org for items I plan to look at and to add any other suggestions for me to fix)

Davo
In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by Paul Wymann -
I get the message myself. I changed the path to C:\gs and copied the files inthere, still no change. Can anyone help? I'm running on Vista with the apache server installed.

C:\gs -q -sDEVICE=png16m -dBATCH -dNOPAUSE -r100 -dFirstPage=1 -dLastPage=1 -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -sOutputFile="C:\moodle\server/moodledata/2/moddata/assignment/6/9/images/image_page1.png" "C:\moodle\server/moodledata/2/moddata/assignment/6/9/submission/submission.pdf" 2>&1


Unable to generate image from PDF - check ghostscript is installed and this module has been configured to use it (see README.txt for more details)



In reply to Paul Wymann

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The path should include the name of the ghostscript executable.

In your case, the path you should give is:

c:\gs\gswin32c.exe

OR

c:\gs\bin\gswin32c.exe

(depending on exactly which folder the 'gswin32c.exe' file is in)

Davo
In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by Paul Wymann -
Thank you, I've done that and it worked a couple of time. Now I get a new error message saying problem with xref and lately with the following line.

TCPDF ERROR: Cannot open C:\moodle\server/moodledata/2/ !

Any help on this greatly appreciated
In reply to Paul Wymann

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The xref problem is likely to be an issue with the FPDI library I use being unable to deal with later versions of the PDF spec. If you can output to PDF version 1.4 (or below), then that shouldn't happen.

The second error is a bit odd - it seems to be looking for a file, but only generating half the file path needed. Could you let me know exactly what you were doing when you got that error, including whether or not you were using a coversheet (and the path to the coversheet if you were).

Davo
In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by Alan Bates -

I had a similar problem uploading a submission. Initially I did include a coversheet. After some tinkering, I added a coversheet and all works fine. It seems a coversheet is necessary for the upload to function.

Happy it is working now!

- Alan.

In reply to Alan Bates

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Just going back through old messages on this forum and in case anyone else comes across this - this bug is now fixed.
In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by ray chan -
Do you mean the bug for the chinese character in response.pdf has been fixed? If so, what's the version no. for the plugin?
In reply to ray chan

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
No, the message I replied to was about problems with uploading documents when there was no coversheet - that bug is now fixed.

I still have no idea how to fix the Chinese characters bug as I don't have any idea how to enter Chinese characters on my home (Ubuntu) computer. That means I can't even start to debug it.
In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I've managed to get slightly further with this, by copying some Chinese characters off a Wikipedia article.

I have now reproduced the problem and created a bug here: http://tracker.moodle.org/browse/CONTRIB-1798

However, I am at a loss as to how to solve it - it certainly will involve working out how to get the TCPDF library to write Chinese characters to a file, but I don't know how to do that and the relevant example on the TCPDF website (example 38 on this page: http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf_examples ) gives me blank space where the Chinese writing should be.

Anyone got any ideas?
In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by ray chan -

Which file and path should I modify so I can make TCPDF to support Chinese character? Do I modify the files under the TCPDF folder?

In reply to ray chan

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Firstly, as mentioned above I have NOT found a solution to this problem (at least, not one that seemed to work on my home computer), so anything suggested here is something to try out, rather than a definite solution.

You could try downloading the latest version of TCPDF from here:
http://www.tcpdf.org

You will then need to copy the file 'arialunicid0.php' from the 'fonts' folder, into 'moodle/mod/assignment/type/uploadpdf/tcpdf/fonts'.

Then open up the file:
'moodle/mod/assignment/type/mypdflib.php'
and change the two lines that look like this:
$this->SetFont('helvetica','', 12.0 * $this->scale);
to:
$this->SetFont('arialunicid0','', 12.0 * $this->scale);

If this works, then great. If this doesn't work, then I don't have any other suggestions, at the moment.
In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by Kathy Morello -

We have installed it on 1.9 and it seems to work well with one exception.  When teacher clicks on an uploaded assignment an error message pops up indicating it is trying to open page 2 and there is only 1 page in the document.  If the cancle button is clicked the box closes and the teacher can proceed making comments and grading and saving with no other problems.

Attachment error_on_pdf_assignment.JPG
In reply to Kathy Morello

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Only just spotted this here. I've tried to reproduce this problem, but without success with the latest version of the plugin.

Is it still a problem for you?
In reply to Davo Smith

Re: Online PDF marking/annotation assignment module

by Kathy Morello -
We have it running opn 1.9 and seems to work for first page of document but does not allow me to move to the subsequent pages.  Can add comments to first page without a problem just will not go to 2nd page unless I use the download at top of the page and then I cannot add comments but can navigate to all the pages.  Any ideas of what the problem is?
In reply to Kathy Morello

Re: Online PDF marking/annotation assignment module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
@Kathy:

The 'download' link just downloads the PDF and opens it in Adobe Reader (or whatever other PDF reader you have installed on your computer), so that will no longer be connected to the marking system.

As you are able to add comments, javascript appears to be up and running in your browser.

I assume you have the two navigation buttons at the top of the page (next, prev) and a dropdown list of pages in between them.

Are the next/prev buttons enabled?
Does anything happen when you click on them?

Are there any pages (other than page 1) in the drop-down list?
What happens if you click on one of them?

Can you copy the address (at the top of the page), paste it into a new window, then add '&pageno=2' to the end of the address (so it looks something like http://[moodleserver]/mod/assignment/type/uploadpdf/editcomment.php?id=123&userid=345&pageno=2 - the 123 and 345 will depend on your particular set up).

If you are able to, a screenshot of the page might also help with figuring out what is going wrong.