Commit Graph

74 Commits

Author SHA1 Message Date
4a6edc5767 MDL-63349 assignfeedback_editpdf: Rotate submitted image automatically 2019-10-11 15:26:53 +11:00
f2ad613278 MDL-61537 assignfeedback_editpdf: Check for existence of old test images
Since error suppression was removed with the call to unlink() to make
sure that there are no previous test image files before testing for the
gs path, make sure that it exists first before deleting to prevent it
from throwing any errors.
2019-03-21 22:38:05 +08:00
9432553b1c MDL-61537 assignfeedback_editpdf: Rotate PDF page
Add page rotation feature.
2019-03-15 15:02:33 +11:00
e3511e7978 MDL-60008 assign: Info messages
Better support for information messages from the conversion process.
2018-12-06 13:33:12 +08:00
86c577093b MDL-60008 assignfeedback_editpdf: Show warnings
When not all files are available in the online pdf, display a warning to graders
that some files must be downloaded.
2018-12-06 12:11:47 +08:00
0888ebc1f9 MDL-60008 assign: Best effort document conversion
Basically we should produce a combined PDF from all the files that it was possible to convert.
If any one submission input file fails conversion, it should just be omitted in the result.
2018-12-06 12:11:47 +08:00
bd5fdcfccd MDL-63422 general: review core loop / switch / case / continue
This commit reviews all continue uses in core happening within a
loop / switch / case hierarchy. This does not cover:

- Changes to libraries. Will be handled in another issue / commit.
- Uses out from loops, will be reviewed by other commit.

The policy followed has been:
- When possible, take rid of the continue.
- When clearly the intention was to jump to next element in loop
  change to continue 2
- When it was not clear, keep old behavior switching to break, no
  matter how weird the behavior may be.
2018-10-31 00:17:59 +01:00
6592598f71 MDL-63531 assignfeedback: Update to use the new privacy interface.
This now uses the new interface to allow the deletion of users based
on a context.
2018-10-30 09:47:14 +08:00
efacf3a099 MDL-61052 assign: Do not queue conversions
Identical submissions do not require individual conversions from the document converter. Text passing through
format_text cannot be trusted and is likely to be unique each time, even for the same text.
2018-10-22 11:56:57 +08:00
888d7b585f MDL-61052 assign: Improve strip_images() to avoid HTML5 tags errors 2018-10-22 11:56:33 +08:00
490e48a4df MDL-63439 assign: Unicode charsets for pdf
Prefer to use freesans font for generated pdfs as it has the biggest charset support.
2018-10-09 09:28:06 +08:00
1afbb97b6b MDL-57610 assignfeedback_editpdf: integration cleanup
* Add a note to upgrade.php to notify devs/admins of the new setting.
* Replace update_record with set_field.
* Add missing phpdoc.
2018-09-25 09:54:39 +09:30
b722a457ad MDL-57610 assignfeedback_editpdf: remove queued jobs that keep failing
Without this, its possible to get a document in the editpdf conversion queue
that keeps failing - and in some cases completely crashing the PHP script
despite exception handling - which ends up blocking the processing of the queue
entirely.

This change allows for a configurable number of attempts the conversion
task will perform before removing the item from the queue.
2018-09-17 09:30:43 +09:30
bbaab1bae7 Merge branch 'MDL-44081-master' of git://github.com/zig-moodle/moodle 2018-07-04 10:50:25 +08:00
bc87f6a2e3 MDL-44081 assign: Fix Grader annotation button accessibility ordering 2018-06-29 09:26:58 +08:00
88c77c8ea3 MDL-60014 assign: Annotate PDF - catch no permission error 2018-06-25 14:11:24 -04:00
8e64242131 MDL-62225 assignfeedback_editpdf: Add alt text for nav button shortcuts 2018-05-30 15:58:18 +01:00
468c8d39c3 MDL-62351 privacy: check that subsystem/plugintype exist 2018-05-09 17:37:31 +08:00
c166b700d8 Merge branch 'MDL-61194-master' of git://git.cameron1729.xyz/moodle 2018-05-03 17:07:57 +08:00
23fe1e2bed MDL-61194 assignfeedback_editpdf: Check if we can convert online text
This patch adds a check to make sure there is a converter available that
will be able to handle html->pdf conversion before adding onlinetext
submissions to the list of files to combine.
2018-05-03 16:44:27 +08:00
f8650bb7a3 MDL-61308 assign_feedback: Privacy code for user rights. 2018-04-26 14:17:55 +08:00
5e6a36f845 MDL-59885 assignfeedback_editpdf: Correctly report combination status 2017-08-21 15:32:02 +08:00
23990a0a80 MDL-55459 assignfeedback_editpdf: Make comments collapsible in editor 2017-03-27 15:13:37 +01:00
2c153c5649 MDL-55459 assignfeedback_editpdf: Add linked comments and markers to PDF 2017-03-24 09:48:42 +00:00
3e6adcd69c MDL-40759 icons: Rename activity_icon
image_icon is a better name because there are some valid uses for these other than for activity icons.

