|
Moodle
2.2.1
http://www.collinsharper.com
|
Go to the source code of this file.
Namespaces | |
| namespace | quiz |
Functions | |
| graph_get_new_colour () | |
Variables | |
| $quizstatisticsid = required_param('id', PARAM_INT) | |
| $quizstatistics = $DB->get_record('quiz_statistics', array('id' => $quizstatisticsid)) | |
| $quiz = $DB->get_record('quiz', array('id' => $quizstatistics->quizid), '*', MUST_EXIST) | |
| $cm = get_coursemodule_from_instance('quiz', $quiz->id) | |
| $modcontext = get_context_instance(CONTEXT_MODULE, $cm->id) | |
| $questionstatistics | |
| $graph = new graph(800, 600) | |
| $graph | parameter ['title'] = '' |
| $graph | parameter ['y_label_left'] = '%' |
| $graph | parameter ['x_label'] = get_string('position', 'quiz_statistics') |
| $graph | parameter ['y_label_angle'] = 90 |
| $graph | parameter ['x_label_angle'] = 0 |
| $graph | parameter ['x_axis_angle'] = 60 |
| $graph | parameter ['legend'] = 'outside-right' |
| $graph | parameter ['legend_border'] = 'black' |
| $graph | parameter ['legend_offset'] = 4 |
| $graph | parameter ['bar_size'] = 1 |
| $graph | parameter ['zero_axis'] = 'grayEE' |
| $fieldstoplot | |
| $fieldstoplotfactor = array('facility' => 100, 'discriminativeefficiency' => 1) | |
| $xdata = array() | |
| $graph | x_data = array_values($xdata) |
| foreach($fieldstoplot as $fieldtoplot=> $notused) $graph | y_order = array_keys($fieldstoplot) |
| $max = 0 | |
| $min = 0 | |
| foreach($fieldstoplot as $fieldtoplot=> $notused) | $gridresolution = 10 |
| $gridlines = ceil(($max - $min) / $gridresolution) + 1 | |
| $graph | parameter ['y_axis_gridlines'] = $gridlines |
| $graph | parameter ['y_min_left'] = $min |
| $graph | parameter ['y_max_left'] = $max |
| $graph | parameter ['y_decimal_left'] = 0 |
This helper function returns a sequence of colours each time it is called. Used for chooseing colours for graph data series.
Definition at line 44 of file statistics_graph.php.
| $cm = get_coursemodule_from_instance('quiz', $quiz->id) |
Definition at line 61 of file statistics_graph.php.
| $fieldstoplot |
array( 'facility' => get_string('facility', 'quiz_statistics'), 'discriminativeefficiency' => get_string('discriminative_efficiency', 'quiz_statistics') )
Definition at line 101 of file statistics_graph.php.
| $fieldstoplotfactor = array('facility' => 100, 'discriminativeefficiency' => 1) |
Definition at line 105 of file statistics_graph.php.
Definition at line 83 of file statistics_graph.php.
Definition at line 157 of file statistics_graph.php.
| foreach ($fieldstoplot as $fieldtoplot=> $notused) $gridresolution = 10 |
Definition at line 154 of file statistics_graph.php.
| $max = 0 |
Definition at line 146 of file statistics_graph.php.
| $min = 0 |
Definition at line 147 of file statistics_graph.php.
| $modcontext = get_context_instance(CONTEXT_MODULE, $cm->id) |
Definition at line 65 of file statistics_graph.php.
| $questionstatistics |
$DB->get_records_select('quiz_question_statistics', 'quizstatisticsid = ? AND slot IS NOT NULL', array($quizstatistics->id))
Definition at line 79 of file statistics_graph.php.
| $quiz = $DB->get_record('quiz', array('id' => $quizstatistics->quizid), '*', MUST_EXIST) |
Definition at line 60 of file statistics_graph.php.
| $quizstatistics = $DB->get_record('quiz_statistics', array('id' => $quizstatisticsid)) |
Definition at line 59 of file statistics_graph.php.
| $quizstatisticsid = required_param('id', PARAM_INT) |
Definition at line 56 of file statistics_graph.php.
| $xdata = array() |
Definition at line 108 of file statistics_graph.php.
Definition at line 84 of file statistics_graph.php.
Definition at line 86 of file statistics_graph.php.
| $graph parameter['x_label'] = get_string('position', 'quiz_statistics') |
Definition at line 87 of file statistics_graph.php.
Definition at line 88 of file statistics_graph.php.
Definition at line 89 of file statistics_graph.php.
Definition at line 90 of file statistics_graph.php.
Definition at line 92 of file statistics_graph.php.
Definition at line 93 of file statistics_graph.php.
Definition at line 94 of file statistics_graph.php.
Definition at line 96 of file statistics_graph.php.
Definition at line 98 of file statistics_graph.php.
Definition at line 159 of file statistics_graph.php.
Definition at line 161 of file statistics_graph.php.
Definition at line 162 of file statistics_graph.php.
Definition at line 163 of file statistics_graph.php.
Definition at line 137 of file statistics_graph.php.
Definition at line 143 of file statistics_graph.php.