Stores and manipulates the structure of the feedback or template (items, pages, etc.)
More...
Stores and manipulates the structure of the feedback or template (items, pages, etc.)
- Copyright
- 2016 Marina Glancy
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
mod_feedback_structure::__construct |
( |
|
$feedback, |
|
|
|
$cm, |
|
|
|
$courseid = 0 , |
|
|
|
$templateid = null , |
|
|
|
$userid = 0 |
|
) |
| |
Constructor.
- Parameters
-
stdClass | $feedback | feedback object, in case of the template this is the current feedback the template is accessed from |
stdClass | cm_info | $cm | course module object corresponding to the $feedback (at least one of $feedback or $cm is required) |
int | $courseid | current course (for site feedbacks only) |
int | $templateid | template id if this class represents the template structure |
int | $userid | User id to use for all capability checks, etc. Set to 0 for current user (default). |
◆ can_view_analysis()
mod_feedback_structure::can_view_analysis |
( |
| ) |
|
Checks if current user is able to view feedback on this course.
- Return values
-
◆ count_completed_responses()
mod_feedback_structure::count_completed_responses |
( |
|
$groupid = 0 | ) |
|
Counts records from {feedback_completed} table for a given feedback.
If $groupid or $this->courseid is set, the records are filtered by the group/course
- Parameters
-
- Return values
-
mixed | array of found completeds otherwise false |
◆ get_cm()
mod_feedback_structure::get_cm |
( |
| ) |
|
Current course module.
- Return values
-
◆ get_completed_courses()
mod_feedback_structure::get_completed_courses |
( |
| ) |
|
For the frontpage feedback returns the list of courses with at least one completed feedback.
- Return values
-
array | id=>name pairs of courses |
◆ get_courseid()
mod_feedback_structure::get_courseid |
( |
| ) |
|
Id of the current course (for site feedbacks only)
- Return values
-
◆ get_feedback()
mod_feedback_structure::get_feedback |
( |
| ) |
|
Current feedback.
- Return values
-
◆ get_items()
mod_feedback_structure::get_items |
( |
|
$hasvalueonly = false | ) |
|
Get all items in this feedback or this template.
- Parameters
-
bool | $hasvalueonly | only count items with a value. |
- Return values
-
array | of objects from feedback_item with an additional attribute 'itemnr' |
◆ get_templateid()
mod_feedback_structure::get_templateid |
( |
| ) |
|
Template id.
- Return values
-
◆ is_already_submitted()
mod_feedback_structure::is_already_submitted |
( |
|
$anycourseid = false | ) |
|
check for multiple_submit = false.
if the feedback is global so the courseid must be given
- Parameters
-
bool | $anycourseid | if true checks if this feedback was submitted in any course, otherwise checks $this->courseid . Applicable to frontpage feedbacks only |
- Return values
-
bool | true if the feedback already is submitted otherwise false |
◆ is_anonymous()
mod_feedback_structure::is_anonymous |
( |
| ) |
|
Is this feedback anonymous?
- Return values
-
◆ is_empty()
mod_feedback_structure::is_empty |
( |
| ) |
|
Is the items list empty?
- Return values
-
◆ is_open()
mod_feedback_structure::is_open |
( |
| ) |
|
Is this feedback open (check timeopen and timeclose)
- Return values
-
◆ page_after_submit()
mod_feedback_structure::page_after_submit |
( |
| ) |
|
Returns the formatted text of the page after submit or null if it is not set.
- Return values
-
◆ $courseid
int mod_feedback_structure::$courseid = 0 |
|
protected |
course where the feedback is filled.
For feedbacks that are NOT on the front page this is 0
◆ $feedback
stdClass mod_feedback_structure::$feedback |
|
protected |
record from 'feedback' table.
Reliably has fields: id, course, timeopen, timeclose, anonymous, completionsubmit. For full object or to access any other field use $this->get_feedback()
The documentation for this class was generated from the following file: