3 require_once("../../config.php");
4 require_once("$CFG->libdir/graphlib.php");
5 require_once("lib.php");
7 $id = required_param('id', PARAM_INT
); // Course Module ID
8 $type = required_param('type', PARAM_FILE
); // Graph Type
9 $group = optional_param('group', 0, PARAM_INT
); // Group ID
10 $sid = optional_param('sid', false, PARAM_INT
); // Student ID
11 $qid = optional_param('qid', 0, PARAM_INT
); // Group ID
13 $url = new moodle_url('/mod/survey/graph.php', array('id'=>$id, 'type'=>$type));
15 $url->param('group', $group);
18 $url->param('sid', $sid);
21 $url->param('qid', $qid);
25 if (! $cm = get_coursemodule_from_id('survey', $id)) {
26 print_error('invalidcoursemodule');
29 if (! $course = $DB->get_record("course", array("id"=>$cm->course
))) {
30 print_error('coursemisconf');
34 if (!$user = $DB->get_record("user", array("id"=>$sid))) {
35 print_error('invaliduserid');
39 require_login($course, false, $cm);
41 $groupmode = groups_get_activity_groupmode($cm); // Groups are being used
42 $context = context_module
::instance($cm->id
);
44 if (!has_capability('mod/survey:readresponses', $context)) {
45 if ($type != "student.png" or $sid != $USER->id
) {
46 print_error('nopermissiontoshow');
47 } else if ($groupmode and !groups_is_member($group)) {
48 print_error('nopermissiontoshow');
52 if (! $survey = $DB->get_record("survey", array("id"=>$cm->instance
))) {
53 print_error('invalidsurveyid', 'survey');
56 /// Check to see if groups are being used in this survey
58 $users = get_users_by_capability($context, 'mod/survey:participate', '', '', '', '', $group, null, false);
59 } else if (!empty($cm->groupingid
)) {
60 $groups = groups_get_all_groups($courseid, 0, $cm->groupingid
);
61 $groups = array_keys($groups);
62 $users = get_users_by_capability($context, 'mod/survey:participate', '', '', '', '', $groups, null, false);
64 $users = get_users_by_capability($context, 'mod/survey:participate', '', '', '', '', '', null, false);
68 $stractual = get_string("actual", "survey");
69 $stractualclass = get_string("actualclass", "survey");
71 $strpreferred = get_string("preferred", "survey");
72 $strpreferredclass = get_string("preferredclass", "survey");
74 if ($sid ||
isset($user)) {
75 $stractualstudent = get_string("actualstudent", "survey", fullname($user));
76 $strpreferredstudent = get_string("preferredstudent", "survey", fullname($user));
79 $virtualscales = false; //set default value for case clauses
85 $question = $DB->get_record("survey_questions", array("id"=>$qid));
86 $question->text
= get_string($question->text
, "survey");
87 $question->options
= get_string($question->options
, "survey");
89 $options = explode(",",$question->options
);
91 foreach ($options as $key => $unused) {
96 if ($aaa = $DB->get_records('survey_answers', array('survey'=>$cm->instance
, 'question'=>$qid))) {
97 foreach ($aaa as $aa) {
98 if (!$group or isset($users[$aa->userid
])) {
99 if ($a1 = $aa->answer1
) {
100 $buckets1[$a1 - 1]++
;
102 if ($a2 = $aa->answer2
) {
103 $buckets2[$a2 - 1]++
;
110 $maxbuckets1 = max($buckets1);
111 $maxbuckets2 = max($buckets2);
112 $maxbuckets = ($maxbuckets1 > $maxbuckets2) ?
$maxbuckets1 : $maxbuckets2;
114 $graph = new graph($SURVEY_GWIDTH,$SURVEY_GHEIGHT);
115 $graph->parameter
['title'] = "$question->text";
117 $graph->x_data
= $options;
119 $graph->y_data
['answers1'] = $buckets1;
120 $graph->y_format
['answers1'] = array('colour' => 'ltblue','bar' => 'fill','legend' =>$stractual,'bar_size' => 0.4);
121 $graph->y_data
['answers2'] = $buckets2;
122 $graph->y_format
['answers2'] = array('colour' =>'ltorange','bar' => 'fill','legend' =>$strpreferred,'bar_size' => 0.2);
124 $graph->parameter
['legend'] = 'outside-top';
125 $graph->parameter
['legend_border'] = 'black';
126 $graph->parameter
['legend_offset'] = 4;
128 if (($maxbuckets1 > 0.0) && ($maxbuckets2 > 0.0)) {
129 $graph->y_order
= array('answers1', 'answers2');
130 } else if ($maxbuckets1 > 0.0) {
131 $graph->y_order
= array('answers1');
133 $graph->y_order
= array('answers2');
136 $graph->parameter
['y_axis_gridlines']= $maxbuckets +
1;
137 $graph->parameter
['y_resolution_left']= 1;
138 $graph->parameter
['y_decimal_left'] = 0;
139 $graph->parameter
['x_axis_angle'] = 20;
140 $graph->parameter
['shadow'] = 'none';
142 $graph->y_tick_labels
= null;
143 $graph->offset_relation
= null;
145 $graph->draw_stack();
151 case "multiquestion.png":
153 $question = $DB->get_record("survey_questions", array("id"=>$qid));
154 $question->text
= get_string($question->text
, "survey");
155 $question->options
= get_string($question->options
, "survey");
157 $options = explode(",",$question->options
);
158 $questionorder = explode( ",", $question->multi
);
160 $qqq = $DB->get_records_list("survey_questions", "id", explode(',',$question->multi
));
162 foreach ($questionorder as $i => $val) {
163 $names[$i] = get_string($qqq["$val"]->shorttext
, "survey");
173 $aaa = $DB->get_records_select("survey_answers", "((survey = ?) AND (question in ($question->multi)))", array($cm->instance
));
176 foreach ($aaa as $a) {
177 if (!$group or isset($users[$a->userid
])) {
178 $index = $indexof[$a->question
];
180 $buckets1[$index] +
= $a->answer1
;
184 $buckets2[$index] +
= $a->answer2
;
191 foreach ($questionorder as $i => $val) {
193 $buckets1[$i] = (float)$buckets1[$i] / (float)$count1[$i];
196 $buckets2[$i] = (float)$buckets2[$i] / (float)$count2[$i];
201 foreach ($aaa as $a) {
202 if (!$group or isset($users[$a->userid
])) {
203 $index = $indexof[$a->question
];
205 $difference = (float) ($a->answer1
- $buckets1[$index]);
206 $stdev1[$index] +
= ($difference * $difference);
209 $difference = (float) ($a->answer2
- $buckets2[$index]);
210 $stdev2[$index] +
= ($difference * $difference);
216 foreach ($questionorder as $i => $val) {
218 $stdev1[$i] = sqrt( (float)$stdev1[$i] / ((float)$count1[$i]));
221 $stdev2[$i] = sqrt( (float)$stdev2[$i] / ((float)$count2[$i]));
223 $buckets1[$i] = $buckets1[$i] - 1;
224 $buckets2[$i] = $buckets2[$i] - 1;
229 $maxbuckets1 = max($buckets1);
230 $maxbuckets2 = max($buckets2);
233 $graph = new graph($SURVEY_GWIDTH,$SURVEY_GHEIGHT);
234 $graph->parameter
['title'] = "$question->text";
236 $graph->x_data
= $names;
237 $graph->y_data
['answers1'] = $buckets1;
238 $graph->y_format
['answers1'] = array('colour' => 'ltblue', 'line' => 'line', 'point' => 'square',
239 'shadow_offset' => 4, 'legend' => $stractual);
240 $graph->y_data
['answers2'] = $buckets2;
241 $graph->y_format
['answers2'] = array('colour' => 'ltorange', 'line' => 'line', 'point' => 'square',
242 'shadow_offset' => 4, 'legend' => $strpreferred);
243 $graph->y_data
['stdev1'] = $stdev1;
244 $graph->y_format
['stdev1'] = array('colour' => 'ltltblue', 'bar' => 'fill',
245 'shadow_offset' => '4', 'legend' => 'none', 'bar_size' => 0.3);
246 $graph->y_data
['stdev2'] = $stdev2;
247 $graph->y_format
['stdev2'] = array('colour' => 'ltltorange', 'bar' => 'fill',
248 'shadow_offset' => '4', 'legend' => 'none', 'bar_size' => 0.2);
249 $graph->offset_relation
['stdev1'] = 'answers1';
250 $graph->offset_relation
['stdev2'] = 'answers2';
252 $graph->parameter
['bar_size'] = 0.15;
254 $graph->parameter
['legend'] = 'outside-top';
255 $graph->parameter
['legend_border'] = 'black';
256 $graph->parameter
['legend_offset'] = 4;
258 $graph->y_tick_labels
= $options;
260 if (($maxbuckets1 > 0.0) && ($maxbuckets2 > 0.0)) {
261 $graph->y_order
= array('stdev1', 'answers1', 'stdev2', 'answers2');
262 } else if ($maxbuckets1 > 0.0) {
263 $graph->y_order
= array('stdev1', 'answers1');
265 $graph->y_order
= array('stdev2', 'answers2');
268 $graph->parameter
['y_max_left']= count($options) - 1;
269 $graph->parameter
['y_axis_gridlines']= count($options);
270 $graph->parameter
['y_resolution_left']= 1;
271 $graph->parameter
['y_decimal_left']= 1;
272 $graph->parameter
['x_axis_angle'] = 20;
282 $qqq = $DB->get_records_list("survey_questions", "id", explode(',', $survey->questions
));
285 foreach ($qqq as $key => $qq) {
287 $qqq[$key]->text
= get_string($qq->text
, "survey");
288 $qqq[$key]->options
= get_string($qq->options
, "survey");
290 $virtualscales = true;
294 foreach ($qqq as $qq) { // if any virtual, then use JUST virtual, else use JUST nonvirtual
296 if ($virtualscales && $qq->type
< 0) {
298 } else if (!$virtualscales && $qq->type
> 0) {
303 $numquestions = count($question);
305 $options = explode(",",$question[0]->options
);
306 $numoptions = count($options);
308 for ($i=0; $i<$numquestions; $i++
) {
309 $names[$i] = $question[$i]->text
;
316 $subquestions = $question[$i]->multi
; // otherwise next line doesn't work
317 $aaa = $DB->get_records_select("survey_answers", "((survey = ?) AND (question in ($subquestions)))", array($cm->instance
));
320 foreach ($aaa as $a) {
321 if (!$group or isset($users[$a->userid
])) {
323 $buckets1[$i] +
= $a->answer1
;
327 $buckets2[$i] +
= $a->answer2
;
335 $buckets1[$i] = (float)$buckets1[$i] / (float)$count1[$i];
338 $buckets2[$i] = (float)$buckets2[$i] / (float)$count2[$i];
341 // Calculate the standard devaiations
343 foreach ($aaa as $a) {
344 if (!$group or isset($users[$a->userid
])) {
346 $difference = (float) ($a->answer1
- $buckets1[$i]);
347 $stdev1[$i] +
= ($difference * $difference);
350 $difference = (float) ($a->answer2
- $buckets2[$i]);
351 $stdev2[$i] +
= ($difference * $difference);
358 $stdev1[$i] = sqrt( (float)$stdev1[$i] / ((float)$count1[$i]));
361 $stdev2[$i] = sqrt( (float)$stdev2[$i] / ((float)$count2[$i]));
364 $buckets1[$i] = $buckets1[$i] - 1; // Hack because there should not be ANY 0 values in the data.
365 $buckets2[$i] = $buckets2[$i] - 1;
369 $maxbuckets1 = max($buckets1);
370 $maxbuckets2 = max($buckets2);
373 $graph = new graph($SURVEY_GWIDTH,$SURVEY_GHEIGHT);
374 $graph->parameter
['title'] = strip_tags(format_string($survey->name
,true));
376 $graph->x_data
= $names;
378 $graph->y_data
['answers1'] = $buckets1;
379 $graph->y_format
['answers1'] = array('colour' => 'ltblue', 'line' => 'line', 'point' => 'square',
380 'shadow_offset' => 4, 'legend' => $stractual);
381 $graph->y_data
['answers2'] = $buckets2;
382 $graph->y_format
['answers2'] = array('colour' => 'ltorange', 'line' => 'line', 'point' => 'square',
383 'shadow_offset' => 4, 'legend' => $strpreferred);
385 $graph->y_data
['stdev1'] = $stdev1;
386 $graph->y_format
['stdev1'] = array('colour' => 'ltltblue', 'bar' => 'fill',
387 'shadow_offset' => '4', 'legend' => 'none', 'bar_size' => 0.3);
388 $graph->y_data
['stdev2'] = $stdev2;
389 $graph->y_format
['stdev2'] = array('colour' => 'ltltorange', 'bar' => 'fill',
390 'shadow_offset' => '4', 'legend' => 'none', 'bar_size' => 0.2);
391 $graph->offset_relation
['stdev1'] = 'answers1';
392 $graph->offset_relation
['stdev2'] = 'answers2';
394 $graph->parameter
['legend'] = 'outside-top';
395 $graph->parameter
['legend_border'] = 'black';
396 $graph->parameter
['legend_offset'] = 4;
398 $graph->y_tick_labels
= $options;
400 if (($maxbuckets1 > 0.0) && ($maxbuckets2 > 0.0)) {
401 $graph->y_order
= array('stdev1', 'answers1', 'stdev2', 'answers2');
402 } else if ($maxbuckets1 > 0.0) {
403 $graph->y_order
= array('stdev1', 'answers1');
405 $graph->y_order
= array('stdev2', 'answers2');
408 $graph->parameter
['y_max_left']= $numoptions - 1;
409 $graph->parameter
['y_axis_gridlines']= $numoptions;
410 $graph->parameter
['y_resolution_left']= 1;
411 $graph->parameter
['y_decimal_left']= 1;
412 $graph->parameter
['x_axis_angle'] = 0;
413 $graph->parameter
['x_inner_padding'] = 6;
423 $qqq = $DB->get_records_list("survey_questions", "id", explode(',', $survey->questions
));
425 foreach ($qqq as $key => $qq) {
427 $qqq[$key]->text
= get_string($qq->text
, "survey");
428 $qqq[$key]->options
= get_string($qq->options
, "survey");
430 $virtualscales = true;
434 foreach ($qqq as $qq) { // if any virtual, then use JUST virtual, else use JUST nonvirtual
436 if ($virtualscales && $qq->type
< 0) {
438 } else if (!$virtualscales && $qq->type
> 0) {
443 $numquestions= count($question);
445 $options = explode(",",$question[0]->options
);
446 $numoptions = count($options);
448 for ($i=0; $i<$numquestions; $i++
) {
449 $names[$i] = $question[$i]->text
;
454 $studbuckets1[$i] = 0.0;
455 $studbuckets2[$i] = 0.0;
461 $subquestions = $question[$i]->multi
; // otherwise next line doesn't work
462 $aaa = $DB->get_records_select("survey_answers","((survey = ?) AND (question in ($subquestions)))", array($cm->instance
));
465 foreach ($aaa as $a) {
466 if (!$group or isset($users[$a->userid
])) {
467 if ($a->userid
== $sid) {
469 $studbuckets1[$i] +
= $a->answer1
;
473 $studbuckets2[$i] +
= $a->answer2
;
478 $buckets1[$i] +
= $a->answer1
;
482 $buckets2[$i] +
= $a->answer2
;
490 $buckets1[$i] = (float)$buckets1[$i] / (float)$count1[$i];
493 $buckets2[$i] = (float)$buckets2[$i] / (float)$count2[$i];
495 if ($studcount1[$i]) {
496 $studbuckets1[$i] = (float)$studbuckets1[$i] / (float)$studcount1[$i];
498 if ($studcount2[$i]) {
499 $studbuckets2[$i] = (float)$studbuckets2[$i] / (float)$studcount2[$i];
502 // Calculate the standard devaiations
503 foreach ($aaa as $a) {
504 if (!$group or isset($users[$a->userid
])) {
506 $difference = (float) ($a->answer1
- $buckets1[$i]);
507 $stdev1[$i] +
= ($difference * $difference);
510 $difference = (float) ($a->answer2
- $buckets2[$i]);
511 $stdev2[$i] +
= ($difference * $difference);
517 $stdev1[$i] = sqrt( (float)$stdev1[$i] / ((float)$count1[$i]));
520 $stdev2[$i] = sqrt( (float)$stdev2[$i] / ((float)$count2[$i]));
523 $buckets1[$i] = $buckets1[$i] - 1; // Hack because there should not be ANY 0 values in the data.
524 $buckets2[$i] = $buckets2[$i] - 1;
525 $studbuckets1[$i] = $studbuckets1[$i] - 1;
526 $studbuckets2[$i] = $studbuckets2[$i] - 1;
530 $maxbuckets1 = max($buckets1);
531 $maxbuckets2 = max($buckets2);
534 $graph = new graph($SURVEY_GWIDTH,$SURVEY_GHEIGHT);
535 $graph->parameter
['title'] = strip_tags(format_string($survey->name
,true));
537 $graph->x_data
= $names;
539 $graph->y_data
['answers1'] = $buckets1;
540 $graph->y_format
['answers1'] = array('colour' => 'ltblue', 'line' => 'line', 'point' => 'square',
541 'shadow_offset' => 0.1, 'legend' => $stractualclass);
542 $graph->y_data
['answers2'] = $buckets2;
543 $graph->y_format
['answers2'] = array('colour' => 'ltorange', 'line' => 'line', 'point' => 'square',
544 'shadow_offset' => 0.1, 'legend' => $strpreferredclass);
545 $graph->y_data
['studanswers1'] = $studbuckets1;
546 $graph->y_format
['studanswers1'] = array('colour' => 'blue', 'line' => 'line', 'point' => 'square',
547 'shadow_offset' => 4, 'legend' => $stractualstudent);
548 $graph->y_data
['studanswers2'] = $studbuckets2;
549 $graph->y_format
['studanswers2'] = array('colour' => 'orange', 'line' => 'line', 'point' => 'square',
550 'shadow_offset' => 4, 'legend' => $strpreferredstudent);
551 $graph->y_data
['stdev1'] = $stdev1;
552 $graph->y_format
['stdev1'] = array('colour' => 'ltltblue', 'bar' => 'fill',
553 'shadow_offset' => 0.1, 'legend' => 'none', 'bar_size' => 0.3);
554 $graph->y_data
['stdev2'] = $stdev2;
555 $graph->y_format
['stdev2'] = array('colour' => 'ltltorange', 'bar' => 'fill',
556 'shadow_offset' => 0.1, 'legend' => 'none', 'bar_size' => 0.2);
557 $graph->offset_relation
['stdev1'] = 'answers1';
558 $graph->offset_relation
['stdev2'] = 'answers2';
560 $graph->y_tick_labels
= $options;
562 $graph->parameter
['bar_size'] = 0.15;
564 $graph->parameter
['legend'] = 'outside-top';
565 $graph->parameter
['legend_border'] = 'black';
566 $graph->parameter
['legend_offset'] = 4;
568 if (($maxbuckets1 > 0.0) && ($maxbuckets2 > 0.0)) {
569 $graph->y_order
= array('stdev1', 'stdev2', 'answers1', 'answers2', 'studanswers1', 'studanswers2');
570 } else if ($maxbuckets1 > 0.0) {
571 $graph->y_order
= array('stdev1', 'answers1', 'studanswers1');
573 $graph->y_order
= array('stdev2', 'answers2', 'studanswers2');
576 $graph->parameter
['y_max_left']= $numoptions - 1;
577 $graph->parameter
['y_axis_gridlines']= $numoptions;
578 $graph->parameter
['y_resolution_left']= 1;
579 $graph->parameter
['y_decimal_left']= 1;
580 $graph->parameter
['x_axis_angle'] = 20;
587 case "studentmultiquestion.png":
589 $question = $DB->get_record("survey_questions", array("id"=>$qid));
590 $question->text
= get_string($question->text
, "survey");
591 $question->options
= get_string($question->options
, "survey");
593 $options = explode(",",$question->options
);
594 $questionorder = explode( ",", $question->multi
);
596 $qqq = $DB->get_records_list("survey_questions", "id", explode(',', $question->multi
));
598 foreach ($questionorder as $i => $val) {
599 $names[$i] = get_string($qqq[$val]->shorttext
, "survey");
605 $studbuckets1[$i] = 0.0;
606 $studbuckets2[$i] = 0.0;
613 $aaa = $DB->get_records_select("survey_answers", "((survey = ?) AND (question in ($question->multi)))", array($cm->instance
));
616 foreach ($aaa as $a) {
617 if (!$group or isset($users[$a->userid
])) {
618 $index = $indexof[$a->question
];
619 if ($a->userid
== $sid) {
621 $studbuckets1[$index] +
= $a->answer1
;
622 $studcount1[$index]++
;
625 $studbuckets2[$index] +
= $a->answer2
;
626 $studcount2[$index]++
;
630 $buckets1[$index] +
= $a->answer1
;
634 $buckets2[$index] +
= $a->answer2
;
641 foreach ($questionorder as $i => $val) {
643 $buckets1[$i] = (float)$buckets1[$i] / (float)$count1[$i];
646 $buckets2[$i] = (float)$buckets2[$i] / (float)$count2[$i];
648 if ($studcount1[$i]) {
649 $studbuckets1[$i] = (float)$studbuckets1[$i] / (float)$studcount1[$i];
651 if ($studcount2[$i]) {
652 $studbuckets2[$i] = (float)$studbuckets2[$i] / (float)$studcount2[$i];
656 foreach ($aaa as $a) {
657 if (!$group or isset($users[$a->userid
])) {
658 $index = $indexof[$a->question
];
660 $difference = (float) ($a->answer1
- $buckets1[$index]);
661 $stdev1[$index] +
= ($difference * $difference);
664 $difference = (float) ($a->answer2
- $buckets2[$index]);
665 $stdev2[$index] +
= ($difference * $difference);
670 foreach ($questionorder as $i => $val) {
672 $stdev1[$i] = sqrt( (float)$stdev1[$i] / ((float)$count1[$i]));
675 $stdev2[$i] = sqrt( (float)$stdev2[$i] / ((float)$count2[$i]));
677 $buckets1[$i] = $buckets1[$i] - 1; // Hack because there should not be ANY 0 values in the data.
678 $buckets2[$i] = $buckets2[$i] - 1;
679 $studbuckets1[$i] = $studbuckets1[$i] - 1;
680 $studbuckets2[$i] = $studbuckets2[$i] - 1;
685 $maxbuckets1 = max($buckets1);
686 $maxbuckets2 = max($buckets2);
689 $graph = new graph($SURVEY_GWIDTH,$SURVEY_GHEIGHT);
690 $graph->parameter
['title'] = "$question->text";
692 $graph->x_data
= $names;
693 $graph->y_data
['answers1'] = $buckets1;
694 $graph->y_format
['answers1'] = array('colour' => 'ltblue', 'line' => 'line', 'point' => 'square',
695 'shadow_offset' => 0.1, 'legend' => $stractualclass);
696 $graph->y_data
['answers2'] = $buckets2;
697 $graph->y_format
['answers2'] = array('colour' => 'ltorange', 'line' => 'line', 'point' => 'square',
698 'shadow_offset' => 0.1, 'legend' => $strpreferredclass);
699 $graph->y_data
['studanswers1'] = $studbuckets1;
700 $graph->y_format
['studanswers1'] = array('colour' => 'blue', 'line' => 'line', 'point' => 'square',
701 'shadow_offset' => 4, 'legend' => $stractualstudent);
702 $graph->y_data
['studanswers2'] = $studbuckets2;
703 $graph->y_format
['studanswers2'] = array('colour' => 'orange', 'line' => 'line', 'point' => 'square',
704 'shadow_offset' => 4, 'legend' => $strpreferredstudent);
705 $graph->y_data
['stdev1'] = $stdev1;
706 $graph->y_format
['stdev1'] = array('colour' => 'ltltblue', 'bar' => 'fill',
707 'shadow_offset' => 0.1, 'legend' => 'none', 'bar_size' => 0.3);
708 $graph->y_data
['stdev2'] = $stdev2;
709 $graph->y_format
['stdev2'] = array('colour' => 'ltltorange', 'bar' => 'fill',
710 'shadow_offset' => 0.1, 'legend' => 'none', 'bar_size' => 0.2);
711 $graph->offset_relation
['stdev1'] = 'answers1';
712 $graph->offset_relation
['stdev2'] = 'answers2';
714 $graph->parameter
['bar_size'] = 0.15;
716 $graph->parameter
['legend'] = 'outside-top';
717 $graph->parameter
['legend_border'] = 'black';
718 $graph->parameter
['legend_offset'] = 4;
720 $graph->y_tick_labels
= $options;
722 if (($maxbuckets1 > 0.0) && ($maxbuckets2 > 0.0)) {
723 $graph->y_order
= array('stdev1', 'stdev2', 'answers1', 'answers2', 'studanswers1', 'studanswers2');
724 } else if ($maxbuckets1 > 0.0) {
725 $graph->y_order
= array('stdev1', 'answers1', 'studanswers1');
727 $graph->y_order
= array('stdev2', 'answers2', 'studanswers2');
730 $graph->parameter
['y_max_left']= count($options)-1;
731 $graph->parameter
['y_axis_gridlines']= count($options);
732 $graph->parameter
['y_resolution_left']= 1;
733 $graph->parameter
['y_decimal_left']= 1;
734 $graph->parameter
['x_axis_angle'] = 20;