Mass Exam Marker Plugin
A Moodle plugin to help mark massive exams.
 All Data Structures Namespaces Files Functions Variables
assign_feedback_pdf Class Reference
Inheritance diagram for assign_feedback_pdf:

Public Member Functions

 get_name ()
 
 is_enabled ()
 
 get_form_elements ($grade, MoodleQuickForm $mform, stdClass $data)
 
 get_form_elements_for_user ($grade, MoodleQuickForm $mform, stdClass $data, $userid)
 
 view_summary (stdClass $grade, &$showviewlink)
 
 view (stdClass $grade)
 
 supports_quickgrading ()
 
 get_quickgrading_html ($userid, $grade)
 
 delete_instance ()
 
 is_empty (stdClass $grade)
 
 get_file_areas ()
 
 can_upgrade ($type, $version)
 
 upgrade_settings (context $oldcontext, stdClass $oldassignment, &$log)
 
 upgrade (context $oldcontext, stdClass $oldassignment, stdClass $oldsubmission, stdClass $grade, &$log)
 
 edit_comment_page ($submissionid, $pageno, $enableedit=true)
 
 show_previous_comments ($submissionid)
 
 create_response_pdf ($submissionid)
 
 update_comment_page ($submissionid, $pageno)
 
 clear_image_cache ($submissionid, $nextaction)
 
 browse_images ($submissionid, $pageno)
 
 delete_feedback ($submission)
 
 get_name ()
 
 is_enabled ()
 
 get_form_elements ($grade, MoodleQuickForm $mform, stdClass $data)
 
 get_form_elements_for_user ($grade, MoodleQuickForm $mform, stdClass $data, $userid)
 
 view_summary (stdClass $grade, &$showviewlink)
 
 view (stdClass $grade)
 
 supports_quickgrading ()
 
 get_quickgrading_html ($userid, $grade)
 
 delete_instance ()
 
 is_empty (stdClass $grade)
 
 get_file_areas ()
 
 can_upgrade ($type, $version)
 
 upgrade_settings (context $oldcontext, stdClass $oldassignment, &$log)
 
 upgrade (context $oldcontext, stdClass $oldassignment, stdClass $oldsubmission, stdClass $grade, &$log)
 
 edit_comment_page ($submissionid, $pageno, $enableedit=true)
 
 show_previous_comments ($submissionid)
 
 create_response_pdf ($submissionid)
 
 update_comment_page ($submissionid, $pageno)
 
 clear_image_cache ($submissionid, $nextaction)
 
 browse_images ($submissionid, $pageno)
 
 delete_feedback ($submission)
 

Static Public Member Functions

static cron ()
 
static cron ()
 

Protected Member Functions

 get_rownum ()
 
 get_userid_because_assign_really_does_not_want_to_tell_me ()
 
 get_submission ($userid, $attemptnumber)
 
 annotate_link ($submission, $teamsubmission)
 
 encode_return_params ()
 
 response_link ($submission, $teamsubmission, $deletelink=false)
 
 return_url ()
 
 output_controls ($submission, $user, $pageno, $enableedit, $showprevious)
 
 output_pageselector ($submission, $pageno)
 
 output_toolbar ()
 
 get_temp_folder ($submissionid)
 
 get_page_image ($pageno, $submission)
 
 get_subfolder ()
 
 get_rownum ()
 
 get_userid_because_assign_really_does_not_want_to_tell_me ()
 
 get_submission ($userid, $attemptnumber)
 
 annotate_link ($submission, $teamsubmission)
 
 encode_return_params ()
 
 response_link ($submission, $teamsubmission, $deletelink=false)
 
 return_url ()
 
 output_controls ($submission, $user, $pageno, $enableedit, $showprevious)
 
 output_pageselector ($submission, $pageno)
 
 output_toolbar ()
 
 get_temp_folder ($submissionid)
 
 get_page_image ($pageno, $submission)
 
 get_subfolder ()
 

Static Protected Member Functions

static get_image_details ($file, $pagecount)
 
static get_image_details ($file, $pagecount)
 

Member Function Documentation

annotate_link (   $submission,
  $teamsubmission 
)
protected

