\n". "EVTI - Drag'n'drop authoring tool\n". "\n". "\n". "
\n". "

Drag'n'drop authoring tool

\n". " \n". " \n". " \n". " \n". " \n"; if ($name != "") echo " \n". " \n". " \n". " \n". " \n". " \n". " \n"; echo "
HomeCreateOpenList|ImageParametersWordsFeedbackSoundsTest
\n". "
\n\n". "
\n"; } function print_f() { echo "
". "
". " Please send comments or suggestions to tp@fonz.de.
". " Last modified: 2004.05.22". "
". ""; } #function ex_connect() { # return mysql_connect("evti", "evti", "evtionly"); # #return odbc_connect("evti", "", ""); #} #function ex_get($db, $name) { # $stmt = odbc_prepare($db, "SELECT serialized FROM ex WHERE name = ?"); # if (odbc_execute($stmt, array($name)) && odbc_fetch_into($stmt, &$stmtdata)) { # return unserialize($stmtdata[0]); # } # else { # echo "Database error: Could not read exercise $name.\n"; # return FALSE; # } #} #function ex_update($db, $name, $ex) { # $stmt = odbc_prepare($db, "UPDATE ex SET serialized = ? WHERE name = ?"); # if (odbc_execute($stmt, array(serialize($ex), $name))) { # return TRUE; # } # else { # echo "Database error: Could not update exercise $name.\n"; # return FALSE; # } #} #function res_set($resname, $fname) { # copy($fname, $resname); #} $DBROOT = "/home/tp/www/evti/src/db"; function res_set($resname, $fname) { global $DBROOT; # echo "res_set($resname, $fname)
"; #$file = "/tmp/evti/res/$resname"; $file = "$DBROOT/res/$resname"; copy($fname, $file); } function ex_filename($name) { global $DBROOT; #return "/tmp/evti/ex/$name"; return "$DBROOT/ex/$name"; } function ex_list() { global $DBROOT; $list = array(); #echo "ex_list dir: $DBROOT/ex
"; if ($dir = @opendir("$DBROOT/ex")) { while (($file = readdir($dir)) !== false) { if ($file[0] != "." && $file != "CVS") { array_push($list, $file); } } closedir($dir); } return $list; } function ex_get($name) { $file = ex_filename($name); if (!file_exists($file)) return null; $ex = unserialize(file_get_contents($file)); return $ex; } function ex_create($name, $ex) { $file = ex_filename($name); if (file_exists($file)) return FALSE; $f = fopen($file, "w"); fwrite($f, serialize($ex)); fclose($f); return TRUE; } function ex_update($name, $ex) { #echo "ex_update($name)
"; $file = ex_filename($name); if (!file_exists($file)) return FALSE; $f = fopen($file, "w"); fwrite($f, serialize($ex)); fclose($f); return TRUE; } ?>