mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-79215 lib/graphlib: Fix unrelated coding style in graphlib_test.php
This commit is contained in:
parent
10705ab716
commit
07b2224e9a
@ -543,6 +543,7 @@ class graph {
|
||||
);
|
||||
ImageLine($this->image, $this->calculated['boundary_box']['left'], $this->calculated['zero_axis'], $this->calculated['boundary_box']['right'], $this->calculated['zero_axis'], $this->colour[$colour]);
|
||||
}
|
||||
|
||||
function draw_zero_axis_right() {
|
||||
$colour = $this->parameter['zero_axis'];
|
||||
if ($colour == 'none') return;
|
||||
|
@ -43,14 +43,29 @@ class graphlib_test extends \basic_testcase {
|
||||
'mock' => [
|
||||
'survey_name' => 'Survey 101',
|
||||
'names' => [
|
||||
'Relevance', 'Reflective thinking', 'Interactivity', 'Tutor support', 'Peer support', 'Interpretation'
|
||||
'Relevance',
|
||||
'Reflective thinking',
|
||||
'Interactivity',
|
||||
'Tutor support',
|
||||
'Peer support',
|
||||
'Interpretation',
|
||||
],
|
||||
'buckets1' => [
|
||||
0.75, 2.5, 1.5, 1.5, 2.5, 2.5
|
||||
0.75,
|
||||
2.5,
|
||||
1.5,
|
||||
1.5,
|
||||
2.5,
|
||||
2.5,
|
||||
],
|
||||
'stractual' => 'Actual',
|
||||
'buckets2' => [
|
||||
-1, -1, -1, -1, -1, -1
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
],
|
||||
'strpreferred' => 'Preferred',
|
||||
'strimagine' => 'Imagine',
|
||||
@ -63,10 +78,20 @@ class graphlib_test extends \basic_testcase {
|
||||
3,
|
||||
],
|
||||
'stdev1' => [
|
||||
0.82915619758885, 1.1180339887499, 1.1180339887499, 1.1180339887499, 1.1180339887499, 1.1180339887499
|
||||
0.82915619758885,
|
||||
1.1180339887499,
|
||||
1.1180339887499,
|
||||
1.1180339887499,
|
||||
1.1180339887499,
|
||||
1.1180339887499,
|
||||
],
|
||||
'stdev2' => [
|
||||
0, 0, 0, 0, 0, 0
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
],
|
||||
'stdev3' => [
|
||||
0.92915619758885,
|
||||
@ -77,7 +102,11 @@ class graphlib_test extends \basic_testcase {
|
||||
2.1180339887499,
|
||||
],
|
||||
'options' => [
|
||||
'Almost never', 'Seldom', 'Sometimes', 'Often', 'Almost always'
|
||||
'Almost never',
|
||||
'Seldom',
|
||||
'Sometimes',
|
||||
'Often',
|
||||
'Almost always',
|
||||
],
|
||||
'maxbuckets1' => 2.5,
|
||||
'maxbuckets2' => -1,
|
||||
@ -102,11 +131,21 @@ class graphlib_test extends \basic_testcase {
|
||||
$graph->parameter['zero_axis'] = 'black';
|
||||
$graph->x_data = $mock['names'];
|
||||
$graph->y_data['answers1'] = $mock['buckets1'];
|
||||
$graph->y_format['answers1'] = array('colour' => 'ltblue', 'line' => 'line', 'point' => 'square',
|
||||
'shadow_offset' => 4, 'legend' => $mock['stractual']);
|
||||
$graph->y_format['answers1'] = [
|
||||
'colour' => 'ltblue',
|
||||
'line' => 'line',
|
||||
'point' => 'square',
|
||||
'shadow_offset' => 4,
|
||||
'legend' => $mock['stractual'],
|
||||
];
|
||||
$graph->y_data['answers2'] = $mock['buckets2'];
|
||||
$graph->y_format['answers2'] = array('colour' => 'ltorange', 'line' => 'line', 'point' => 'square',
|
||||
'shadow_offset' => 4, 'legend' => $mock['strpreferred']);
|
||||
$graph->y_format['answers2'] = [
|
||||
'colour' => 'ltorange',
|
||||
'line' => 'line',
|
||||
'point' => 'square',
|
||||
'shadow_offset' => 4,
|
||||
'legend' => $mock['strpreferred'],
|
||||
];
|
||||
$graph->y_data['answers3'] = $mock['buckets3'];
|
||||
$graph->y_format['answers3'] = [
|
||||
'colour' => 'ltred',
|
||||
@ -116,11 +155,21 @@ class graphlib_test extends \basic_testcase {
|
||||
'legend' => $mock['stractual'],
|
||||
];
|
||||
$graph->y_data['stdev1'] = $mock['stdev1'];
|
||||
$graph->y_format['stdev1'] = array('colour' => 'ltltblue', 'bar' => 'fill',
|
||||
'shadow_offset' => '4', 'legend' => 'none', 'bar_size' => 0.3);
|
||||
$graph->y_format['stdev1'] = [
|
||||
'colour' => 'ltltblue',
|
||||
'bar' => 'fill',
|
||||
'shadow_offset' => '4',
|
||||
'legend' => 'none',
|
||||
'bar_size' => 0.3,
|
||||
];
|
||||
$graph->y_data['stdev2'] = $mock['stdev2'];
|
||||
$graph->y_format['stdev2'] = array('colour' => 'ltltorange', 'bar' => 'fill',
|
||||
'shadow_offset' => '4', 'legend' => 'none', 'bar_size' => 0.2);
|
||||
$graph->y_format['stdev2'] = [
|
||||
'colour' => 'ltltorange',
|
||||
'bar' => 'fill',
|
||||
'shadow_offset' => '4',
|
||||
'legend' => 'none',
|
||||
'bar_size' => 0.2,
|
||||
];
|
||||
$graph->y_data['stdev3'] = $mock['stdev3'];
|
||||
$graph->y_format['stdev3'] = [
|
||||
'colour' => 'ltred',
|
||||
@ -146,9 +195,15 @@ class graphlib_test extends \basic_testcase {
|
||||
'answers3',
|
||||
];
|
||||
} else if ($mock['maxbuckets1'] > 0.0) {
|
||||
$graph->y_order = array('stdev1', 'answers1');
|
||||
$graph->y_order = [
|
||||
'stdev1',
|
||||
'answers1',
|
||||
];
|
||||
} else if ($mock['maxbuckets2'] > 0.0) {
|
||||
$graph->y_order = array('stdev2', 'answers2');
|
||||
$graph->y_order = [
|
||||
'stdev2',
|
||||
'answers2',
|
||||
];
|
||||
} else {
|
||||
$graph->y_order = [
|
||||
'stdev3',
|
||||
|
Loading…
x
Reference in New Issue
Block a user