<commit_before><?php  // $Id$
include '../../../../config.php';
include $CFG->dirroot."/lib/graphlib.php";
include $CFG->dirroot."/mod/quiz/locallib.php";
include $CFG->dirroot."/mod/quiz/report/reportlib.php";
function graph_get_new_colour(){
    static $colourindex = 0;
    $colours = array('red', 'green', 'yellow', 'orange', 'purple', 'black', 'maroon', 'blue', 'ltgreen', 'navy', 'ltred', 'ltltgreen', 'ltltorange', 'olive', 'gray', 'ltltred', 'ltorange', 'lime', 'ltblue', 'ltltblue');
    $colour = $colours[$colourindex];
    $colourindex++;
    if ($colourindex > (count($colours)-1)){
        $colourindex =0;
    }
    return $colour;
}
$quizstatisticsid = required_param('id', PARAM_INT);

$quizstatistics = $DB->get_record('quiz_statistics', array('id' => $quizstatisticsid));
$questionstatistics = $DB->get_records('quiz_question_statistics', array('quizstatisticsid' => $quizstatistics->id, 'subquestion' => 0));
$quiz = $DB->get_record('quiz', array('id' => $quizstatistics->quizid));
require_login($quiz->course);
$questions = quiz_report_load_questions($quiz);
$cm = get_coursemodule_from_instance('quiz', $quiz->id);
if ($groupmode = groups_get_activity_groupmode($cm)) {   // Groups are being used
    $groups = groups_get_activity_allowed_groups($cm);
} else {
    $groups = false;
}
if ($quizstatistics->groupid){
    if (!in_array($quizstatistics->groupid, array_keys($groups))){
        print_error('groupnotamember', 'group');
    }
}
$modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
require_capability('mod/quiz:viewreports', $modcontext);

$line = new graph(800,600);
$line->parameter['title']   = '';
$line->parameter['y_label_left'] = '%';
$line->parameter['x_label'] = get_string('position', 'quiz_statistics');
$line->parameter['y_label_angle'] = 90;
$line->parameter['x_label_angle'] = 0;
$line->parameter['x_axis_angle'] = 60;

$line->parameter['legend']        = 'outside-top';<commit_msg>MDL-16501 "moving key to colours on graph to the bottom of the graph gives more horizontal screen space for the graph itself"<commit_after><?php  // $Id$
include '../../../../config.php';
include $CFG->dirroot."/lib/graphlib.php";
include $CFG->dirroot."/mod/quiz/locallib.php";
include $CFG->dirroot."/mod/quiz/report/reportlib.php";
function graph_get_new_colour(){
    static $colourindex = 0;
    $colours = array('red', 'green', 'yellow', 'orange', 'purple', 'black', 'maroon', 'blue', 'ltgreen', 'navy', 'ltred', 'ltltgreen', 'ltltorange', 'olive', 'gray', 'ltltred', 'ltorange', 'lime', 'ltblue', 'ltltblue');
    $colour = $colours[$colourindex];
    $colourindex++;
    if ($colourindex > (count($colours)-1)){
        $colourindex =0;
    }
    return $colour;
}
$quizstatisticsid = required_param('id', PARAM_INT);

$quizstatistics = $DB->get_record('quiz_statistics', array('id' => $quizstatisticsid));
$questionstatistics = $DB->get_records('quiz_question_statistics', array('quizstatisticsid' => $quizstatistics->id, 'subquestion' => 0));
$quiz = $DB->get_record('quiz', array('id' => $quizstatistics->quizid));
require_login($quiz->course);
$questions = quiz_report_load_questions($quiz);
$cm = get_coursemodule_from_instance('quiz', $quiz->id);
if ($groupmode = groups_get_activity_groupmode($cm)) {   // Groups are being used
    $groups = groups_get_activity_allowed_groups($cm);
} else {
    $groups = false;
}
if ($quizstatistics->groupid){
    if (!in_array($quizstatistics->groupid, array_keys($groups))){
        print_error('groupnotamember', 'group');
    }
}
$modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
require_capability('mod/quiz:viewreports', $modcontext);

$line = new graph(800,600);
$line->parameter['title']   = '';
$line->parameter['y_label_left'] = '%';
$line->parameter['x_label'] = get_string('position', 'quiz_statistics');
$line->parameter['y_label_angle'] = 90;
$line->parameter['x_label_angle'] = 0;
$line->parameter['x_axis_angle'] = 60;

$line->parameter['legend']        = 'outside-right';
{'fraction_non_alphanumeric': 0.20346211741093828, 'fraction_numerical': 0.008780732563973909, 'mean_word_length': 5.9339130434782605, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2972131', 'n_tokens_mistral': 1444, 'n_tokens_neox': 1385, 'n_words': 238}