diff --git a/lang/en/vpl.php b/lang/en/vpl.php index a23c695fddbd86fcaa514fe50634f70198882ebc..9a93fdd42d7077fb7f695f70e4d321bcd175e231 100644 --- a/lang/en/vpl.php +++ b/lang/en/vpl.php @@ -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>'; $string ['find'] = "Find"; $string ['find_replace'] = 'Find/Replace'; +$string ['forceload'] = 'Force load'; $string ['freeevaluations'] = 'Free evaluations'; $string ['freeevaluations_help'] = 'Number of automatic evaluations that do not reduce final score'; $string ['fulldescription'] = 'Full description'; diff --git a/views/vpl_grapher.class.php b/views/vpl_grapher.class.php index d5a5c35660ff21bcd72cab31b6e3b637d22dff0a..6429780e2f4504dfe62586c1ee44bdebdf951bda 100644 --- a/views/vpl_grapher.class.php +++ b/views/vpl_grapher.class.php @@ -151,6 +151,11 @@ class vpl_grapher { $totalseries = array(); if ($diff) { $reqfiles = $this->vpl->get_fgm('required')->getAllFiles(); + if (optional_param('forcegraphload', false, PARAM_INT)) { + $timelimit = 0; + } else { + $timelimit = 500; + } } foreach ($submissionslist as $subinstance) { $submission = new mod_vpl_submission( $this->vpl, $subinstance ); @@ -162,7 +167,7 @@ class vpl_grapher { $series[$name] = array_fill(0, $i - 1, null); } if ($diff && isset($reqfiles[$name])) { - $value = vpl_diff::compute_filediff($reqfiles[$name], $data, 500); + $value = vpl_diff::compute_filediff($reqfiles[$name], $data, $timelimit); } else { $value = strlen( $data ); } @@ -184,9 +189,11 @@ class vpl_grapher { } self::draw( $title, get_string( 'submissions', VPL ) , get_string( "sizeb" ), $subsn, $series, $names ); } catch (Exception $e) { + global $PAGE; echo '<span class="chart-area nograph">'; 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>'; } }