function game_bookquiz_continue($id, $game, $attempt, $bookquiz, $chapterid = 0)
{
    if ($attempt != false and $bookquiz != false) {
        return game_bookquiz_play($id, $game, $attempt, $bookquiz, $chapterid);
    }
    if ($attempt == false) {
        $attempt = game_addattempt($game);
    }
    unset($bookquiz);
    $bookquiz->lastchapterid = 0;
    $bookquiz->id = $attempt->id;
    if (!game_insert_record('game_bookquiz', $bookquiz)) {
        error('game_bookquiz_continue: error inserting in game_bookquiz');
    }
    return game_bookquiz_play($id, $game, $attempt, $bookquiz, 0);
}
Beispiel #2
0
function game_bookquiz_continue($id, $game, $attempt, $bookquiz, $chapterid, $context)
{
    if ($attempt != false and $bookquiz != false) {
        return game_bookquiz_play($id, $game, $attempt, $bookquiz, $chapterid, $context);
    }
    if ($attempt == false) {
        $attempt = game_addattempt($game);
    }
    $bookquiz = new stdClass();
    $bookquiz->lastchapterid = 0;
    $bookquiz->id = $attempt->id;
    $bookquiz->bookid = $game->bookid;
    if (!game_insert_record('game_bookquiz', $bookquiz)) {
        print_error('game_bookquiz_continue: error inserting in game_bookquiz');
    }
    return game_bookquiz_play($id, $game, $attempt, $bookquiz, 0, $context);
}