Skip to content

Commit

Permalink
Fixes coding style of brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Carlos Rodríguez del Pino committed May 22, 2022
1 parent 7b0212c commit 4124811
Show file tree
Hide file tree
Showing 112 changed files with 3,122 additions and 3,123 deletions.
22 changes: 11 additions & 11 deletions backup/moodle1/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ protected function get_files($base, $dirname) {
foreach ($extrafiles as $file) {
if (file_exists ( $base . $file )) {
$data = array ();
$data ['name'] = $file;
$data ['content'] = file_get_contents ( $base . $file );
$files [] = $data;
$data['name'] = $file;
$data['content'] = file_get_contents ( $base . $file );
$files[] = $data;
}
}
$dirpath = $base . $dirname;
Expand All @@ -156,9 +156,9 @@ protected function get_files($base, $dirname) {
continue;
}
$data = array ();
$data ['name'] = $dirname . '/' . $filename;
$data ['content'] = file_get_contents ( $dirpath . '/' . $filename );
$files [] = $data;
$data['name'] = $dirname . '/' . $filename;
$data['content'] = file_get_contents ( $dirpath . '/' . $filename );
$files[] = $data;
}
closedir ( $dirlst );
}
Expand Down Expand Up @@ -198,14 +198,14 @@ protected function process_required_files() {
*/
public function process_vpl($data) {
// Get the course module id and context id.
$this->instanceid = $data ['id'];
$this->instanceid = $data['id'];
$cminfo = $this->get_cminfo ( $this->instanceid );
$this->moduleid = $cminfo ['id'];
$this->moduleid = $cminfo['id'];
$contextid = $this->converter->get_contextid ( CONTEXT_MODULE, $this->moduleid );

// Get intro from file.
$data ['intro'] = $this->get_fulldescription ();
$data ['introformat'] = 1;
$data['intro'] = $this->get_fulldescription ();
$data['introformat'] = 1;

// Start writing vpl.xml.
$this->open_xml_writer ( "activities/vpl_{$this->moduleid}/vpl.xml" );
Expand Down Expand Up @@ -293,7 +293,7 @@ public function process_vpl_submission($data) {
$this->xmlwriter->begin_tag ( 'submission', $data, array (
'/submission/id'
) );
$this->process_submitted_files ( $data ['userid'], $data ['id'] );
$this->process_submitted_files ( $data['userid'], $data['id'] );
$this->xmlwriter->end_tag ( 'submission' );
}

Expand Down
4 changes: 2 additions & 2 deletions backup/moodle2/backup_vpl_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private function get_files($base, $dirname) {
);
foreach ($extrafiles as $file) {
if (file_exists( $base . $file )) {
$files [] = $this->load_file($base, $file);
$files[] = $this->load_file($base, $file);
}
}
$dirpath = $base . $dirname;
Expand All @@ -84,7 +84,7 @@ private function get_files($base, $dirname) {
if ($filename == "." || $filename == "..") {
continue;
}
$files [] = $this->load_file($base, $dirname . '/' . $filename);
$files[] = $this->load_file($base, $dirname . '/' . $filename);
}
closedir( $dirlst );
}
Expand Down
6 changes: 3 additions & 3 deletions backup/moodle2/restore_vpl_activity_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ protected function define_my_steps() {
public static function define_decode_contents() {
$contents = array ();

$contents [] = new restore_decode_content ( 'vpl', array (
$contents[] = new restore_decode_content ( 'vpl', array (
'intro'
), 'vpl' );

Expand All @@ -75,8 +75,8 @@ public static function define_decode_contents() {
public static function define_decode_rules() {
$rules = array ();

$rules [] = new restore_decode_rule ( 'VPLVIEWBYID', '/mod/vpl/view.php?id=$1', 'course_module' );
$rules [] = new restore_decode_rule ( 'VPLINDEX', '/mod/vpl/index.php?id=$1', 'course' );
$rules[] = new restore_decode_rule ( 'VPLVIEWBYID', '/mod/vpl/view.php?id=$1', 'course_module' );
$rules[] = new restore_decode_rule ( 'VPLINDEX', '/mod/vpl/index.php?id=$1', 'course' );

return $rules;
}
Expand Down
18 changes: 9 additions & 9 deletions backup/moodle2/restore_vpl_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ protected function define_structure() {
$paths = array ();
$userinfo = $this->get_setting_value ( 'userinfo' );

$paths [] = new restore_path_element ( 'vpl', '/activity/vpl' );
$paths [] = new restore_path_element ( 'required_file', '/activity/vpl/required_files/required_file' );
$paths [] = new restore_path_element ( 'execution_file', '/activity/vpl/execution_files/execution_file' );
$paths [] = new restore_path_element ( 'variation', '/activity/vpl/variations/variation' );
$paths [] = new restore_path_element ( 'override', '/activity/vpl/overrides/override' );
$paths[] = new restore_path_element ( 'vpl', '/activity/vpl' );
$paths[] = new restore_path_element ( 'required_file', '/activity/vpl/required_files/required_file' );
$paths[] = new restore_path_element ( 'execution_file', '/activity/vpl/execution_files/execution_file' );
$paths[] = new restore_path_element ( 'variation', '/activity/vpl/variations/variation' );
$paths[] = new restore_path_element ( 'override', '/activity/vpl/overrides/override' );
if ($userinfo) {
$paths [] = new restore_path_element ( 'assigned_variation', '/activity/vpl/assigned_variations/assigned_variation' );
$paths [] = new restore_path_element ( 'assigned_override', '/activity/vpl/assigned_overrides/assigned_override' );
$paths [] = new restore_path_element ( 'submission', '/activity/vpl/submissions/submission' );
$paths [] = new restore_path_element (
$paths[] = new restore_path_element ( 'assigned_variation', '/activity/vpl/assigned_variations/assigned_variation' );
$paths[] = new restore_path_element ( 'assigned_override', '/activity/vpl/assigned_overrides/assigned_override' );
$paths[] = new restore_path_element ( 'submission', '/activity/vpl/submissions/submission' );
$paths[] = new restore_path_element (
'submission_file',
'/activity/vpl/submissions/submission/submission_files/submission_file'
);
Expand Down
2 changes: 1 addition & 1 deletion classes/event/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function get_url_base($script) {
'id' => $this->contextinstanceid
);
if (($this->relateduserid) && $this->relateduserid != $this->userid) {
$parms ['userid'] = $this->relateduserid;
$parms['userid'] = $this->relateduserid;
}
return new \moodle_url( '/mod/vpl/' . $script, $parms );
}
Expand Down
6 changes: 3 additions & 3 deletions classes/event/override_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public static function get_other_mapping() {
return false;
}
protected function init() {
$this->data ['crud'] = 'u';
$this->data ['edulevel'] = self::LEVEL_TEACHING;
$this->data ['objecttable'] = VPL_OVERRIDES;
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
$this->data['objecttable'] = VPL_OVERRIDES;
}
public static function log($vpl, $overrideid = null) {
if (is_array($vpl)) {
Expand Down
2 changes: 1 addition & 1 deletion classes/event/override_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class override_created extends override_base {
protected function init() {
parent::init();
$this->data ['crud'] = 'c';
$this->data['crud'] = 'c';
$this->legacyaction = 'created override';
}
public function get_description() {
Expand Down
2 changes: 1 addition & 1 deletion classes/event/override_updated.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class override_updated extends override_base {
protected function init() {
parent::init();
$this->data ['crud'] = 'u';
$this->data['crud'] = 'u';
$this->legacyaction = 'updated override';
}
public function get_description() {
Expand Down
6 changes: 3 additions & 3 deletions classes/event/submission_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public static function get_other_mapping() {
return false;
}
protected function init() {
$this->data ['crud'] = 'c';
$this->data ['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data ['objecttable'] = VPL_SUBMISSIONS;
$this->data['crud'] = 'c';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = VPL_SUBMISSIONS;
}
public function get_url() {
return $this->get_url_base( 'forms/submissionview.php' );
Expand Down
2 changes: 1 addition & 1 deletion classes/event/submission_debugged.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class submission_debugged extends submission_base {
protected function init() {
parent::init();
$this->data ['crud'] = 'r';
$this->data['crud'] = 'r';
$this->legacyaction = 'debug';
}
}
2 changes: 1 addition & 1 deletion classes/event/submission_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class submission_deleted extends submission_base {
protected function init() {
parent::init();
$this->data ['crud'] = 'd';
$this->data['crud'] = 'd';
$this->legacyaction = 'delete submission';
}
}
2 changes: 1 addition & 1 deletion classes/event/submission_edited.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class submission_edited extends submission_base {
protected function init() {
parent::init();
$this->data ['crud'] = 'r';
$this->data['crud'] = 'r';
$this->legacyaction = 'edit submission';
}
}
2 changes: 1 addition & 1 deletion classes/event/submission_evaluated.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class submission_evaluated extends submission_base {
protected function init() {
parent::init();
$this->data ['crud'] = 'u';
$this->data['crud'] = 'u';
$this->legacyaction = 'evaluate';
}
}
2 changes: 1 addition & 1 deletion classes/event/submission_grade_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class submission_grade_deleted extends submission_graded {
protected function init() {
parent::init();
$this->data ['crud'] = 'd';
$this->data['crud'] = 'd';
}
public function get_description() {
return $this->get_description_mod( 'grade' );
Expand Down
4 changes: 2 additions & 2 deletions classes/event/submission_grade_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
class submission_grade_viewed extends submission_graded {
protected function init() {
parent::init();
$this->data ['crud'] = 'r';
$this->data ['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
}
public function get_description() {
return $this->get_description_mod( 'grade' );
Expand Down
4 changes: 2 additions & 2 deletions classes/event/submission_graded.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
class submission_graded extends submission_base {
protected function init() {
parent::init();
$this->data ['crud'] = 'c';
$this->data ['edulevel'] = self::LEVEL_TEACHING;
$this->data['crud'] = 'c';
$this->data['edulevel'] = self::LEVEL_TEACHING;
$this->legacyaction = 'grade';
}
protected function get_description_mod($mod) {
Expand Down
2 changes: 1 addition & 1 deletion classes/event/submission_previous_upload_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class submission_previous_upload_viewed extends vpl_base {
protected function init() {
parent::init();
$this->data ['crud'] = 'r';
$this->data['crud'] = 'r';
$this->legacyaction = 'view previous';
}
public function get_description() {
Expand Down
2 changes: 1 addition & 1 deletion classes/event/submission_run.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class submission_run extends submission_base {
protected function init() {
parent::init();
$this->data ['crud'] = 'r';
$this->data['crud'] = 'r';
$this->legacyaction = 'run';
}
}
2 changes: 1 addition & 1 deletion classes/event/submission_uploaded.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class submission_uploaded extends submission_base {
protected function init() {
parent::init();
$this->data ['crud'] = 'c';
$this->data['crud'] = 'c';
$this->legacyaction = 'submit files';
}
}
2 changes: 1 addition & 1 deletion classes/event/submission_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class submission_viewed extends submission_base {
protected function init() {
parent::init();
$this->data ['crud'] = 'r';
$this->data['crud'] = 'r';
$this->legacyaction = 'view submission';
}
}
2 changes: 1 addition & 1 deletion classes/event/variation_added.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class variation_added extends variation_base {
protected function init() {
parent::init();
$this->data ['crud'] = 'c';
$this->data['crud'] = 'c';
$this->legacyaction = 'added variation';
}
public function get_description() {
Expand Down
2 changes: 1 addition & 1 deletion classes/event/variation_assigned.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class variation_assigned extends variation_base {
protected function init() {
parent::init();
$this->legacyaction = 'assigned variation';
$this->data ['crud'] = 'c';
$this->data['crud'] = 'c';
}
public function get_description() {
return $this->get_description_mod( 'assigned' );
Expand Down
6 changes: 3 additions & 3 deletions classes/event/variation_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public static function get_other_mapping() {
return false;
}
protected function init() {
$this->data ['crud'] = 'u';
$this->data ['edulevel'] = self::LEVEL_TEACHING;
$this->data ['objecttable'] = VPL_VARIATIONS;
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
$this->data['objecttable'] = VPL_VARIATIONS;
}
public static function log($vpl, $varid = null) {
if (is_array($vpl)) {
Expand Down
2 changes: 1 addition & 1 deletion classes/event/variation_updated.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class variation_updated extends variation_base {
protected function init() {
parent::init();
$this->data ['crud'] = 'u';
$this->data['crud'] = 'u';
$this->legacyaction = 'updated variation';
}
public function get_description() {
Expand Down
2 changes: 1 addition & 1 deletion classes/event/vpl_all_submissions_downloaded.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class vpl_all_submissions_downloaded extends vpl_base {
protected function init() {
parent::init();
$this->data ['crud'] = 'r';
$this->data['crud'] = 'r';
$this->legacyaction = 'Download all submissions';
}
public function get_description() {
Expand Down
2 changes: 1 addition & 1 deletion classes/event/vpl_all_submissions_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class vpl_all_submissions_viewed extends vpl_base {
protected function init() {
parent::init();
$this->data ['crud'] = 'r';
$this->data['crud'] = 'r';
$this->legacyaction = 'view all submissions';
}
public function get_description() {
Expand Down
6 changes: 3 additions & 3 deletions classes/event/vpl_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public static function get_other_mapping() {
return false;
}
protected function init() {
$this->data ['crud'] = 'u';
$this->data ['edulevel'] = self::LEVEL_TEACHING;
$this->data ['objecttable'] = VPL;
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_TEACHING;
$this->data['objecttable'] = VPL;
}
public static function log($vpl) {
if (is_array( $vpl )) {
Expand Down
8 changes: 4 additions & 4 deletions classes/event/vpl_checkvpls.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ public static function get_other_mapping() {
return false;
}
protected function init() {
$this->data ['crud'] = 'u';
$this->data ['edulevel'] = self::LEVEL_OTHER;
$this->data ['objecttable'] = 'course';
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'course';
}

public function get_url() {
$param = array ( 'id' => $this->data ['objectid'] );
$param = array ( 'id' => $this->data['objectid'] );
return new \moodle_url( 'mod/vpl/views/checkvpls.php', $param);
}
public function get_description() {
Expand Down
2 changes: 1 addition & 1 deletion classes/event/vpl_description_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
class vpl_description_viewed extends vpl_base {
protected function init() {
parent::init();
$this->data ['crud'] = 'r';
$this->data['crud'] = 'r';
$this->legacyaction = 'view';
}
public function get_description() {
Expand Down
4 changes: 2 additions & 2 deletions classes/event/vpl_diff_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
class vpl_diff_viewed extends submission_base {
protected function init() {
parent::init();
$this->data ['edulevel'] = self::LEVEL_TEACHING;
$this->data ['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_TEACHING;
$this->data['crud'] = 'r';
$this->legacyaction = 'Diff';
}
public function get_description() {
Expand Down
2 changes: 1 addition & 1 deletion classes/event/vpl_execution_keeplist_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class vpl_execution_keeplist_viewed extends vpl_base {
protected function init() {
parent::init();
$this->data ['crud'] = 'r';
$this->data['crud'] = 'r';
$this->legacyaction = 'execution keep file form';
}
public function get_description() {
Expand Down
Loading

0 comments on commit 4124811

Please sign in to comment.