Skip to content

Commit

Permalink
Removed legacy deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
drachels committed Apr 10, 2023
1 parent 1db8727 commit 1f663f3
Show file tree
Hide file tree
Showing 24 changed files with 18 additions and 189 deletions.
10 changes: 0 additions & 10 deletions classes/event/course_exercises_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,4 @@ public function get_description() {
public function get_url() {
return new \moodle_url('/mod/mootyper/exercises.php', array('id' => $this->objectid));
}

/**
* Return the legacy event log data.
*
* @return array|null
*/
protected function get_legacy_logdata() {
return array($this->courseid, 'mootyper', 'view mootyper', 'exercises.php?id=' . $this->objectid,
$this->objectid, $this->contextinstanceid);
}
}
10 changes: 0 additions & 10 deletions classes/event/exam_completed.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,4 @@ public function get_description() {
public function get_url() {
return new \moodle_url('/mod/mootyper/exercises.php', array('id' => $this->contextinstanceid));
}

/**
* replace add_to_log() statement.
*
* @return array of parameters to be passed to legacy add_to_log() function.
*/
protected function get_legacy_logdata() {
$url = new \moodle_url('exercises.php', array('id' => $this->contextinstanceid));
return array($this->courseid, 'mootyper', 'exercises', $url->out(), $this->objectid, $this->contextinstanceid);
}
}
10 changes: 0 additions & 10 deletions classes/event/exercise_added.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,4 @@ public function get_description() {
public function get_url() {
return new \moodle_url('/mod/mootyper/exercises.php', array('id' => $this->contextinstanceid));
}

/**
* replace add_to_log() statement.
*
* @return array of parameters to be passed to legacy add_to_log() function.
*/
protected function get_legacy_logdata() {
$url = new \moodle_url('exercises.php', array('id' => $this->contextinstanceid));
return array($this->courseid, 'mootyper', 'exercises', $url->out(), $this->objectid, $this->contextinstanceid);
}
}
10 changes: 0 additions & 10 deletions classes/event/exercise_completed.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,4 @@ public function get_description() {
public function get_url() {
return new \moodle_url('/mod/mootyper/exercises.php', array('id' => $this->contextinstanceid));
}

/**
* replace add_to_log() statement.
*
* @return array of parameters to be passed to legacy add_to_log() function.
*/
protected function get_legacy_logdata() {
$url = new \moodle_url('exercises.php', array('id' => $this->contextinstanceid));
return array($this->courseid, 'mootyper', 'exercises', $url->out(), $this->objectid, $this->contextinstanceid);
}
}
10 changes: 0 additions & 10 deletions classes/event/exercise_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,4 @@ public function get_description() {
public function get_url() {
return new \moodle_url('/mod/mootyper/exercises.php', array('id' => $this->contextinstanceid));
}

/**
* replace add_to_log() statement.
*
* @return array of parameters to be passed to legacy add_to_log() function.
*/
protected function get_legacy_logdata() {
$url = new \moodle_url('exercises.php', array('id' => $this->contextinstanceid));
return array($this->courseid, 'mootyper', 'exercises', $url->out(), $this->objectid, $this->contextinstanceid);
}
}
10 changes: 0 additions & 10 deletions classes/event/exercise_edited.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,4 @@ public function get_description() {
public function get_url() {
return new \moodle_url('/mod/mootyper/exercises.php', array('id' => $this->contextinstanceid));
}

/**
* replace add_to_log() statement.
*
* @return array of parameters to be passed to legacy add_to_log() function.
*/
protected function get_legacy_logdata() {
$url = new \moodle_url('exercises.php', array('id' => $this->contextinstanceid));
return array($this->courseid, 'mootyper', 'exercises', $url->out(), $this->objectid, $this->contextinstanceid);
}
}
10 changes: 0 additions & 10 deletions classes/event/export_viewallgrades_to_csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,4 @@ public function get_description() {
public function get_url() {
return new \moodle_url('/mod/mootyper/gview.php', array('id' => $this->contextinstanceid));
}

/**
* replace add_to_log() statement.
*
* @return array of parameters to be passed to legacy add_to_log() function.
*/
protected function get_legacy_logdata() {
$url = new \moodle_url('gview.php', array('id' => $this->contextinstanceid));
return array($this->courseid, 'mootyper', 'gview', $url->out(), $this->objectid, $this->contextinstanceid);
}
}
10 changes: 0 additions & 10 deletions classes/event/grade_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,4 @@ public function get_description() {
public function get_url() {
return new \moodle_url('/mod/mootyper/gview.php', array('id' => $this->contextinstanceid));
}

/**
* replace add_to_log() statement.
*
* @return array of parameters to be passed to legacy add_to_log() function.
*/
protected function get_legacy_logdata() {
$url = new \moodle_url('gview.php', array('id' => $this->contextinstanceid));
return array($this->courseid, 'mootyper', 'gview', $url->out(), $this->objectid, $this->contextinstanceid);
}
}
10 changes: 0 additions & 10 deletions classes/event/invalid_access_attempt.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,4 @@ public function get_description() {
public function get_url() {
return new \moodle_url('/mod/mootyper/view.php', array('id' => $this->contextinstanceid));
}

/**
* replace add_to_log() statement.
*
* @return array of parameters to be passed to legacy add_to_log() function.
*/
protected function get_legacy_logdata() {
$url = new \moodle_url('view.php', array('id' => $this->contextinstanceid));
return array($this->courseid, 'mootyper', 'view', $url->out(), $this->objectid, $this->contextinstanceid);
}
}
10 changes: 0 additions & 10 deletions classes/event/layout_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,4 @@ public function get_description() {
public function get_url() {
return new \moodle_url('/mod/mootyper/layouts.php', array('id' => $this->contextinstanceid));
}

/**
* replace add_to_log() statement.
*
* @return array of parameters to be passed to legacy add_to_log() function.
*/
protected function get_legacy_logdata() {
$url = new \moodle_url('layouts.php', array('id' => $this->contextinstanceid));
return array($this->courseid, 'mootyper', 'layouts', $url->out(), $this->objectid, $this->contextinstanceid);
}
}
10 changes: 0 additions & 10 deletions classes/event/layout_imported.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,4 @@ public function get_description() {
public function get_url() {
return new \moodle_url('/mod/mootyper/exercises.php', array('id' => $this->contextinstanceid));
}

/**
* replace add_to_log() statement.
*
* @return array of parameters to be passed to legacy add_to_log() function.
*/
protected function get_legacy_logdata() {
$url = new \moodle_url('exercises.php', array('id' => $this->contextinstanceid));
return array($this->courseid, 'mootyper', 'exercises', $url->out(), $this->objectid, $this->contextinstanceid);
}
}
10 changes: 0 additions & 10 deletions classes/event/lesson_completed.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,4 @@ public function get_description() {
public function get_url() {
return new \moodle_url('/mod/mootyper/exercises.php', array('id' => $this->contextinstanceid));
}

/**
* replace add_to_log() statement.
*
* @return array of parameters to be passed to legacy add_to_log() function.
*/
protected function get_legacy_logdata() {
$url = new \moodle_url('exercises.php', array('id' => $this->contextinstanceid));
return array($this->courseid, 'mootyper', 'exercises', $url->out(), $this->objectid, $this->contextinstanceid);
}
}
10 changes: 0 additions & 10 deletions classes/event/lesson_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,4 @@ public function get_description() {
public function get_url() {
return new \moodle_url('/mod/mootyper/exercises.php', array('id' => $this->contextinstanceid));
}

/**
* replace add_to_log() statement.
*
* @return array of parameters to be passed to legacy add_to_log() function.
*/
protected function get_legacy_logdata() {
$url = new \moodle_url('exercises.php', array('id' => $this->contextinstanceid));
return array($this->courseid, 'mootyper', 'exercises', $url->out(), $this->objectid, $this->contextinstanceid);
}
}
10 changes: 0 additions & 10 deletions classes/event/lesson_exported.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,4 @@ public function get_description() {
public function get_url() {
return new \moodle_url('/mod/mootyper/exercises.php', array('id' => $this->contextinstanceid));
}

/**
* replace add_to_log() statement.
*
* @return array of parameters to be passed to legacy add_to_log() function.
*/
protected function get_legacy_logdata() {
$url = new \moodle_url('exercises.php', array('id' => $this->contextinstanceid));
return array($this->courseid, 'mootyper', 'exercises', $url->out(), $this->objectid, $this->contextinstanceid);
}
}
10 changes: 0 additions & 10 deletions classes/event/lesson_imported.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,4 @@ public function get_description() {
public function get_url() {
return new \moodle_url('/mod/mootyper/exercises.php', array('id' => $this->contextinstanceid));
}

/**
* replace add_to_log() statement.
*
* @return array of parameters to be passed to legacy add_to_log() function.
*/
protected function get_legacy_logdata() {
$url = new \moodle_url('exercises.php', array('id' => $this->contextinstanceid));
return array($this->courseid, 'mootyper', 'exercises', $url->out(), $this->objectid, $this->contextinstanceid);
}
}
10 changes: 0 additions & 10 deletions classes/event/owngrades_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,4 @@ public function get_description() {
public function get_url() {
return new \moodle_url('/mod/mootyper/gview.php', array('id' => $this->contextinstanceid));
}

/**
* replace add_to_log() statement.
*
* @return array of parameters to be passed to legacy add_to_log() function.
*/
protected function get_legacy_logdata() {
$url = new \moodle_url('owngrades.php', array('id' => $this->contextinstanceid));
return array($this->courseid, 'mootyper', 'owngrades', $url->out(), $this->objectid, $this->contextinstanceid);
}
}
10 changes: 0 additions & 10 deletions classes/event/viewed_all_grades.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,4 @@ public function get_description() {
public function get_url() {
return new \moodle_url('/mod/mootyper/gview.php', array('id' => $this->contextinstanceid));
}

/**
* replace add_to_log() statement.
*
* @return array of parameters to be passed to legacy add_to_log() function.
*/
protected function get_legacy_logdata() {
$url = new \moodle_url('gview.php', array('id' => $this->contextinstanceid));
return array($this->courseid, 'mootyper', 'gview', $url->out(), $this->objectid, $this->contextinstanceid);
}
}
10 changes: 0 additions & 10 deletions classes/event/viewed_own_grades.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,4 @@ public function get_description() {
public function get_url() {
return new \moodle_url('/mod/mootyper/owngrades.php', array('id' => $this->contextinstanceid));
}

/**
* replace add_to_log() statement.
*
* @return array of parameters to be passed to legacy add_to_log() function.
*/
protected function get_legacy_logdata() {
$url = new \moodle_url('owngrades.php', array('id' => $this->contextinstanceid));
return array($this->courseid, 'mootyper', 'owngrades', $url->out(), $this->objectid, $this->contextinstanceid);
}
}
2 changes: 1 addition & 1 deletion gview.php
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@

