aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cockpit/js/cockpit.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/cockpit/js/cockpit.js b/cockpit/js/cockpit.js
index e4a6b35..e2f07b2 100644
--- a/cockpit/js/cockpit.js
+++ b/cockpit/js/cockpit.js
@@ -155,17 +155,20 @@ function pointClickHandler(color) {
textareaDiv.style.display = "block";
textarea.focus();
+ // Can not use string interpolation because of Moodle's firstname filter.
+ const coach = firstname + " " + lastname;
+
let submit = function() {
let change;
switch (color) {
case "green":
- change = GraduationChange.newGreenPointChange(student, textarea.value, `${firstname} ${lastname}`);
+ change = GraduationChange.newGreenPointChange(student, textarea.value, coach);
break;
case "orange":
- change = GraduationChange.newOrangePointChange(student, textarea.value, `${firstname} ${lastname}`);
+ change = GraduationChange.newOrangePointChange(student, textarea.value, coach);
break;
case "red":
- change = GraduationChange.newRedPointChange(student, textarea.value, `${firstname} ${lastname}`);
+ change = GraduationChange.newRedPointChange(student, textarea.value, coach);
break;
default:
alert("Invalid color");