Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-29846 qbehaviours admin: correct $needed logic.

Also, fix a notice.
  • Loading branch information...
commit 9f689071a891c7d7c9668174394b986efe43efe7 1 parent cb8e878
@timhunt timhunt authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 admin/qbehaviours.php
View
10 admin/qbehaviours.php
@@ -52,16 +52,16 @@
if (!array_key_exists($behaviour, $counts)) {
$counts[$behaviour] = 0;
}
- $needed[$behaviour] = ($counts[$behaviour] > 0) &&
+ $needed[$behaviour] = ($counts[$behaviour] > 0) ||
$pluginmanager->other_plugins_that_require('qbehaviour_' . $behaviour);
$archetypal[$behaviour] = question_engine::is_behaviour_archetypal($behaviour);
}
-
foreach ($counts as $behaviour => $count) {
if (!array_key_exists($behaviour, $behaviours)) {
- $counts['missingtype'] += $count;
+ $counts['missing'] += $count;
}
}
+$needed['missing'] = true;
// Work of the correct sort order.
$config = get_config('question');
@@ -179,7 +179,7 @@
unset($disabledbehaviours[$key]);
set_config('disabledbehaviours', implode(',', $disabledbehaviours), 'question');
}
- $behaviourorder = explode(',', $config->behavioursortorder);
+ $behaviourorder = array_keys($sortedbehaviours);
if (($key = array_search($delete, $behaviourorder)) !== false) {
unset($behaviourorder[$key]);
set_config('behavioursortorder', implode(',', $behaviourorder), 'question');
@@ -248,7 +248,7 @@
$row[] = '';
}
- // Are people allowed to create new questions of this type?
+ // Are people allowed to select this behaviour?
$rowclass = '';
if ($archetypal[$behaviour]) {
$enabled = array_search($behaviour, $disabledbehaviours) === false;
Please sign in to comment.
Something went wrong with that request. Please try again.