diff --git a/cfg_grades.php b/cfg_grades.php
index 182e061..07fa74d 100644
--- a/cfg_grades.php
+++ b/cfg_grades.php
@@ -50,8 +50,6 @@ foreach ($mappings as $cfg) {
}
}
-print $OUTPUT->header();
-
$action = optional_param("action","",PARAM_TEXT);
if ($action == "update") {
// First loop through the scales to see which need to be updated.
@@ -193,6 +191,8 @@ foreach ($scales as $scale) {
$data[] = $row;
}
+print $OUTPUT->header();
+
print html_writer::start_tag("form", ["method" => "post"]);
print html_writer::tag("input", null, ['name' => "action", 'value' => 'update', 'type' => 'hidden']);
diff --git a/templates/cfg_grades.mustache b/templates/cfg_grades.mustache
new file mode 100644
index 0000000..2bd44b5
--- /dev/null
+++ b/templates/cfg_grades.mustache
@@ -0,0 +1,38 @@
+{{!
+ This file is part of Moodle - https://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see