* @package game
 **/
require_once "../../config.php";
require_once "lib.php";
require_once "locallib.php";
require_once "hangman/play.php";
require_once "cross/play.php";
require_once "cryptex/play.php";
require_once "millionaire/play.php";
require_once "sudoku/play.php";
require_once "bookquiz/play.php";
require_once "snakes/play.php";
require_once "hiddenpicture/play.php";
$action = optional_param('action', "", PARAM_ALPHANUM);
// action
game_show_header($id, $game, $course, $context);
game_do_attempt($id, $game, $action, $course, $context);
function game_show_header(&$id, &$game, &$course, &$context)
{
    global $DB, $USER, $PAGE, $OUTPUT;
    $id = optional_param('id', 0, PARAM_INT);
    // Course Module ID, or
    $q = optional_param('q', 0, PARAM_INT);
    // game ID
    if ($id) {
        if (!($cm = get_coursemodule_from_id('game', $id))) {
            print_error('invalidcoursemodule');
        }
        if (!($course = $DB->get_record('course', array('id' => $cm->course)))) {
            print_error('coursemisconf');
        }
示例#2
0
 * @package game
 **/
require_once "../../config.php";
require_once "lib.php";
require_once "locallib.php";
require_once "hangman/play.php";
require_once "cross/play.php";
require_once "cryptex/play.php";
require_once "millionaire/play.php";
require_once "sudoku/play.php";
require_once "bookquiz/play.php";
require_once "snakes/play.php";
require_once "hiddenpicture/play.php";
$action = optional_param('action', "", PARAM_ALPHANUM);
// action
game_show_header($id, $game, $course);
game_do_attempt($id, $game, $action, $course);
function game_show_header(&$id, &$game, &$course)
{
    global $DB, $USER, $PAGE, $OUTPUT;
    $id = optional_param('id', 0, PARAM_INT);
    // Course Module ID, or
    $q = optional_param('q', 0, PARAM_INT);
    // game ID
    if ($id) {
        if (!($cm = get_coursemodule_from_id('game', $id))) {
            print_error('invalidcoursemodule');
        }
        if (!($course = $DB->get_record('course', array('id' => $cm->course)))) {
            print_error('coursemisconf');
        }