Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

This file contains the definition for the abstract class for submission_plugin This class provides all the functionality for submission plugins.

Copyright: 2012 NetSpot {@link http://www.netspot.com.au}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 157 lines (5 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class

assign_submission_plugin:: (12 methods):
  get_subtype()
  allow_submissions()
  precheck_submission()
  submit_for_grading()
  copy_submission()
  lock()
  unlock()
  revert_to_draft()
  remove()
  add_attempt()
  submission_is_empty()
  allow_image_conversion()


Class: assign_submission_plugin  - X-Ref

Abstract base class for submission plugin types.

get_subtype()   X-Ref
return subtype name of the plugin

return: string

allow_submissions()   X-Ref
This plugin accepts submissions from a student
The comments plugin has no submission component so should not be counted
when determining whether to show the edit submission link.

return: boolean

precheck_submission($submission)   X-Ref
Check if the submission plugin has all the required data to allow the work
to be submitted for grading

param: stdClass $submission the assign_submission record being submitted.
return: bool|string 'true' if OK to proceed with submission, otherwise a

submit_for_grading($submission)   X-Ref
Carry out any extra processing required when the work is submitted for grading

param: stdClass $submission the assign_submission record being submitted.
return: void

copy_submission( stdClass $oldsubmission, stdClass $submission)   X-Ref
Copy the plugin specific submission data to a new submission record.

param: stdClass $oldsubmission - Old submission record
param: stdClass $submission - New submission record
return: bool

lock($submission, stdClass $flags)   X-Ref
Carry out any extra processing required when the work is locked.

param: stdClass|false $submission - assign_submission data if any
param: stdClass $flags - User flags record
return: void

unlock($submission, stdClass $flags)   X-Ref
Carry out any extra processing required when the work is unlocked.

param: stdClass|false $submission - assign_submission data if any
param: stdClass $flags - User flags record
return: void

revert_to_draft(stdClass $submission)   X-Ref
Carry out any extra processing required when the work reverted to draft.

param: stdClass $submission - assign_submission data
return: void

remove(stdClass $submission)   X-Ref
Remove any saved data from this submission.

param: stdClass $submission - assign_submission data
return: void

add_attempt(stdClass $oldsubmission, stdClass $newsubmission)   X-Ref
Carry out any extra processing required when a student is given a new attempt
(i.e. when the submission is "reopened"

param: stdClass $oldsubmission The previous attempt
param: stdClass $newsubmission The new attempt

submission_is_empty(stdClass $data)   X-Ref
Determine if a submission is empty

This is distinct from is_empty in that it is intended to be used to
determine if a submission made before saving is empty.

param: stdClass $data The submission data
return: bool

allow_image_conversion()   X-Ref
Determine if the plugin allows image file conversion

return: bool