Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
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.
 
static add_comment (comment $comment)
 Add a comment to a page.
 
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.
 
static delete_draft_content ($gradeid)
 Delete the draft annotations and comments.
 
static get_annotation ($annotationid)
 Get a single annotation by id.
 
static get_annotations ($gradeid, $pageno, $draft)
 Get all annotations for a page.
 
static get_comment ($commentid)
 Get a single comment by id.
 
static get_comments ($gradeid, $pageno, $draft)
 Get all comments for a page.
 
static get_page_rotation ($gradeid, $pageno)
 Get Page Rotation Value.
 
static has_annotations_or_comments ($gradeid, $includedraft)
 Has annotations or comments.
 
static release_drafts ($gradeid)
 Release the draft comments and annotations to students.
 
static remove_annotation ($annotationid)
 Remove a annotation from a page.
 
static remove_comment ($commentid)
 Remove a comment from a page.
 
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.
 
static revert_drafts ($gradeid)
 Aborts all draft annotations and reverts to the last version released to students.
 
static set_annotations ($gradeid, $pageno, $annotations)
 Set all annotations for a page.
 
static set_comments ($gradeid, $pageno, $comments)
 Set all comments for a page.
 
static set_page_rotation ($gradeid, $pageno, $isrotated, $pathnamehash, $degree=0)
 Set page rotation value.
 
static unrelease_drafts ($gradeid)
 Unrelease drafts.
 

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: