Skip to content
Snippets Groups Projects
Commit efda107e authored by Astor Bizard's avatar Astor Bizard :dog2:
Browse files

Fixed graph total diff display conditions.

parent a104e476
No related branches found
No related tags found
No related merge requests found
...@@ -184,9 +184,6 @@ class vpl_grapher { ...@@ -184,9 +184,6 @@ class vpl_grapher {
$i++; $i++;
} }
if ($diff && count($names) > 1) { if ($diff && count($names) > 1) {
$names[] = get_string('total');
$series[get_string('total')] = $totalseries;
// Filter out all zero-diff files. // Filter out all zero-diff files.
$names = array_filter($names, function($name) use(&$series){ $names = array_filter($names, function($name) use(&$series){
foreach ($series[$name] as $value){ foreach ($series[$name] as $value){
...@@ -198,6 +195,12 @@ class vpl_grapher { ...@@ -198,6 +195,12 @@ class vpl_grapher {
unset($series[$name]); unset($series[$name]);
return false; return false;
}); });
if (count($names) != 1) {
// Add Total series.
$names[] = get_string('total');
$series[get_string('total')] = $totalseries;
}
} }
self::draw( $title, get_string( 'submissions', VPL ) , get_string( "sizeb" ), $subsn, $series, $names ); self::draw( $title, get_string( 'submissions', VPL ) , get_string( "sizeb" ), $subsn, $series, $names );
} catch (moodle_exception $e) { } catch (moodle_exception $e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment