Exemplo n.º 1
0
            $timestamp += (double) $jrun['runtime'];
        }
        XMLaddnode($run, 'judged', 'True');
        XMLaddnode($run, 'status', 'done');
        XMLaddnode($run, 'result', $result_map[$jdata['result']]);
        if ($jdata['result'] == 'correct') {
            XMLaddnode($run, 'solved', 'True');
            XMLaddnode($run, 'penalty', 'False');
        } else {
            XMLaddnode($run, 'solved', 'False');
            if ($compile_penalty == 0 && $jdata['result'] == 'compiler-error') {
                XMLaddnode($run, 'penalty', 'False');
            } else {
                XMLaddnode($run, 'penalty', 'True');
            }
        }
    }
}
// We don't support a finalize attribute in DOMjudge master branch, so
// just output some fake data if the contest has finished.
if (difftime(now(), $cdata['endtime']) >= 0) {
    $node = XMLaddnode($root, 'finalized');
    XMLaddnode($node, 'timestamp', $cdata['endtime']);
    XMLaddnode($node, 'last-gold', 0);
    XMLaddnode($node, 'last-silver', 0);
    XMLaddnode($node, 'last-bronze', 0);
    XMLaddnode($node, 'comment', 'Automatically finalized by DOMjudge');
}
header('Content-Type: text/xml; charset=' . DJ_CHARACTER_SET);
$xmldoc->formatOutput = true;
echo $xmldoc->saveXML();
Exemplo n.º 2
0
            XMLaddnode($testcase, 'time', $jrun['runtime']);
            XMLaddnode($testcase, 'timestamp', $timestamp);
            $timestamp += (double) $jrun['runtime'];
        }
        XMLaddnode($run, 'judged', 'True');
        XMLaddnode($run, 'status', 'done');
        XMLaddnode($run, 'result', $result_map[$jdata['result']]);
        if ($jdata['result'] == 'correct') {
            XMLaddnode($run, 'solved', 'True');
            XMLaddnode($run, 'penalty', 'False');
        } else {
            XMLaddnode($run, 'solved', 'False');
            if ($compile_penalty == 0 && $jdata['result'] == 'compiler-error') {
                XMLaddnode($run, 'penalty', 'False');
            } else {
                XMLaddnode($run, 'penalty', 'True');
            }
        }
    }
}
if (isset($cdata['finalizetime'])) {
    $node = XMLaddnode($root, 'finalized');
    XMLaddnode($node, 'timestamp', $cdata['finalizetime']);
    XMLaddnode($node, 'last-gold', 4);
    XMLaddnode($node, 'last-silver', 8);
    XMLaddnode($node, 'last-bronze', 12 + $cdata['b']);
    XMLaddnode($node, 'comment', $cdata['finalizecomment']);
}
header('Content-Type: text/xml; charset=' . DJ_CHARACTER_SET);
$xmldoc->formatOutput = true;
echo $xmldoc->saveXML();