Permalink
Browse files

MDL-30995 Completion Fixedup some more PHP DOC issues

  • Loading branch information...
1 parent 836375e commit 95dd54eea3d3b0d74854800398e1abdd896f5ccf @ankitagarwal ankitagarwal committed Jan 19, 2012
@@ -39,10 +39,7 @@
*/
class completion_aggregation extends data_object {
- /**
- * Database table name that stores completion aggregation information
- * @var string
- */
+ /* @var string Database table name that stores completion aggregation information */
public $table = 'course_completion_aggr_methd';
/**
@@ -52,28 +49,16 @@ class completion_aggregation extends data_object {
*/
public $required_fields = array('id', 'course', 'criteriatype', 'method', 'value');
- /**
- * Course id
- * @var int
- */
+ /* @var int Course id */
public $course;
- /**
- * Criteria type this aggregation method applies to, or NULL for overall course aggregation
- * @var int
- */
+ /* @var int Criteria type this aggregation method applies to, or NULL for overall course aggregation */
public $criteriatype;
- /**
- * Aggregation method (COMPLETION_AGGREGATION_* constant)
- * @var int
- */
+ /* @var int Aggregation method (COMPLETION_AGGREGATION_* constant)*/
public $method;
- /**
- * Method value
- * @var mixed
- */
+ /* @var mixed Method value */
public $value;
@@ -113,4 +98,4 @@ public function setMethod($method) {
$this->method = COMPLETION_AGGREGATION_ALL;
}
}
-}
+}
@@ -38,47 +38,26 @@
*/
class completion_completion extends data_object {
- /**
- * Database table name that stores completion information
- * @var string $table
- */
+ /* @var string $table Database table name that stores completion information */
public $table = 'course_completions';
- /**
- * Array of required table fields, must start with 'id'.
- * @var array $required_fields
- */
+ /* @var array $required_fields Array of required table fields, must start with 'id'. */
public $required_fields = array('id', 'userid', 'course', 'deleted', 'timenotified',
'timeenrolled', 'timestarted', 'timecompleted', 'reaggregate');
- /**
- * User ID
- * @var int
- */
+ /* @var int $userid User ID */
public $userid;
- /**
- * Course ID
- * @var int
- */
+ /* @var int $course Course ID */
public $course;
- /**
- * Set to 1 if this record has been deleted
- * @var int
- */
+ /* @var int $deleted set to 1 if this record has been deleted */
public $deleted;
- /**
- * Timestamp the interested parties were notified of this user's completion.
- * @var int
- */
+ /* @var int Timestamp the interested parties were notified of this user's completion. */
public $timenotified;
- /**
- * Time of course enrolment {@see completion_completion::mark_enrolled()}
- * @var int
- */
+ /* @var int Time of course enrolment {@see completion_completion::mark_enrolled()} */
public $timeenrolled;
/**
@@ -87,22 +66,16 @@ class completion_completion extends data_object {
*/
public $timestarted;
- /**
- * Timestamp of course completion {@see completion_completion::mark_complete()}
- * @var int
- */
+ /* @var int Timestamp of course completion {@see completion_completion::mark_complete()} */
public $timecompleted;
- /**
- * Flag to trigger cron aggregation (timestamp)
- * @var int
- */
+ /* @var int Flag to trigger cron aggregation (timestamp) */
public $reaggregate;
/**
* Finds and returns a data_object instance based on params.
- *
+ *
* @param array $params associative arrays varname = >value
* @return data_object instance of data_object or false if none found.
*/
@@ -114,7 +87,7 @@ public static function fetch($params) {
/**
* Return status of this completion
*
- * @return boolean
+ * @return bool
*/
public function is_complete() {
return (bool) $this->timecompleted;
@@ -224,4 +197,4 @@ private function _save() {
$this->insert();
}
}
-}
+}
@@ -103,10 +103,7 @@
*/
abstract class completion_criteria extends data_object {
- /**
- * Database table name that stores completion criteria information
- * @var string
- */
+ /* @var string Database table name that stores completion criteria information */
public $table = 'course_completion_criteria';
/**
@@ -117,10 +114,7 @@
*/
public $required_fields = array('id', 'course', 'criteriatype', 'module', 'moduleinstance', 'courseinstance', 'enrolperiod', 'timeend', 'gradepass', 'role');
- /**
- * Course id
- * @var int
- */
+ /* @var int Course id */
public $course;
/**
@@ -130,16 +124,10 @@
*/
public $criteriatype;
- /**
- * Module type this criteria relates to (for activity criteria)
- * @var string
- */
+ /* @var string Module type this criteria relates to (for activity criteria) */
public $module;
- /**
- * Course module instance id this criteria relates to (for activity criteria)
- * @var int
- */
+ /* @var int Course module instance id this criteria relates to (for activity criteria) */
public $moduleinstance;
/**
@@ -156,16 +144,10 @@
*/
public $date;
- /**
- * Passing grade required to complete course (for grade completion)
- * @var float
- */
+ /* @var float Passing grade required to complete course (for grade completion) */
public $gradepass;
- /**
- * Role ID that has the ability to mark a user as complete (for role completion)
- * @var int
- */
+ /* @var int Role ID that has the ability to mark a user as complete (for role completion) */
public $role;
/**
@@ -197,9 +179,9 @@ public static function factory($params) {
/**
* Add appropriate form elements to the critieria form
- *
+ *
* @param moodleform $mform Moodle forms object
- * @param mixed $data optional
+ * @param mixed $data optional Any additional data that can be used to set default values in the form
* @return void
*/
abstract public function config_form_display(&$mform, $data = null);
@@ -272,4 +254,4 @@ public function is_pending($completion) {
return $review !== $completion->is_complete();
}
-}
+}
@@ -39,10 +39,7 @@
*/
class completion_criteria_activity extends completion_criteria {
- /**
- * Criteria type constant
- * @var int [COMPLETION_CRITERIA_TYPE_ACTIVITY]
- */
+ /* @var int Criteria [COMPLETION_CRITERIA_TYPE_ACTIVITY] */
public $criteriatype = COMPLETION_CRITERIA_TYPE_ACTIVITY;
/**
@@ -58,9 +55,9 @@ public static function fetch($params) {
/**
* Add appropriate form elements to the critieria form
- *
+ *
* @param moodleform $mform Moodle forms object
- * @param stdClass $data
+ * @param stdClass $data details of various modules
*/
public function config_form_display(&$mform, $data = null) {
$mform->addElement('checkbox', 'criteria_activity['.$data->id.']', ucfirst(self::get_mod_name($data->module)).' - '.$data->name);
@@ -72,7 +69,7 @@ public function config_form_display(&$mform, $data = null) {
/**
* Update the criteria information stored in the database
- *
+ *
* @param stdClass $data Form data
*/
public function update_config(&$data) {
@@ -95,7 +92,7 @@ public function update_config(&$data) {
/**
* Get module instance module type
- *
+ *
* @param int $type Module type id
* @return string
*/
@@ -114,7 +111,7 @@ public static function get_mod_name($type) {
* Gets the module instance from the database and returns it.
* If no module instance exists this function returns false.
*
- * @return stdClass|false
+ * @return stdClass|bool
*/
public function get_mod_instance() {
global $DB;
@@ -137,8 +134,8 @@ public function get_mod_instance() {
* Review this criteria and decide if the user has completed
*
* @param completion_completion $completion The user's completion record
- * @param boolean $mark Optionally set false to not save changes to database
- * @return boolean
+ * @param bool $mark Optionally set false to not save changes to database
+ * @return bool
*/
public function review($completion, $mark = true) {
global $DB;
@@ -193,7 +190,7 @@ public function get_type_title() {
}
/**
- * Find user's who have completed this criteria and mark them accordingly
+ * Find users who have completed this criteria and mark them accordingly
*/
public function cron() {
global $DB;
@@ -290,4 +287,4 @@ public function get_details($completion) {
return $details;
}
-}\
+}
Oops, something went wrong.

0 comments on commit 95dd54e

Please sign in to comment.