diff --git a/grade/edit/outcome/export.php b/grade/edit/outcome/export.php
index dbb510f..ce048d3 100644
--- a/grade/edit/outcome/export.php
+++ b/grade/edit/outcome/export.php
@@ -27,7 +27,7 @@ $action   = optional_param('action', '', PARAM_ALPHA);
 /// Make sure they can even access this course
 if ($courseid) {
     if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-        print_error('nocourseid');
+        print_error('unknowncourseidnumber', 'error', '', $courseid);
     }
     require_login($course);
     $context = get_context_instance(CONTEXT_COURSE, $course->id);
diff --git a/grade/edit/outcome/import.php b/grade/edit/outcome/import.php
index 6e62867..7f466f0 100644
--- a/grade/edit/outcome/import.php
+++ b/grade/edit/outcome/import.php
@@ -30,7 +30,7 @@ $PAGE->set_url('/grade/edit/outcome/import.php', array('courseid' => $courseid))
 /// Make sure they can even access this course
 if ($courseid) {
     if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-        print_error('nocourseid');
+        print_error('unknowncourseidnumber', 'error', '', $courseid);
     }
     require_login($course);
     $context = get_context_instance(CONTEXT_COURSE, $course->id);
diff --git a/grade/edit/scale/edit.php b/grade/edit/scale/edit.php
index f226139..6063906 100644
--- a/grade/edit/scale/edit.php
+++ b/grade/edit/scale/edit.php
@@ -62,7 +62,7 @@ if ($id) {
     $heading = get_string('addscale', 'grades');
     /// adding new scale from course
     if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-        print_error('nocourseid');
+        print_error('unknowncourseidnumber', 'error', '', $courseid);
     }
     $scale_rec = new stdClass();
     $scale_rec->standard = 0;
diff --git a/grade/edit/scale/index.php b/grade/edit/scale/index.php
index 237944e..8b5d640 100644
--- a/grade/edit/scale/index.php
+++ b/grade/edit/scale/index.php
@@ -27,7 +27,7 @@ $PAGE->set_url('/grade/edit/scale/index.php', array('id' => $courseid));
 /// Make sure they can even access this course
 if ($courseid) {
     if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-        print_error('nocourseid');
+        print_error('unknowncourseidnumber', 'error', '', $courseid);
     }
     require_login($course);
     $context = get_context_instance(CONTEXT_COURSE, $course->id);
diff --git a/grade/edit/settings/index.php b/grade/edit/settings/index.php
index c4949a4..e82d0b3 100644
--- a/grade/edit/settings/index.php
+++ b/grade/edit/settings/index.php
@@ -26,7 +26,7 @@ $PAGE->set_url('/grade/edit/settings/index.php', array('id'=>$courseid));
 $PAGE->set_pagelayout('admin');
 
 if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 require_login($course);
 $context = get_context_instance(CONTEXT_COURSE, $course->id);
diff --git a/grade/edit/tree/action.php b/grade/edit/tree/action.php
index ed8d2af..71eefd0 100644
--- a/grade/edit/tree/action.php
+++ b/grade/edit/tree/action.php
@@ -26,7 +26,7 @@ $PAGE->set_url('/grade/edit/tree/action.php', array('id'=>$courseid, 'action'=>$
 
 /// Make sure they can even access this course
 if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 require_login($course);
 $context = get_context_instance(CONTEXT_COURSE, $course->id);
diff --git a/grade/edit/tree/calculation.php b/grade/edit/tree/calculation.php
index 9993324..d80cd55 100644
--- a/grade/edit/tree/calculation.php
+++ b/grade/edit/tree/calculation.php
@@ -32,7 +32,7 @@ if ($section !== 'calculation') {
 $PAGE->set_url($url);
 
 if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course);
diff --git a/grade/edit/tree/category.php b/grade/edit/tree/category.php
index 0c37f8c..620550c 100644
--- a/grade/edit/tree/category.php
+++ b/grade/edit/tree/category.php
@@ -31,7 +31,7 @@ $PAGE->set_url($url);
 $PAGE->set_pagelayout('admin');
 
 if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course);
diff --git a/grade/edit/tree/grade.php b/grade/edit/tree/grade.php
index ab188de..24350d8 100644
--- a/grade/edit/tree/grade.php
+++ b/grade/edit/tree/grade.php
@@ -38,7 +38,7 @@ if ($userid !== 0) {
 $PAGE->set_url($url);
 
 if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 $PAGE->set_pagelayout('incourse');
diff --git a/grade/edit/tree/index.php b/grade/edit/tree/index.php
index 8d88615..8e2b9af 100644
--- a/grade/edit/tree/index.php
+++ b/grade/edit/tree/index.php
@@ -44,7 +44,7 @@ $PAGE->set_pagelayout('admin');
 
 /// Make sure they can even access this course
 if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course);
diff --git a/grade/edit/tree/item.php b/grade/edit/tree/item.php
index 1ce936c..582ac57 100644
--- a/grade/edit/tree/item.php
+++ b/grade/edit/tree/item.php
@@ -31,7 +31,7 @@ $PAGE->set_url($url);
 $PAGE->set_pagelayout('admin');
 
 if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course);