$chart = new core\chart_bar(); // Tell the api we want a bar chart.
$chart->set_horizontal(true); // Calling set_horizontal() passing true as parameter will display horizontal bar charts.
$chart->set_title(get_string('charttitleallgrades', 'mootyper')); // Tell the api what we want for a the chart title.
$chart->set_title(get_string('charttitleallgrades', 'mootyper')); // Tell the api what we want for a chart title.
// Temp $chart->add_series($serie1); // Pass the hits per minute data to the api.
$chart->add_series($serie2); // Pass the precision data to the api.
$chart->add_series($serie3); // Pass the words per minute data to the api.
Expand Down
2 changes: 1 addition & 1 deletion lang/en/mootyper.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
$string['defaultlayout'] = 'Default keyboard layout';
$string['defaultlayout_desc'] = 'If overwrite_defaultlayout is not activated then this layout will be used in new activitys as default but trainer can chose a different layout.';
$string['defaultlayout_filenamewithoutfiletype'] = 'Defaultlayout filename (without filetype!)';
$string['default_defaultlayout_filenamewithoutfiletype'] = 'English(UKV5)';
$string['default_defaultlayout_filenamewithoutfiletype'] = 'English(USV5)';
$string['defaultlayout_filenamewithoutfiletype_desc'] = 'This is the filename of the defaultlayout that should be used if overwrite_defaultlayout is activated. If file does not exist, then the normal defaultlayout will be used.';
$string['defaultprecision'] = 'Default typing precision %';
$string['defaulttextalign'] = 'Text alignment';
Expand Down
4 changes: 3 additions & 1 deletion mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ public function definition() {
isset($mootyperconfig->defaultlayout_filenamewithoutfiletype) &&
keyboards::is_layout_installed("$mootyperconfig->defaultlayout_filenamewithoutfiletype")) {
// We should overwrite and the layout is installed!
$mform->setDefault('layout', keyboards::get_id_of_layout_by_layoutname($mootyperconfig->defaultlayout_filenamewithoutfiletype));
$mform->setDefault('layout',
keyboards::get_id_of_layout_by_layoutname($mootyperconfig->defaultlayout_filenamewithoutfiletype
));
} else {
// We should not overwrite or the laylout is not installed so we have to use the "normal" default.
$mform->setDefault('layout', $mootyperconfig->defaultlayout);
Expand Down
10 changes: 6 additions & 4 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,16 @@
3,
$layouts));