E.g. Old JS code that is not worth re-writing.
2017-03-17 15:52:18 +08:00
8857c715d1 MDL-40759 icons: Behat fixes for font-awesome 2017-03-17 15:52:18 +08:00
357712eabe MDL-55528 assignfeedback_editpdf: Remove unnecessary escapes 2017-03-10 10:45:47 +08:00
f7a9f1dd0e MDL-55528 assignfeedback_editpdf: Update to use fileconverter_unoconv 2017-03-10 10:45:46 +08:00
1f3556b010 MDL-55762 assignpdf: Handle errored pages better 2017-02-27 09:24:07 +05:30
b6d06a5f78 MDL-55762 assignpdf: Fix bug in phpdocs 2017-02-27 09:24:07 +05:30
ab1058247c MDL-56122 editpdf: Fix ghostscript checking 2017-02-14 13:45:21 +01:00
fecfb4c6fb MDL-56122 assignfeedback_editpdf: Regenerate PDF & page images if blank 2017-02-13 17:23:42 +00:00
6be2b79b9c MDL-56810 unoconv: task fails if user removed
If the user is removed from a course after a submission has been made,
the task will crash and never continue.  This removes submissions from
the cron task if the user isn't enrolled in the course.
2016-12-12 08:22:51 -05:00
c156b7b76d MDL-56345 assignfeedback_editpdf: Use correct strings for tool alt text 2016-10-10 16:13:37 +01:00
f5ba9ac995 MDL-45969 editpdf: The logic for showing a previous attempt is wrong
It originally was only ever going to show static pdfs for older versions,
but this doesn't make sense in the UI for 3.1.
2016-09-30 13:15:00 +08:00
fca211bf05 MDL-55374 mod_assign: Force utf-8 for DOMDocument
This prevents charset issues on some sites.
2016-07-29 10:43:25 +08:00
55907a738a MDL-53822 editpdf: Add a new tool for scrolling
I added a new tool to the toolbar to allow click and drag scrolling (especially useful for touchscreens).
2016-05-06 16:33:31 +08:00
fcc9218fb8 MDL-53811 mod_assign: fixed error in convert submissions task 2016-04-19 13:08:27 +08:00
6853cd5ed4 MDL-52954 assign: Fix the reasonable cibot warnings. 2016-03-30 14:07:28 +08:00
bb690849c9 MDL-52954 assign: Rebuild the assignment single grade page. 2016-03-30 13:47:21 +08:00
1356d85151 MDL-52954 core: Change from pandoc to unoconv - it gives better results
Most importantly it retains formatting better, and supports different charsets far better than pandoc.
2016-03-30 11:48:39 +08:00
2e76c14e11 MDL-52954 core: Add a document converter to file_storage
This lets us convert between common office formats. E.g. docx -> pdf
html -> pdf, html -> ods.

This commit also updates assignment editpdf plugin to use this converter
on all compatible submission files.
2016-03-30 11:48:39 +08:00
626d833543 MDL-51779 assign: PDF annotate quality
Fixes the quality of pdf content when annotating.
2015-10-23 09:22:38 -04:00
0bf75ff15f MDL-49864 mod_assign: Fix missing annotations when viewing PDF
Added 'draft = 1' criteria for the delete query in
page_editor::set_annotations in order to prevent the deletion of non-draft
annotations while the PDF is being edited.
2015-08-03 09:07:03 +08:00
46686eafeb MDL-49998 editpdf: Clean code to make it more readable.
There was a big proliferation and reuse of $pdf variable
that was making the code hard to read/review. This commit
does change nothing but makes it more readable.

Also adds a couple of Close() calls, not strictly needed
because they don't have opened files. But think it makes
really clearer the scope of every variable. And, for sure
it frees some resources. That cannot be bad.
2015-04-30 10:55:08 +02:00
a916d557cf MDL-49998 unit tests: Close the pdf objects when needed.
When a pdf object is instantiated and any file is loaded
with set_pdf() or load_pdf(), the files remain open until
the pdf is saved with pdf_save() or outputted with Output()..

In that cases is needed to perform an explicit Close() in
order to free resources, parsers and, ultimately, fclose()
the files.

Note that only the uses detected in the editpdf unit tests have
been fixed. I'd recommend to analyse every instance of the tcpdf
libs.

Also, there was one incorrecly reused pdf instance in then
generate_combined_pdf_for_attempt() method. Apparently it was not
leading to problems, but better use a separate instance (#246).
2015-04-28 19:46:50 +02:00
861265b43a Merge branch 'MDL-43462_landscape_pdf' of git://github.com/davosmith/moodle 2014-12-16 19:20:22 +00:00
50c12f01bc MDL-43462 assignfeedback_editpdf: fix display of landscape PDFs
The size of the drawing canvas is now set from the size of the generated page image, with automatic
scrolling if it is too wide to display
Absolutely-positioned nodes (comments + stamps) are repositioned as the drawing canvas is scrolled
2014-12-15 22:01:26 +00:00
9b65a08095 MDL-47475 mod_assign: Copy files to other group members for editpdf 2014-12-15 08:50:31 +08:00
20942dd702 MDL-47397 assignfeedback_editpdf: Copy stamps to other students in team
During a team submission the stamps were attached to the user that
was graded and not to the other users. This could lead to errors when
generating the PDF for each user.
2014-10-24 15:09:06 +01:00