Browse Source

phpdocs compatibility

MOODLE_20_STABLE
bdaloukas 8 years ago
parent
commit
f1d28dda08
  1. 4
      attempt.php
  2. 16
      backup/moodle2/backup_game_activity_task.class.php
  3. 29
      backup/moodle2/backup_game_settingslib.php
  4. 7
      backup/moodle2/backup_game_stepslib.php
  5. 44
      backup/moodle2/restore_game_stepslib.php
  6. 54
      bookquiz/play.php
  7. 8
      bookquiz/questions.php
  8. 23
      bookquiz/toc.php
  9. 8
      bookquiz/view.php
  10. 12
      classes/event/course_module_instance_list_viewed.php
  11. 2
      classes/event/course_module_viewed.php
  12. 9
      classes/event/game_played.php
  13. 9
      classes/plugininfo/gametool.php
  14. 153
      cross/cross_class.php
  15. 90
      cryptex/cryptexdb_class.php
  16. 47
      cryptex/play.php
  17. 6
      db/access.php
  18. 7
      db/createsnakes.php
  19. 8
      db/importsnakes.php
  20. 8
      db/importsudoku.php
  21. 48
      db/upgrade.php
  22. 10
      export.php
  23. 9
      export/exporthtml.php
  24. 9
      export/exporthtml_hangman.php
  25. 7
      export/exporthtml_millionaire.php
  26. 9
      export/exporthtml_snakes.php
  27. 7
      export/exportjavame.php
  28. 4
      export/html/snakes/css/game.css
  29. 17
      export/html/snakes/css/snakes.css
  30. 8
      export/html/snakes/css/style.css
  31. 20
      export/html/snakes/css/subModal.css
  32. 39
      export/html/snakes/js/snakes-mod.js
  33. 8
      hangman/play.php
  34. 7
      headergame.php
  35. 8
      hiddenpicture/picture.php
  36. 9
      hiddenpicture/play.php
  37. 8
      index.php
  38. 8
      lib.php
  39. 8
      locallib.php
  40. 9
      millionaire/play.php
  41. 8
      preview.php
  42. 7
      print.php
  43. 8
      report/default.php
  44. 8
      report/overview/report.php
  45. 5
      settings.php
  46. 7
      showanswers.php
  47. 8
      showattempts.php
  48. 8
      snakes/createboard.php
  49. 9
      snakes/play.php
  50. 10
      sudoku/class.Sudoku.php
  51. 7
      sudoku/create.php
  52. 8
      sudoku/export.php
  53. 8
      sudoku/play.php
  54. 7
      tabs.php
  55. 7
      translate.php
  56. 4
      version.php

4
attempt.php

