MDL-16409 Make a new admin report to list all questions of a particular type, by context

Partially done. This has the settings form, and queries the database for the right data, but does not format it correctly yet.
This commit is contained in:
tjhunt
2008-09-09 10:16:17 +00:00
parent 2ddd044af8
commit 3041a0dfed
4 changed files with 104 additions and 2 deletions
+7 -2
View File
@@ -10,6 +10,7 @@
require_login();
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/question:config', $systemcontext);
$canviewreports = has_capability('moodle/site:viewreports', $systemcontext);
admin_externalpage_setup('manageqtypes');
@@ -179,8 +180,12 @@
} else {
$strcount = $counts[$qtypename]->numquestions;
}
$row[] = '<a href="' . admin_url('/report/questioninstances/index.php?qtype=' . $qtypename) .
'">' . $strcount . '</a>';
if ($canviewreports) {
$row[] = '<a href="' . admin_url('/report/questioninstances/index.php?qtype=' . $qtypename) .
'">' . $strcount . '</a>';
} else {
$strcount;
}
} else {
$row[] = 0;
}