General plugins

UploadPDF assignment type

 
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.
Davo
UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

This plugin ( http://moodle.org/mod/data/view.php?d=13&rid=2350 ) has been around for a while, but there isn't really a discussion thread for it.

In honour of the recent updates to it (new UI, with oval/rectangle/freehand drawing features and a new 'find comments' option), I'm starting this thread. Please post any comments, feature requests of bugs here (or add them to tracker - http://tracker.moodle.org/browse/CONTRIB/component/10461 ).

 
Average of ratings: Useful (1)
Picture of Geoffrey Rowland
Re: UploadPDF assignment type
Group Plugin developers

Davo

Thanks for the updates. We will certainly be testing the Moodle 2 version.

Any plans to integrate this with Crot antiplagiarism detection? I think the Moodle Crot works with Moodle 1.9 and 2.0 and PDF files though currently with the multi-file assigment upload.

http://moodle.org/mod/forum/discuss.php?d=116512

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers
I've never looked into crot, as it is not something we use in college. I'm guessing I'd need to pay for a turnitin account if I wanted to add this, and I'm not likely to do that in the near future.
 
Average of ratings: -
Picture of Geoffrey Rowland
Re: UploadPDF assignment type
Group Plugin developers

Fully appreciate your sentiments with regard to Turnitin costs.

I only mentioned the Crot module as it is a free (Bing-based) alternative, is under active development, and can work with PDFs.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Having never really looked into it and mostly having heard the term 'plagiarism detection', I'd assumed that the 'crot' plugin was an interface to 'turnitin'. Having now looked I can see that it isn't (which is good).

I'm guessing that it would certainly be possible to integrate it into the uploadpdf module, but I'm just taking on a couple of other Moodle projects at the moment, so it'll be a while before I can stop and look into this further. I would certainly only consider integrating the Moodle 2.0 version (as it would be significantly different, due to the new support in M2.0 for plagiarism detection).

 
Average of ratings: -
Picture of John Pembroke
Re: UploadPDF assignment type
 

I have installed the latest version of this plugin in a Moodle 1.9.7 build on an IIS server. I am uisng IE9 but I have checked Firefox, Chrome and Safrai - all have the same problem.  The assignment type loads correctly however I am unable to place any comments or other markings on the pdf. Looks like the javascript fails to run. The ghostscript seems to be working corretly as I am able to send the file back. Page turning does not work under javascript. Any suggestions

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

The javascript certainly works in FF, Chrome and IE7/IE8 (not tried with IE9), so it must be a problem with sending the javascript to the browser.

In Chrome, can you open up the 'developer tools' (ctrl+shift+i), reload the page and see if there are any error messages ('red excalmation mark' in the bottom-right of the screen) - that might help to narrow-down the problem.

 
Average of ratings: -
Picture of John Pembroke
Re: UploadPDF assignment type
 

Hi Davo. I have open the console in chrome. Here is the results

moodle.allhallows.qld.edu.au/file.php?file=/316/moddata/assignment/1935/3230/images/image_page1.png:-1Resource interpreted as Image but transferred with MIME type application/x-forcedownload.

 

  1. element-beta-min.js:7Uncaught TypeError: Cannot read property 'selectedMenuItemChange' of undefined

 

 

 

12
  1. annotate.js:1676Uncaught TypeError: Object #<Object> has no method 'getElements'
    1. gotonextpageannotate.js:1731
    2. (anonymous function)editcomment.php:163

 

Not quite sure what all this means. ANy help much appreciated.

John

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

My first guess is that there is a naming clash between MooTools (which I use) and another javascript library on your system.

Is your theme inserting anything like jquery, prototype or suchlike into every page?

If it is, then that is going to clash with the uploadpdf plugin (there are workarounds that I can write, but I'm not going to have much time to look into them in the near future).

 
Average of ratings: -
Picture of Vicki Taylor
Re: UploadPDF assignment type
 

Hi,

I'm having the same problem.  It seems to work okay in Firefox and Chrome but not IE8 or IE9.  There is a javascript error and the page doesn't load properly.  It puts all of the tools under eachother:

uploadpdf error

I can't use the tools, when you click on them nothing happens.  I clicked on the javascript error and it had the following description:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E; Tablet PC 2.0)

Timestamp: Tue, 17 Jul 2012 12:57:02 UTC

Message: Object doesn't support this property or method

Line: 1

Char: 7585

Code: 0

Thanks,

Vicki.

 
Average of ratings: -
Picture of kathy chilvers
Re: UploadPDF assignment type
 
We are having the exact same problem..........with the exact error message. Is fine in Chrome, firefox but will not work in IE8. We really want to use this and hope that someone has an answer to this. I am not sure how to take this forward ie how do you report a bug or adding my reply to this forum might be the way. Thanks Kathy
 
Average of ratings: -
Picture of Michel AlSharidah
Re: UploadPDF assignment type
 

I tried to install it on my moodle website (v.2.03) but it was not able to upgrade it. Is the latest version compatible with my version of moodle? Thanks

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers
The moodle 2.0 version of the plugin should work fine with moodle 2.0.3. What version are you upgrading from and what error are you getting?
 
Average of ratings: -
Picture of Michel AlSharidah
Re: UploadPDF assignment type
 

Its actually a fresh moodle install but migratd my 2.02 from an old server to a new one so the new moodle is at version 2.03. When I copied the davosmith-moodle-uploadpdf-fab13fe file to mod folder. The error message that i get is

===================Error Message ====================

Plugin "mod_davosmith-moodle-uploadpdf-fab13fe" is defective or outdated, can not continue, sorry.

Debug info: Invalid plugin directory name.
Stack trace:
  • line 426 of /lib/upgradelib.php: plugin_defective_exception thrown
  • line 265 of /lib/upgradelib.php: call to upgrade_plugins_modules()
  • line 1425 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 311 of /admin/index.php: call to upgrade_noncore()

===================================================

Am I doing something wrong?

 
Average of ratings: -
Picture of Michel AlSharidah
Re: UploadPDF assignment type
 

Ops! never mind, just realized that filezilla did not manage to transfer all my files, some have failed. It works fine now. smile Sorry

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers
It doesn't go in the 'mod' folder, it goes in the 'mod/assignment/type/uploadpdf' folder, as stated in the included 'README.txt' file (unless I've made a mistake in the documemtation). Also note that the davosmith-moodle-uploadpdf-xxxx folder needs renaming to uploadpdf before it will work (this is a by-product of storing code on github, but again, this is covered in the included instructions, and on the download page). Hope that fixes the problems you've been having smile
 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Just fixed a bug in this plugin which might well have stopped people from annotating assignments at all (a 1 line bug in the javascript that affects marking assignments where there were no previous assignments to compare to).

The latest verision, available form the above link, fixes this problem.

 
Average of ratings: -
Picture of Dave Emsley
Re: UploadPDF assignment type
Group Particularly helpful Moodlers

Hi, I installed this today on a test server and it worked OK.  Student submitted the assignment, teacher commented on it. 

Teacher can see the comments but the student cannot.

 

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers
Did you click on the button to send the response to the student (second from left at top of editing page)?
 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

I've just done a tidy up of the javascript code for this plugin - I've prevented a few errors in cases where server responses arrived after the user had moved to a new page (the errors weren't breaking any functionality, but they looked messy). I've also improved the 'find comment' feature, by scrolling the browser window to show the comment if it is off screen, as well as highlighting the comment you were looking for (with a red, dashed border).

 
Average of ratings: -
Picture of Ian Scott
Re: UploadPDF assignment type
 

Installed in V2 and all works until I click Final submission - then I get a new screen TCPDF ERROR: File is encrypted! - the PDF isn't

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

It appears that the FPDI library I use to read the PDF thinks that it is encrypted. I know very little about the internal workings of the library (or how data is stored inside a PDF), so there isn't much I can suggest.

You could try opening the file in another program (e.g. Adobe Reader) and checking the properties to see what version of PDF it is. If the version number is 1.4 or below, then there shouldn't be a problem. If the version number is 1.5 or above, then the freely availalbe version of FPDI cannot handle it (I wish there was a workaround to this, but the only options that I have found are to pay a fee for every site that wants to use this, or to dedicate a very large amount of time to implementing a new PDF parser).

One way to make sure that PDFs are compatible is to choose the 'PDF/A' option when creating a PDF. Another method is to use PDFCreator to create PDFs.

 
Average of ratings: -
Picture of Ian Scott
Re: UploadPDF assignment type
 

Thanks Davo - it was V1.5 - created a new PDF via PDF creator and now get

error/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)

I know ghostscript is installed (I installed it via YUM) - as this is the only program I know that uses ghostscript I'm not sure how to test if its UploadPDF or Ghostscript at fault.

The error message is

gs -q -sDEVICE=png16m -dBATCH -dNOPAUSE -r100 -dFirstPage=1 -dLastPage=1 -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -sOutputFile="/home/digitalt/moodledata/temp/uploadpdf/img/image_page1.png" "/home/digitalt/moodledata/temp/sub/submission.pdf" 2>&1

I note above both the sub and uploadpdf/img didn't exist in moodledata/temp so I created them but to no effect

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

I take it you are editing the template (before you have any assignments set up)?

The folders should all be automatcially created before it tries to run ghostscript, so I'm not sure why they don't exist.

The best way to find out what is going wrong is to copy & paste the error message you have shown onto the command line and see what happens (the message is the command line that the web server calls to generate the image from the PDF). If you get an error, that should help to track down what is going wrong. If you don't get an error, then there may be a permission problem with calling 'exec' from within PHP.

 
Average of ratings: -
Picture of Nadav Kavalerchik
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developersGroup TestersGroup Translators

We had a similar issue. Eventually, setting "embed fonts" in the export setting of the PDF creator (OpenOffice) solved this issue.

 
Average of ratings: -
Frankie's the name, Moodle's my game!
Re: UploadPDF assignment type
Group Particularly helpful MoodlersGroup Plugin developers

Hi Davo.

I'm making full use of your marvellous mod.

Some suggested improvments to an otherwise very good mod:
1. Allow an "Undo" button or shortcut-key

2. For PDF files which extend down the page, i find that I often have to scroll UP the page to access the menu buttons. Could the buttons be stuck on the, let's say, right side of the screen so that no matter where I am in the document, the menu buttons are within easy reach and I no longer have to scroll up?

Thanks and regards
Frankie Kam

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

1. Undo might be possible, but I don't currently store any previous details, so it would take a bit of coding. Add a tracker request for it and I'll see what I can do (but I'm unlikely to look at it for a few weeks).

2. The best suggestion is to learn the keyboard shortcuts - hover over any button and it displays the shortcut keys (n/p for navigation, [/] for colours, {/} for line colours, c - comment, l - line, r - rectangle, o - oval, e - erase, f - freehand, hold ctrl to draw a line in comment mode).

 
Average of ratings: -
Picture of John Pembroke
Re: UploadPDF assignment type
 

Great assignment type. Howvere just recently starting to have the following problem

MIssing Charatcers. Is anyone else having this experience.

Regards John

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

@John Pembroke - Are the characters missing in the original PDF (click on the 'download' icon, 3rd from left on top row), or only in the output?

 
Average of ratings: -
Picture of John Pembroke
Re: UploadPDF assignment type
 

The orignal document is totally in tact. No missing charaters. The problem is only in the display image. When you generate a response the file is inatct with the annotated comments.

John

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers
This sounds like a bug in ghostscript (which is the program I use to generate the images). I'm afraid I know nothing about the internals of ghostscript, so the best I can suggest is to check you have the latest version on your server and, if you do, try reporting it as a bug on their website.
 
Average of ratings: -
Picture of Athas Dos
Re: UploadPDF assignment type
 

Thanks for this great module. I have intalled it and I am receiving the following message "Server communication failed -do you want to resend the message?"

Can anyone send me a way of solving this error? Thanks

 
Average of ratings: -
Picture of Athas Dos
Re: UploadPDF assignment type
 

I figured out....I was missing json extension in my server. It should be added as a requirement in the installation instructions. Thanks for this great module

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Sorry, I didn't put the JSON extension in the list as I thought it was a standard part of PHP.

Turns out it has only been standard since PHP 5.2.0, which was released in Nov 2006.

I'll update the documentation.

 
Average of ratings: -
Picture of Timothy Byers
Re: UploadPDF assignment type
 

I am having problems with Internet Explorer. When I grade a pdf assignment it will show boxes and comments but will push comments to the bottom of the page and it won't draw lines. However, if I open the assignment in firefox, it will show the lines and comments in the correct place. I am using IE9 and I think this should be an easy fix?

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers
Last time I tried this with ie it was working fine, which suggests that Microsoft had once again broken something when releasing a new version of their browser.

When I next have a moment I'll reboot into windows and see if I can reproduce the problem and figure out what is going wrong.
 
Average of ratings: -
Picture of Timothy Byers
Re: UploadPDF assignment type
 

 

 

 
Average of ratings: -
Trolling in the deep
Re: UploadPDF assignment type
 

Hello I am still currently experiencing this error.

Default exception handler: error/Unable to generate image from PDF - check ghostscript is installed and this module has been configured to use it

I've tried doing the following:

installed ghostscript

checked json extension if installed

cnofigured uploadpdf_config.php to "gs"

i get it when I am using the annotation in assignment upload pdf.

what else can i do to fix it?

Thanks.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

When that error is generated, there should also be a message to explain what went wrong.

e.g. 'no filename', 'no image folder', 'bad folder: [foldername]', or (more likely) the full 'gs' command that was attempted to be run, along with the response from that command.

If you post that here, then I may be able to suggest what is going wrong (BTW, assuming you are the person who also posted on the YouTube video - JSON and TCPDF are not relevant to this part of the plugin, it is just ghostscript that is relevant).

 
Average of ratings: -
Trolling in the deep
Re: UploadPDF assignment type
 

Yes. I was the one who asked that in YT.

Anyway, here's what I got in the error logs:

Default exception handler: error/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)

Debug: \n* line 435 of /lib/setuplib.php: moodle_exception thrown\n* line 1328 of /mod/assignment/type/uploadpdf/assignment.class.php: call to print_error()\n* line 1864 of /mod/assignment/type/uploadpdf/assignment.class.php: call to assignment_uploadpdf->get_page_image()\n* line 50 of /mod/assignment/type/uploadpdf/updatecomment.php: call to assignment_uploadpdf->update_comment_page()\n,
referer: http://<ip>/<site>/mod/assignment/type/uploadpdf/editcomment.php?id=353&userid=13

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

OK, so that's the error message, but what about the extra information that is displayed in the browser when the error occurs?

That information includes the full command line that was attempting to run, as well as the result of running it.

 
Average of ratings: -
Trolling in the deep
Re: UploadPDF assignment type
 

Are you talking about this?

Output buffer: gs -q -sDEVICE=png16m -dSAFER -dBATCH -dNOPAUSE -r100 -dFirstPage=2 -dLastPage=2 -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -sOutputFile=&quot;/var/www/data/<site>/temp/uploadpdf/img/image_page2.png&quot; &quot;/var/www/data/<site>/temp/sub/submission.pdf&quot; 2&gt;&amp;1<br/>GPL Ghostscript 8.70: Unrecoverable error, exit code 1<br/>

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

If possible, can you do the following:

  1. Download the submitted PDF and open it in a PDF viewer (e.g. Adobe Reader) and check that it is a valid file.
  2. Copy the PDF file to somewhere on your server and then run the ghostscript command line on it (substituting the location of the PDF you copied to the server for the bit that says '/var/www ... /submission.pdf' and giving a suitable destination for the png image).

If the first test is OK, but the second test gives the same error, then I suggest you see if you can get a more up-to-date version of ghostscript (current version is 9.06).

 

 
Average of ratings: -
Trolling in the deep
Re: UploadPDF assignment type
 

I already updated it. It's still giving me the pop up error that says:

Server communication failed - do you want to resend the message?

...whenever I annotate.

 

 

====

I commented out the line

// Definition for 'resend' box
//echo '<div id="sendfailed" style="display: none;"><p>'.get_string('servercommfailed','assignment_uploadpdf').'</p><button id="sendagain">'.get_string('resend','assignment_uploadpdf').'</button><button onClick="hidesendfailed();">'.get_string('cancel','assignment_uploadpdf').'</button></div>';

 

in assignment.class

 

will it have negative effects on the plugin?

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

If you have already updated ghostscript, does that mean that the error has stopped happening, or that you have updated to the latest version and it still isn't working?

If it still isn't working, then did the attempt to run ghostscript via the command line work?

Commenting out the 'resend' box is a very bad idea. That box is telling you that there is some problem when communicating with the server. This may mean that your annotations are not saving properly. This will probably mean that you can't edit any comments after you have saved them. The answer is not to ignore the error, but to find out why it is happening. You don't say which browser you are using, but if it is Chrome, then open up the developer tools (if Firefox install Firebug and then open that up), go to the 'network' tab and look to see what message the webserver is returning. It is probably showing some sort of error - tell me what the error is and I may be able to help fix it.

 
Average of ratings: -
Trolling in the deep
Re: UploadPDF assignment type
 

Yes. I have updated the ghostscript.

I did run the command. I thought it worked just fine the first time but when I tried it again, I noticed there is some error.

This is the command:

gs -q -sDEVICE=png16m -dSAFER -dBATCH -dNOPAUSE -r100 -dFirstPage=2 -dLastPage=2 -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -sOutputFile=&quot;/var/www/data/<SITE>/temp/uploadpdf/img/image_page2.png&quot; &quot;/var/www/data/<SITE>/temp/sub/submission.pdf&quot; 2&gt;&amp;1

(Of course I changed the ISO 8859-1 characters before running it)

I encountered this error:

 

PuTTY/var/www/data//temp/sub/submission.pdf: command substitution: line 3: syntax error near unexpected token `;'
/var/www/data//temp/sub/submission.pdf: command substitution: line 3: `Ê'ãÜ"7WÕã$=^ЦM°Ajm=´âV==¶e³
/¹½n½÷åj é=þÒ+ñæÁºsE>@öäæyû¼:¶¸b£®gh{9ªkÕ&ʶ¿nr°ÍÊ»Ï
A ²Q²ñkæK´5¦ûg§ô¸=ß/R¹vnãì¸}¿2vâzä
^Òo!cqÛ1¥¢KtõÐRÇ"幸/ÙÛû"Yó^eì¢÷(ýxI÷ÓBÆbãÞÄBW->ÖÁ"é^sJouA'
/var/www/data//temp/sub/submission.pdf: command substitution: line 3: unexpected EOF while looking for matching `"'
/var/www/data//temp/sub/submission.pdf: command substitution: line 4: syntax error: unexpected end of file
/var/www/data//temp/sub/submission.pdf: line 3: LÑì0¸ÎðO7gw³yf: command not found
Xr¬Ý: command not found/sub/submission.pdf: line 3: ÆÂç··êtµÓÏ3Ðó
Lƶ3¸ùĵ{é±÷ahÞ'Ì?æk6æp/sub/submission.pdf: command substitution: line 4: syntax error near unexpected token `)'
/var/www/data//temp/sub/submission.pdf: command substitution: line 3: syntax error near unexpected token `4'
/var/www/data//temp/sub/submission.pdf: command substitution: line 3: `Ϥ(4&ºôPlq«)B\àâ]Ûv~Ç«8ħ'

 

 
Average of ratings: -
Trolling in the deep
Re: UploadPDF assignment type
 

Okay I ran the wrong command. I tried again and the command is working on the console. The gs command is okay.

What then is the problem when the command is ran in the plugin?

 

Thank you for amswering

 
Average of ratings: -
Trolling in the deep
Re: UploadPDF assignment type
 
I also got this error: Error: /rangecheck in --.execform1--
 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

If my plugin is producing the correct command line and that is working when you type it in manually, then there isn't much else I can check as it appears to be a problem with you PHP install running the command line program.

The error message would appear to be an internal ghostscript fault, so I can't help you with that either, expect to suggest this: https://www.google.co.uk/webhp?q=Error%3A%20%2Frangecheck%20in%20--.execform1--

 
Average of ratings: -
Me, with my new 'slow explosion' hair!
Re: UploadPDF assignment type
Group Core developersGroup Plugin developers

Hiya Davo.

We're experiencing some of the issues reported here and one of the things I usually do first is to check we're using the most recent code. I checked on github.com/davosmith and it seems that we're using the code from the moodle20-originalui branch, whereas the master branch has more recent commits. (We're using Moodle 2.1.1+.)

Are we on the right branch or should we switch to master?

Cheers,

Paul.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

I've not touched the 'original-ui' branches in a while, these were created to keep an archive of the old version of the UI, before I made some significant changes to it back in April.

I am no longer maintaining those branches, so you will probably find the master branch works better (plus the benefits of a refreshed UI with the ability to draw circles, boxes, etc. rather than just comments and lines).

 
Average of ratings: -
Picture of Timothy Byers
Re: UploadPDF assignment type
 

Just to verify, I am using the latest version for Moodle 1.9.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Timothy - thanks for the heads-up about IE9.

After rebooting into Windows and downloading it, I've managed to reproduce the problems you were having and roll out a fix for them.

The GitHub version of my plugin ( https://github.com/davosmith/moodle-uploadpdf/tree/MOODLE_19_STABLE ) is now fixed - please could you confirm it is all working and I'll put that version into the modules & plugins database.

Thanks again.

 
Average of ratings: -
Picture of Timothy Byers
Re: UploadPDF assignment type
 

Thanks for all your help. The lines are working fine. But, comment boxes seem to disappear whenever you click save or generate response. Thanks again.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Clicking 'save' doesn't do anything (comments are saved as soon as they are typed in - I only added the save button to make people feel better about closing the window).

If you can go to another page and back to the original page and the comments are still there, then the comments are saved. If that doesn't work, then there is something different the matter (but it was working fine on my test computer, last time I checked, with IE9, Firefox, Chrome).

 
Average of ratings: -
Picture of Timothy Byers
Re: UploadPDF assignment type
 

I was able to just click off the comment box and it displayed for student when they opened it. I assumed you needed to save. There may be an issue with the eraser yet. Doesn't seem to work with IE9 does work with firefox. Thanks for all your help.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

In ie, you have to click on the line, for the erase to work, with Firefox/Chrome you just need to click somewhere inside the shape. 

That might account for the differences (but I'll double-check when I get a chance).

 
Average of ratings: -
Picture of Timothy Byers
Re: UploadPDF assignment type
 

I feel dumb, you're right, click on the eraser and click on line and it disapears.  Thanks for your help.

 
Average of ratings: -
Me, with my new 'slow explosion' hair!
Re: UploadPDF assignment type
Group Core developersGroup Plugin developers

Thanks for that, will upgrade shortly. smile

 
Average of ratings: -
Me, with my new 'slow explosion' hair!
Re: UploadPDF assignment type
Group Core developersGroup Plugin developers

Hi Davo.

Just grabbed the master branch from Github and installed it as per usual. I can add comments of different colours but the drawing tools don't work. Firebug (I am using Firefox 5.0 on Ubuntu Linux) reports the following:

missing : in conditional expression
http://localhost/moodle/lib/javascript.php?file=%2Fmod%2Fassignment%2Ftype%2Fuploadpdf%2Fscripts%2Fraphael-min.js&rev=337
Line 1

Aditionally, I added another more serious error (which I think is UploadPDF related, but not 100% certain) to the CONTRIB entry for UploadPDF (I'm not too sure where you'd prefer error reports).

Cheers.

Edited to add: I'm not sure if you can do anything about MDL-27520 but I thought I'd bring it to your attention.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

I'll look into the javascript error - it could easily be something I broke whilst upgrading the drawing library (to fix the IE9 problems).

Not sure about MDL-27520 - it doesn't sound like something I've done, but I'd have to test it out (which I won't be able to do for a few days).

As you've already seen, I think the other error you reported was to do with Moodle core, not my plugin, so I've marked it as such.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Looks like the Moodle Javascript caching process was disagreeing with the already-minimized version of the Raphael library (I always have caching turned off, as a developer, as otherwise it is hard to debug the code).

I've rolled out a new version that should fix that issue.

 
Average of ratings: -
Me, with my new 'slow explosion' hair!
Re: UploadPDF assignment type
Group Core developersGroup Plugin developers

Thanks for everything! smile

 
Average of ratings: -
Me, with my new 'slow explosion' hair!
Re: UploadPDF assignment type
Group Core developersGroup Plugin developers

Hi Davo. I'm now getting this error (from Firebug) when the 'annotate' page loads:

content is null
http://server.ac.uk/moodle21/mod/assignment/type/uploadpdf/scripts/annotate.js
Line 1658

Multi-coloured text boxes work fine, it's just the drawing tools which don't work. I can click on them (e.g. the pen) and they become highlighted in blue, however when I click on the page to draw a box or squiggle (again from Firebug):

context_quicklist is null
http://server.ac.uk/moodle21/mod/assignment/type/uploadpdf/scripts/annotate.js
Line 979

I hope this is useful. I tried looking through annotate.js but Javascript is not really my strong point, so I can't be of much help.

P.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

It looks like the 'region-main' element is missing from the page.

It might be a Moodle 2.1 issue, or it might be a theme issue. I'll look into it and see what I can figure out.

 
Average of ratings: -
Me, with my new 'slow explosion' hair!
Re: UploadPDF assignment type
Group Core developersGroup Plugin developers

Then it's worth mentioning that the theme we're using is Standard with changes to the CSS. It's also been tested with Aardvark 2.1.1 beta, same results.

 
Average of ratings: -
Picture of Jonathan Kulp
Re: UploadPDF assignment type
 

I'm having the same problem in Moodle 2.1. Text box comments work, but when I use a drawing tool it draws the shape while I'm click-dragging, then the shape disappears after I let go.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

I've just checked in a version that fixes the 'disappearing annotations' bug (you can find it on GitHub) - the problem was an undefined function hidden in the Raphael javascript library I use for the line drawing.

This is unrelated to the firebug errors (content is null / context_quicklist is null), but I've checked in a fix for those as well.

 
Average of ratings: Useful (3)
Picture of Jonathan Kulp
Re: UploadPDF assignment type
 
Thank you! It works great now! I was afraid there was a problem with my server's ghostscript or java setup or something. Thanks for patching it so fast. :)
 
Average of ratings: -
Me, with my new 'slow explosion' hair!
Re: UploadPDF assignment type
Group Core developersGroup Plugin developers

Hi Davo, thanks **so much** for fixing these issues! smile

 
Average of ratings: -
Picture of Евгений Мамаев
Re: UploadPDF assignment type
 

Hi, Davo!

I`m asking for some help if I may.

On my development machine with Win XP it works great. However when I try it on the server with Win2008 it prints the following error message when trying to annotate the submission: "bad folder: mysiterootdir\moodledata/courseid/moddata/assignment/assignmentid/userid/images "

"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)"

Ghostscript is installed in c:\gs\bin\ and file uploadpdf_config.php contains the line "$CFG->gs_path = 'c:/gs/bin/gswin32c.exe';", so it should be right.

Could it be some problem with permissions (as I have FAT32 filesystem on my desktop and NTFS on the server)?

Other scripts successfully create folders and files in moddata directory on the server.

Thanks in advance for suggestions!

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

First of all, I assume you've sanitised the line that reads 'bad folder:' and it actually reads something like:

'bad folder: c:\moodledata/5/moddata/assignment/3/1/images'

If so, can you check that the folder exists and that the server has permission to write to it (my code uses the standard moodle function call to create folders).

The code should also output the full command line that is used to run ghostscript, so you might find some milage in running that command from outside of Moodle and seeing if it works.

Aside from that, the best advice I can give is to consider running Moodle on a Linux server - I know that solved a number of problems in the college where I currently work (although I have no direct involvement in the admin of our Moodle site).

 
Average of ratings: -
Picture of Geoffrey Rowland
Re: UploadPDF assignment type
Group Plugin developers

Hi Davo

We are now taking a serious look at UploadPDF and starting to really like what we see. We run our Moodles (1.9.x and 2.1.x) on CentOS linux so things have worked 'out-of-the box'.

One key driver/enabler is that we have recently upgraded to MS Office 2010 accross college, making it easy for users to save directly as PDF (i.e. without having to convince IT Services to deploy LibreOffice or PDFCreator or Acrobat writer or whatever - or our students to use them!)

Here are a few observations/questions.

  1. Internet Explorer 9 and recent versions of Firefox, Google Chrome and Opera all work well for adding comments.
  2. Internet Explore 8 does not work (draws a scrambled version of the editing toolbar, then stops). Not a show stopper as we are already moving to Firefox as our default browser (for Drag-and-drop file upload, amongst other reasons!)
  3. PDFs saved from Office 2010 allow comments to be added. I'm not complaining about this, just seeking some clarification.  By default, Office 2010 appears to save in PDF ver 1.5 format (not PDF/A). Earlier postings on this forum suggested that the TCPDF/FPDI libraries did not work with PDF ver 1.5. Has this now been fixed with recent upgrades of TCPDF/FPDI?

    I am obviously keen to avoid the situation of having a batch of assignments that are unmarkable (without the hassle of PDF format version conversion).

Also, really appreciate the 'polish' on this module; the assignment front-page, drawing tools, automatic merging of PDFs, comment-list, shortcut keys etc. Makes it very fit for our purposes.

Keep up the good work!

Cheers

Geoff

 

 

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers
It should work with ie8 (that was what I was using it with in college), however the process of fixing it to work with ie9 may have broken this (I'd have to check).

FPDI does not work reliably with 1.5+ version of pdf unless you pay for it. I think it costs about $100 per site, but I've never tried that version. I have advised students to use the PDF/A option (or print via pdfcreator). I guess it would be possible for ghostscript to pre-process the files and convert to required version (if needed), but I've not tried.

I'm glad you like the polish, that is the result of me using  it for  all my assignment making over the last 3 years (up until last week, when I stopped being a teacher).
 
Average of ratings: -
Picture of Geoffrey Rowland
Re: UploadPDF assignment type
Group Plugin developers

Thanks

If the PDF version proves to be a problem, I'll look into preprocessing by Ghostscript

e.g. http://superuser.com/questions/25598/linux-pdf-version-converter

 
Average of ratings: -
Picture of Geoffrey Rowland
Re: UploadPDF assignment type
Group Plugin developers

Hi Davo

Whilst rummaging around the TCPDF and FPDI websites, I noticed updated versions of the libraries (FPDI-1.4.2, FPDF_TPL-1.2 and TCPDF-5.9.133)

http://www.setasign.de/products/pdf-php-solutions/fpdi/downloads/

http://sourceforge.net/projects/tcpdf/files/

I have dropped in the latest versions to our installations of UploadPDF. Not extensively tested, but nothing seems obviously broken. Worth an update on your GitHub repo?

Geoff

Edit: Also, just noticed there is already a /lib/tcpdf in Moodle 2 core. This is also an old version. So, perhaps an update and rationalisation is in order.

 
Average of ratings: -
Picture of Geoffrey Rowland
Re: UploadPDF assignment type
Group Plugin developers

...and added a brief comment to

http://tracker.moodle.org/browse/MDL-29283

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers
I don't generally keep up to date with TCPDF/FPDI releases, partly due to time constraints, partly due to the'if it ain't broke...' Principal.

As for the version in core, at last check that was too old to work with my plugin (several key features missing). I prefer to keep my plugin stand-alone, not requiring the overwriting of core libraries, so (after some debate) I just bundle a more up to date version. If you want a more up to date version included in core, I suggest you open (or find) a relevant tracker issue and suggest it to the core dev team.
 
Average of ratings: -
Picture of Geoffrey Rowland
Re: UploadPDF assignment type
Group Plugin developers

Thanks to Petr Škoda, looks as if an up-to-date TCPDF should now make it into Moodle 2.2 core

http://tracker.moodle.org/browse/MDL-29283

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi there,

I am not sure if this has been answered already but if anyone can help it would be much appreciated.

Problem 1

Running Moodle 1.9+ on Server 2003, MYSQL, IIS. The mod has installed fine but when I go to upload a PDF for marking the error below appears. I have check folder permissions but not sure what access is needed for what.

TCPDF ERROR: Unable to create output file: D:\Inetpub\moodledata/6/moddata/assignment/311/1351/submission/submission.pdf

Problem 2

Running Moodle 2.1.2 on server 2008, MYSQL, IIS. Mod installed fine and works. Try to annotate a PDF in IE8 and the editor appears jumbled up and buttons don't work. Do the same in Firefox and it all works fine. Get the following warning error in IE:

 

Webpage error details from IE8

 

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E; Tablet PC 2.0; InfoPath.3)
Timestamp: Thu, 1 Dec 2011 12:40:53 UTC

 


Message: Unexpected quantifier
Line: 21
Char: 1872
Code: 0
URI: http://webtest.cardinalheenan.leeds.sch.uk/theme/yui_combo.php?3.4.1/build/oop/oop-min.js&3.4.1/build/event-custom-base/event-custom-base-min.js&3.4.1/build/dom-core/dom-core-min.js&3.4.1/build/dom-base/dom-base-min.js&3.4.1/build/selector-native/selector-native-min.js&3.4.1/build/selector/selector-min.js&3.4.1/build/selector-css2/selector-css2-min.js&3.4.1/build/node-core/node-core-min.js&3.4.1/build/node-base/node-base-min.js&3.4.1/build/event-base/event-base-min.js&3.4.1/build/event-base-ie/event-base-ie-min.js&3.4.1/build/event-delegate/event-delegate-min.js&3.4.1/build/node-event-delegate/node-event-delegate-min.js&3.4.1/build/pluginhost-base/pluginhost-base-min.js&3.4.1/build/pluginhost-config/pluginhost-config-min.js&3.4.1/build/node-pluginhost/node-pluginhost-min.js&3.4.1/build/dom-style/dom-style-min.js&3.4.1/build/dom-style-ie/dom-style-ie-min.js&3.4.1/build/dom-screen/dom-screen-min.js&3.4.1/build/node-screen/node-screen-min.js&3.4.1/build/node-style/node-style-min.js&3.4.1/build/event-custom-complex/event-custom-complex-min.js&3.4.1/build/intl/intl-min.js

 

Thanks

 

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

1. Could you check the version number of the PDF you are trying to submit (open in Adobe Reader and select File, Properties). If it is PDF version 1.4 (or below) then it should work fine, if it is PDF version 1.5 (or above) then it may well not work. If you want to know why, see here: http://www.setasign.de/products/pdf-php-solutions/fpdi-pdf-parser/

2. What happens if you click on the 'compatibility mode' button? Does that fix it in IE8? I've not got a copy of IE8 around to test with at the moment, as I've 'upgraded' my home computer to IE9 to fix a different reported bug. I haven't got time at the moment to download & install one of the Microsoft VMs with IE8 in it, to try and get to the bottom of this. Sorry, I can't be of more help with that.

(As an aside, I note from the URLs that you are only 1 hour drive away from me, via the M1)

Davo

 

 

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

1. It is 1.5 (Adobe 6.x) But does work ok on my Moodle 2.0 install as I mentioned. Would what you put cause the error?

2. Not sure will check this in the morning

Cool - so when I break it completely you can nip up the road and sort it out for me! wink

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi there,

I tried compatiblity mode and it did not make any difference

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

I'm afraid I don't know too much about the inner workings of the FPDI / TCPDF libraries, so, without tracing through the code, I'm not really sure what is going wrong.

If I get a moment (when I'm not writing Moodle code for my new employers at Synergy Learning) I'll try running  the code with IE8, but we were using it successfully with IE8 at the college where I used to work, so I'm not sure what the problem is (unless it is something I broke during some recent changes ...).

Have you cleared out the site cache (Admin > Developer > Purge all caches) and the browser cache, just in case that helps?

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Im not sure if it is an IE8 problem as it does not work on any browser for our production 1.9 moodle server.

The 2.0 version seems to work ok o IE9 and firefox.

Is there another version that might work on my 1.9 server? Thats the one I really need to get working the most.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

There were two problems you mention - 1.9: TCPDF error, this is entirely unrelated to the browser and is likely to be due to some permission problem on the server. I really don't know what the error is, as unfortunately FPDI/TCPDF (either of which could be giving the error), are not very forthcoming with details about any errors that occur. Without the error happening in front of me on a development box (where I could trace through it), I cannot say what is going wrong. As I've mentioned before, if you are using a PDF with version > 1.4, then there is a good chance it will not work (I recommend using PDF Creator, to create PDFs as they tend to work well, or, if you are using MS Office, make sure you use the 'PDF/A' mode under 'options'). There are earlier versions of the plugin on GitHub, but they are not likely to solve the problem you are having. Another alternative is to test it out on a Linux/Apache server, as they tend to work better with PHP/Moodle; if that works, then it is certainly a configuration problem on the server.

The 2.0 error is a browser problem, but I can't trace that without downloading an IE8 VM, which I haven't had a chance to do yet.

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi Davo,

Thanks for your help.

If you do come accross anything please let me know.

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi there again!

Just ran a developer console in Firefox for my 1.9 moodle with the TCPDF error and got the attached. Does it make any sense to you?

 


 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

I assume that the errors are related to the page being aborted part way through when it failed to create the PDF file.

Having had a brief further look at this, please could you double-check the permissions on the 'moodledata/6/moddate/assignment/315/1352/submission' folder?

Try setting it to 0777, if it is not set that way already.

If that fixes the problem, then you will need to change the $CFG->directorypermissions in config.php to match this (00777 is the default value).

Davo

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi Davo,

Could you advise what that is in Windows world please as I am running it on IIS on a Windows server.

Thanks.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

0777 (Linux) = Read / Write / Execute

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi Davo,

I don't suppose you know for which group? I have that set for "users". It looks like one of the processes that uploadpdf uses cannot create the folders as when I create the "submission" folder manually it allows the file to upload.

Then I get:
bad folder: D:\Inetpub\moodledata/6/moddata/assignment/316/1352/images

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)

If I then create the "images" folder manually I get:

require_js: yui_element - file not found.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

The group should be whichever group the webserver is in (as that is what needs to be able to create folders and files).

The yui_element error is something different - I'll have a look at why you're getting that error.

Update: had a quick look - please can you confirm that the following file exists on your server:

/lib/yui/element/element-beta-min.js

and that /lib/ajax/ajaxlib.php contains the line:

'yui_element' => '/lib/yui/element/element-beta-min.js'

If either of these are missing, it would explain why you are getting that error (these should both be there in Moodle 1.9).

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi Davo,

The YUI_Element  was missing and also the same line for YUI_Button. Once I added them in it now loads fine and works. Thanks for that.

However I am still stumped by the permissons issue in that the upload folders won't create for submission and images. If I manually create it works but I can't do that for every assignment. Just don't get it...... grrrrr

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

The directories are created by using the PHP mkdir command and passing into it the variable $CFG->directorypermissions, as defined in your config.php file.

By default, this is set to 0777, which should give everyone permission to read, write and execute (open) the directory. Theoretically, this is a security risk. In practice, it is not likely to be a massive problem.

I have no experience of PHP & Windows servers, so you might want to see if there is anyone one one of the other forums who can offer advice on this.

BTW What directory permissions are they starting with (before you manually fix them)? Maybe that will give a clue as to what needs changing.

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi Davo,

The folders are not creating at all for submission and images. Once I create them, leaving default permissions, it works and allows the PDF files to be created.

My config.php file shows $CFG->directorypermissions = 00777; 

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

I'm running out of suggestions here.

My code definitely asks Moodle to create the directories that it requires (otherwise it would never work on any server).

If you wanted to do some more tracing, then maybe adding some 'echo' statements into 'lib/moodlelib.php' in the function 'check_dir_exists' might give a clue, but that function seems to work fine in other situations, so I have no idea why it wouldn't work this time.

 
Average of ratings: -
Picture of Conn Warwicker
Re: UploadPDF assignment type
Group Particularly helpful MoodlersGroup Plugin developers

Hi,

I've installed this on our development server and I've got ghostscript installed as well.

Everything works up until the point that I want to "annotate a submission", when I get to that page, nothing works. I can't add text, or lines or shapes or anything. The "Next" button doesn't work either, or the drop down to change page.

I've tried this in 3 different browsers, but am getting the same result.

We're using Moodle 1.9 and I downloaded the 1.9 version, and there are no errors being displayed when I turn debugging on.

Any ideas?

Thanks.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Are there any javascript errors?

Try using the chrome developer tools (Ctrl + Shift + I) or the Firefox Firebug extension to see if there are any errors.

Which browsers have you tried?

 
Average of ratings: -
Picture of Conn Warwicker
Re: UploadPDF assignment type
Group Particularly helpful MoodlersGroup Plugin developers

Hi, The browsers I've tried are: IE9, Firefox, Opera.

Opera and Firefox do give me a javascript error actually, I forget to check that:

 

[07/12/2011 13:21:04] JavaScript - http://moodledev.bedford.ac.uk/mod/assignment/type/uploadpdf/editcomment.php?id=56440&userid=37255
Event thread: DOMContentLoaded
Uncaught exception: TypeError: '$('pdfholder').adopt' is not a function
Error thrown at line 61, column 5 in (settings) in http://moodledev.bedford.ac.uk/mod/assignment/type/uploadpdf/scripts/annotate.js:
    $('pdfholder').adopt(this.waitel);
called from line 3513, column 2 in () in http://moodledev.bedford.ac.uk/mod/assignment/type/uploadpdf/scripts/mootools-core-1.3.js:
    var result = method.apply(this, arguments);
called via Function.prototype.apply() from line 3471, column 2 in () in http://moodledev.bedford.ac.uk/mod/assignment/type/uploadpdf/scripts/mootools-core-1.3.js:
    var value = (this.initialize) ? this.initialize.apply(this, arguments) : this;
called via Function.prototype.apply() from line 1482, column 4 in startjs() in http://moodledev.bedford.ac.uk/mod/assignment/type/uploadpdf/scripts/annotate.js:
    server = new ServerComm(server_config);
called from line 1843, column 4 in () in http://moodledev.bedford.ac.uk/mod/assignment/type/uploadpdf/scripts/annotate.js:
    startjs();
called from line 4378, column 8 in (fn) in http://moodledev.bedford.ac.uk/mod/assignment/type/uploadpdf/scripts/mootools-core-1.3.js:
    fn.apply(this, args);
called via Function.prototype.apply() from unknown location in (item) in http://moodledev.bedford.ac.uk/mod/assignment/type/uploadpdf/scripts/mootools-core-1.3.js:
    /* no source available */
called from line 326, column 2 in (fn, bind) in http://moodledev.bedford.ac.uk/mod/assignment/type/uploadpdf/scripts/mootools-core-1.3.js:
    Array.forEach(this, fn, bind);
called from line 4376, column 2 in (type, args, delay) in http://moodledev.bedford.ac.uk/mod/assignment/type/uploadpdf/scripts/mootools-core-1.3.js:
    events[type].keys.each(function(fn){
called from line 4485, column 1 in () in http://moodledev.bedford.ac.uk/mod/assignment/type/uploadpdf/scripts/mootools-core-1.3.js:
    window.fireEvent('domready');

I've not used Mootools before, so would have no idea what the adopt() is supposed to do, or why it's not working. 

Any thoughts? The Version of mootools supplied with the uploadpdf seems to be 1.3 if that helps.

 

Thanks.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

The latest version of my plugin includes Mootools 1.4.1

The most likely explanation is that you have jquery included (in your theme?) and that is conflicting with the Mootools use of $.

I've just thrown in a quick fix, so try grabbing the latest code from github:

https://github.com/davosmith/moodle-uploadpdf/zipball/master

OR

https://github.com/davosmith/moodle-uploadpdf/zipball/MOODLE_19_STABLE

 
Average of ratings: Useful (1)
Picture of Conn Warwicker
Re: UploadPDF assignment type
Group Particularly helpful MoodlersGroup Plugin developers

Fixed it in Opera, still seems to not be working in IE though. Odd mixed

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Clear browser cache?

And which version of IE?

 
Average of ratings: -
Picture of Conn Warwicker
Re: UploadPDF assignment type
Group Particularly helpful MoodlersGroup Plugin developers

Tried that several times. It's version 9.

 I turned on the IE debugger now and I'm getting these errors:

 

Line: 321: mootools-core-1.4.1.js, line 321 character 28
Error: Unable to get value of the property 'domready': object is null or undefined

Line: 324
Error: Unable to get value of the property 'load': object is null or undefined

Line: 399: mootools-core-1.4.1.js, line 399 character 41
Error: Unable to delete property 'load': object is null or undefined

Line: 49: mootools-more-1.4.0.1.js, line 49 character 127
Error: Object doesn't support property or method 'set'

 

A little googling seems to show that maybe there is just a problem with using mootools and IE9 unfortunately. 

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers
Odd, it worked fine in ie9 last time I tried it (which was a while ago, as I try to avoid ie as much as possible). Will test again when I get a chance.
 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

@Conn,

I've just tested again in IE9, with Moodle 1.9, 2.0 and 2.3 (alpha).

With the last of these I've even tried switching debugging and javascript caching on and off. 

None of these have produced and javascript errors on my test system, so it must be something about your setup which is causing the javascript errors you mentioned.

Davo

 
Average of ratings: -
Picture of Graham Setters
Re: UploadPDF assignment type
 

Hi Davo,

First off, fantastic idea. This is exactly what I need to give feedback for my writing course. One slight problem, though. You mention in your installation instructions that I need to set permissions for IIS. Could you, or anyone else knowledgeable with IIS, give me detailed instructions on how this can be accomplished? Any help would be greatly appreciated.

My current version of moodle is 2.1.3+ and I'm using PHP 5.3.8. I'm using Server 2008 R2.

Thanks!

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

I'm afraid I've never set up an IIS server, or done anything at all on one, which is why I was rather vague about what needed to be done.

Basically, you need to give the server permission to run the ghostscript executable, but quite how you do this I don't know.

 
Average of ratings: -
Picture of Graham Setters
Re: UploadPDF assignment type
 

I'll root around, and see what I can come up with. If I figure it out, I'll post my solution.

Thanks.

 
Average of ratings: -
Picture of Teddy Aprilianto
Re: UploadPDF assignment type
 

Weird... selection box displayed like this

 

I have installed and 90% working except two things. See above picture. The selection box displayed weird . I'm using moodle 1.9.1   . Please advice how to fix the problem

Thanks

Teddy

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

You don't mention which browser you are running or if there are any Javascript errors.

It might be a problem with your theme (particularly if it does anything with javascript) or it could be a caching problem - try refreshing your page / emptying the browser cache.

 
Average of ratings: -
Picture of Teddy Aprilianto
Re: UploadPDF assignment type
 

I'm using Firefox .... I'll try other browsers

What kind of things that potentially can make  the plugin doesn't work ??

Thanks

Teddy

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

@Teddy - If I knew that, then I would have fixed them.

If you are using firefox, then install firebug and let me know of any javascript error messages.

 
Average of ratings: -
Picture of Teddy Aprilianto
Re: UploadPDF assignment type
 

haha , make sense .

I have already installed firebug  and no errors on console , even warning . 

So I have no clue why this happened.

Thanks

TA

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

@Teddy - could you make sure you have the latest version of the code from https://github.com/davosmith/moodle-uploadpdf/zipball/MOODLE_19_STABLE

Are you able to use the javascript debugger in firebug?

If so, stepping through the 'startjs' function in 'uploadpdf/scripts/annotate.js' might give some clue as to what is going wrong. After that, I'm not sure what else to suggest.

 
Average of ratings: -
Picture of Teddy Aprilianto
Re: UploadPDF assignment type
 

Hi,

Ok I have upgraded to latest version .

Now when I click the selection box I've got errors like this. Please see below picture . I also attach the JS file that mentioned in this errors. The file is located in /lib/yui/button/button-beta-min.js

Thanks

Teddy

 

uploadpdf errors

 

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

@Teddy - something is certainly going wrong before it gets to the point where you click on the button.

The file you attached does not help, as that only tells me that the button has not been set up correctly, not why (and the 'minified' versions of these files are pretty much unreadable anyway).

If you were able to switch to the 'script' tab, put a breakpoint on line 1462 of annotate.js (it should be just inside 'startjs()') - you can add breakpoints by clicking just to the left of the line, so that a red dot appears. Then refresh the page and press the 'step over' button until it gets to the end of the function.

If it stops early, then that might be a clue as to what is going wrong.

Unfortunately (for you, at least), I have been unable to reproduce this problem with the latest version of my code & Moodle code, so there isn't really a lot I can suggest to help.

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi,

I am getting the strange layout problem where all the button menus display on the page when annotating a PDF. This seems to happen in IE9 but works fine in chrome. 

I am now running a linux install with apache and MYSQL rather than a windws version. Moodle version 2.2 also. 

I thought this problem was related to my old 1.9 Windows install but seemingly not

Any ideas?

Thanks

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

@Richard - Last time I tried it in IE9, it was working fine.

Have you got compatibility mode on or off?

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi Dave,

Compat mode is definately off. I have tried it both on and off to see what happens but it is still the same.

I have tried it on a work machine with IE9 and a home one just to check it is not something on our network; I get the same result on both I'm afraid.

 

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

@Richard - I just checked again with IE9 (I don't regularly test with IE, as I mostly develop under Linux).

I've spotted a bug in the JS which was preventing it from working (introduced back in February, when I added the 'highligher' functionality).

The new version should fix those problems.

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi Davo,

Which link should I use to download the new version?

And do I just copy over the current one and go to site notifications to upgrade?

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Both Github and Moodle.org versions are up-to-date, so either.

Yes, the usual upgrade process. Drop the files in, run notifications upgrade (but note, you *may* also need to clear the browser cache to get the fixed javascript to appear immediately - although that may just be when development settings are enabled).

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi Davo,

I have updated to the version released today but am still having the problem even after clearing the broswer cache. When I go in to IE developer mode I can see the following error:

SCRIPT5007: Unable to delete property 'load': object is null or undefined

javascript.php?file=%2Fmod%2Fassignment%2Ftype%2Fuploadpdf%2Fscripts%2Fmootools-core-1.4.1.js&rev=293, line 1 character 71936

SCRIPT438: Object doesn't support property or method 'set'

javascript.php?file=%2Fmod%2Fassignment%2Ftype%2Fuploadpdf%2Fscripts%2Fmootools-more-1.4.0.1.js&rev=293, line 1 character 7585

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi Davo,

Have you had chance to look at this?

Regards,

Richard

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

@Richard - I've not had a free evening to do this yet - maybe tomorrow night.

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

No worries mate. Anything you can do would be much appreciated. 

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

@Richard - I've found a couple of spare minutes this morning and tried this out.

I've not been able to reproduce the problem at all - I'm able to open up an assignment in IE9, navigate through the pages, add & delete comments and annotations without any problems.

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi Davo,

Found the last problem! There was a network setting that had ticked "Display Intranet Sites in Compatibility View" for all machines. Now having turned that off it works a treat in IE!

Also tested it at home and your last fix seems to have sorted that as well!

Chrome, Firefox and IE all now seem good!

Thanks again for all your help with this!

Regards,

Richard

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

@Richard - phew! Glad it wasn't something I'd done wrong smile

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

No mate - it all works great now! Thanks again for all your help.

 
Average of ratings: -
Picture of Richard Oelmann
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developersGroup Testers

Hi Davo,

This module looks absolutely brilliant and ticks so many boxes for requirements in our university. However, I'm having a problem with it and wondered if you can see what I've done wrong - or what step I've missed out in setting it up.

I've set a test assignment, uploaded a coversheet and then logged on as a student to submit a file, but it then gives me the error message below

Warning: copy(C:\dev2moodle_data/temp/uploadpdf/sub/coversheet.pdf): failed to open stream: No such file or directory in C:\dev2moodle\lib\filestorage\stored_file.php on line 177

We are using a Windows server with IIS, Moodle2.2 and downloaded the code from the plugins database yesterday. Our technician set up ghostscript for me yesterday based ont he instructions on the plugins page. But I'm guessing I have/he has missed a step somewhere, but I can't see what.

Many thanks

Richard

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

@Richard - it certainly isn't a Ghostscript problem (Ghostscript is not used until you come to view/annotate the pages in the browser - it creates the images of each of the pages).

Unfortunately, I don't know what the problem actually is.

Could you take a look on your server in the c:\dev2moodle_data\temp\uploadpdf\sub folder and make sure that:

a) it exists (a good starting point!)

b) IIS has permission to write to that folder

After that, I don't know what else to suggest - looking at the code it certainly checks for the existence of the correct folder, then creates it, if it doesn't exist.

Aside from that, my only other suggestion would be that Moodle (and most other PHP applications) generally seem to be much happier running on Apache, not IIS (and preferably on a Linux system, not Windows). But I could be wrong about that, as my web hosting experience has only been with Linux / Apache.

 
Average of ratings: -
Picture of Richard Oelmann
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developersGroup Testers

Hi Davo,

Thanks for the swift reply. My own experience is also in Linux/Apache, but unfortunately my university IT team is set with MS/IIS (I have raised the question but been told that they will be sticking with Windows/IIS)

I don't currently have access to the moodledata folder (dev2moodle_data) but will pass on your helpful comments to our technician to look at - and to see if i can be given that access myself!

Many thanks for your work on this module smile

Richard

 
Average of ratings: -
Picture of Richard Oelmann
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developersGroup Testers

Hi Davo,

Just to let you know, I got this working - the issue was related to permissions on our IIS server. It seems by default they are quite tied down and this was preventing the mod from creating the combined pdf

Thanks for a wonderful tool!

Richard

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

I just wanted to announce a few new features in the latest version of the UploadPDF plugin (which is available here: http://moodle.org/plugins/view.php?plugin=assignment_uploadpdf )

  • New 'highlighter' tool (this is not perfect - it only works with text on a plain background, but hopefully it will be of use to some teachers)
  • Better PDF compatibility - should now be able to cope with any PDFs students throw at it (as it silently converts any unsupported PDF versions using Ghostscript when the files are uploaded).
  • Various compatibility fixes (other javascript libraries / IE9 / Postgres)

Please let me know if there are any problems.

 
Average of ratings: -
Mary Cooch
Re: UploadPDF assignment type
Group Documentation writersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup TestersGroup Translators

Davo Smith is my herosmile

 
Average of ratings: -
Picture of Geoffrey Rowland
Re: UploadPDF assignment type
Group Plugin developers

Thanks Davo

Any chance of backporting the new features to the Moodle 1.9 version?

The improved PDF compatibility looks particularly useful.

Thanks again.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

@Geoffrey - I really don't want to be maintaining the Moodle 1.9 version any longer. I could take a look at it, but anything to do with files is very different between the two versions.

 
Average of ratings: -
Picture of Geoffrey Rowland
Re: UploadPDF assignment type
Group Plugin developers

Hi Davo

Fully understand your focus on development for Moodle 2.x. Indeed, I really hope your UploadPDF assignment type makes it into Moodle 2.3 core as part of the refactoring of Moodle Assignments.

However, I have just got some lecturer colleagues interested in using UploadPDF assignments and want to make their experience as easy and rich as possible. For this academic year (i.e. until the summer) they'll be stuck with Moodle 1.9.x.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers
There is no chance of uploadpdf being in core for 2.3. That is not even being proposed, even if the code met the Moodle code guidelines (that is before you even consider the use of MooTools, instead of YUI). There may be something I can do with pdf compatibility in 1.9, but will have to wait until I have a spare evening...
 
Average of ratings: -
Picture of Geoffrey Rowland
Re: UploadPDF assignment type
Group Plugin developers

"There is no chance of uploadpdf being in core for 2.3."

Shame! sad

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

I got a little more carried away this evening:

  • there is now a 'stamps' tool (with some little images I have drawn - so please feel free to send me some improved images if you have more drawing talent than I have).
  • I've also fixed the 'highlighter' tool to work properly

Note: the stamps can be customised for a site - just drop some 'png' files (with transparent backgrounds) into the 'pix/stamps' folder and they'll automatically be picked up and available for all users.

 
Average of ratings: -
Picture of Paul Winslow
Re: UploadPDF assignment type
 

I've been unable to get the highlighter tool to work properly.  When I select text, the generated response file kicks up the highlight and misaligns it.

 

I've attached a sample file . . . the beginning part works fine, but the middle portion should highlight every other line, but you can see the jumping.

 

I would love for this highlighting feature to work . . . I'm a teacher and we use highlighting for revision.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

@Paul - I will try and look at the alignment of the highlighting soon, but it might be a while before I can do so. Could you pop something on tracker.moodle.org to remind me to fix it?

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

@Paul - could you test out the latest version on GitHub https://github.com/davosmith/moodle-uploadpdf

The highligher now seems to be lined up properly on the files I've tested (including adding extra annotations to your attachment).

Only tested with Firefox and Chrome this morning, as haven't got a Windows machine booted up at the moment.

Will update the version on Moodle.org, once you've confirmed it is all OK.

 
Average of ratings: -
Picture of Paul Winslow
Re: UploadPDF assignment type
 

Dave,

 

Looks like that did it.  I tried on a few documents and it looks pretty good.

 

Any chance for tablet support?  You would be a godsend to teachers . . . correcting papers with a stylus on an iPad or tablet would truly convert schools like you couldn't imagine.

Amazing plugin . . . should be standard in Moodle . . . serious.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers
I can't see why it wouldn't work on a tablet. It uses standard Javascript and has a freehand drawing tool. I don't have a tablet to test it with, so can't check.
 
Average of ratings: -
Picture of Paul Winslow
Re: UploadPDF assignment type
 

Yeah … that's what I thought but when I tried it on my Android-based tablet and my iPhone, it doesn't seem to be collapsing the editing option tools and leaves huge HTML boxes open as if the JavaScript isn't kicking in. It also leaves the PDF document on the bottom and doesn't place it into an edit box. It did load correctly on my Android but then when I tried to edit the PDF any movement and swipes on the PDF Simply move the screen around. Tried three diff tablets so I don't thInk it's the tablet. Anyone else get it to work on a tablet??

 
Average of ratings: -
Frankie's the name, Moodle's my game!
Re: UploadPDF assignment type
Group Particularly helpful MoodlersGroup Plugin developers

HI Paul (and Davo!)

I came to this thread because I wanted to inform Davo that the Pen tool to write handwriting (or squiggles since I use the mouse to write instead of a stylus!!!) when editing the PDF, does NOT work in mobile devices running on Android OS. Ah, but Paul, you've already beaten me to it, and you have reported it here! So my entry (post) is just to confirm what you have already mentioned.

>> It did load correctly on my Android but then when I tried to edit
>> the PDF any movement and swipes on the PDF Simply move the
>> screen around. 

Yup. Same thing. I tried it on a Samsung Galaxy Tab  10.1using, what, Honeycomb(?) and some clone tablet running on Andriod 2.x, all I get is the screen moving around. It's as though Android won't allow the pen writing tool to activate. 

Davo, any ideas to get the pen tool to work properly in Android?

Regards
Frankie Kam


BTW, your UplodPDF Module is my *the* choice for BEST MOODLE MODULE ever! I'm nominating it because of its simplicity and practical use in my college. Just that I need a stylus instead of a mouse. And Samsung Galaxy Tabs don't have use styluses. Samsung Galaxy Note (yummy!!!)  does use a stylus, but it's outside of my affordable price range.

 
Average of ratings: -
Picture of huizhou rong
回复: UploadPDF assignment type
 

Hi,

I use the Linux as webserver. And n the uploadpdf_config.php, there's a comment says:
$CFG->gs_path = 'gs';
/*
 **Linux server**: the path should be 'gs' (unless you have installed ghostscript outside of the PATH, in which case the full directory path might be needed
*/

What does the word "PATH" means?
If I install the ghostscript in "/usr/local/ghostscript-9.05", what the "$CFG->gs_path" should be?

Thank you!

 
Average of ratings: -
Davo
Re: 回复: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

http://lowfatlinux.com/linux-environment-variables.html

(the section about 'understanding the PATH variable')

Wherever you installed the bulk of ghostscript, the actual executable is usually in /usr/bin/gs (or at least a link to the executable is placed there). /usr/bin is usually in the PATH variable.

Unless you have gone out of your way to install ghostscript in a strange way, then 'gs' will already be in the path and you will have nothing to do (and in most cases it should have been installed through the standard repos for whatever Linux distro you are using, so it will be fine).

 
Average of ratings: -
Frankie's the name, Moodle's my game!
Re: UploadPDF assignment type
Group Particularly helpful MoodlersGroup Plugin developers

Hi Davo, just to let you know that the Pen tool (in UploadPDF module) used to write handwriting (or squiggles since I use the mouse to write instead of a stylus!!!) when editing the PDF, does NOT work in mobile devices running on Android OS. If that could be corrected then it would make your module available on thousands, if not millions, of Android mobile devices like tablets and smartphones.

Frankie Kam
 

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Thinking about, I guess that a few 'e.preventDefault(); e.stopPropagation();' lines added to the line drawing code might help, but I'd have to find some time to test it.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

After some experimentation with my Android phone, I was able to get the code to detect touches on the screen, ready to draw the lines.

However, there were two major (showstopper) problems I've encountered:

  • The Raphael javascript library I use for displaying the lines does not support the Android browser (I assume this is a case of the Android browser not supporting the canvas tag, but I've not investigated further).
  • If you scroll down to the middle of the page, it is very difficult to get back off it again, as line drawing replaces page scrolling (I guess there may be some clever trick I could do with floating elements on a mobile phone, but I'm really not up for the amount of work this would be).

Note, I have not tried this on any iPad/Phone devices, as I do not own any (this is not a situation I have any intention of changing).

 
Average of ratings: -
Frankie's the name, Moodle's my game!
Re: UploadPDF assignment type
Group Particularly helpful MoodlersGroup Plugin developers

> as I do not own any (this is not a situation I have any intention of changing).
>
If I may be so bold as to ask, Sire, "Why not?".

 
Average of ratings: -
Picture of John Ryan
Re: UploadPDF assignment type
 

My students have clicked the "Send for marking" button but one of them uploaded the wrong document.

However, I can't find a way of reverting the setting so that they can upload the correct file.

I'm using moodle 2.0.8 and plugin->version  = 2012020700;

 
Average of ratings: -
I Teach With Moodle
Re: UploadPDF assignment type
Group Particularly helpful MoodlersGroup Plugin developersGroup Testers

Hey John,

you need to go click on 'View xxx assignments', then scroll down to the student in question, click 'grade' and on that screen you'll see an option to 'revert to draft'. The student will then have to go and delete the assignment themselves & replace it with a new one. Alternatively you could 'login as' your student and delete it for them.

There might be another way but that's the only one I have found so far.

Cheers,

Fred

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers
Fred, that is correct, there is no other way to revert assignments.
 
Average of ratings: -
Picture of John Ryan
Re: UploadPDF assignment type
 

That is what I have done previously with other assignment types.  But with uploadpdf the option to revert to draft is not there.

I have tried logging in as the student but they don't have any option to delete either.  This I believe is deliberate -to stop students changing submissions once they have sent them for marking.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers
Have you given the student a grade? As with the standard upload multiple format (which I based my code on), you cannot revert to draft if you have given a grade (although you can choose 'no grade' and click save, then revert to draft).
 
Average of ratings: -
Picture of John Ryan
Re: UploadPDF assignment type
 

Thank you Davo -that was the problem.

He had failed to submit his work by the deadline so I had given him a "Not completed" grade.

Thanks for the help.

Can students still upload further work if, for example, they want to improve on the given grade? This is a requirement on several of our courses.

 
Average of ratings: -
Picture of Kees Koopman
Re: UploadPDF assignment type
 

I can't choose "no grade" when i choose for rubric-assignments. So i can't revert to draft from there. Is there an workaround?

KeesK

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

I've not tried with rubric assignments, so I can't really help with that. I am not sure there is a workaround, without altering the code to allow reverting to draft when a grade has been saved.

 
Average of ratings: -
Picture of Kees Koopman
Re: UploadPDF assignment type
 

Problem: i can't choose for plagiarism-control for the documents which are send to me. I don't see a solution. What do i wrong?

KeesK

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Uploadpdf does not currently support plagiarism detection. I hope that when I finish rewriting the plugin to work with the new 'assign' module (which should be replacing the assignment module in 2.3), then plagiarism will be supported.

 
Average of ratings: -
Picture of Richard Oelmann
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developersGroup Testers

Really looking forward to seeing this on 2.3 Davo.

I'm currently working on our upgrade from 1.9(.3) to Moodle2 for the summer (we can do a major upgrade between academic years) and I would really like to go to 2.3 with the new assignment tools being developed, but one of the most eagerly anticipated developments I've added to our testing environment recently has been your uploadpdf tool. Without that, I can see me going with 2.2 only and not pushing on to get 2.3 installed once it's out. smile

Thanks for a fantastic tool!

Richard

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

@Richard - thanks for the vote of encouragement.

I'm hoping I'll have my plugin ready for the 2.3 launch, but it all depends on me having a few free evenings to do the rewrite (I know what needs doing, I just need time to do it). However, current status with 2.3 would suggest that mod_assignment will still be there, in parallel with mod_assign (with, I assume, mod_assignment being dropped in 2.4). That means the current version of my plugin *should* still work.

Davo

 
Average of ratings: -
Picture of Nadav Kavalerchik
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developersGroup TestersGroup Translators

@Davo

Thanks you for a beautiful and very useful plugin!!!

How about using Moodle's lib/tcpdf instead of the one you distribute with the plugin?

It is outdated and does not support Hebrew fonts (Which is very important to us Hebrew folks) and also can save some diskspace. 

What do you think?

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

@Nadav - When I wrote the plugin, the Moodle version of TCPDF was so massively out of date that it didn't support several bits I needed for my plugin to work.

I did recently notice that the Moodle version was more up-to-date, but haven't had a chance to switch over.

I'm guessing it'd be fairly straightforward to do (probably only needs one require_once line changing), but would need testing as well.

 
Average of ratings: -
Picture of Rex Lorenzo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developersGroup Plugins guardiansGroup Testers

Davo, when you update your tool for Moodle 2.3 will existing assignments created with this tool be upgraded as well?

I am wondering if we should install/try out this plugin now with out Moodle 2.2 install or wait until we upgrade to Moodle 2.3 and also have your tool upgraded to support the new assignment module.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

@Rex

Ideally, yes the updated version of my plugin will upgrade all old assignments to the new version.

However, whether or not it does end up doing so will depend on a number of factors:

  • How much free time I have (I no longer have any marking to do, so updating this plugin falls into the 'hobby' category)
  • How long it takes to write the main part of the upgrade
  • How difficult it is to write the migration code
 
Average of ratings: -
Picture of Rex Lorenzo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developersGroup Plugins guardiansGroup Testers

Hey Davo, we just deployed out Moodle 2.3 a few weeks ago and turned off the old assignment tool.

Now we are getting some requests/inquiries on the ability to do inline grading of student submissions.

I am watching your github repo and wanted to know if you have gotten a chance on porting over this plugin to use the new assignment subtype for 2.3. We can help in testing.

We don't have any existing assignments using uploadpdf for 2.2 and lower, so we don't need the migration code.

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

I've not done any work on it for a while. I'd still like to make a 2.3 version, but it's not looking like it will get done anytime soon, unless anyone is able to step forward and pay for me to get it done during my working day. It's probably about 3 days work (but that is a lot of evenings, if I'm only getting a couple of hours done at a time, when I've got a spare evening and still want to write Moodle code after a day of working on it).

 
Average of ratings: -
Picture of Jim Daly
Re: UploadPDF assignment type
 

Hi Davo,
We are using IE8 and finding that the annotation tools appear in a column down the left of the screen and when you click on them nothing happens. Moodle itself does not display any messages at this point with debug switched on. With IE Developer turned on things come to a halt at the point shown in the screenshot below. Does it suggest anything we might look at further?
Regards
Jim Daly

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

@Jim - I'm afraid that doesn't really help me any further. The screenshot shows the state of the HTML when it fails, but not the javascript code that it is failing on.

You might try looking at the line number in the error and putting a breakpoint just before that line then reloading the page. If that is not possible, then at least letting me know the line number of the error and what code is on that line would help.

 
Average of ratings: -
Picture of Jim Daly
Re: UploadPDF assignment type
 

Hi Davo

I've never developed in this area and don't know the tools so I'm probably not giving you as much information as I could - but the module is hitting an error in line 7 of yui.min.js. The error message is '1 is null or not an object'. See screen shots below.  

We have teachers gearing up to use this at the college and if you could give us any assistance in getting this great module working again it would be much appreciated.

Jim

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

I'm afraid the line of code which is breaking on is insde the YUI library, so I can't tell what has actually caused it to fail on that line (which is probably a bad value that IE is processing earlier).

I'm not going to be available to look at this for at least a week now, but I will try to see if I can reproduce it locally, otherwise I'm not going to be able to get to the bottom of it.

 
Average of ratings: -
Picture of Michael Wuttke
Re: UploadPDF assignment type
 

Hello Davo,

I am using moodle in the latest version 2.3.1+ (Build: 20120726) with apache2.2, php5.3 and postgresql-8.4 and the assignment_uploadpdf plugin (version 2012043000).

When I turn the debugging-modus on up to the developer-level then I am getting the following error-massage from the cron-job:

PHP Strict standards:  Declaration of assignment_uploadpdf::send_file() should be compatible with that of assignment_base::send_file() in /var/www/moodle/mod/assignment/type/uploadpdf/assignment.class.php on line 2315
PHP Stack trace:
PHP   1. {main}() /var/www/moodle/admin/cli/cron.php:0
PHP   2. cron_run() /var/www/moodle/admin/cli/cron.php:61
PHP   3. assignment_cron() /var/www/moodle/lib/cronlib.php:259
PHP Strict standards:  Declaration of FPDF_TPL::Image() should be compatible with that of TCPDF::Image() in /var/www/moodle/mod/assignment/type/uploadpdf/fpdi/fpdf_tpl.php on line 409
PHP Stack trace:
PHP   1. {main}() /var/www/moodle/admin/cli/cron.php:0
PHP   2. cron_run() /var/www/moodle/admin/cli/cron.php:61
PHP   3. assignment_cron() /var/www/moodle/lib/cronlib.php:259
PHP   4. require_once() /var/www/moodle/mod/assignment/lib.php:2805
PHP   5. require_once() /var/www/moodle/mod/assignment/type/uploadpdf/assignment.class.php:6
PHP   6. require_once() /var/www/moodle/mod/assignment/type/uploadpdf/mypdflib.php:5
Default exception handler: Error by reading the database Debug: ERROR:  Subquery in FROM must receive aliases
LINE 1: SELECT COUNT(*) FROM (
                              ^
HINT:  FOR EXAMPLE FROM (SELECT ...) [AS] xyz.
SELECT COUNT(*) FROM (
        SELECT DISTINCT ue.userid, e.courseid
        FROM mdl_user_enrolments ue, mdl_enrol e, mdl_course c
        WHERE ue.enrolid = e.id
            AND e.courseid <> $1
            AND c.id = e.courseid
            AND c.visible = 1)
[array (
  0 => '1',
)]
Error code: dmlreadexception
* line 407 of /lib/dml/moodle_database.php: dml_read_exception thrown
* line 239 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
* line 708 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
* line 1346 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_records_sql()
* line 1419 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
* line 1590 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()
* line 4044 of /course/lib.php: call to moodle_database->count_records_sql()
* line 255 of /admin/registration/lib.php: call to average_number_of_participants()
* line 66 of /admin/registration/lib.php: call to registration_manager->get_site_info()
* line 380 of /lib/cronlib.php: call to registration_manager->cron()
* line 61 of /admin/cli/cron.php: call to cron_run()

Can you help me plaese with this issue?

Thanks & Greetings,

michael

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Michael

There are two warnings messages related to my plugin (they are only 'strict' warnings, which means there isn't actually a problem, but they are there to help catch subtle mistakes). These were both fixed in my code early last month (although I haven't yet updated the Moodle.org plugins database, so you'll have to get the code from the github repo: https://github.com/davosmith/moodle-uploadpdf ).

The error message is related to Moodle core code, so I suggest you raise an issue on tracker.moodle.org (everything from 'Default exception handler' onwards).

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi,

I have installed the plugin on to our new 2.3 Moodle install. It seems to work fine for most users, but for a handful I get the following error when going to submit an assignment for marking:

TCPDF ERROR: Unable to find pointer to xref table

I can then go to another user and they can upload fine. But then return to the other and they get the error. The have a draft saved but cannot submit.

Hope you can help!

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Sounds like a bad PDF file - can other users upload the same file?

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hmm - I shall get them to try and feedback to you.

It isn't the same source file as they where created in MS Word and saved as PDF.

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi Davo,

You got it spot on. They had a number of corrupt PDFs generated from MS Word.

We do have a new issue though:

A handful of students appear to have submitted the same PDF somehow. It looks like one has overwritten another during the submission process? At the time a number of students, most of the class submitted assignments together. 

E.G. The submission from one person appears to have also gone in as the submission for another.

Any thoughts?

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Richard - that sounds pretty much impossible (unless there is a very strange bug in my code). The submissions are all kept separately, based on the submission ID (which is unique to each person).

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi Davo,

I thought as much too and have asked the teacher to double check.

In theory there is no chance that it can happen even if uploading at the same time?

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Richard - no, the submission ID is not related to the time that the file was uploaded.

If you have access to the datbase, then you can take a look at the following tables:

mdl_assignment - to find the 'id' of the relevant assignment

mdl_assignment_submissions - look for the 'userid' of the students who have uploaded the work and make sure the 'assignment' value matches the 'id' from mdl_assignment

mdl_files - look for compnent = 'mod_assignment', filearea = 'submission' and itemid = the 'id' from mdl_assignment_submissions.

You will see that there are separate entries in mdl_files for the separate submissions by the different stutents and that it would be impossible for two submissions to share the same entry in the mdl_files table (as there is only one space for the 'itemid' that matches the file to the submission). It is possible that the two 'files' entries may share the same physical file on the server hard disk, but only if an identical file was uploaded in the first place.

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi davo,

Attached is a doc with the results of my findings following your instructions. Is this what you would expect to see?

Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Well, looking at the submitted documents they have different filenames and different contents (from the 'contenthash' value).

Are you able to repeat the same DB queries for the same users, but look at the 'submissionfinal' filearea. The contextid will be the same (4940) as will the component (mod_assignment) and the itemids will be the same (24439, 24442, 24446, 24432)?

If those come out with matching contenthash values (the filenames will all be 'submission.pdf' anyway, as I've hard-coded that for the final submission), then there is a problem with my code. If not, then the files are not actually the same.

Another thing you could try, is to physically compare the files themselves in the data storage - so look at the file '[moodledatafolder]/filedir/86/f7/86f7d0930406d...' (the name should match the 'contenthash' value) and compare it to '[moodledatafolder]/filedir/4c/46/4c462ae9a8ba...'. Once you've copied the files, you may need to rename them to end '.pdf' to open them in Adobe Reader. Once done, the files *should* be different (but match what the student submitted).

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi Davo,

These are the results attached.

How do I find the file paths to do the compare?

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

I've checked the screenshots and can clearly see that all 4 'submission.pdf' files have different content (if you are using coversheets, then that could be explained by them having the same initial file, but having different data in the coversheet, but given that the original files were different, I think that is unlikely).

As I stated in the last message, you need to look in your 'moodledata' directory on your server - I cannot tell you where that is, it depends on where it was placed when you first set up your moodle install (although looking in the main 'config.php' file in the Moodle code folder for '$CFG->dataroot' will tell you where it is located).

Once you've located the moodledata folder, you then need to find the 'filedir' folder and then look for the files in the subdirectories there. If the 'contenthash' of the file is, for example, 'cfe0640de78cf2a42...' (rest ommitted to avoid me typing any more), then the file will be found, on the server, in:

[moodledata]/filedir/cf/e0/cfe0640de78cf2a42... 

If you copy that file out (do not alter it or delete it where it is!) and then rename it to end '.pdf' you should be able to open it in Adobe reader and check the file is what you expected. You should find that, for each user, the files in 'submission' should be the same as the file in 'submissionfinal', with (optionally) a coversheet attached and all files combined together (if there were originally more than one file submitted).

The 'submissionfinal' file should also be what you get if you click through to annotate the file in Moodle, or if you click to download the file. If, somewhere along the lines, a file is not matching up with what you expected, then that would be a bug that I need to investigate.

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi Davo,

I have been through and compared the submission with submission final for the 4 examples I gave you. The files in submission match submission final.

But their in lies the problem I think. For each pair of the 4 people, they seem to have the same pdf in both areas. So the first though is have they cheated and uploaded the same pdf? Given that we have a couple of examples of this and the teacher says they have not uploaded the same files, I am unsure what is happening.

Could they somehow have gotten duplicated if the uploads occurred at the extract same time or something crazy like that?   

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

I'll look into this a bit further.

I have spotted one possible way that the files might have got mixed up - during the upload process files are converted if they are of PDF version 1.5 or greater.

It might be possible for this to duplicate files in very strange circumstances. I'll look into this.

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Cheers Davo. Any help is greatfully received. We are starting to use this quite heavily now so anything you can offer would really help!

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

I've been back through the code and made a few changes to ensure that all the temporary files that are created during PDF operations (processing the file on initial upload, combining the files during submission, generating the images for marking and generating the final, annotated version) are now put in a uniquely named folder each time (which is generated based on the userid, the submissionid and the current time).

This should ensure that there can never be any files getting mixed up during the submission process.

The updated plugin can be found here: https://github.com/davosmith/moodle-uploadpdf/zipball/master 

Please let me know of any problems with it and, if it is all OK, I'll make it available on Moodle.org (I've tested locally and all seems to be OK, but it's worth double-checking before I do a full release).

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Cheers Davo. Will give it a go over the weekend. Do I simply delete the old plugin folder and copy the new one in? 

Will existing Upload PDF assignment activities be ok?

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Yes, delete the old code and put this over the top.

There is no change to the data and it won't fix any of the duplicated assignments that are already there, but it should ensure that any future submissions cannot get mixed up like they appear to have done in the cases you highlighted.

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Thanks Davo - that's cracking!

I have updated our code and have asked the teacher to get a class load of students to upload at once again. I shall feedback once this has been done.

Once again - thanks very much for all your prompt help with this! smile

 
Average of ratings: -
Picture of Richard Lian
Re: UploadPDF assignment type
 

Hi Davo,

Just letting you know that we have not fully tested this with a large class but so far have not seen the issue again. I will let you know if we do.

Thanks for all your help!

 
Average of ratings: -
Davo
Re: UploadPDF assignment type
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Richard - thanks for testing this and getting back to me. I've now released the new version to Moodle.org, as well as on github.

 
Average of ratings: -