// Check if the layout that might should be used by the layoutname is installed
$defaultlayoutid = keyboards::get_id_of_layout_by_layoutname(get_string('default_defaultlayout_filenamewithoutfiletype', 'mootyper'));
// Check if the layout that might should be used by the layoutname is installed.
$defaultlayoutid = keyboards::get_id_of_layout_by_layoutname(
get_string('default_defaultlayout_filenamewithoutfiletype', 'mootyper'
));
$description = get_string('defaultlayout_filenamewithoutfiletype_desc', 'mootyper');
if ($defaultlayoutid == 0) {
$description = get_string('default_defaultlayout_filenamewithoutfiletype', 'mootyper') . " does not exist. " . $description;
$description = get_string('default_defaultlayout_filenamewithoutfiletype', 'mootyper')." does not exist. ". $description;
}

// Overwrite defaultlayout by layoutname
// Overwrite defaultlayout by layoutname.
$settings->add(new admin_setting_configcheckbox("mod_mootyper/overwrite_defaultlayout",
get_string('overwrite_defaultlayout', 'mootyper'), '', 1));
$settings->add(new admin_setting_configtext("mod_mootyper/defaultlayout_filenamewithoutfiletype",
Expand Down
5 changes: 5 additions & 0 deletions upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ Moodle Versions
20230224 MooTyper_699 - Create Hindi(HIV5) KB Layout. Dropping this ticket because the
Hindi alphabet is not in the Courier New font file so it is not compatible with
view.php and typer.js files.
20230224 MooTyper_1013 - Need to see about selecting KB Layout based on name instead of ID.
New code provided as a merged pulled request for item #110.
20230406 MooTyper_1032 - Invalid event functions defined in \mod_mootyper\event
\course_exercises_viewed. Deleted deprecated legacy log code as need in all the new,
MooTyper v4.2.3, files.



Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2023020600; // The current module version (Date: YYYYMMDDXX).
$plugin->version = 2023041000; // The current module version (Date: YYYYMMDDXX).
$plugin->requires = 2018120300; // Requires Moodle 3.6.
$plugin->cron = 60; // Period for cron to check this module (secs).
$plugin->component = 'mod_mootyper';
$plugin->maturity = MATURITY_STABLE;
$plugin->release = '4.2.3 (Build: 2023020600)';
$plugin->release = '4.2.3 (Build: 2023041000)';

0 comments on commit 1f663f3

Please sign in to comment.