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

Added force graph load option on previous submissions list.

parent 1746d2aa
No related branches found
No related tags found
No related merge requests found
...@@ -112,6 +112,7 @@ $string ['finalreduction_help'] = '<b>FR [NE/FE R]</b><br> ...@@ -112,6 +112,7 @@ $string ['finalreduction_help'] = '<b>FR [NE/FE R]</b><br>
<b>R</b> Grade reduction by evaluation. If it is a percent, it is apply over previous result.<br>'; <b>R</b> Grade reduction by evaluation. If it is a percent, it is apply over previous result.<br>';
$string ['find'] = "Find"; $string ['find'] = "Find";
$string ['find_replace'] = 'Find/Replace'; $string ['find_replace'] = 'Find/Replace';
$string ['forceload'] = 'Force load';
$string ['freeevaluations'] = 'Free evaluations'; $string ['freeevaluations'] = 'Free evaluations';
$string ['freeevaluations_help'] = 'Number of automatic evaluations that do not reduce final score'; $string ['freeevaluations_help'] = 'Number of automatic evaluations that do not reduce final score';
$string ['fulldescription'] = 'Full description'; $string ['fulldescription'] = 'Full description';
......
...@@ -151,6 +151,11 @@ class vpl_grapher { ...@@ -151,6 +151,11 @@ class vpl_grapher {
$totalseries = array(); $totalseries = array();
if ($diff) { if ($diff) {
$reqfiles = $this->vpl->get_fgm('required')->getAllFiles(); $reqfiles = $this->vpl->get_fgm('required')->getAllFiles();
if (optional_param('forcegraphload', false, PARAM_INT)) {
$timelimit = 0;
} else {
$timelimit = 500;
}
} }
foreach ($submissionslist as $subinstance) { foreach ($submissionslist as $subinstance) {
$submission = new mod_vpl_submission( $this->vpl, $subinstance ); $submission = new mod_vpl_submission( $this->vpl, $subinstance );
...@@ -162,7 +167,7 @@ class vpl_grapher { ...@@ -162,7 +167,7 @@ class vpl_grapher {
$series[$name] = array_fill(0, $i - 1, null); $series[$name] = array_fill(0, $i - 1, null);
} }
if ($diff && isset($reqfiles[$name])) { if ($diff && isset($reqfiles[$name])) {
$value = vpl_diff::compute_filediff($reqfiles[$name], $data, 500); $value = vpl_diff::compute_filediff($reqfiles[$name], $data, $timelimit);
} else { } else {
$value = strlen( $data ); $value = strlen( $data );
} }
...@@ -184,9 +189,11 @@ class vpl_grapher { ...@@ -184,9 +189,11 @@ class vpl_grapher {
} }
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 (Exception $e) { } catch (Exception $e) {
global $PAGE;
echo '<span class="chart-area nograph">'; echo '<span class="chart-area nograph">';
echo '<b>' . $title . '</b><br>'; echo '<b>' . $title . '</b><br>';
echo get_string('graphcomputationfailed', VPL); echo get_string('graphcomputationfailed', VPL) . '<br>';
echo '<a href="'. $PAGE->url->out(true, array('forcegraphload' => 1)) .'">' . get_string('forceload', VPL) . '</a>';
echo '</span>'; echo '</span>';
} }
} }
......
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