diff --git a/grade/lib.php b/grade/lib.php
index f4d1cfb9f43..8f268a0d826 100644
--- a/grade/lib.php
+++ b/grade/lib.php
@@ -2663,6 +2663,10 @@ class grade_structure {
$context->divider2 = false;
}
+ if ($mode == 'setup') {
+ $context->databoundary = 'window';
+ }
+
if (!empty($USER->editing) || isset($context->gradeanalysisurl) || isset($context->gradesonlyurl)
|| isset($context->aggregatesonlyurl) || isset($context->fullmodeurl) || isset($context->reporturl0)
|| isset($context->ascendingfirstnameurl) || isset($context->ascendingurl)
diff --git a/grade/templates/category_settings.mustache b/grade/templates/category_settings.mustache
index ceca527f62a..5387a95a19d 100644
--- a/grade/templates/category_settings.mustache
+++ b/grade/templates/category_settings.mustache
@@ -15,7 +15,7 @@
along with Moodle. If not, see