From 249309e65d62f17af68a71a3c8fbf940c1957c4d Mon Sep 17 00:00:00 2001 From: bdaloukas Date: Sat, 17 Jun 2017 15:49:44 +0300 Subject: [PATCH] phpdocs compatibility --- backup/moodle2/backup_game_stepslib.php | 3 + .../restore_game_activity_task.class.php | 7 +- classes/event/course_module_viewed.php | 3 + cross/cross_class.php | 39 +++++------ cross/crossdb_class.php | 6 +- cross/play.php | 10 +-- cryptex/cryptexdb_class.php | 10 +-- db/access.php | 5 +- export.php | 14 ++++ export/html/snakes/css/subModal.css | 2 - export/html/snakes/js/snakes-mod.js | 69 ++++++------------- version.php | 4 +- 12 files changed, 80 insertions(+), 92 deletions(-) diff --git a/backup/moodle2/backup_game_stepslib.php b/backup/moodle2/backup_game_stepslib.php index 023fc10..09744b0 100644 --- a/backup/moodle2/backup_game_stepslib.php +++ b/backup/moodle2/backup_game_stepslib.php @@ -25,6 +25,9 @@ /** * Define the complete game structure for backup, with file and id annotations + * + * @copyright 2007 Vasilis Daloukas + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); diff --git a/backup/moodle2/restore_game_activity_task.class.php b/backup/moodle2/restore_game_activity_task.class.php index f121444..6777cae 100644 --- a/backup/moodle2/restore_game_activity_task.class.php +++ b/backup/moodle2/restore_game_activity_task.class.php @@ -17,7 +17,8 @@ /** * @package mod_game * @subpackage backup-moodle2 - * @author bdaloukas + * @copyright 2007 Vasilis Daloukas + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); @@ -107,8 +108,10 @@ class restore_game_activity_task extends restore_activity_task { return $rules; } + /** + * Do something at end of restore. + */ public function after_restore() { - // Do something at end of restore. global $DB; // Get the blockid. diff --git a/classes/event/course_module_viewed.php b/classes/event/course_module_viewed.php index fa6e24e..b8c77cb 100644 --- a/classes/event/course_module_viewed.php +++ b/classes/event/course_module_viewed.php @@ -55,6 +55,9 @@ class course_module_viewed extends \core\event\course_module_viewed { return $event; } + /** + * Create instance of event. + */ public static function played(\stdClass $game, \context_module $context) { $data = array( 'context' => $context, diff --git a/cross/cross_class.php b/cross/cross_class.php index 039892c..8d1e31d 100644 --- a/cross/cross_class.php +++ b/cross/cross_class.php @@ -171,7 +171,7 @@ class Cross * Compute one crossword. * * @param stdClass crossm - * @param stdClass crossm + * @param stdClass crossd * @param string $letters * @param int minwords * @param int maxwords @@ -223,7 +223,7 @@ class Cross * @param int $ctries * @param int $minwords * @param int $maxwords - * @param int &$nochange + * @param int $nochange * * @return \moodle_url */ @@ -322,11 +322,10 @@ class Cross * @param int $n22 * @param int $n2222 * @param int $nwords - * @param int @$nconnectors - * @param int @$nfilleds - * @param int @$cspaces + * @param int $nconnectors + * @param int $nfilleds + * @param int $cspaces * @param stdClass $crossword - * @param array reps * * @return \moodle_url */ @@ -439,10 +438,10 @@ class Cross /** * Save the crossword to database. * - * @param array &$crossm - * @param array &$crossd - * @param int ctries - * @param int time + * @param array $crossm + * @param array $crossd + * @param int $ctries + * @param int $time */ public function savepuzzle( &$crossm, &$crossd, $ctries, $time) { $n22 = $this->mbestn20 + 2; @@ -571,13 +570,13 @@ class Cross * @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 string $puzzle + * @param array $words + * @param $magics + * @param $poss + * @param $ccrosspos + * @param $crossdir + * @param $crosssword * @param int $n20 * * @return true if it is ok. @@ -711,8 +710,8 @@ class Cross * my_preg_match (backward compatibility). * * @param $w - * @param @words - * @param &$word + * @param $words + * @param $word * * @return true if it is ok. */ @@ -745,7 +744,7 @@ class Cross /** * Set a char to the specified position. * - * @param @$s + * @param $s * @param int $pos * @param char $char */ diff --git a/cross/crossdb_class.php b/cross/crossdb_class.php index c78c6eb..01f6b7f 100644 --- a/cross/crossdb_class.php +++ b/cross/crossdb_class.php @@ -102,8 +102,8 @@ class CrossDB extends Cross { * @param stdClass $crossrec * @param boolean $onlyshow * @param boolean $showsolution - * @param finishattempt - * @param boolean $htmlsolutions + * @param $finishattempt + * @param boolean $showhtmlsolutions * @param string $language * @param boolean $showstudentguess * @param stdClass $context @@ -252,7 +252,7 @@ class CrossDB extends Cross { * @param stdClass $game * @param stdClass $attempt * @param stdClass $crossrec - * @param boolean loadfromdb + * @param boolean $loadfromdb */ public function updatecrossquestions( &$rec, &$g, &$pos, &$correctletters, &$wrongletters, &$restletters, $game, $attempt, $crossrec, $loadfromdb) { diff --git a/cross/play.php b/cross/play.php index 0c980a9..3f7cf9e 100644 --- a/cross/play.php +++ b/cross/play.php @@ -37,7 +37,7 @@ require( "crossdb_class.php"); * @param stdClass $cross * @param string $g * @param boolean $endofgame - * param stdClass $context + * @param stdClass $context */ function game_cross_continue( $id, $game, $attempt, $cross, $g, $endofgame, $context) { if ($endofgame) { @@ -1159,8 +1159,6 @@ if ($game->param3 == 2) { /** * Shows welcome message 1. - * - * @param stdClass $game */ function game_cross_show_welcome1() { ?> @@ -1200,13 +1198,7 @@ function game_cross_show_welcome1() { /** * Show the legend (horizontal and vertical) * - * @param int $id - * @param stdClass $game - * @param stdClass $attempt * @param stdClass $cross - * @param string $g - * @param boolean $endofgame - * param stdClass $context */ function game_cross_show_legends( $cross) { ShowLegend( $cross->mlegendh, get_string( 'cross_across', 'game')); diff --git a/cryptex/cryptexdb_class.php b/cryptex/cryptexdb_class.php index 9e27f98..b24d474 100644 --- a/cryptex/cryptexdb_class.php +++ b/cryptex/cryptexdb_class.php @@ -38,7 +38,7 @@ class CryptexDB extends CrossDB { * @param stdClass $game * @param array $crossm * @param array $crossd - * @param int id + * @param int $id * @param $letters * * @return the saved record @@ -170,7 +170,7 @@ class CryptexDB extends CrossDB { * @param $cols * @param $rows * @param $char - * @param int &$spaces + * @param int $spaces */ public function insertchar( &$letters, $cols, $rows, $char, &$spaces) { $len = game_strlen( $letters); @@ -190,7 +190,7 @@ class CryptexDB extends CrossDB { * @param $cols * @param $rows * @param $char - * @param int &$spaces + * @param int $spaces */ public function insertchars( &$letters, $cols, $rows, $char, &$spaces) { $len = game_strlen( $letters); @@ -286,7 +286,7 @@ class CryptexDB extends CrossDB { } /** - * Calss the setwords of class Cross. + * Calls the setwords of class Cross. * * @param $answers * @param $maxcols @@ -299,7 +299,7 @@ class CryptexDB extends CrossDB { } /** - * Calss the computedata of class Cross. + * Calls the computedata of class Cross. * * @param $crossm * @param $crossd diff --git a/db/access.php b/db/access.php index cd379e6..bd40a9a 100644 --- a/db/access.php +++ b/db/access.php @@ -14,8 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -defined('MOODLE_INTERNAL') || die(); - /* * Plugin capabilities * @@ -23,6 +21,9 @@ defined('MOODLE_INTERNAL') || die(); * @copyright 2007 Vasilis Daloukas * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ + +defined('MOODLE_INTERNAL') || die(); + $capabilities = array( // Ability to see that the game exists, and the basic information about it, for example the start date and time limit. diff --git a/export.php b/export.php index 39043d0..c7fcc55 100644 --- a/export.php +++ b/export.php @@ -39,6 +39,13 @@ if (!has_capability('mod/game:viewreports', $context)) { $target = optional_param('target', "", PARAM_ALPHANUM); // The target is HTML or JavaMe. +/** + * The mod_game_exporthtml_form show the export form. + * + * @package mod_game + * @copyright 2007 Vasilis Daloukas + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class mod_game_exporthtml_form extends moodleform { /** @@ -152,6 +159,13 @@ class mod_game_exporthtml_form extends moodleform { } } +/** + * The mod_game_exportjavame_form show the export form. + * + * @package mod_game + * @copyright 2007 Vasilis Daloukas + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class mod_game_exportjavame_form extends moodleform { /** diff --git a/export/html/snakes/css/subModal.css b/export/html/snakes/css/subModal.css index 4a43469..305ddb8 100644 --- a/export/html/snakes/css/subModal.css +++ b/export/html/snakes/css/subModal.css @@ -14,7 +14,6 @@ * I find setting the color in the css gives me more flexibility * than the PNG solution. */ - background-color: transparent !important; background-color: #333; /* this hack is for opera support * you can uncomment the background-image if you don't care about opera. @@ -68,6 +67,5 @@ #popupControls { float: right; - cursor: pointer; cursor: hand; } diff --git a/export/html/snakes/js/snakes-mod.js b/export/html/snakes/js/snakes-mod.js index 207eec7..45e946a 100644 --- a/export/html/snakes/js/snakes-mod.js +++ b/export/html/snakes/js/snakes-mod.js @@ -108,31 +108,31 @@ function paintBoard( a) { currentblock -= (a + 1); } } - document.getElementById("cont").style.width = (a * 52 + 52) + "px" + 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); - registerSnake( 62, 183, "img2", 27, 24, 1); - registerSnake( 175, 18, "img3", 18, 4, 2); - registerSnake( 10, 45, "img4", 32, 23, 3); - - registerLadder( 27, 132, "lad1", 28, 34, 0); - registerLadder( 90, 22, "lad2", 19, 30, 1); - registerLadder( 179, 137, "lad3", 2, 16, 2); + registerSnake(158, 196, "img1", 14, 3, 0); + registerSnake(62, 183, "img2", 27, 24, 1); + registerSnake(175, 18, "img3", 18, 4, 2); + registerSnake(10, 45, "img4", 32, 23, 3); + + registerLadder(27, 132, "lad1", 28, 34, 0); + registerLadder(90, 22, "lad2", 19, 30, 1); + registerLadder(179, 137, "lad3", 2, 16, 2); } else if (a == 8) { - registerSnake( 300, 380, "img1", 44, 29, 0); - registerSnake( 180, 550, "img2", 51, 46, 1); - registerSnake( 290, 50, "img3", 41, 40, 2); - registerSnake( 500, 280, "img4", 27, 22, 3); - - registerLadder( 350, 515, "lad1", 19, 35, 0); - registerLadder( 180, 230, "lad2", 43, 54, 1); - registerLadder( 80, 350, "lad3", 53, 60, 2); + registerSnake(300, 380, "img1", 44, 29, 0); + registerSnake(180, 550, "img2", 51, 46, 1); + registerSnake(290, 50, "img3", 41, 40, 2); + registerSnake(500, 280, "img4", 27, 22, 3); + + registerLadder(350, 515, "lad1", 19, 35, 0); + registerLadder(180, 230, "lad2", 43, 54, 1); + registerLadder(80, 350, "lad3", 53, 60, 2); } } @@ -189,7 +189,7 @@ function laddercheck(k) { break; } } - if(!checkWin(k)) { + if (!checkWin(k)) { alert("You have won!"); } } @@ -210,31 +210,6 @@ function registerLadder(tp, lft, dv, src, dest, i) { laddest[i] = dest; } -// The below function checks the change in the boardtype selection combobox. -function selectBoard() { - totblocks = 0; - data = ""; - currentblock = 0; - - hideAll(); - if (document.getElementById("boardtype").value != null) { - paintBoard(parseInt(document.getElementById("boardtype").value)); - } -} - -// The below function checks the change in the player selection combobox. -function selectPlayer() { - if (document.getElementById("players").value != null) { - user[document.getElementById("players").value - 1] = 0; - tots[document.getElementById("players").value - 1] = 0; - lastposition[document.getElementById("players").value - 1] = 0; - for(var j = 0; j < lastposition.length; j++) { - lastposition[j] = 0; - tots[j] = 0; - } - } -} - // The below function starts the play. function play() { if (tots[l] != null) { @@ -298,7 +273,7 @@ function question() { coranswered.concat(quest.splice(picked * 4, 4)); } else { - alert("Η απάντηση δεν ήταν σωστή. Χάνεις τη σειρά σου για αυτό το γύρο!") + alert("Η απάντηση δεν ήταν σωστή. Χάνεις τη σειρά σου για αυτό το γύρο!"); wroanswered.concat(quest.splice(picked * 4, 4)); } diff --git a/version.php b/version.php index 3b240bc..c5626b4 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 = 2017061604; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2017061701; // 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-13'; +$plugin->release = '2017-06-17'; if ($useplugin != 2) { $module = $plugin;