diff --git a/attempt.php b/attempt.php index 2b04dae..7fd9db7 100644 --- a/attempt.php +++ b/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 */ diff --git a/backup/moodle2/backup_game_activity_task.class.php b/backup/moodle2/backup_game_activity_task.class.php index 2521dae..b4fda95 100644 --- a/backup/moodle2/backup_game_activity_task.class.php +++ b/backup/moodle2/backup_game_activity_task.class.php @@ -15,19 +15,21 @@ // along with Moodle. If not, see . /** + * 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; diff --git a/backup/moodle2/backup_game_settingslib.php b/backup/moodle2/backup_game_settingslib.php deleted file mode 100644 index 35e15d2..0000000 --- a/backup/moodle2/backup_game_settingslib.php +++ /dev/null @@ -1,29 +0,0 @@ -. - -/** - * @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(); diff --git a/backup/moodle2/backup_game_stepslib.php b/backup/moodle2/backup_game_stepslib.php index 7072801..f83f359 100644 --- a/backup/moodle2/backup_game_stepslib.php +++ b/backup/moodle2/backup_game_stepslib.php @@ -15,13 +15,12 @@ // along with Moodle. If not, see . /** + * 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 */ /** diff --git a/backup/moodle2/restore_game_stepslib.php b/backup/moodle2/restore_game_stepslib.php index b3480ed..70d14a8 100644 --- a/backup/moodle2/restore_game_stepslib.php +++ b/backup/moodle2/restore_game_stepslib.php @@ -15,6 +15,8 @@ // along with Moodle. If not, see . /** + * 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,8 +101,10 @@ 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) { + protected function process_game_export_javame( $data) { global $DB; $data = (object)$data; @@ -113,8 +117,10 @@ 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) { + protected function process_game_grade( $data) { global $DB; $data = (object)$data; @@ -128,8 +134,10 @@ 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) { + protected function process_game_repetition( $data) { global $DB; $data = (object)$data; @@ -143,8 +151,10 @@ 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) { + protected function process_game_attempt( $data) { global $DB; $data = (object)$data; @@ -173,8 +183,10 @@ 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) { + protected function process_game_query( $data) { global $DB; $data = (object)$data; @@ -190,8 +202,10 @@ 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) { + protected function process_game_bookquiz( $data) { global $DB; $data = (object)$data; @@ -203,8 +217,10 @@ 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) { + protected function process_game_bookquiz_chapter( $data) { global $DB; $data = (object)$data; @@ -216,8 +232,10 @@ 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) { + protected function process_game_bookquiz_question( $data) { global $DB; $data = (object)$data; @@ -229,8 +247,10 @@ 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) { + protected function process_game_cross( $data) { global $DB; $data = (object)$data; @@ -242,8 +262,10 @@ 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) { + protected function process_game_cryptex( $data) { global $DB; $data = (object)$data; @@ -255,8 +277,10 @@ 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) { + protected function process_game_hangman( $data) { global $DB; $data = (object)$data; @@ -269,8 +293,10 @@ 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) { + protected function process_game_hiddenpicture( $data) { global $DB; $data = (object)$data; @@ -282,8 +308,10 @@ 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) { + protected function process_game_millionaire( $data) { global $DB; $data = (object)$data; @@ -296,8 +324,10 @@ 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) { + protected function process_game_snake( $data) { global $DB; $data = (object)$data; @@ -310,8 +340,10 @@ 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) { + protected function process_game_sudoku( $data) { global $DB; $data = (object)$data; @@ -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); diff --git a/bookquiz/play.php b/bookquiz/play.php index 0196da5..15731de 100644 --- a/bookquiz/play.php +++ b/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 "\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; diff --git a/bookquiz/questions.php b/bookquiz/questions.php index 5db1029..4b9acb2 100644 --- a/bookquiz/questions.php +++ b/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; diff --git a/bookquiz/toc.php b/bookquiz/toc.php index 74cba09..0a73e3c 100644 --- a/bookquiz/toc.php +++ b/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 . +/** + * 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 = ' '; diff --git a/bookquiz/view.php b/bookquiz/view.php index e16408a..6aeb250 100644 --- a/bookquiz/view.php +++ b/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 . +/** + * 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'); diff --git a/classes/event/course_module_instance_list_viewed.php b/classes/event/course_module_instance_list_viewed.php index 578c210..6f98c79 100644 --- a/classes/event/course_module_instance_list_viewed.php +++ b/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( diff --git a/classes/event/course_module_viewed.php b/classes/event/course_module_viewed.php index 94dc544..fa6e24e 100644 --- a/classes/event/course_module_viewed.php +++ b/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 */ diff --git a/classes/event/game_played.php b/classes/event/game_played.php index b201dfe..9c0ad84 100644 --- a/classes/event/game_played.php +++ b/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, diff --git a/classes/plugininfo/gametool.php b/classes/plugininfo/gametool.php index 687daca..853fbc8 100644 --- a/classes/plugininfo/gametool.php +++ b/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; diff --git a/cross/cross_class.php b/cross/cross_class.php index 41171cb..6c1c94c 100644 --- a/cross/cross_class.php +++ b/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.''; } + /** + * 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)); } diff --git a/cryptex/cryptexdb_class.php b/cryptex/cryptexdb_class.php index 3c88fa8..78f6444 100644 --- a/cryptex/cryptexdb_class.php +++ b/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 ""; for ($row = 0; $row < $rows; $row++) { @@ -119,6 +155,15 @@ class CryptexDB extends CrossDB { echo "
"; } + /** + * 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; diff --git a/cryptex/play.php b/cryptex/play.php index 04a05bf..f5bb366 100644 --- a/cryptex/play.php +++ b/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 ''; } } - +/** + * On finished. + * + * @param int $id + * @param stdClass $game + * @param stdClass $atttempt + * @param $cryptexrec + */ function game_cryptex_onfinished( $id, $game, $attempt, $cryptexrec) { global $CFG, $DB; diff --git a/db/access.php b/db/access.php index 8a1db34..cd379e6 100644 --- a/db/access.php +++ b/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( diff --git a/db/createsnakes.php b/db/createsnakes.php index 1e84cce..a0584ec 100644 --- a/db/createsnakes.php +++ b/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 . +/** + * 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}"); diff --git a/db/importsnakes.php b/db/importsnakes.php index 7f1374c..2c99c46 100644 --- a/db/importsnakes.php +++ b/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 . +/** + * 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(); diff --git a/db/importsudoku.php b/db/importsudoku.php index 76bf847..dded0ca 100644 --- a/db/importsudoku.php +++ b/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 . +/** + * 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, ". diff --git a/db/upgrade.php b/db/upgrade.php index 7b85f27..d8455d5 100644 --- a/db/upgrade.php +++ b/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 . +// +// 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'); diff --git a/export.php b/export.php index 277a848..39043d0 100644 --- a/export.php +++ b/export.php @@ -14,13 +14,13 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -/* +/** * 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(); diff --git a/export/exporthtml.php b/export/exporthtml.php index d002712..a4748a3 100644 --- a/export/exporthtml.php +++ b/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 . -/* +/** * 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(); diff --git a/export/exporthtml_hangman.php b/export/exporthtml_hangman.php index dbc3bab..0e6f4dc 100644 --- a/export/exporthtml_hangman.php +++ b/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 . -/* +/** * 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(); diff --git a/export/exporthtml_millionaire.php b/export/exporthtml_millionaire.php index cf91793..5b7085b 100644 --- a/export/exporthtml_millionaire.php +++ b/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(); diff --git a/export/exporthtml_snakes.php b/export/exporthtml_snakes.php index d63aa0d..5e27f06 100644 --- a/export/exporthtml_snakes.php +++ b/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 . -/* +/** * 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(); diff --git a/export/exportjavame.php b/export/exportjavame.php index c54e06e..f919cb4 100644 --- a/export/exportjavame.php +++ b/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(); diff --git a/export/html/snakes/css/game.css b/export/html/snakes/css/game.css index be82a2e..a76885a 100644 --- a/export/html/snakes/css/game.css +++ b/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; diff --git a/export/html/snakes/css/snakes.css b/export/html/snakes/css/snakes.css index db54951..ead9604 100644 --- a/export/html/snakes/css/snakes.css +++ b/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,13 +79,16 @@ 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; } -.popup_block{ +.popup_block { display: none; /*--hidden by default--*/ background: #fff; padding: 20px; diff --git a/export/html/snakes/css/style.css b/export/html/snakes/css/style.css index 297ce3f..69a7dac 100644 --- a/export/html/snakes/css/style.css +++ b/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; } diff --git a/export/html/snakes/css/subModal.css b/export/html/snakes/css/subModal.css index 14cbef7..c6f5d05 100644 --- a/export/html/snakes/css/subModal.css +++ b/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; diff --git a/export/html/snakes/js/snakes-mod.js b/export/html/snakes/js/snakes-mod.js index e223958..aef5213 100644 --- a/export/html/snakes/js/snakes-mod.js +++ b/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; @@ -105,9 +111,9 @@ function paintBoard(a) { document.getElementById("cont").style.width = (a * 52 + 52) + "px" document.getElementById("cont").innerHTML = data; - $("#cont").slideDown("slow"); - $("#cont").effect("shake",3000); - $("img:hidden").fadeIn(5000); + $("#cont").slideDown( "slow"); + $("#cont").effect( "shake",3000); + $("img:hidden").fadeIn( 5000); if (a == 6) { registerSnake(158, 196, "img1", 14, 3, 0); @@ -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). diff --git a/hangman/play.php b/hangman/play.php index 630ec33..680d33a 100644 --- a/hangman/play.php +++ b/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 . -// 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(); diff --git a/headergame.php b/headergame.php index 842dc6c..65e9fe5 100644 --- a/headergame.php +++ b/headergame.php @@ -14,6 +14,13 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * 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'); diff --git a/hiddenpicture/picture.php b/hiddenpicture/picture.php index 0b319c9..1331864 100644 --- a/hiddenpicture/picture.php +++ b/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 . +/** + * 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(); diff --git a/hiddenpicture/play.php b/hiddenpicture/play.php index 2761b71..ccf956b 100644 --- a/hiddenpicture/play.php +++ b/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 . -// 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(); diff --git a/index.php b/index.php index 528218e..8b52b41 100644 --- a/index.php +++ b/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"); diff --git a/lib.php b/lib.php index daa7c6e..0368fb3 100644 --- a/lib.php +++ b/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. diff --git a/locallib.php b/locallib.php index e0d49ad..58c638c 100644 --- a/locallib.php +++ b/locallib.php @@ -14,6 +14,14 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +/** + * 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. diff --git a/millionaire/play.php b/millionaire/play.php index e202f96..81e57f8 100644 --- a/millionaire/play.php +++ b/millionaire/play.php @@ -15,11 +15,12 @@ // along with Moodle. If not, see . /** - * 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(); diff --git a/preview.php b/preview.php index 33c16e2..b951b6c 100644 --- a/preview.php +++ b/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(); diff --git a/print.php b/print.php index 64a3f00..671f0fd 100644 --- a/print.php +++ b/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"); diff --git a/report/default.php b/report/default.php index 1d736ee..1e2bd71 100644 --- a/report/default.php +++ b/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 { diff --git a/report/overview/report.php b/report/overview/report.php index 5b60c53..8210d9f 100644 --- a/report/overview/report.php +++ b/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'); diff --git a/settings.php b/settings.php index a0b110f..c005663 100644 --- a/settings.php +++ b/settings.php @@ -17,11 +17,10 @@ /** * Form for creating and modifying a game * - * @package game - * @author Vasilis Daloukas - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @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) { diff --git a/showanswers.php b/showanswers.php index e499196..6b8152f 100644 --- a/showanswers.php +++ b/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"); diff --git a/showattempts.php b/showattempts.php index 45be850..5b35bee 100644 --- a/showattempts.php +++ b/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(); diff --git a/snakes/createboard.php b/snakes/createboard.php index 74bc2b0..bb7a916 100644 --- a/snakes/createboard.php +++ b/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; diff --git a/snakes/play.php b/snakes/play.php index 8daaf7e..0555a6e 100644 --- a/snakes/play.php +++ b/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); diff --git a/sudoku/class.Sudoku.php b/sudoku/class.Sudoku.php index 69fe3ea..02ed3d0 100644 --- a/sudoku/class.Sudoku.php +++ b/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). diff --git a/sudoku/create.php b/sudoku/create.php index 3929535..ad5f770 100644 --- a/sudoku/create.php +++ b/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 . +/** + * 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'); diff --git a/sudoku/export.php b/sudoku/export.php index 609fa98..d201701 100644 --- a/sudoku/export.php +++ b/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 . +/** + * 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(); diff --git a/sudoku/play.php b/sudoku/play.php index 60491e6..745fe91 100644 --- a/sudoku/play.php +++ b/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 . +/** + * 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"); diff --git a/tabs.php b/tabs.php index 27118ea..7574ad1 100644 --- a/tabs.php +++ b/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)) { diff --git a/translate.php b/translate.php index 12ef31b..6320205 100644 --- a/translate.php +++ b/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(); diff --git a/version.php b/version.php index a6443ee..71a38a2 100644 --- a/version.php +++ b/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;