diff --git a/grade/edit/tree/outcomeitem.php b/grade/edit/tree/outcomeitem.php
index 518f111..350007e 100644
--- a/grade/edit/tree/outcomeitem.php
+++ b/grade/edit/tree/outcomeitem.php
@@ -30,7 +30,7 @@ if ($id !== 0) {
 $PAGE->set_url($url);
 
 if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course);
diff --git a/grade/export/keymanager.php b/grade/export/keymanager.php
index b6d7314..917b408 100644
--- a/grade/export/keymanager.php
+++ b/grade/export/keymanager.php
@@ -31,7 +31,7 @@ $id = required_param('id', PARAM_INT); // course id
 $PAGE->set_url('/grade/export/keymanager.php', array('id' => $id));
 
 if (!$course = $DB->get_record('course', array('id'=>$id))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course);
diff --git a/grade/export/ods/dump.php b/grade/export/ods/dump.php
index 1bca2f1..f8566f4 100644
--- a/grade/export/ods/dump.php
+++ b/grade/export/ods/dump.php
@@ -20,7 +20,7 @@ require_once '../../../config.php';
 
 $id = required_param('id', PARAM_INT); // course id
 if (!$course = $DB->get_record('course', array('id'=>$id))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_user_key_login('grade/export', $id); // we want different keys for each course
diff --git a/grade/export/ods/export.php b/grade/export/ods/export.php
index f81f1d6..2773ffa 100644
--- a/grade/export/ods/export.php
+++ b/grade/export/ods/export.php
@@ -28,7 +28,7 @@ $displaytype       = optional_param('displaytype', $CFG->grade_export_displaytyp
 $decimalpoints     = optional_param('decimalpoints', $CFG->grade_export_decimalpoints, PARAM_INT);
 
 if (!$course = $DB->get_record('course', array('id'=>$id))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course);
diff --git a/grade/export/ods/index.php b/grade/export/ods/index.php
index f0d4b3c..3bda1a9 100644
--- a/grade/export/ods/index.php
+++ b/grade/export/ods/index.php
@@ -24,7 +24,7 @@ $id = required_param('id', PARAM_INT); // course id
 $PAGE->set_url('/grade/export/ods/index.php', array('id'=>$id));
 
 if (!$course = $DB->get_record('course', array('id'=>$id))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course);
diff --git a/grade/export/txt/dump.php b/grade/export/txt/dump.php
index 305b480..52a76d5 100644
--- a/grade/export/txt/dump.php
+++ b/grade/export/txt/dump.php
@@ -20,7 +20,7 @@ require_once '../../../config.php';
 
 $id = required_param('id', PARAM_INT); // course id
 if (!$course = $DB->get_record('course', array('id'=>$id))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_user_key_login('grade/export', $id); // we want different keys for each course
diff --git a/grade/export/txt/export.php b/grade/export/txt/export.php
index ab7a03b..972122e 100644
--- a/grade/export/txt/export.php
+++ b/grade/export/txt/export.php
@@ -29,7 +29,7 @@ $displaytype       = optional_param('displaytype', $CFG->grade_export_displaytyp
 $decimalpoints     = optional_param('decimalpoints', $CFG->grade_export_decimalpoints, PARAM_INT);
 
 if (!$course = $DB->get_record('course', array('id'=>$id))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course);
diff --git a/grade/export/txt/index.php b/grade/export/txt/index.php
index 47de3e7..6877420 100644
--- a/grade/export/txt/index.php
+++ b/grade/export/txt/index.php
@@ -24,7 +24,7 @@ $id = required_param('id', PARAM_INT); // course id
 $PAGE->set_url('/grade/export/txt/index.php', array('id'=>$id));
 
 if (!$course = $DB->get_record('course', array('id'=>$id))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course);
diff --git a/grade/export/xls/dump.php b/grade/export/xls/dump.php
index 7c4ea4e..13c3614 100644
--- a/grade/export/xls/dump.php
+++ b/grade/export/xls/dump.php
@@ -20,7 +20,7 @@ require_once '../../../config.php';
 
 $id = required_param('id', PARAM_INT); // course id
 if (!$course = $DB->get_record('course', array('id'=>$id))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_user_key_login('grade/export', $id); // we want different keys for each course
diff --git a/grade/export/xls/export.php b/grade/export/xls/export.php
index 4df1fec..89b1fc7 100644
--- a/grade/export/xls/export.php
+++ b/grade/export/xls/export.php
@@ -28,7 +28,7 @@ $displaytype       = optional_param('displaytype', $CFG->grade_export_displaytyp
 $decimalpoints     = optional_param('decimalpoints', $CFG->grade_export_decimalpoints, PARAM_INT);
 
 if (!$course = $DB->get_record('course', array('id'=>$id))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course);
diff --git a/grade/export/xls/index.php b/grade/export/xls/index.php
index fc509bc..32929dd 100644
--- a/grade/export/xls/index.php
+++ b/grade/export/xls/index.php
@@ -24,7 +24,7 @@ $id = required_param('id', PARAM_INT); // course id
 $PAGE->set_url('/grade/export/xls/index.php', array('id'=>$id));
 
 if (!$course = $DB->get_record('course', array('id'=>$id))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course);
diff --git a/grade/export/xml/dump.php b/grade/export/xml/dump.php
index 5b147f8..eaf1505 100644
--- a/grade/export/xml/dump.php
+++ b/grade/export/xml/dump.php
@@ -20,7 +20,7 @@ require_once '../../../config.php';
 
 $id = required_param('id', PARAM_INT); // course id
 if (!$course = $DB->get_record('course', array('id'=>$id))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_user_key_login('grade/export', $id); // we want different keys for each course
diff --git a/grade/export/xml/export.php b/grade/export/xml/export.php
index 7807993..987cbac 100644
--- a/grade/export/xml/export.php
+++ b/grade/export/xml/export.php
@@ -28,7 +28,7 @@ $displaytype       = optional_param('displaytype', $CFG->grade_export_displaytyp
 $decimalpoints     = optional_param('decimalpoints', $CFG->grade_export_decimalpoints, PARAM_INT);
 
 if (!$course = $DB->get_record('course', array('id'=>$id))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course);
diff --git a/grade/export/xml/index.php b/grade/export/xml/index.php
index bc4d925..46248e6 100644
--- a/grade/export/xml/index.php
+++ b/grade/export/xml/index.php
@@ -24,7 +24,7 @@ $id = required_param('id', PARAM_INT); // course id
 $PAGE->set_url('/grade/export/xml/index.php', array('id'=>$id));
 
 if (!$course = $DB->get_record('course', array('id'=>$id))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course);
diff --git a/grade/import/csv/index.php b/grade/import/csv/index.php
index 886bf43..cca5bb4 100644
--- a/grade/import/csv/index.php
+++ b/grade/import/csv/index.php
@@ -37,7 +37,7 @@ $PAGE->set_url($url);
 define('GRADE_CSV_LINE_LENGTH', 4096);
 
 if (!$course = $DB->get_record('course', array('id'=>$id))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course);
diff --git a/grade/import/keymanager.php b/grade/import/keymanager.php
index 7d469f6..d2e76bd 100644
--- a/grade/import/keymanager.php
+++ b/grade/import/keymanager.php
@@ -31,7 +31,7 @@ $id = required_param('id', PARAM_INT); // course id
 $PAGE->set_url('/grade/import/keymanager.php', array('id' => $id));
 
 if (!$course = $DB->get_record('course', array('id'=>$id))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course);
diff --git a/grade/import/xml/fetch.php b/grade/import/xml/fetch.php
index 68fd62e..6c84e70 100644
--- a/grade/import/xml/fetch.php
+++ b/grade/import/xml/fetch.php
@@ -20,7 +20,7 @@ require_once '../../../config.php';
 
 $id = required_param('id', PARAM_INT); // course id
 if (!$course = $DB->get_record('course', array('id'=>$id))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_user_key_login('grade/import', $id); // we want different keys for each course
diff --git a/grade/import/xml/import.php b/grade/import/xml/import.php
index 3c941f0..9c355ca 100644
--- a/grade/import/xml/import.php
+++ b/grade/import/xml/import.php
@@ -30,7 +30,7 @@ if ($feedback !== 0) {
 $PAGE->set_url($url);
 
 if (!$course = $DB->get_record('course', array('id'=>$id))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course);
diff --git a/grade/import/xml/index.php b/grade/import/xml/index.php
index 5ce766b..30ea06b 100644
--- a/grade/import/xml/index.php
+++ b/grade/import/xml/index.php
@@ -25,7 +25,7 @@ $PAGE->set_url(new moodle_url('/grade/import/xml/index.php', array('id'=>$id)));
 $PAGE->set_pagelayout('admin');
 
 if (!$course = $DB->get_record('course', array('id'=>$id))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course);
diff --git a/grade/report/grader/ajax_callbacks.php b/grade/report/grader/ajax_callbacks.php
index 463f1d6..a1dab24 100644
--- a/grade/report/grader/ajax_callbacks.php
+++ b/grade/report/grader/ajax_callbacks.php
@@ -31,7 +31,7 @@ $newvalue = optional_param('newvalue', false, PARAM_MULTILANG);
 
 /// basic access checks
 if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 $context = get_context_instance(CONTEXT_COURSE, $course->id);
 require_login($course);
diff --git a/grade/report/grader/index.php b/grade/report/grader/index.php
index ca4c063..8ce591e 100644
--- a/grade/report/grader/index.php
+++ b/grade/report/grader/index.php
@@ -36,7 +36,7 @@ $PAGE->set_url(new moodle_url('/grade/report/grader/index.php', array('id'=>$cou
 
 /// basic access checks
 if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 require_login($course);
 $context = get_context_instance(CONTEXT_COURSE, $course->id);
diff --git a/grade/report/grader/preferences.php b/grade/report/grader/preferences.php
index 595eb84..f4bcf5e 100644
--- a/grade/report/grader/preferences.php
+++ b/grade/report/grader/preferences.php
@@ -28,7 +28,7 @@ $PAGE->set_pagelayout('admin');
 /// Make sure they can even access this course
 
 if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course->id);
diff --git a/grade/report/grader/quickedit_item.php b/grade/report/grader/quickedit_item.php
index 7a9ce65..8e72e19 100644
--- a/grade/report/grader/quickedit_item.php
+++ b/grade/report/grader/quickedit_item.php
@@ -37,7 +37,7 @@ $PAGE->set_url($url);
 
 /// basic access checks
 if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 if (!$item = $DB->get_record('grade_items', array('id' => $itemid))) {
diff --git a/grade/report/index.php b/grade/report/index.php
index e4ba906..61ba141 100644
--- a/grade/report/index.php
+++ b/grade/report/index.php
@@ -23,7 +23,7 @@ $PAGE->set_url('/grade/report/index.php', array('id'=>$courseid));
 
 /// basic access checks
 if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 require_login($course);
 $context = get_context_instance(CONTEXT_COURSE, $course->id);
diff --git a/grade/report/outcomes/index.php b/grade/report/outcomes/index.php
index cf73c63..3cc4a3a 100644
--- a/grade/report/outcomes/index.php
+++ b/grade/report/outcomes/index.php
@@ -24,7 +24,7 @@ $courseid = required_param('id', PARAM_INT);                   // course id
 $PAGE->set_url('/grade/report/outcomes/index.php', array('id'=>$courseid));
 
 if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course->id);
diff --git a/grade/report/overview/index.php b/grade/report/overview/index.php
index fefc771..1f6c4ea 100644
--- a/grade/report/overview/index.php
+++ b/grade/report/overview/index.php
@@ -27,7 +27,7 @@ $PAGE->set_url(new moodle_url('/grade/report/overview/index.php', array('id'=>$c
 
 /// basic access checks
 if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 require_login($course);
 
diff --git a/grade/report/user/index.php b/grade/report/user/index.php
index 10aeffb..df652eb 100644
--- a/grade/report/user/index.php
+++ b/grade/report/user/index.php
@@ -27,7 +27,7 @@ $PAGE->set_url(new moodle_url('/grade/report/user/index.php', array('id'=>$cours
 
 /// basic access checks
 if (!$course = $DB->get_record('course', array('id' => $courseid))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 require_login($course);
 $PAGE->set_pagelayout('report');
diff --git a/group/groupings.php b/group/groupings.php
index 80ad8bd..d1f04ee 100644
--- a/group/groupings.php
+++ b/group/groupings.php
@@ -31,7 +31,7 @@ $courseid = required_param('id', PARAM_INT);
 $PAGE->set_url('/group/groupings.php', array('id'=>$courseid));
 
 if (!$course = $DB->get_record('course', array('id'=>$courseid))) {
-    print_error('nocourseid');
+    print_error('unknowncourseidnumber', 'error', '', $courseid);
 }
 
 require_login($course);
