fixed script parameters + some warnings SC#150; merged from MOODLE_15_STABLE

This commit is contained in:
skodak 2005-10-29 16:45:58 +00:00
parent 870e3cad2c
commit 2d5b322c0f
5 changed files with 18 additions and 12 deletions

View File

@ -4,9 +4,9 @@
// Check that all the parameters have been provided.
require_variable($id); // Course Module ID
optional_variable($type, "xls");
optional_variable($group, 0);
$id = required_param('id', PARAM_INT); // Course Module ID
$type = optional_param('type', 'xls', PARAM_ALPHA);
$group = optional_param('group', 0, PARAM_INT);
if (! $cm = get_record("course_modules", "id", $id)) {
error("Course Module ID was incorrect");
@ -106,7 +106,7 @@
foreach ($aaa as $a) {
if (!$group or isset($users[$a->userid])) {
if (!$results["$a->userid"]) { // init new array
if (empty($results["$a->userid"])) { // init new array
$results["$a->userid"]["time"] = $a->time;
foreach ($order as $key => $qid) {
$results["$a->userid"]["$qid"]["answer1"] = "";

View File

@ -4,10 +4,11 @@
require_once("$CFG->libdir/graphlib.php");
require_once("lib.php");
$id = required_param('id',PARAM_INT); // Course Module ID
$type = required_param('type',PARAM_CLEAN); // Graph Type
$id = required_param('id', PARAM_INT); // Course Module ID
$type = required_param('type', PARAM_FILE); // Graph Type
$group = optional_param('group', 0, PARAM_INT); // Group ID
$sid = optional_param('sid', 0, PARAM_INT); // Student ID
$sid = optional_param('sid', false, PARAM_INT); // Student ID
$qid = optional_param('qid', 0, PARAM_INT); // Group ID
if (! $cm = get_record("course_modules", "id", $id)) {
error("Course Module ID was incorrect");
@ -112,6 +113,9 @@
$graph->parameter['x_axis_angle'] = 20;
$graph->parameter['shadow'] = 'none';
$graph->y_tick_labels = null;
$graph->offset_relation = null;
$graph->draw_stack();
break;

View File

@ -3,7 +3,7 @@
require_once("../../config.php");
require_once("lib.php");
require_variable($id); // course
$id = required_param('id', PARAM_INT); // Course Module ID
if (! $course = get_record("course", "id", $id)) {
error("Course ID is incorrect");

View File

@ -5,9 +5,10 @@
// Check that all the parameters have been provided.
$id = required_param('id', PARAM_INT); // Course Module ID
$action = optional_param('action', ''); // What to look at
$qid = optional_param('qid', 0, PARAM_INT); // Question id
$id = required_param('id', PARAM_INT); // Course Module ID
$action = optional_param('action', '', PARAM_ALPHA); // What to look at
$qid = optional_param('qid', 0, PARAM_INT); // Group ID
$student = optional_param('student', 0, PARAM_INT); // Student ID
if (! $cm = get_record("course_modules", "id", $id)) {
error("Course Module ID was incorrect");

View File

@ -3,7 +3,6 @@
require_once('../../config.php');
require_once('lib.php');
$id = required_param( 'id', PARAM_INT );
// Make sure this is a legitimate posting
@ -15,6 +14,8 @@
error("Guests are not allowed to answer surveys", $_SERVER["HTTP_REFERER"]);
}
$id = required_param('id', PARAM_INT); // Course Module ID
if (! $cm = get_record("course_modules", "id", $id)) {
error("Course Module ID was incorrect");
}