Hi Matthew,
On Tue, December 15, 2015 16:36, Matthew Fahrenbacher wrote:
For anyone who is interested, here is the code I added to submission_details.php to get this to work:
//start attempt of determining any runtime errors
$test = $DB->q('MAYBETUPLE SELECT judgingid, output_error, runresult FROM judging_run WHERE judgingid = %i AND runresult = "run-error"',$row['judgingid']);
if($test) { echo "Runtime Error: "; foreach($test as $key => $value) { if($key == "output_error") { echo "$value<br>"; } } }
Strictly speaking you should add htmlspecialchars() (or specialchars() in DOMjudge 5.1 and up) around the $value you output, otherwise any < will mess up the display and there's a potential for XSS (not highly critical I guess, since the team can only see its own output).
I'm not sure if we'd add this to DOMjudge proper, since such functionality makes it trivial to know what the testdata is (just cat it all to STDERR from your program and then terminate with a non-zero exit code). But for situations where the testdata is not secret, this could definitely work.
Cheers, Thijs