Return a link to annotate the given submission (uses the 'team submission' if set, otherwise uses the individual submission)

Parameters
$submission
$teamsubmission
Returns
string
annotate_link (   $submission,
  $teamsubmission 
)
protected

Return a link to annotate the given submission (uses the 'team submission' if set, otherwise uses the individual submission)

Parameters
$submission
$teamsubmission
Returns
string
browse_images (   $submissionid,
  $pageno 
)

Output an image browser for all the pages in the given submission. (Intended for debugging purposes)

Parameters
$submissionid
$pageno
browse_images (   $submissionid,
  $pageno 
)

Output an image browser for all the pages in the given submission. (Intended for debugging purposes)

Parameters
$submissionid
$pageno
can_upgrade (   $type,
  $version 
)

Return true if this plugin can upgrade an old Moodle 2.2 assignment of this type and version.

Parameters
string$typeold assignment subtype
int$versionold assignment version
Returns
bool True if upgrade is possible
can_upgrade (   $type,
  $version 
)

Return true if this plugin can upgrade an old Moodle 2.2 assignment of this type and version.

Parameters
string$typeold assignment subtype
int$versionold assignment version
Returns
bool True if upgrade is possible
clear_image_cache (   $submissionid,
  $nextaction 
)

Delete all generated images for a particular submission. (Intended for use if there is a problem with the generated images).

Parameters
$submissionid
$nextaction
clear_image_cache (   $submissionid,
  $nextaction 
)

Delete all generated images for a particular submission. (Intended for use if there is a problem with the generated images).

Parameters
$submissionid
$nextaction
create_response_pdf (   $submissionid)

Generate a new PDF with the original submission + annotations

Parameters
$submissionid
Returns
bool - true if successful
create_response_pdf (   $submissionid)

Generate a new PDF with the original submission + annotations

Parameters
$submissionid
Returns
bool - true if successful
static cron ( )
static

Delete old page image files after 3 weeks.

static cron ( )
static

Delete old page image files after 3 weeks.

delete_feedback (   $submission)
delete_feedback (   $submission)
delete_instance ( )

The assignment has been deleted - cleanup

Returns
bool
delete_instance ( )

The assignment has been deleted - cleanup

Returns
bool
edit_comment_page (   $submissionid,
  $pageno,
  $enableedit = true 
)

Output the page for annotating the PDF

