Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Static Public Member Functions | List of all members
assignfeedback_editpdf\page_editor Class Reference

This class performs crud operations on comments and annotations from a page of a response. More...

Static Public Member Functions

static add_annotation (annotation $annotation)
 Add a annotation to a page. More...
 
static add_comment (comment $comment)
 Add a comment to a page. More...
 
static copy_drafts_from_to ($assignment, $grade, $sourceuserid)
 Copy annotations, comments, pages, and other required content from the source user to the current group member being procssed when using applytoall. More...
 
static delete_draft_content ($gradeid)
 Delete the draft annotations and comments. More...
 
static get_annotation ($annotationid)
 Get a single annotation by id. More...
 
static get_annotations ($gradeid, $pageno, $draft)
 Get all annotations for a page. More...
 
static get_comment ($commentid)
 Get a single comment by id. More...
 
static get_comments ($gradeid, $pageno, $draft)
 Get all comments for a page. More...
 
static get_page_rotation ($gradeid, $pageno)
 Get Page Rotation Value. More...
 
static has_annotations_or_comments ($gradeid, $includedraft)
 Has annotations or comments. More...
 
static release_drafts ($gradeid)
 Release the draft comments and annotations to students. More...
 
static remove_annotation ($annotationid)
 Remove a annotation from a page. More...
 
static remove_comment ($commentid)
 Remove a comment from a page. More...
 
static replace_files_from_to ($fs, $contextid, $sourceitemid, $itemid, $area, $includesubdirs=false)
 Replace the area files in the specified area with those in the source item id. More...
 
static revert_drafts ($gradeid)
 Aborts all draft annotations and reverts to the last version released to students. More...
 
static set_annotations ($gradeid, $pageno, $annotations)
 Set all annotations for a page. More...
 
static set_comments ($gradeid, $pageno, $comments)
 Set all comments for a page. More...
 
static set_page_rotation ($gradeid, $pageno, $isrotated, $pathnamehash, $degree=0)
 Set page rotation value. More...
 
static unrelease_drafts ($gradeid)
 Unrelease drafts. More...
 

Detailed Description

This class performs crud operations on comments and annotations from a page of a response.

No capability checks are done - they should be done by the calling class.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ add_annotation()

static assignfeedback_editpdf\page_editor::add_annotation ( annotation  $annotation)
static

Add a annotation to a page.

Parameters
annotation$annotation
Return values
bool

◆ add_comment()

static assignfeedback_editpdf\page_editor::add_comment ( comment  $comment)
static

Add a comment to a page.

Parameters
comment$comment
Return values
bool

◆ copy_drafts_from_to()

static assignfeedback_editpdf\page_editor::copy_drafts_from_to (   $assignment,
  $grade,
  $sourceuserid 
)
static

Copy annotations, comments, pages, and other required content from the source user to the current group member being procssed when using applytoall.

Parameters
int | assign$assignment
stdClass$grade
int$sourceuserid
Return values
bool

◆ delete_draft_content()

static assignfeedback_editpdf\page_editor::delete_draft_content (   $gradeid)
static

Delete the draft annotations and comments.

This is intended to be used when the version of the PDF has changed and the annotations might not be relevant any more, therefore we should delete them.

Parameters
int$gradeidThe grade ID.
Return values
bool

◆ get_annotation()

static assignfeedback_editpdf\page_editor::get_annotation (   $annotationid)
static

Get a single annotation by id.

Parameters
int$annotationid
Return values
annotationor false

◆ get_annotations()

static assignfeedback_editpdf\page_editor::get_annotations (   $gradeid,
  $pageno,
  $draft 
)
static

Get all annotations for a page.

Parameters
int$gradeid
int$pageno
bool$draft
Return values
annotation[]

◆ get_comment()

static assignfeedback_editpdf\page_editor::get_comment (   $commentid)
static

Get a single comment by id.

Parameters
int$commentid
Return values
commentor false

◆ get_comments()

static assignfeedback_editpdf\page_editor::get_comments (   $gradeid,
  $pageno,
  $draft 
)
static

Get all comments for a page.

Parameters
int$gradeid
int$pageno
bool$draft
Return values
comment[]

◆ get_page_rotation()

static assignfeedback_editpdf\page_editor::get_page_rotation (   $gradeid,
  $pageno 
)
static

Get Page Rotation Value.

Parameters
int$gradeidgrade id.
int$pagenopage number.
Return values
mixed
Exceptions
dml_exception

◆ has_annotations_or_comments()

static assignfeedback_editpdf\page_editor::has_annotations_or_comments (   $gradeid,
  $includedraft 
)
static

Has annotations or comments.

Parameters
int$gradeid
Return values
bool

◆ release_drafts()

static assignfeedback_editpdf\page_editor::release_drafts (   $gradeid)
static

Release the draft comments and annotations to students.

Parameters
int$gradeid
Return values
bool

◆ remove_annotation()

static assignfeedback_editpdf\page_editor::remove_annotation (   $annotationid)
static

Remove a annotation from a page.

Parameters
int$annotationid
Return values
bool

◆ remove_comment()

static assignfeedback_editpdf\page_editor::remove_comment (   $commentid)
static

Remove a comment from a page.

Parameters
int$commentid
Return values
bool

◆ replace_files_from_to()

static assignfeedback_editpdf\page_editor::replace_files_from_to (   $fs,
  $contextid,
  $sourceitemid,
  $itemid,
  $area,
  $includesubdirs = false 
)
static

Replace the area files in the specified area with those in the source item id.

Parameters
file_storage$fsThe file storage class
int$contextidThe ID of the context for the assignment.
int$sourceitemidThe itemid to copy from - typically the source grade id.
int$itemidThe itemid to copy to - typically the target grade id.
string$areaThe file storage area.
bool$includesubdirsWhether to copy the content of sub-directories too.

◆ revert_drafts()

static assignfeedback_editpdf\page_editor::revert_drafts (   $gradeid)
static

Aborts all draft annotations and reverts to the last version released to students.

Parameters
int$gradeid
Return values
bool

◆ set_annotations()

static assignfeedback_editpdf\page_editor::set_annotations (   $gradeid,
  $pageno,
  $annotations 
)
static

Set all annotations for a page.

Parameters
int$gradeid
int$pageno
annotation[]$annotations
Return values
int- the number of annotations.

◆ set_comments()

static assignfeedback_editpdf\page_editor::set_comments (   $gradeid,
  $pageno,
  $comments 
)
static

Set all comments for a page.

Parameters
int$gradeid
int$pageno
comment[]$comments
Return values
int- the number of comments.

◆ set_page_rotation()

static assignfeedback_editpdf\page_editor::set_page_rotation (   $gradeid,
  $pageno,
  $isrotated,
  $pathnamehash,
  $degree = 0 
)
static

Set page rotation value.

Parameters
int$gradeidgrade id.
int$pagenopage number.
bool$isrotatedwhether the page is rotated or not.
string$pathnamehashpath name hash
int$degreerotation degree.
Exceptions
dml_exception

◆ unrelease_drafts()

static assignfeedback_editpdf\page_editor::unrelease_drafts (   $gradeid)
static

Unrelease drafts.

Parameters
int$gradeid
Return values
bool

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