Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Churchward authored and Jay Churchward committed Mar 14, 2024
1 parent 3852ea4 commit f333d24
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
26 changes: 26 additions & 0 deletions block_badgeawarder.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,52 @@

class block_badgeawarder extends block_base {

/**
* Ininitalizes the object.
*/
public function init() {
$this->title = get_string('blockname', 'block_badgeawarder');
}

/**
* Returns an array of applicable formats.
*
* @return array
*/
public function applicable_formats() {
return array('course' => true);
}

/**
* Sets the title value.
*/
public function specialization() {
$this->title = get_string('blockname', 'block_badgeawarder');
}

/**
* Returns true.
*
* @return true
*/
public function has_config() {
return true;
}

/**
* Returns false.
*
* @return bool
*/
public function instance_allow_multiple() {
return false;
}

/**
* Retrieves the block content.
*
* @return object
*/
public function get_content() {
global $CFG;

Expand Down
2 changes: 2 additions & 0 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Contains the set up functions.
*
* @package block_badgeawarder
* @copyright 2013 Learning Technology Services, www.lts.ie - Lead Developer: Bas Brands
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Expand Down
9 changes: 5 additions & 4 deletions processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class block_badgeawarder_processor {
const UPDATE_NOTHING = 0;

/**
* @bool true if there is really nothing to do.
* @var bool true if there is really nothing to do.
*/
public $nothingtodo;

Expand Down Expand Up @@ -105,7 +105,6 @@ class block_badgeawarder_processor {
*
* @param csv_import_reader $cir import reader object
* @param array $options options of the process
* @param array $defaults default data value
*/
public function __construct(csv_import_reader $cir, $options) {
if (is_array($options)) {
Expand Down Expand Up @@ -302,7 +301,7 @@ private function get_badge($name) {
/**
* Checks the criteria of a badge.
*
* @param object $badge the badge object.
* @param badge $badge the badge object.
* @return bool
*/
private function check_badge_criteria(badge $badge) {
Expand Down Expand Up @@ -415,6 +414,7 @@ private function get_enrolmentinstance() {
/**
* Sends an email to the user with the awarded badge details.
*
* @param object $user
* @return bool
*/
private function send_email($user) {
Expand All @@ -438,6 +438,7 @@ private function send_email($user) {
/**
* Enrols a user in a course.
*
* @param object $user
* @return void
*/
private function enrol_user($user) {
Expand Down Expand Up @@ -519,6 +520,7 @@ protected function get_existing_usernames() {
/**
* Verifies that filecolumns has all the required fields.
*
* @param array $data
* @return bool
*/
protected function check_required_fields($data) {
Expand All @@ -542,7 +544,6 @@ protected function check_required_fields($data) {
* This only returns passed data, along with the errors.
*
* @param integer $rows number of rows to preview.
* @param object $tracker the output tracker to use.
* @return array of preview data.
*/
public function preview($rows = 10) {
Expand Down

0 comments on commit f333d24

Please sign in to comment.