Browse Source

phpdocs compatibility

MOODLE_20_STABLE
bdaloukas 8 years ago
parent
commit
249309e65d
  1. 3
      backup/moodle2/backup_game_stepslib.php
  2. 7
      backup/moodle2/restore_game_activity_task.class.php
  3. 3
      classes/event/course_module_viewed.php
  4. 39
      cross/cross_class.php
  5. 6
      cross/crossdb_class.php
  6. 10
      cross/play.php
  7. 10
      cryptex/cryptexdb_class.php
  8. 5
      db/access.php
  9. 14
      export.php
  10. 2
      export/html/snakes/css/subModal.css
  11. 69
      export/html/snakes/js/snakes-mod.js
  12. 4
      version.php

3
backup/moodle2/backup_game_stepslib.php

@ -25,6 +25,9 @@
/** /**
* Define the complete game structure for backup, with file and id annotations * 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(); defined('MOODLE_INTERNAL') || die();

7
backup/moodle2/restore_game_activity_task.class.php

@ -17,7 +17,8 @@
/** /**
* @package mod_game * @package mod_game
* @subpackage backup-moodle2 * @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(); defined('MOODLE_INTERNAL') || die();
@ -107,8 +108,10 @@ class restore_game_activity_task extends restore_activity_task {
return $rules; return $rules;
} }
/**
* Do something at end of restore.
*/
public function after_restore() { public function after_restore() {
// Do something at end of restore.
global $DB; global $DB;
// Get the blockid. // Get the blockid.

3
classes/event/course_module_viewed.php

@ -55,6 +55,9 @@ class course_module_viewed extends \core\event\course_module_viewed {
return $event; return $event;
} }
/**
* Create instance of event.
*/
public static function played(\stdClass $game, \context_module $context) { public static function played(\stdClass $game, \context_module $context) {
$data = array( $data = array(
'context' => $context, 'context' => $context,

39
cross/cross_class.php

@ -171,7 +171,7 @@ class Cross
* Compute one crossword. * Compute one crossword.
* *
* @param stdClass crossm * @param stdClass crossm
* @param stdClass crossm * @param stdClass crossd
* @param string $letters * @param string $letters
* @param int minwords * @param int minwords
* @param int maxwords * @param int maxwords
@ -223,7 +223,7 @@ class Cross
* @param int $ctries * @param int $ctries
* @param int $minwords * @param int $minwords
* @param int $maxwords * @param int $maxwords
* @param int &$nochange * @param int $nochange
* *
* @return \moodle_url * @return \moodle_url
*/ */
@ -322,11 +322,10 @@ class Cross
* @param int $n22 * @param int $n22
* @param int $n2222 * @param int $n2222
* @param int $nwords * @param int $nwords
* @param int @$nconnectors * @param int $nconnectors
* @param int @$nfilleds * @param int $nfilleds
* @param int @$cspaces * @param int $cspaces
* @param stdClass $crossword * @param stdClass $crossword
* @param array reps
* *
* @return \moodle_url * @return \moodle_url
*/ */
@ -439,10 +438,10 @@ class Cross
/** /**
* Save the crossword to database. * Save the crossword to database.
* *
* @param array &$crossm * @param array $crossm
* @param array &$crossd * @param array $crossd
* @param int ctries * @param int $ctries
* @param int time * @param int $time
*/ */
public function savepuzzle( &$crossm, &$crossd, $ctries, $time) { public function savepuzzle( &$crossm, &$crossd, $ctries, $time) {
$n22 = $this->mbestn20 + 2; $n22 = $this->mbestn20 + 2;
@ -571,13 +570,13 @@ class Cross
* @param int $pos * @param int $pos
* @param int $dir * @param int $dir
* @param int $valblanc * @param int $valblanc
* @param string &$puzzle * @param string $puzzle
* @param array &$words * @param array $words
* @param &$magics * @param $magics
* @param poss * @param $poss
* @param #ccrosspos * @param $ccrosspos
* @param crossdir * @param $crossdir
* @param crosssword * @param $crosssword
* @param int $n20 * @param int $n20
* *
* @return true if it is ok. * @return true if it is ok.
@ -711,8 +710,8 @@ class Cross
* my_preg_match (backward compatibility). * my_preg_match (backward compatibility).
* *
* @param $w * @param $w
* @param @words * @param $words
* @param &$word * @param $word
* *
* @return true if it is ok. * @return true if it is ok.
*/ */
@ -745,7 +744,7 @@ class Cross
/** /**
* Set a char to the specified position. * Set a char to the specified position.
* *
* @param @$s * @param $s
* @param int $pos * @param int $pos
* @param char $char * @param char $char
*/ */

6
cross/crossdb_class.php

@ -102,8 +102,8 @@ class CrossDB extends Cross {
* @param stdClass $crossrec * @param stdClass $crossrec
* @param boolean $onlyshow * @param boolean $onlyshow
* @param boolean $showsolution * @param boolean $showsolution
* @param finishattempt * @param $finishattempt
* @param boolean $htmlsolutions * @param boolean $showhtmlsolutions
* @param string $language * @param string $language
* @param boolean $showstudentguess * @param boolean $showstudentguess
* @param stdClass $context * @param stdClass $context
@ -252,7 +252,7 @@ class CrossDB extends Cross {
* @param stdClass $game * @param stdClass $game
* @param stdClass $attempt * @param stdClass $attempt
* @param stdClass $crossrec * @param stdClass $crossrec
* @param boolean loadfromdb * @param boolean $loadfromdb
*/ */
public function updatecrossquestions( &$rec, &$g, &$pos, &$correctletters, &$wrongletters, public function updatecrossquestions( &$rec, &$g, &$pos, &$correctletters, &$wrongletters,
&$restletters, $game, $attempt, $crossrec, $loadfromdb) { &$restletters, $game, $attempt, $crossrec, $loadfromdb) {

10
cross/play.php

@ -37,7 +37,7 @@ require( "crossdb_class.php");
* @param stdClass $cross * @param stdClass $cross
* @param string $g * @param string $g
* @param boolean $endofgame * @param boolean $endofgame
* param stdClass $context * @param stdClass $context
*/ */
function game_cross_continue( $id, $game, $attempt, $cross, $g, $endofgame, $context) { function game_cross_continue( $id, $game, $attempt, $cross, $g, $endofgame, $context) {
if ($endofgame) { if ($endofgame) {
@ -1159,8 +1159,6 @@ if ($game->param3 == 2) {
/** /**
* Shows welcome message 1. * Shows welcome message 1.
*
* @param stdClass $game
*/ */
function game_cross_show_welcome1() { function game_cross_show_welcome1() {
?> ?>
@ -1200,13 +1198,7 @@ function game_cross_show_welcome1() {
/** /**
* Show the legend (horizontal and vertical) * Show the legend (horizontal and vertical)
* *
* @param int $id
* @param stdClass $game
* @param stdClass $attempt
* @param stdClass $cross * @param stdClass $cross
* @param string $g
* @param boolean $endofgame
* param stdClass $context
*/ */
function game_cross_show_legends( $cross) { function game_cross_show_legends( $cross) {
ShowLegend( $cross->mlegendh, get_string( 'cross_across', 'game')); ShowLegend( $cross->mlegendh, get_string( 'cross_across', 'game'));

10
cryptex/cryptexdb_class.php

@ -38,7 +38,7 @@ class CryptexDB extends CrossDB {
* @param stdClass $game * @param stdClass $game
* @param array $crossm * @param array $crossm
* @param array $crossd * @param array $crossd
* @param int id * @param int $id
* @param $letters * @param $letters
* *
* @return the saved record * @return the saved record
@ -170,7 +170,7 @@ class CryptexDB extends CrossDB {
* @param $cols * @param $cols
* @param $rows * @param $rows
* @param $char * @param $char
* @param int &$spaces * @param int $spaces
*/ */
public function insertchar( &$letters, $cols, $rows, $char, &$spaces) { public function insertchar( &$letters, $cols, $rows, $char, &$spaces) {
$len = game_strlen( $letters); $len = game_strlen( $letters);
@ -190,7 +190,7 @@ class CryptexDB extends CrossDB {
* @param $cols * @param $cols
* @param $rows * @param $rows
* @param $char * @param $char
* @param int &$spaces * @param int $spaces
*/ */
public function insertchars( &$letters, $cols, $rows, $char, &$spaces) { public function insertchars( &$letters, $cols, $rows, $char, &$spaces) {
$len = game_strlen( $letters); $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 $answers
* @param $maxcols * @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 $crossm
* @param $crossd * @param $crossd

5
db/access.php

@ -14,8 +14,6 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
defined('MOODLE_INTERNAL') || die();
/* /*
* Plugin capabilities * Plugin capabilities
* *
@ -23,6 +21,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2007 Vasilis Daloukas * @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
defined('MOODLE_INTERNAL') || die();
$capabilities = array( $capabilities = array(
// Ability to see that the game exists, and the basic information about it, for example the start date and time limit. // Ability to see that the game exists, and the basic information about it, for example the start date and time limit.

14
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. $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 { 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 { class mod_game_exportjavame_form extends moodleform {
/** /**

2
export/html/snakes/css/subModal.css

@ -14,7 +14,6 @@
* I find setting the color in the css gives me more flexibility * I find setting the color in the css gives me more flexibility
* than the PNG solution. * than the PNG solution.
*/ */
background-color: transparent !important;
background-color: #333; background-color: #333;
/* this hack is for opera support /* this hack is for opera support
* you can uncomment the background-image if you don't care about opera. * you can uncomment the background-image if you don't care about opera.
@ -68,6 +67,5 @@
#popupControls { #popupControls {
float: right; float: right;
cursor: pointer;
cursor: hand; cursor: hand;
} }

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

@ -108,31 +108,31 @@ function paintBoard( a) {
currentblock -= (a + 1); 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; document.getElementById("cont").innerHTML = data;
$( "#cont").slideDown( "slow"); $("#cont").slideDown("slow");
$( "#cont").effect( "shake", 3000); $("#cont").effect("shake", 3000);
$( "img:hidden").fadeIn( 5000); $("img:hidden").fadeIn( 5000);
if (a == 6) { if (a == 6) {
registerSnake( 158, 196, "img1", 14, 3, 0); registerSnake(158, 196, "img1", 14, 3, 0);
registerSnake( 62, 183, "img2", 27, 24, 1); registerSnake(62, 183, "img2", 27, 24, 1);
registerSnake( 175, 18, "img3", 18, 4, 2); registerSnake(175, 18, "img3", 18, 4, 2);
registerSnake( 10, 45, "img4", 32, 23, 3); registerSnake(10, 45, "img4", 32, 23, 3);
registerLadder( 27, 132, "lad1", 28, 34, 0); registerLadder(27, 132, "lad1", 28, 34, 0);
registerLadder( 90, 22, "lad2", 19, 30, 1); registerLadder(90, 22, "lad2", 19, 30, 1);
registerLadder( 179, 137, "lad3", 2, 16, 2); registerLadder(179, 137, "lad3", 2, 16, 2);
} else if (a == 8) { } else if (a == 8) {
registerSnake( 300, 380, "img1", 44, 29, 0); registerSnake(300, 380, "img1", 44, 29, 0);
registerSnake( 180, 550, "img2", 51, 46, 1); registerSnake(180, 550, "img2", 51, 46, 1);
registerSnake( 290, 50, "img3", 41, 40, 2); registerSnake(290, 50, "img3", 41, 40, 2);
registerSnake( 500, 280, "img4", 27, 22, 3); registerSnake(500, 280, "img4", 27, 22, 3);
registerLadder( 350, 515, "lad1", 19, 35, 0); registerLadder(350, 515, "lad1", 19, 35, 0);
registerLadder( 180, 230, "lad2", 43, 54, 1); registerLadder(180, 230, "lad2", 43, 54, 1);
registerLadder( 80, 350, "lad3", 53, 60, 2); registerLadder(80, 350, "lad3", 53, 60, 2);
} }
} }
@ -189,7 +189,7 @@ function laddercheck(k) {
break; break;
} }
} }
if(!checkWin(k)) { if (!checkWin(k)) {
alert("You have won!"); alert("You have won!");
} }
} }
@ -210,31 +210,6 @@ function registerLadder(tp, lft, dv, src, dest, i) {
laddest[i] = dest; 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. // The below function starts the play.
function play() { function play() {
if (tots[l] != null) { if (tots[l] != null) {
@ -298,7 +273,7 @@ function question() {
coranswered.concat(quest.splice(picked * 4, 4)); coranswered.concat(quest.splice(picked * 4, 4));
} else { } else {
alert("Η απάντηση δεν ήταν σωστή. Χάνεις τη σειρά σου για αυτό το γύρο!") alert("Η απάντηση δεν ήταν σωστή. Χάνεις τη σειρά σου για αυτό το γύρο!");
wroanswered.concat(quest.splice(picked * 4, 4)); wroanswered.concat(quest.splice(picked * 4, 4));
} }

4
version.php

@ -35,10 +35,10 @@ if (!isset( $plugin)) {
} }
$plugin->component = 'mod_game'; // Full name of the plugin (used for diagnostics). $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->requires = 2010112400; // Requires Moodle 2.0.
$plugin->cron = 0; // Period for cron to check this module (secs). $plugin->cron = 0; // Period for cron to check this module (secs).
$plugin->release = '2017-06-13'; $plugin->release = '2017-06-17';
if ($useplugin != 2) { if ($useplugin != 2) {
$module = $plugin; $module = $plugin;

Loading…
Cancel
Save