Browse Source

phpdocs compatibility

MOODLE_20_STABLE
bdaloukas 8 years ago
parent
commit
6ee163b73e
  1. 6
      backup/moodle2/backup_game_activity_task.class.php
  2. 7
      backup/moodle2/backup_game_stepslib.php
  3. 5
      backup/moodle2/restore_game_stepslib.php
  4. 1
      bookquiz/play.php
  5. 8
      classes/event/course_module_instance_list_viewed.php
  6. 53
      cross/cross_class.php
  7. 66
      cross/crossdb_class.php
  8. 19
      cross/play.php
  9. 3
      export/html/snakes/css/modal.css
  10. 6
      export/html/snakes/css/subModal.css
  11. 48
      export/html/snakes/js/snakes-mod.js
  12. 14
      snakes/play.php
  13. 2
      sudoku/class.Sudoku.php
  14. 1
      sudoku/play.php
  15. 4
      version.php

6
backup/moodle2/backup_game_activity_task.class.php

@ -28,10 +28,10 @@ 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_stepslib.php'); // Because it exists (must).
/** /**
* Defines backup_game_activity_task class * Fame backup task that provides all the settings and steps to perform one complete backup of the activity
* *
* game backup task that provides all the settings and steps to perform one * @copyright 2007 Vasilis Daloukas
* complete backup of the activity * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
class backup_game_activity_task extends backup_activity_task { class backup_game_activity_task extends backup_activity_task {

7
backup/moodle2/backup_game_stepslib.php

@ -19,8 +19,8 @@
* *
* @package mod_game * @package mod_game
* @subpackage backup-moodle2 * @subpackage backup-moodle2
* @author bdaloukas * @copyright 2007 Vasilis Daloukas
backup_game_settingslib.php * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
/** /**
@ -29,6 +29,9 @@ backup_game_settingslib.php
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
/**
* Define the complete game structure for backup, with file and id annotations
*/
class backup_game_activity_structure_step extends backup_activity_structure_step { class backup_game_activity_structure_step extends backup_activity_structure_step {
/** /**

5
backup/moodle2/restore_game_stepslib.php

@ -19,7 +19,8 @@
* *
* @package mod_game * @package mod_game
* @subpackage backup-moodle2 * @subpackage backup-moodle2
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @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();
@ -102,7 +103,7 @@ class restore_game_activity_structure_step extends restore_activity_structure_st
/** /**
* Restores the game_export_javame table. * Restores the game_export_javame table.
* *
* @param stdClass $game * @param stdClass $data
*/ */
protected function process_game_export_javame( $data) { protected function process_game_export_javame( $data) {
global $DB; global $DB;

1
bookquiz/play.php

@ -30,7 +30,6 @@ defined('MOODLE_INTERNAL') || die();
* @param stdClass $game * @param stdClass $game
* @param stdClass $attempt * @param stdClass $attempt
* @param stdClass $bookquiz * @param stdClass $bookquiz
* @param int $bookquizid
* @param int $chapterid * @param int $chapterid
* @param stdClass $context * @param stdClass $context
*/ */

8
classes/event/course_module_instance_list_viewed.php

@ -27,14 +27,6 @@
namespace mod_game\event; namespace mod_game\event;
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
/*
* 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
*/
/** /**
* The mod_game instance list viewed event class. * The mod_game instance list viewed event class.
* *

53
cross/cross_class.php

@ -43,42 +43,61 @@ Author Àngel Fenoy from Arenys de Mar, Barcelona.
*/ */
class Cross class Cross
{ {
public $minputanswers; // Contains the words and the answers. /** @var int Contains the words and the answers. */
public $mwords; // The words that will be used. public $minputanswers; //
/** @var The words that will be used. */
public $mwords;
/** @var Time limit for computing the cross */
public $mtimelimit = 3; public $mtimelimit = 3;
// Computed by computenextcross. // Computed by computenextcross.
public $mbestcrosspos; // The best puzzle. /** @var Best score post */
public $mbestcrossdir; // The best puzzle. public $mbestcrosspos;
public $mbestcrossword; // The best puzzle. /** @var Best score dir */
public $mbestcrossdir;
/** @var Best score crossword */
public $mbestcrossword;
/** @var Best puzzle */
public $mbestpuzzle; public $mbestpuzzle;
public $mbests; // The best score as a phrase. /** @var The best score as a phrase. */
public $mbestscore; // The best score. public $mbests;
/** @var The best score */
public $mbestscore;
/** @var The best connectors */
public $mbestconnectors; public $mbestconnectors;
/** @var The best filleds */
public $mbestfilleds; public $mbestfilleds;
/** @var The best spaces */
public $mbestspaces; public $mbestspaces;
/** @var The best n20 */
public $mbestn20; public $mbestn20;
// Computepuzzleinfo. /** @var Computed by ComputePuzzleInfo. */
public $mmincol; // Computed by ComputePuzzleInfo. public $mmincol;
public $mmaxcol; // Computed by ComputePuzzleInfo. /** @var Computed by ComputePuzzleInfo. */
public $mminrow; // Computed by ComputePuzzleInfo. public $mmaxcol;
public $mmaxrow; // Computed by ComputePuzzleInfo. /** @var Computed by ComputePuzzleInfo. */
public $mcletter; // Computed by ComputePuzzleInfo. public $mminrow;
public $mreps; // Repetition of each word. /** @var Computed by ComputePuzzleInfo. */
public $maveragereps; // Average of repetitions. public $mmaxrow;
/** @var Computed by ComputePuzzleInfo. */
public $mcletter;
/** @var Repetition of each word. */
public $mreps;
/** @var Average of repetitions. */
public $maveragereps;
/** /**
* Set words for computing. * Set words for computing.
* *
* @param array $answers * @param array $answers
* @param int $maxcols * @param int $maxcols
* @param array reps * @param array $reps
* *
* @return \moodle_url * @return moodle_url
*/ */
public function setwords( $answers, $maxcols, $reps) { public function setwords( $answers, $maxcols, $reps) {
$this->mreps = array(); $this->mreps = array();

66
cross/crossdb_class.php

@ -16,6 +16,14 @@
// 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/>.
/**
* CrossDB class
*
* @package mod_game
* @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();
/* /*
@ -28,6 +36,14 @@ defined('MOODLE_INTERNAL') || die();
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
class CrossDB extends Cross { class CrossDB extends Cross {
/**
* Save cross.
*
* @param stdClass $game
* @param array $crossm
* @param array $crossd
* @param int $id
*/
public function savecross( $game, &$crossm, $crossd, $id) { public function savecross( $game, &$crossm, $crossd, $id) {
global $DB, $USER; global $DB, $USER;
@ -58,6 +74,11 @@ class CrossDB extends Cross {
return true; return true;
} }
/**
* Delete records.
*
* @param int $id
*/
public function delete_records( $id) { public function delete_records( $id) {
global $DB; global $DB;
@ -70,6 +91,23 @@ class CrossDB extends Cross {
} }
/**
* Load cross.
*
* @param $g
* @param boolean $done
* @param string $html
* @param stdClass $game
* @param stdClass $attempt
* @param stdClass $crossrec
* @param boolean $onlyshow
* @param boolean $showsolution
* @param finishattempt
* @param boolean $htmlsolutions
* @param string $language
* @param boolean $showstudentguess
* @param stdClass $context
*/
public function loadcross( $g, &$done, &$html, $game, $attempt, $crossrec, $onlyshow, $showsolution, public function loadcross( $g, &$done, &$html, $game, $attempt, $crossrec, $onlyshow, $showsolution,
&$finishattempt, $showhtmlsolutions, &$language, $showstudentguess, $context) { &$finishattempt, $showhtmlsolutions, &$language, $showstudentguess, $context) {
global $DB; global $DB;
@ -133,6 +171,19 @@ class CrossDB extends Cross {
return $info; return $info;
} }
/**
* Compute check.
*
* @param int $correctletters
* @param int $wrongletters
* @param $restletters
* @param stdClass $game
* @param stdClass $attempt
* @param boolean $done
* @param boolean $onlyshow
* @param boolean $showsolution
* @param boolean $finishattempt
*/
public function game_cross_computecheck( $correctletters, $wrongletters, $restletters, $game, public function game_cross_computecheck( $correctletters, $wrongletters, $restletters, $game,
$attempt, &$done, $onlyshow, $showsolution, $finishattempt) { $attempt, &$done, $onlyshow, $showsolution, $finishattempt) {
@ -189,7 +240,20 @@ class CrossDB extends Cross {
return $ret; return $ret;
} }
// Rec is a record of cross_questions. /**
* Update cross questions.
*
* @param stdClass $rec (is a record of cross_questions).
* @param $g
* @param $pos
* @param int $correctletters
* @param int $wrongletters
* @param int $restletters
* @param stdClass $game
* @param stdClass $attempt
* @param stdClass $crossrec
* @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) {

19
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) {
@ -1097,6 +1097,11 @@ if ($showsolution == false) {
<?php <?php
} }
/**
* Shows welcome message.
*
* @param stdClass $game
*/
function game_cross_show_welcome( $game) { function game_cross_show_welcome( $game) {
if ($game->param3 <> 2) { if ($game->param3 <> 2) {
game_cross_show_welcome0( $game); game_cross_show_welcome0( $game);
@ -1105,6 +1110,11 @@ function game_cross_show_welcome( $game) {
} }
} }
/**
* Shows welcome message0.
*
* @param stdClass $game
*/
function game_cross_show_welcome0( $game) { function game_cross_show_welcome0( $game) {
?> ?>
<td valign="top" style="padding-left: 1em;"> <td valign="top" style="padding-left: 1em;">
@ -1147,6 +1157,11 @@ if ($game->param3 == 2) {
<?php <?php
} }
/**
* Shows welcome message 1.
*
* @param stdClass $game
*/
function game_cross_show_welcome1() { function game_cross_show_welcome1() {
?> ?>
<td valign="top" style="padding-left: 1em;"> <td valign="top" style="padding-left: 1em;">
@ -1191,7 +1206,7 @@ function game_cross_show_welcome1() {
* @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_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'));

3
export/html/snakes/css/modal.css

@ -19,7 +19,8 @@
float: left; float: left;
font-size: 1.2em; font-size: 1.2em;
position: fixed; position: fixed;
top: 50%; left: 50%; top: 50%;
left: 50%;
z-index: 99999; z-index: 99999;
/*--CSS3 Box Shadows--*/ /*--CSS3 Box Shadows--*/
-webkit-box-shadow: 0 0 20px #000; -webkit-box-shadow: 0 0 20px #000;

6
export/html/snakes/css/subModal.css

@ -31,7 +31,7 @@
z-index: 201; z-index: 201;
top: 0; top: 0;
left: 0; left: 0;
display:none; display: none;
padding: 0; padding: 0;
} }
#popupInner { #popupInner {
@ -40,7 +40,7 @@
} }
#popupFrame { #popupFrame {
margin: 0px; margin: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative; position: relative;
@ -62,7 +62,7 @@
} }
#popupTitle { #popupTitle {
float:left; float: left;
font-size: 1.1em; font-size: 1.1em;
} }

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

@ -49,8 +49,9 @@ for (;;) {
allQuest = z / 4; allQuest = z / 4;
function selectQuest(all) { function selectQuest(all) {
pickOne = Math.floor((Math.random() * all)); var pickone = Math.floor((Math.random() * all));
return pickOne;
return pickone;
} }
// The Below Function will hide all the snakes. // The Below Function will hide all the snakes.
@ -67,9 +68,8 @@ function hideAll() {
} }
// The Below Function will Render The Main Board. // The Below Function will Render The Main Board.
function paintBoard( a) {
function paintBoard(a) { var i, j;
var j;
totblocks = (a * a); totblocks = (a * a);
if ((a * a) % 2 == 0) { if ((a * a) % 2 == 0) {
@ -111,28 +111,28 @@ function paintBoard(a) {
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);
} }
} }

14
snakes/play.php

@ -30,7 +30,7 @@ defined('MOODLE_INTERNAL') || die();
* @param stdClass $game * @param stdClass $game
* @param stdClass $attempt * @param stdClass $attempt
* @param stdClass $snakes * @param stdClass $snakes
* @param stdClass $context * @param stdClass $context
*/ */
function game_snakes_continue( $id, $game, $attempt, $snakes, $context) { function game_snakes_continue( $id, $game, $attempt, $snakes, $context) {
if ($attempt != false and $snakes != false) { if ($attempt != false and $snakes != false) {
@ -66,7 +66,7 @@ function game_snakes_continue( $id, $game, $attempt, $snakes, $context) {
* @param stdClass $game * @param stdClass $game
* @param stdClass $attempt * @param stdClass $attempt
* @param stdClass $snakes * @param stdClass $snakes
* @param stdClass $context * @param stdClass $context
*/ */
function game_snakes_play( $id, $game, $attempt, $snakes, $context) { function game_snakes_play( $id, $game, $attempt, $snakes, $context) {
global $CFG, $DB, $OUTPUT; global $CFG, $DB, $OUTPUT;
@ -171,7 +171,7 @@ top:<?php p( -2 * round($board->height / 3));?>px; ">
* Computes player's position. * Computes player's position.
* *
* @param stdClass $snakes * @param stdClass $snakes
* @param stdClass $board * @param stdClass $board
*/ */
function game_snakes_computeplayerposition( $snakes, $board) { function game_snakes_computeplayerposition( $snakes, $board) {
$x = ($snakes->position - 1) % $board->cols; $x = ($snakes->position - 1) % $board->cols;
@ -273,7 +273,7 @@ function game_snakes_computenextquestion( $game, &$snakes, &$query) {
* @param stdClass $game * @param stdClass $game
* @param stdClass $snakes * @param stdClass $snakes
* @param stdClass $query * @param stdClass $query
* @param stdClass $context * @param stdClass $context
*/ */
function game_snakes_showquestion( $id, $game, $snakes, $query, $context) { function game_snakes_showquestion( $id, $game, $snakes, $query, $context) {
if ($query->sourcemodule == 'glossary') { if ($query->sourcemodule == 'glossary') {
@ -290,7 +290,7 @@ function game_snakes_showquestion( $id, $game, $snakes, $query, $context) {
* @param $id * @param $id
* @param stdClass $snakes * @param stdClass $snakes
* @param stdClass $query * @param stdClass $query
* @param stdClass $context * @param stdClass $context
*/ */
function game_snakes_showquestion_question( $game, $id, $snakes, $query, $context) { function game_snakes_showquestion_question( $game, $id, $snakes, $query, $context) {
global $CFG; global $CFG;
@ -365,7 +365,7 @@ function game_snakes_showquestion_glossary( $id, $snakes, $query, $game) {
* @param stdClass $game * @param stdClass $game
* @param stdClass $attempt * @param stdClass $attempt
* @param stdClass $snakes * @param stdClass $snakes
* @param stdClass $context * @param stdClass $context
*/ */
function game_snakes_check_questions( $id, $game, $attempt, $snakes, $context) { function game_snakes_check_questions( $id, $game, $attempt, $snakes, $context) {
global $CFG, $DB; global $CFG, $DB;
@ -410,7 +410,7 @@ function game_snakes_check_questions( $id, $game, $attempt, $snakes, $context) {
* @param stdClass $game * @param stdClass $game
* @param stdClass $attempt * @param stdClass $attempt
* @param stdClass $snakes * @param stdClass $snakes
* @param stdClass $context * @param stdClass $context
*/ */
function game_snakes_check_glossary( $id, $game, $attempt, $snakes, $context) { function game_snakes_check_glossary( $id, $game, $attempt, $snakes, $context) {
global $CFG, $DB; global $CFG, $DB;

2
sudoku/class.Sudoku.php

@ -234,7 +234,7 @@ class cell extends objects {
* Sudoku::_newSolvedPosition. * Sudoku::_newSolvedPosition.
* *
* @desc Assert pending solution. * @desc Assert pending solution.
] * @param integer $value The value for the solved position. * @param integer $value The value for the solved position.
*/ */
public function flagsolvedposition($value) { public function flagsolvedposition($value) {
$this->state = array($value => $value); $this->state = array($value => $value);

1
sudoku/play.php

@ -708,7 +708,6 @@ function game_sudoku_check_glossaryentries( $id, $game, $attempt, $sudoku, $fini
} }
/**This is the last function after submiting the answers. /**This is the last function after submiting the answers.
*
* *
* @param $id * @param $id
* @param $game * @param $game

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 = 2017061201; // The current module version (Date: YYYYMMDDXX). $plugin->version = 2017061301; // 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-12'; $plugin->release = '2017-06-13';
if ($useplugin != 2) { if ($useplugin != 2) {
$module = $plugin; $module = $plugin;

Loading…
Cancel
Save