@ -18,7 +18,8 @@
* This page prints a particular attempt of game
*
* @author bdaloukas
* @package game
* @copyright 2007 Vasilis Daloukas
* @package mod_game
**/
require_once( "../../config.php");
require_once( "lib.php");
@ -126,6 +127,7 @@ function game_show_header( &$id, &$game, &$course, &$context) {
*
* @param int $id
* @param stdClass $game
* @param string $action
* @param stdClass $course
* @param stdClass $context
*/

16
backup/moodle2/backup_game_activity_task.class.php

@ -15,19 +15,21 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Defines backup_glossary_activity_task class
*
* @package mod_game
* @subpackage backup-moodle2
* class backup_game_activity_task
* @author
* @package game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
**/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/mod/game/backup/moodle2/backup_game_stepslib.php'); // Because it exists (must).
require_once($CFG->dirroot . '/mod/game/backup/moodle2/backup_game_settingslib.php'); // Because it exists (optional).
/**
* Defines backup_game_activity_task class
*
* game backup task that provides all the settings and steps to perform one
* complete backup of the activity
*/
@ -49,8 +51,10 @@ class backup_game_activity_task extends backup_activity_task {
}
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* Encodes URLs to the index.php and view.php scripts
*
* @param string $content some HTML text that eventually contains URLs to the activity instance scripts
* @return string the content with the URLs encoded
*/
static public function encode_content_links($content) {
global $CFG;

29
backup/moodle2/backup_game_settingslib.php

@ -1,29 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package game
* @subpackage backup-moodle2
* @copyright 2010 onwards YOUR_NAME_GOES_HERE {@link YOUR_URL_GOES_HERE}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/** This activity has not particular settings but the inherited from the generic
* backup_activity_task so here there isn't any class definition, like the ones
* existing in /backup/moodle2/backup_settingslib.php (activities section)
*/
defined('MOODLE_INTERNAL') || die();

7
backup/moodle2/backup_game_stepslib.php

@ -15,13 +15,12 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Define all the backup steps that will be used by the backup_game_activity_task
*
* @package mod_game
* @subpackage backup-moodle2
* @author bdaloukas
*/
/**
* Define all the backup steps that will be used by the backup_game_activity_task
backup_game_settingslib.php
*/
/**

44
backup/moodle2/restore_game_stepslib.php

@ -15,6 +15,8 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Define all the restore steps that will be used by the restore_game_activity_task
*
* @package mod_game
* @subpackage backup-moodle2
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@ -22,10 +24,6 @@
defined('MOODLE_INTERNAL') || die();
/**
* Define all the restore steps that will be used by the restore_game_activity_task
*/
/**
* Structure step to restore one game activity
*/
@ -67,6 +65,8 @@ class restore_game_activity_structure_step extends restore_activity_structure_st
/**
* Restores the game table.
*
* @param stdClass $data
*/
protected function process_game($data) {
global $DB;
@ -85,6 +85,8 @@ class restore_game_activity_structure_step extends restore_activity_structure_st
/**
* Restores the game_export_html table.
*
* @param stdClass $data
*/
protected function process_game_export_html($data) {
global $DB;
@ -99,6 +101,8 @@ class restore_game_activity_structure_step extends restore_activity_structure_st
/**
* Restores the game_export_javame table.
*
* @param stdClass $game
*/
protected function process_game_export_javame( $data) {
global $DB;
@ -113,6 +117,8 @@ class restore_game_activity_structure_step extends restore_activity_structure_st
/**
* Restores the game_grades table.
*
* @param stdClass $data
*/
protected function process_game_grade( $data) {
global $DB;
@ -128,6 +134,8 @@ class restore_game_activity_structure_step extends restore_activity_structure_st
/**
* Restores the game_repetitions table.
*
* @param stdClass $data
*/
protected function process_game_repetition( $data) {
global $DB;
@ -143,6 +151,8 @@ class restore_game_activity_structure_step extends restore_activity_structure_st
/**
* Restores the game_attempts table.
*
* @param stdClass $data
*/
protected function process_game_attempt( $data) {
global $DB;
@ -173,6 +183,8 @@ class restore_game_activity_structure_step extends restore_activity_structure_st
/**
* Restores the game_queries table.
*
* @param stdClass $data
*/
protected function process_game_query( $data) {
global $DB;
@ -190,6 +202,8 @@ class restore_game_activity_structure_step extends restore_activity_structure_st
/**
* Restores the game_bookquiz table.
*
* @param stdClass $data
*/
protected function process_game_bookquiz( $data) {
global $DB;
@ -203,6 +217,8 @@ class restore_game_activity_structure_step extends restore_activity_structure_st
/**
* Restores the game_bookauiz_chapters table.
*
* @param stdClass $data
*/
protected function process_game_bookquiz_chapter( $data) {
global $DB;
@ -216,6 +232,8 @@ class restore_game_activity_structure_step extends restore_activity_structure_st
/**
* Restores the game_bookquiz_questions table.
*
* @param stdClass $data
*/
protected function process_game_bookquiz_question( $data) {
global $DB;
@ -229,6 +247,8 @@ class restore_game_activity_structure_step extends restore_activity_structure_st
/**
* Restores the game_cross table.
*
* @param stdClass $data
*/
protected function process_game_cross( $data) {
global $DB;
@ -242,6 +262,8 @@ class restore_game_activity_structure_step extends restore_activity_structure_st
/**
* Restores the game_cryptex table.
*
* @param stdClass $data
*/
protected function process_game_cryptex( $data) {
global $DB;
@ -255,6 +277,8 @@ class restore_game_activity_structure_step extends restore_activity_structure_st
/**
* Restores the game_hangman table.
*
* @param stdClass $data
*/
protected function process_game_hangman( $data) {
global $DB;
@ -269,6 +293,8 @@ class restore_game_activity_structure_step extends restore_activity_structure_st
/**
* Restores the game_hiddenpicture table.
*
* @param stdClass $data
*/
protected function process_game_hiddenpicture( $data) {
global $DB;
@ -282,6 +308,8 @@ class restore_game_activity_structure_step extends restore_activity_structure_st
/**
* Restores the game_millionaire table.
*
* @param stdClass $data
*/
protected function process_game_millionaire( $data) {
global $DB;
@ -296,6 +324,8 @@ class restore_game_activity_structure_step extends restore_activity_structure_st
/**
* Restores the game_snakes table.
*
* @param stdClass $data
*/
protected function process_game_snake( $data) {
global $DB;
@ -310,6 +340,8 @@ class restore_game_activity_structure_step extends restore_activity_structure_st
/**
* Restores the game_sudoku table.
*
* @param stdClass $data
*/
protected function process_game_sudoku( $data) {
global $DB;
@ -321,7 +353,9 @@ class restore_game_activity_structure_step extends restore_activity_structure_st
$DB->insert_record('game_sudoku', $data);
}
// Add Game related files, no need to match by itemname (just internally handled context).
/**
* Add Game related files, no need to match by itemname (just internally handled context).
*/
protected function after_execute() {
$this->add_related_files('mod_game', 'snakes_file', null);
$this->add_related_files('mod_game', 'snakes_board', null);

54
bookquiz/play.php

@ -16,6 +16,17 @@
defined('MOODLE_INTERNAL') || die();
/**
* Plays the game bookquiz.
*
* @param int $id
* @param stdClass $game
* @param stdClass $attempt
* @param stdClass $bookquiz
* @param int $bookquizid
* @param int $chapterid
* @param stdClass $context
*/
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);
@ -37,6 +48,16 @@ function game_bookquiz_continue( $id, $game, $attempt, $bookquiz, $chapterid, $c
return game_bookquiz_play( $id, $game, $attempt, $bookquiz, 0, $context);
}
/**
* Plays the game bookquiz.
*
* @param int $id
* @param stdClass $game
* @param stdClass $attempt
* @param stdClass $bookquiz
* @param int $chapterid
* @param stdClass $context
*/
function game_bookquiz_play( $id, $game, $attempt, $bookquiz, $chapterid, $context) {
global $DB, $OUTPUT, $cm;
@ -240,6 +261,12 @@ function game_bookquiz_play( $id, $game, $attempt, $bookquiz, $chapterid, $conte
}
}
/**
* Computes the last chapter.
*
* @param stdClass $game
* @param stdClass $bookquiz
*/
function game_bookquiz_play_computelastchapter( $game, &$bookquiz) {
global $DB;
@ -262,6 +289,17 @@ function game_bookquiz_play_computelastchapter( $game, &$bookquiz) {
}
}
/**
* Shows questions.
*
* @param int $id
* @param int $questionid
* @param int $chapterid
* @param int $nextchapterid
* @param int $scoreattempt
* @param stdClass $game
* @param stdClass $context
*/
function game_bookquiz_showquestions( $id, $questionid, $chapterid, $nextchapterid, $scoreattempt, $game, $context) {
$onlyshow = false;
$showsolution = false;
@ -306,6 +344,13 @@ function game_bookquiz_showquestions( $id, $questionid, $chapterid, $nextchapter
echo "</form>\n";
}
/**
* Selects random one question from the input list.
*
* @param array $questions
*
* @return the position of the random question.
*/
function game_bookquiz_selectrandomquestion( $questions) {
global $DB;
@ -333,6 +378,15 @@ function game_bookquiz_selectrandomquestion( $questions) {
}
}
/**
* Check if the answers are correct.
*
* @param int $id
* @param stdClass $game
* @param stdClass $attempt
* @param stdClass $bookquiz
* @param stdClass $context
*/
function game_bookquiz_check_questions( $id, $game, $attempt, $bookquiz, $context) {
global $USER, $DB;

8
bookquiz/questions.php

@ -123,6 +123,14 @@ if (($recs = $DB->get_records( 'book_chapters', array('bookid' => $game->bookid)
echo $OUTPUT->footer($course);
/**
* Save infos to database.
*
* @param int $gameid
* @param int $bookid
* @param array $ids
* @param stdClass $form
*/
function game_bookquiz_save( $gameid, $bookid, $ids, $form) {
global $DB;

23
bookquiz/toc.php

@ -14,6 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Table of contents.
*
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
define('NUM_NONE', '0');
@ -21,21 +29,6 @@ define('NUM_NUMBERS', '1');
define('NUM_BULLETS', '2');
define('NUM_INDENTED', '3');
/* Included from mod/book/view.php and print.php.
*
* uses:
* $chapters - all book chapters
* $chapter - may be false
* $cm - course module
* $book - book
* $edit - force editing view
*
* fills:
* $toc
* $title (not for print)
*/
$currtitle = ''; // Active chapter title (plain text).
$currsubtitle = ''; // Active subchapter if any.
$prevtitle = '&nbsp;';

8
bookquiz/view.php

@ -14,6 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* View a bookquiz.
*
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once('../../config.php');
require_once('lib.php');

12
classes/event/course_module_instance_list_viewed.php

@ -31,10 +31,18 @@ defined('MOODLE_INTERNAL') || die();
* The mod_game instance list viewed event class.
*
* @package mod_game
* @since Moodle 2.7
* @copyright 2014 Vasilis Daloukas
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* The mod_game instance list viewed event class.
*
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class course_module_instance_list_viewed extends \core\event\course_module_instance_list_viewed {
public static function create_from_course(\stdClass $course) {
$params = array(

2
classes/event/course_module_viewed.php

@ -20,7 +20,7 @@
* The mod_game course module viewed event.
*
* @package mod_game
* @copyright 2014 Vasilis Daloukas
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

9
classes/event/game_played.php

@ -47,6 +47,15 @@ class game_played extends \core\event\base {
"course module id '$this->contextinstanceid'.";
}
/**
* Create instance of event.
*
* @since Moodle 2.7
*
* @param \stdClass $game
* @param \context_module $context
* @return event
*/
public static function played(\stdClass $game, \context_module $context) {
$data = array(
'context' => $context,

9
classes/plugininfo/gametool.php

@ -29,7 +29,14 @@ use core\plugininfo\base;
defined('MOODLE_INTERNAL') || die();
/**
* The mod_game gametool.
*
* @package mod_game
* @since Moodle 2.6
* @copyright 2014 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class gametool extends base {
public function is_uninstall_allowed() {
return true;

153
cross/cross_class.php

@ -26,8 +26,13 @@ Codewalkers PHP Coding Contest of July 2002
Author Àngel Fenoy from Arenys de Mar, Barcelona.
*/
defined('MOODLE_INTERNAL') || die();
/**
* The class cross computes a crossword.
*
* @package mod_game
* @copyright 2014 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class Cross
{
public $minputanswers; // Contains the words and the answers.
@ -58,6 +63,15 @@ class Cross
public $mreps; // Repetition of each word.
public $maveragereps; // Average of repetitions.
/**
* Set words for computing.
*
* @param array $answers
* @param int $maxcols
* @param array reps
*
* @return \moodle_url
*/
public function setwords( $answers, $maxcols, $reps) {
$this->mreps = array();
foreach ($reps as $word => $r) {
@ -114,6 +128,9 @@ class Cross
return count( $this->mwords);
}
/**
* Randomizes the words.
*/
public function randomize() {
$n = count( $this->mwords);
for ($j = 0; $j <= $n / 4; $j++) {
@ -123,6 +140,18 @@ class Cross
}
}
/**
* Compute one crossword.
*
* @param stdClass crossm
* @param stdClass crossm
* @param string $letters
* @param int minwords
* @param int maxwords
* @param int mtimelimit
*
* @return the crossword
*/
public function computedata( &$crossm, &$crossd, &$letters, $minwords, $maxwords, $mtimelimit=3) {
$t1 = time();
@ -141,7 +170,7 @@ class Cross
// Selects the size of the cross.
$n20 = mt_rand( $this->mn20min, $this->mn20max);
if (!$this->computenextcross( $n20, $t1, $ctries, $minwords, $maxwords, $nochange)) {
if (!$this->computenextcross( $n20, $ctries, $minwords, $maxwords, $nochange)) {
break;
}
@ -160,7 +189,18 @@ class Cross
return $this->savepuzzle( $crossm, $crossd, $ctries, time() - $t1);
}
public function computenextcross( $n20, $t1, $ctries, $minwords, $maxwords, &$nochange) {
/**
* Compute the next crossword.
*
* @param int $n20
* @param int $ctries
* @param int $minwords
* @param int $maxwords
* @param int &$nochange
*
* @return \moodle_url
*/
public function computenextcross( $n20, $ctries, $minwords, $maxwords, &$nochange) {
$maxw = $n20;
$n21 = $n20 + 1;
@ -247,6 +287,22 @@ class Cross
return true;
}
/**
* Compute the scrore of one crossword.
*
* @param string $puzzle
* @param int $n20
* @param int $n22
* @param int $n2222
* @param int $nwords
* @param int @$nconnectors
* @param int @$nfilleds
* @param int @$cspaces
* @param stdClass $crossword
* @param array reps
*
* @return \moodle_url
*/
public function computescore( $puzzle, $n20, $n22, $n2222, $nwords, &$nconnectors, &$nfilleds, &$cspaces, $crossword) {
$nconnectors = $nfilleds = 0;
$puzzle00 = str_replace('.', '0', $puzzle);
@ -279,6 +335,15 @@ class Cross
return $score - 10 * $sumrep;
}
/**
* Compute puzzle info.
*
* @param int $n20
* @param int $crosspos
* @param int $crossdir
* @param stdClass $crossword
* @param boolean bprint
*/
public function computepuzzleinfo( $n20, $crosspos, $crossdir, $crossword, $bprint=false) {
$bprint = false;
$n22 = $n20 + 2;
@ -344,6 +409,14 @@ class Cross
}
}
/**
* Save the crossword to database.
*
* @param array &$crossm
* @param array &$crossd
* @param int ctries
* @param int time
*/
public function savepuzzle( &$crossm, &$crossd, $ctries, $time) {
$n22 = $this->mbestn20 + 2;
@ -410,12 +483,24 @@ class Cross
return (count( $crossd) > 0);
}
/**
* Swaps two variables.
*
* @param $a
* @param $b
*/
public function swap( &$a, &$b) {
$temp = $a;
$a = $b;
$b = $temp;
}
/**
* Displays a crossword.
*
* @param sting $puzzle
* @param int $n20
*/
public function displaycross($puzzle, $n20) {
$n21 = $n20 + 1;
$n22 = $n20 + 2;
@ -453,6 +538,23 @@ class Cross
return $ret.'</tr></table>';
}
/**
* Scans a positions.
*
* @param int $pos
* @param int $dir
* @param int $valblanc
* @param string &$puzzle
* @param array &$words
* @param &$magics
* @param poss
* @param #ccrosspos
* @param crossdir
* @param crosssword
* @param int $n20
*
* @return true if it is ok.
*/
public function scan_pos($pos, $dir, $valblanc, &$puzzle, &$words, &$magics,
&$poss, &$crosspos, &$crossdir, &$crossword, $n20) {
@ -578,6 +680,15 @@ class Cross
return false;
}
/**
* my_preg_match (backward compatibility).
*
* @param $w
* @param @words
* @param &$word
*
* @return true if it is ok.
*/
public function my_preg_match( $w, $words, &$word) {
$a = explode( ";", $words);
$lenw = game_strlen( $w);
@ -604,6 +715,13 @@ class Cross
return false;
}
/**
* Set a char to the specified position.
*
* @param @$s
* @param int $pos
* @param char $char
*/
public function setchar( &$s, $pos, $char) {
$ret = "";
@ -614,6 +732,17 @@ class Cross
$s = $ret . $char . game_substr( $s, $pos + 1, game_strlen( $s) - $pos - 1);
}
/**
* Show html base.
*
* @param $crossm
* @param $crossd
* @param boolean $showsolution
* @param boolean $showhtmlsolutions
* @param boolean $showstudentguess
* @param stdClass $context
* @param stdClass $game
*/
public function showhtml_base( $crossm, $crossd, $showsolution, $showhtmlsolutions, $showstudentguess, $context, $game) {
$this->mLegendh = array();
$this->mLegendv = array();
@ -735,10 +864,26 @@ class Cross
return $sret;
}
/**
* Compares length of two strings.
*
* @param string $a
* @param string $b
*
* @return -1 if a < b, 0 if equal
*/
public function cmp($a, $b) {
return game_strlen($b) - game_strlen($a);
}
/**
* Compares two strings with random
*
* @param string $a
* @param string $b
*
* @return -1 if a < b, 0 if equal
*/
public function cmp_magic($a, $b) {
return (game_strlen($a) + mt_rand(0, 3)) - (game_strlen($b) - mt_rand(0, 1));
}

90
cryptex/cryptexdb_class.php

@ -16,7 +16,25 @@
defined('MOODLE_INTERNAL') || die();
/**
* The class CryptexDB loads/save the cryptex from/to database.
*
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class CryptexDB extends CrossDB {
/**
* Save cryptex.
*
* @param stdClass $game
* @param array &$crossm
* @param array &$crossd
* @param int id
* @param $letters
*
* @return the saved record
*/
public function savecryptex( $game, &$crossm, $crossd, $id, $letters) {
global $USER;
@ -39,6 +57,14 @@ class CryptexDB extends CrossDB {
return $newrec;
}
/**
* Compute letters.
*
* @param array &$crossm
* @param array &$crossd
*
* @return the letters.
*/
public function computeletters( $crossm, $crossd) {
$letters = '';
$cols = $crossm->cols + 1;
@ -97,6 +123,16 @@ class CryptexDB extends CrossDB {
return $retletters;
}
/**
* Displays the cryptex.
*
* @param $cols
* @param $rows
* @param $letters
* @param $mask
* @param boolean $showsolution
* @param $textdir
*/
public function displaycryptex( $cols, $rows, $letters, $mask, $showsolution, $textdir) {
echo "<table border=1 $textdir>";
for ($row = 0; $row < $rows; $row++) {
@ -119,6 +155,15 @@ class CryptexDB extends CrossDB {
echo "</table>";
}
/**
* Inserts a char.
*
* @param $letters
* @param $cols
* @param $rows
* @param $char
* @param int &$spaces
*/
public function insertchar( &$letters, $cols, $rows, $char, &$spaces) {
$len = game_strlen( $letters);
for ($i = 0; $i < $len; $i++) {
@ -130,6 +175,15 @@ class CryptexDB extends CrossDB {
}
}
/**
* Inserts chars.
*
* @param $letters
* @param $cols
* @param $rows
* @param $char
* @param int &$spaces
*/
public function insertchars( &$letters, $cols, $rows, $char, &$spaces) {
$len = game_strlen( $letters);
for ($i = 0; $i < $len; $i++) {
@ -150,6 +204,13 @@ class CryptexDB extends CrossDB {
return false;
}
/**
* Gets the hash of a word.
*
* @param string $word
*
* @return the hash
*/
public function gethash( $word) {
$x = 37;
$len = count( game_strlen( $word));
@ -161,6 +222,16 @@ class CryptexDB extends CrossDB {
return $x;
}
/**
* Loads the cryptex from database.
*
* @param array $crossm
* @param &$mask
* @param &$corrects
* @param &$language
*
* @return questions
*/
public function loadcryptex( $crossm, &$mask, &$corrects, &$language) {
global $DB;
@ -206,10 +277,29 @@ class CryptexDB extends CrossDB {
return $questions;
}
/**
* Calss the setwords of class Cross.
*
* @param $answers
* @param $maxcols
* @param $reps
*
* @return Cross::setwords
*/
public function setwords( $answers, $maxcols, $reps) {
return Cross::setwords( $answers, $maxcols, $reps);
}
/**
* Calss the computedata of class Cross.
*
* @param &$crossm
* @param &$crossd
* @param &$letters
* @param $minwords
* @param $maxwords
* @param $mtimelimit
*/
public function computedata( &$crossm, &$crossd, &$letters, $minwords, $maxwords, $mtimelimit=3) {
if (!cross::computedata( $crossm, $crossd, $letters, $minwords, $maxwords, $mtimelimit)) {
return false;

47
cryptex/play.php

@ -25,6 +25,16 @@ defined('MOODLE_INTERNAL') || die();
require_once( "cryptexdb_class.php");
/**
* Plays the game cryptex.
*
* @param int $id
* @param stdClass $game
* @param stdClass $atttempt
* @param $cryptexrec
* @param $endofgame
* @param stdClass $context
*/
function game_cryptex_continue( $id, $game, $attempt, $cryptexrec, $endofgame, $context) {
global $DB, $USER;
@ -99,7 +109,18 @@ function game_cryptex_continue( $id, $game, $attempt, $cryptexrec, $endofgame, $
return game_cryptex_play( $id, $game, $attempt, $cryptexrec, $crossm, false, false, false, $context);
}
// The q means game_queries.id.
/**
* Checks if is correct.
*
* @param int $id
* @param stdClass $game
* @param stdClass $atttempt
* @param $cryptexrec
* @param $q (The q means game_queries.id).
* @param $answer
* @param $finishattempt
* @param stdClass $context
*/
function game_cryptex_check( $id, $game, $attempt, $cryptexrec, $q, $answer, $finishattempt, $context) {
global $DB;
@ -144,6 +165,21 @@ function game_cryptex_check( $id, $game, $attempt, $cryptexrec, $q, $answer, $fi
game_cryptex_play( $id, $game, $attempt, $cryptexrec, $crossm, true, $onlyshow, $showsolution, $context);
}
/**
* Plays the game cryptex.
*
* @param int $id
* @param stdClass $game
* @param stdClass $atttempt
* @param $cryptexrec
* @param $crosssm
* @param boolean $updateattempt
* @param boolean $onlyshow
* @param boolean $showsolution
* @param stdClass $context
* @param boolean $print
* @param boolean $showhtmlprintbutton
*/
function game_cryptex_play( $id, $game, $attempt, $cryptexrec, $crossm,
$updateattempt = false, $onlyshow = false, $showsolution = false, $context,
$print = false, $showhtmlprintbutton = true) {
@ -366,7 +402,14 @@ if ($print) {
echo '<body>';
}
}
/**
* On finished.
*
* @param int $id
* @param stdClass $game
* @param stdClass $atttempt
* @param $cryptexrec
*/
function game_cryptex_onfinished( $id, $game, $attempt, $cryptexrec) {
global $CFG, $DB;

6
db/access.php

@ -17,9 +17,11 @@
defined('MOODLE_INTERNAL') || die();
/*
* Capability definitions for the game module.
* Plugin capabilities
*
* For naming conventions, see lib/db/access.php.
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$capabilities = array(

7
db/createsnakes.php

@ -14,6 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Creates the snakes database.
*
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require( "../../../config.php");
require_login();
execute_sql("truncate TABLE {game_snakes_database}");

8
db/importsnakes.php

@ -14,6 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Imports the snakes database.
*
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
game_importsnakes();

8
db/importsudoku.php

@ -14,6 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Imports the sudoku database.
*
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$DB->execute( "INSERT INTO {game_sudoku_database}( level, opened, data) VALUES (1, 26, ".

48
db/upgrade.php

@ -13,24 +13,30 @@
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
//
// Sometimes, changes between versions involve
// alterations to database structures and other
// major things that may break installations.
//
// The upgrade function in this file will attempt
// to perform all the necessary actions to upgrade
// your older installation to the current version.
//
// If there's something it cannot do itself, it
// will tell you what you need to do.
//
// The commands in here will all be database-neutral,
// using the methods of database_manager class
//
// Please do not forget to use upgrade_set_timeout()
// before any action that may take longer time to finish.
/* This file keeps track of upgrades to the game module
* Sometimes, changes between versions involve
* alterations to database structures and other
* major things that may break installations.
/**
* This file keeps track of upgrades to the game module
*
* The upgrade function in this file will attempt
* to perform all the necessary actions to upgrade
* your older installation to the current version.
*
* If there's something it cannot do itself, it
* will tell you what you need to do.
*
* The commands in here will all be database-neutral,
* using the methods of database_manager class
*
* Please do not forget to use upgrade_set_timeout()
* before any action that may take longer time to finish.
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
@ -853,16 +859,6 @@ function xmldb_game_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2007111310, 'game');
}
if ($oldversion < 2007111303) {
$table = new xmldb_table('game');
$field = new xmldb_field('bottomtext', XMLDB_TYPE_TEXT);
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
upgrade_mod_savepoint(true, 2007111303, 'game');
}
if ($oldversion < 2007111842) {
$table = new xmldb_table( 'game_queries');
$field = new xmldb_field( 'gameinstanceid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0');

10
export.php

@ -14,13 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/*
/**
* This page exports a game to another platform e.g. html, jar
*
* @author bdaloukas
* @package game
**/
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../../config.php');
ob_start();

9
export/exporthtml.php

@ -14,12 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/*
/**
* This page export the game to html for games: cross, hangman
*
* @author bdaloukas
* @package game
**/
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();

9
export/exporthtml_hangman.php

@ -14,12 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/*
/**
* This page export the game hangman to html
*
* @author bdaloukas
* @package game
**/
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();

7
export/exporthtml_millionaire.php

@ -17,9 +17,10 @@
/**
* This page export the game millionaire to html
*
* @author bdaloukas
* @package game
**/
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();

9
export/exporthtml_snakes.php

@ -14,12 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/*
/**
* This page export the game snakes to html
*
* @author bdaloukas
* @package game
**/
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();

7
export/exportjavame.php

@ -17,9 +17,10 @@
/**
* This page export the game to javame for mobile phones
*
* @author bdaloukas
* @package game
**/
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();

4
export/html/snakes/css/game.css

@ -19,8 +19,8 @@
background-repeat: repeat;
font-family: Arial, Helvetica, sans-serif;
font-weight: normal;
color: #ffffff;
border: 0.5em solid #333333;
color: #fff;
border: 0.5em solid #333;
top: 30px;
position: absolute;
left: 500px;

17
export/html/snakes/css/snakes.css

@ -37,7 +37,7 @@ Any Duplication of this code should be avoided*/
}
body {
background:#cccccc;
background:#ccc;
}
#player {
@ -58,8 +58,8 @@ body {
background-repeat: repeat;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
color: #ffffff;
border: 0.5em solid #333333;
color: #fff;
border: 0.5em solid #333;
top: 30px;
position: absolute;
right: 880px;
@ -69,8 +69,8 @@ body {
margin-left: 0.5em;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
color: #000000;
background-color: #FC0;
color: #000;
background-color: #fc0;
padding: 1em;
}
@ -79,8 +79,11 @@ body {
#fade { /*--Transparent background layer--*/
display: none; /*--hidden by default--*/
background: #000;
position: fixed; left: 0; top: 0;
width: 100%; height: 100%;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
opacity: .80;
z-index: 9999;
}

8
export/html/snakes/css/style.css

@ -2,14 +2,16 @@ body {
background-color: #efefef;
}
body, html, input {
body,
html,
input {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #333333;
color: #333;
}
.info {
font-style: italic;
font-size: 0.9em;
color: #666666;
color: #666;
}

20
export/html/snakes/css/subModal.css

@ -4,8 +4,8 @@
#popupMask {
position: absolute;
z-index: 200;
top: 0px;
left: 0px;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: .4;
@ -15,12 +15,12 @@
* than the PNG solution.
*/
background-color:transparent !important;
background-color: #333333;
background-color: #333;
/* this hack is for opera support
* you can uncomment the background-image if you don't care about opera.
* this gives you the flexibility to use any bg color that you want, instead of the png
*/
background-image/**/: url("../images/maskBG.png") !important; // For browsers Moz, Opera, etc.
background-image: url("../images/maskBG.png") !important; // For browsers Moz, Opera, etc.
background-image:none;
background-repeat: repeat;
display:none;
@ -29,14 +29,14 @@
#popupContainer {
position: absolute;
z-index: 201;
top: 0px;
left: 0px;
top: 0;
left: 0;
display:none;
padding: 0px;
padding: 0;
}
#popupInner {
border: 2px solid #000000;
background-color: #ffffff;
border: 2px solid #000;
background-color: #fff;
}
#popupFrame {
@ -52,7 +52,7 @@
font-weight: bold;
height: 1.3em;
padding: 5px;
border-bottom: 2px solid #000000;
border-bottom: 2px solid #000;
border-top: 1px solid #7878a3f2;
border-left: 1px solid #7878a3f2;
border-right: 1px solid #204095;

39
export/html/snakes/js/snakes-mod.js

@ -5,7 +5,6 @@ Husain Limdiyawala(MSc IT DA-IICT) */
var totblocks = 0;
var data = "";
var currentblock = 0;
var position = 0;
var lastposition = new Array();
var randomno = 0;
var tots = new Array();
@ -16,8 +15,8 @@ var destsnake = new Array(4);
var ladsrc = new Array(3);
var laddest = new Array(3);
var quest = new Array(); // Available questions along with multiple answers.
var cor_answered = new Array(); // Record all questions (along with answers) the user responded CORRECTLY.
var wro_answered = new Array(); // Record all questions (along with answers) the user responded WRONGLY.
var coranswered = new Array(); // Record all questions (along with answers) the user responded CORRECTLY.
var wroanswered = new Array(); // Record all questions (along with answers) the user responded WRONGLY.
var user = new Array();
// Constract table with questions and answers and pick question to display.
@ -38,9 +37,14 @@ quest[12] = "Spell 4";
quest[13] = "four";
quest[14] = "three";
quest[15] = "one";
z = 0;
for (z = 0; quest[z] != null; z++) {
// Do nothing.
var z = 0;
var allQuest;
for () {
if (quest[z] === null) {
break;
}
}
allQuest = z / 4;
@ -65,6 +69,8 @@ function hideAll() {
// The Below Function will Render The Main Board.
function paintBoard(a) {
var j;
totblocks = (a * a);
if ((a * a) % 2 == 0) {
currentblock = (a * a) - a + 1;
@ -188,22 +194,6 @@ function laddercheck(k) {
}
}
// The below Function checks for pythons.
function pythoncheck(k) {
i = 0;
for (i = 0; i < pythons.length; i++) {
if (pythons[i] == tots[k]) {
alert("You have been eaten up by a python.Your game is over");
document.getElementById(tots[k]).style.background = "url(images/csnake.gif) #000000";
lastposition[k] = null;
tots[k] = null;
break;
}
}
}
// The below function will register a snake.
function registerSnake(tp, lft, dv, src, dest, i) {
document.getElementById(dv).style.top = tp + "px";
@ -225,7 +215,6 @@ function selectBoard() {
totblocks = 0;
data = "";
currentblock = 0;
position = 0;
hideAll();
if (document.getElementById("boardtype").value != null) {
@ -307,10 +296,10 @@ function question() {
alert("Σωστά!")
doit(l);
cor_answered.concat(quest.splice(picked * 4, 4));
coranswered.concat(quest.splice(picked * 4, 4));
} else {
alert("Η απάντηση δεν ήταν σωστή. Χάνεις τη σειρά σου για αυτό το γύρο!")
wro_answered.concat(quest.splice(picked * 4, 4));
wroanswered.concat(quest.splice(picked * 4, 4));
}
// Remove question and answers from available questions - (thus not allowing to have a Repeated question).

8
hangman/play.php

@ -14,7 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
// This file plays the game hangman.
/**
* This file plays the game hangman.
*
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();

7
headergame.php

@ -14,6 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* The header for many .php files.
*
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once(dirname(__FILE__) . '/../../config.php');

8
hiddenpicture/picture.php

@ -14,6 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Creates an image dynamically.
*
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require( '../../../config.php');
require_login();

9
hiddenpicture/play.php

@ -14,7 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
// This file plays the game Hidden Picture.
/**
* This file plays the game Hidden Picture.
*
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();

8
index.php

@ -17,10 +17,10 @@
/**
* This page lists all the instances of game module in a particular course
*
* @author Vasilis Daloukas
* @package game
**/
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once("../../config.php");
require_once("lib.php");
require_once("locallib.php");

8
lib.php

@ -17,10 +17,10 @@
/**
* Library of functions and constants for module game
*
* @author Vasilis Daloukas
* @package game
**/
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
// Define CONSTANTS.

8
locallib.php

@ -14,6 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Basic library.
*
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
// Include those library functions that are also used by core Moodle or other modules.

9
millionaire/play.php

@ -15,11 +15,12 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file plays the game millionaire
* This file plays the game millionaire.
*
* @author bdaloukas
* @package game
**/
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();

8
preview.php

@ -17,10 +17,10 @@
/**
* This page prints a particular attempt of game
*
* @author bdaloukas
* @package game
**/
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once("../../config.php");
require_login();

7
print.php

@ -17,9 +17,10 @@
/**
* This page export the game to html
*
* @author bdaloukas
* @package game
**/
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once("../../config.php");
require_once("lib.php");
require_once("locallib.php");

8
report/default.php

@ -29,6 +29,14 @@
// Included by ../report.php.
/**
* the default report.
*
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
class game_default_report {

8
report/overview/report.php

@ -17,11 +17,11 @@
defined('MOODLE_INTERNAL') || die();
/*
* This script lists student attempts
* This script lists student attempts.
*
* @author bdaloukas.
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package game
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once($CFG->libdir.'/tablelib.php');

5
settings.php

@ -17,11 +17,10 @@
/**
* Form for creating and modifying a game
*
* @package game
* @author Vasilis Daloukas
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
if ($ADMIN->fulltree) {

7
showanswers.php

@ -17,9 +17,10 @@
/**
* This page shows the answers of the current game
*
* @author bdaloukas
* @package game
**/
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once("../../config.php");
require_once( "headergame.php");

8
showattempts.php

@ -17,10 +17,10 @@
/**
* This page shows the answers of the current game
*
* @author bdaloukas
* @package game
**/
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once("../../config.php");
require_login();

8
snakes/createboard.php

@ -16,7 +16,13 @@
defined('MOODLE_INTERNAL') || die();
// This file creates a board for "Snakes and Ladders".
/**
* This file creates a board for "Snakes and Ladders".
*
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
function game_createsnakesboard($imageasstring, $colsx, $colsy, $ofstop, $ofsbottom,
$ofsright, $ofsleft, $board, $setwidth, $setheight) {
global $CFG;

9
snakes/play.php

@ -16,8 +16,13 @@
defined('MOODLE_INTERNAL') || die();
// This files plays the game "Snakes and Ladders".
/**
* This files plays the game "Snakes and Ladders".
*
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
function game_snakes_continue( $id, $game, $attempt, $snakes, $context) {
if ($attempt != false and $snakes != false) {
return game_snakes_play( $id, $game, $attempt, $snakes, $context);

10
sudoku/class.Sudoku.php

@ -65,15 +65,13 @@ defined('MOODLE_INTERNAL') || die();
* @package Sudoku
*/
/*
/**
* Basic functionality needed for ObjectSs in the Sudoku solver.
*
* Technically speaking these aren't restricted to the Sudoku classes
* and are of use generally.
*
* @package Sudoku
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class objects {
/**
* @desc Are two array's equal (have the same contents).

7
sudoku/create.php

@ -14,6 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Creates a sudoku.
*
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require( "../../../config.php");
require_once("class.Sudoku.php");
require( '../header.php');

8
sudoku/export.php

@ -14,6 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Exports a sudoku.
*
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require( "../../../config.php");
require_login();

8
sudoku/play.php

@ -14,6 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Plays the game "Sudoku".
*
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once( "../../lib/questionlib.php");

7
tabs.php

@ -17,11 +17,10 @@
/**
* Sets up the tabs used by the game pages based on the users capabilites.
*
* @author Vasilis Daloukas.
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package game
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
if (empty($game)) {

7
translate.php

@ -17,9 +17,10 @@
/**
* Check translation of module Game
*
* @author Vasilis Daloukas
* @package game
**/
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require( "../../config.php");
require_login();

4
version.php

@ -35,10 +35,10 @@ if (!isset( $plugin)) {
}
$plugin->component = 'mod_game'; // Full name of the plugin (used for diagnostics).
$plugin->version = 2017061001; // The current module version (Date: YYYYMMDDXX).
$plugin->version = 2017061101; // The current module version (Date: YYYYMMDDXX).
$plugin->requires = 2010112400; // Requires Moodle 2.0.
$plugin->cron = 0; // Period for cron to check this module (secs).
$plugin->release = '2017-06-10';
$plugin->release = '2017-06-11';
if ($useplugin != 2) {
$module = $plugin;

Loading…
Cancel
Save