Parameters
int$submissionid- the submission to annotate
int$pageno- the page to start on
bool$enableedit- true if the editing interface should be enabled (overridden if the user does not have the required capabilities.
edit_comment_page (   $submissionid,
  $pageno,
  $enableedit = true 
)

Output the page for annotating the PDF

Parameters
int$submissionid- the submission to annotate
int$pageno- the page to start on
bool$enableedit- true if the editing interface should be enabled (overridden if the user does not have the required capabilities.
encode_return_params ( )
protected

Encode the 'return parameters', so they can be passed on to the annotation page.

Returns
string
encode_return_params ( )
protected

Encode the 'return parameters', so they can be passed on to the annotation page.

Returns
string
get_file_areas ( )

Get file areas returns a list of areas this plugin stores files

Returns
array - An array of fileareas (keys) and descriptions (values)
get_file_areas ( )

Get file areas returns a list of areas this plugin stores files

Returns
array - An array of fileareas (keys) and descriptions (values)
get_form_elements (   $grade,
MoodleQuickForm  $mform,
stdClass  $data 
)

Get form elements for grading form - retained so that plugin will be compatible with Moodle 2.3

Parameters
stdClass$grade
MoodleQuickForm$mform
stdClass$data
Returns
bool true if elements were added to the form
get_form_elements (   $grade,
MoodleQuickForm  $mform,
stdClass  $data 
)

Get form elements for grading form - retained so that plugin will be compatible with Moodle 2.3

Parameters
stdClass$grade
MoodleQuickForm$mform
stdClass$data
Returns
bool true if elements were added to the form
get_form_elements_for_user (   $grade,
MoodleQuickForm  $mform,
stdClass  $data,
  $userid 
)

Get form elements for grading form

Parameters
stdClass$grade
MoodleQuickForm$mform
stdClass$data
int$userid
Returns
bool true if elements were added to the form
get_form_elements_for_user (   $grade,
MoodleQuickForm  $mform,
stdClass  $data,
  $userid 
)

Get form elements for grading form

Parameters
stdClass$grade
MoodleQuickForm$mform
stdClass$data
int$userid
Returns
bool true if elements were added to the form
static get_image_details (   $file,
  $pagecount 
)
staticprotected

Get the image details from a file and return them.

Parameters
stored_file$file
$pagecount
Returns
mixed array|false
static get_image_details (   $file,
  $pagecount 
)
staticprotected

Get the image details from a file and return them.

Parameters
stored_file$file
$pagecount
Returns
mixed array|false
get_name ( )

Get the name of the file feedback plugin

Returns
string
get_name ( )

Get the name of the file feedback plugin

Returns
string
get_page_image (   $pageno,
  $submission 
)
protected

Generate a page image (if it doesn't exist already) and return the details

Parameters
int$pageno
object$submission
Returns
array|mixed - [ image url, width, height, total page count ]
get_page_image (   $pageno,
  $submission 
)
protected

Generate a page image (if it doesn't exist already) and return the details

Parameters
int$pageno
object$submission
Returns
array|mixed - [ image url, width, height, total page count ]
get_quickgrading_html (   $userid,
  $grade 
)

Return the annotation and response links

Parameters
int$userid
mixed$grade
Returns
string
get_quickgrading_html (   $userid,
  $grade 
)

Return the annotation and response links

Parameters
int$userid
mixed$grade
Returns
string
get_rownum ( )
protected

Find the current row from the assignment 'return_params'

Returns
bool
get_rownum ( )
protected

Find the current row from the assignment 'return_params'

Returns
bool
get_subfolder ( )
protected

Return the subfolder that contains the details for this submission (was intended to handle resubmissions, but that is already implemented for all assignment types in Moodle 2.5)

Returns
string
get_subfolder ( )
protected

Return the subfolder that contains the details for this submission (was intended to handle resubmissions, but that is already implemented for all assignment types in Moodle 2.5)

Returns
string
get_submission (   $userid,
  $attemptnumber 
)
protected

Get the user submission and team submission objects for the given user.

Parameters
$userid
$attemptnumber
Returns
array - [$submission, $teamsubmission]
get_submission (   $userid,
  $attemptnumber 
)
protected

Get the user submission and team submission objects for the given user.

Parameters
$userid
$attemptnumber
Returns
array - [$submission, $teamsubmission]
get_temp_folder (   $submissionid)
protected

Return a unique path for writing temporary files to

Parameters
$submissionid
Returns
string
get_temp_folder (   $submissionid)
protected

Return a unique path for writing temporary files to

Parameters
$submissionid
Returns
string
get_userid_because_assign_really_does_not_want_to_tell_me ( )
protected

Work out the userid from the return parameters.

Returns
bool
get_userid_because_assign_really_does_not_want_to_tell_me ( )
protected

Work out the userid from the return parameters.

Returns
bool
is_empty ( stdClass  $grade)

Return true if there are no feedback files

Parameters
stdClass$grade
Returns
bool
is_empty ( stdClass  $grade)

Return true if there are no feedback files

Parameters
stdClass$grade
Returns
bool
is_enabled ( )

Check the ghostscript path is valid to see if the plugin should be enabled.

Returns
bool
is_enabled ( )

Check the ghostscript path is valid to see if the plugin should be enabled.

Returns
bool
output_controls (   $submission,
  $user,
  $pageno,
  $enableedit,
  $showprevious 
)
protected

Return the controls toolbar

Parameters
$submission
$user
$pageno
$enableedit
$showprevious
Returns
string
output_controls (   $submission,
  $user,
  $pageno,
  $enableedit,
  $showprevious 
)
protected

Return the controls toolbar

Parameters
$submission
$user
$pageno
$enableedit
$showprevious
Returns
string
output_pageselector (   $submission,
  $pageno 
)
protected

Return the next/previous buttons + drop-down page list

Parameters
$submission
$pageno
Returns
string
output_pageselector (   $submission,
  $pageno 
)
protected

Return the next/previous buttons + drop-down page list

Parameters
$submission
$pageno
Returns
string
output_toolbar ( )
protected

Return the second row of the controls: colour + tool selectors.

Returns
string
output_toolbar ( )
protected

Return the second row of the controls: colour + tool selectors.

Returns
string
response_link (   $submission,
  $teamsubmission,
  $deletelink = false 
)
protected

Return the links to view / download the response file

Parameters
$submission
$teamsubmission
bool$deletelink
Returns
string
response_link (   $submission,
  $teamsubmission,
  $deletelink = false 
)
protected

Return the links to view / download the response file

Parameters
$submission
$teamsubmission
bool$deletelink
Returns
string
return_url ( )
protected

Extract the URL to return to when annotation is complete.

Returns
moodle_url
return_url ( )
protected

Extract the URL to return to when annotation is complete.

Returns
moodle_url
show_previous_comments (   $submissionid)

Output a list of comments written on a previous submission.

Parameters
$submissionid
show_previous_comments (   $submissionid)

Output a list of comments written on a previous submission.

Parameters
$submissionid
supports_quickgrading ( )

This plugin does support quick grading.

Returns
bool
supports_quickgrading ( )

This plugin does support quick grading.

Returns
bool
update_comment_page (   $submissionid,
  $pageno 
)

Process the AJAX requests - retrieve/update comments, annotations, etc.

Parameters
int$submissionid
int$pageno
update_comment_page (   $submissionid,
  $pageno 
)

Process the AJAX requests - retrieve/update comments, annotations, etc.

Parameters
int$submissionid
int$pageno
upgrade ( context  $oldcontext,
stdClass  $oldassignment,
stdClass  $oldsubmission,
stdClass  $grade,
$log 
)

Upgrade the feedback from the old assignment to the new one

Parameters
context$oldcontext- the database for the old assignment context
stdClass$oldassignmentThe data record for the old assignment
stdClass$oldsubmissionThe data record for the old submission
stdClass$gradeThe data record for the new grade
string$logRecord upgrade messages in the log
Returns
bool true or false - false will trigger a rollback
upgrade ( context  $oldcontext,
stdClass  $oldassignment,
stdClass  $oldsubmission,
stdClass  $grade,
$log 
)

Upgrade the feedback from the old assignment to the new one

Parameters
context$oldcontext- the database for the old assignment context
stdClass$oldassignmentThe data record for the old assignment
stdClass$oldsubmissionThe data record for the old submission
stdClass$gradeThe data record for the new grade
string$logRecord upgrade messages in the log
Returns
bool true or false - false will trigger a rollback
upgrade_settings ( context  $oldcontext,
stdClass  $oldassignment,
$log 
)

Upgrade the settings from the old assignment to the new plugin based one

Parameters
context$oldcontext- the context for the old assignment
stdClass$oldassignment- the data for the old assignment
string$log- can be appended to by the upgrade
Returns
bool was it a success? (false will trigger a rollback)
upgrade_settings ( context  $oldcontext,
stdClass  $oldassignment,
$log 
)

Upgrade the settings from the old assignment to the new plugin based one

Parameters
context$oldcontext- the context for the old assignment
stdClass$oldassignment- the data for the old assignment
string$log- can be appended to by the upgrade
Returns
bool was it a success? (false will trigger a rollback)
view ( stdClass  $grade)

Display the list of files in the feedback status table

Parameters
stdClass$grade
Returns
string
view ( stdClass  $grade)

Display the list of files in the feedback status table

Parameters
stdClass$grade
Returns
string
view_summary ( stdClass  $grade,
$showviewlink 
)

Display the list of files in the feedback status table

Parameters
stdClass$grade
bool$showviewlink- Set to true to show a link to see the full list of files
Returns
string
view_summary ( stdClass  $grade,
$showviewlink 
)

Display the list of files in the feedback status table

Parameters
stdClass$grade
bool$showviewlink- Set to true to show a link to see the full list of files
Returns
string

The documentation for this class was generated from the following files: