function game_OnExportHTML($game, $context, $html)
{
    global $CFG;
    /*
            if( $game->gamekind == 'cross'){
                $destdir = "{$CFG->dataroot}/{$game->course}/export";
                if( !file_exists( $destdir)){
                    mkdir( $destdir);
                }
                game_OnExportHTML_cross( $game, $context, $html, $destdir);
                return;
            }
    */
    $destdir = game_export_createtempdir();
    switch ($game->gamekind) {
        case 'cross':
            game_OnExportHTML_cross($game, $context, $html, $destdir);
            break;
        case 'hangman':
            game_OnExportHTML_hangman($game, $context, $html, $destdir);
            break;
        case 'snakes':
            game_OnExportHTML_snakes($game, $html, $destdir);
            break;
        case 'millionaire':
            game_OnExportHTML_millionaire($game, $context, $html, $destdir);
            break;
    }
    remove_dir($destdir);
}
function game_OnExportHTML($gameid, $html, $update)
{
    global $CFG;
    $game = get_record_select('game', "id={$gameid}");
    if ($game->gamekind == 'cross') {
        $destdir = "{$CFG->dataroot}/{$game->course}/export";
        if (!file_exists($destdir)) {
            mkdir($destdir);
        }
        game_OnExportHTML_cross($game, $html, $update, $destdir);
        return;
    }
    $destdir = game_export_createtempdir();
    switch ($game->gamekind) {
        case 'hangman':
            game_OnExportHTML_hangman($game, $html, $update);
            break;
        case 'millionaire':
            game_OnExportHTML_millionaire($game, $html, $update, $destdir);
            break;
    }
    if ($destdir != '') {
        remove_dir($destdir);
    }
}
Beispiel #3
0
function game_OnExportHTML($game, $context, $html)
{
    global $CFG;
    $destdir = game_export_createtempdir();
    switch ($game->gamekind) {
        case 'cross':
            game_OnExportHTML_cross($game, $context, $html, $destdir);
            break;
        case 'hangman':
            game_OnExportHTML_hangman($game, $context, $html, $destdir);
            break;
        case 'snakes':
            game_OnExportHTML_snakes($game, $html, $destdir, $context);
            break;
        case 'millionaire':
            game_OnExportHTML_millionaire($game, $context, $html, $destdir);
            break;
    }
    remove_dir($destdir);
}