$results[] = $file; } } // tidy up: close the handler closedir($handler); // Check if should include hidden files, $h parameter if ($h == false) { $results = array_filter($results, create_function('$a', 'return ($a[0]!=".");')); } // done! return $results; } function xmlOut($con, $tag) { return "<" . $tag . ">" . $con . "</" . $tag . ">"; } function cdat($dat) { return "<![CDATA[" . $dat . "]]>"; } //---------- MAIN ------------- loadProb(); runProb(); echo '<?xml version="1.0" encoding="UTF-8"?>'; echo "<result>"; echo xmlOut("compiler", "TYPE"); echo xmlOut(cdat($code), "CODE"); echo xmlOut(cdat($input), "INPUT"); echo xmlOut(cdat($uOutput), "uOutput"); //echo xmlOut($LOG,"LOG"); echo "</result>";
echo '</select>'; } function isSelected($sOption, $option) { if ($sOption == $option) { echo 'selected="selected"'; } else { echo ""; } } function xmlOut($con, $tag) { return "<" . $tag . ">" . $con . "</" . $tag . ">"; } function cdat($dat) { return "<![CDATA[" . $dat . "]]>"; } // ---------- MAIN -------- // $allProblems = getDirectoryList("/var/www/HYPC/ProblemZone/Problems/",false); echo '<?xml version="1.0" encoding="UTF-8"?>'; echo "<result>"; echo xmlOut("loader", "TYPE"); /* echo "<pSelect><![CDATA["; echo optionsFromArray($allProblems)); // Problems to select echo "]]></pSelect>"; */ echo xmlOut(cdat("test"), "probInfo"); // Problem info echo "</result>";
return 'selected="selected"'; } else { return ""; } } function xmlOut($con, $tag) { return "<" . $tag . ">" . $con . "</" . $tag . ">"; } function cdat($dat) { return "<![CDATA[" . $dat . "]]>"; } // ---------- MAIN -------- $allProblems = getDirectoryList("{$topDir}/HYPC/ProblemZone/Problems/", false); loadProb(); loadCode(); echo '<?xml version="1.0" encoding="UTF-8"?>'; echo "<result>"; echo xmlOut("loader", "TYPE"); echo xmlOut($pname, "pname"); echo "<pSelect><![CDATA["; echo optionsFromArray($allProblems, $pname); // Problems to select // echo "Test"; echo "]]></pSelect>"; echo xmlOut(cdat($probInfo), "probInfo"); // Problem info echo xmlOut(cdat($code), "code"); // Problem code echo "</result>";