Browse Source

phpdoc compatibility

MOODLE_20_STABLE
bdaloukas 8 years ago
parent
commit
5d67c8daf7
  1. 2
      cross/cross_class.php
  2. 13
      cross/crossdb_class.php
  3. 40
      cryptex/cryptexdb_class.php
  4. 20
      cryptex/play.php
  5. 2
      db/access.php
  6. 2
      db/importsnakes.php
  7. 4
      export/exporthtml_millionaire.php
  8. 98
      export/exportjavame.php
  9. 2
      hangman/play.php
  10. 32
      hiddenpicture/picture.php
  11. 31
      lib.php
  12. 261
      locallib.php
  13. 134
      millionaire/play.php
  14. 7
      mod_form.php
  15. 6
      report/overview/report.php
  16. 38
      showanswers.php

2
cross/cross_class.php

@ -574,7 +574,7 @@ class Cross
* @param array $words * @param array $words
* @param object $magics * @param object $magics
* @param object $poss * @param object $poss
* @param int $ccrosspos * @param int $crosspos
* @param int $crossdir * @param int $crossdir
* @param object $crosssword * @param object $crosssword
* @param int $n20 * @param int $n20

13
cross/crossdb_class.php

@ -29,8 +29,9 @@ defined('MOODLE_INTERNAL') || die();
/* /*
* This class is a cross that can load and save to a table * This class is a cross that can load and save to a table
* *
* @author bdaloukas * @package mod_game
* @package game * @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
**/ **/
class CrossDB extends Cross { class CrossDB extends Cross {
/** /**
@ -91,7 +92,7 @@ class CrossDB extends Cross {
/** /**
* Load cross. * Load cross.
* *
* @param $g * @param string $g
* @param boolean $done * @param boolean $done
* @param string $html * @param string $html
* @param stdClass $game * @param stdClass $game
@ -173,7 +174,7 @@ class CrossDB extends Cross {
* *
* @param int $correctletters * @param int $correctletters
* @param int $wrongletters * @param int $wrongletters
* @param $restletters * @param string $restletters
* @param stdClass $game * @param stdClass $game
* @param stdClass $attempt * @param stdClass $attempt
* @param boolean $done * @param boolean $done
@ -241,8 +242,8 @@ class CrossDB extends Cross {
* Update cross questions. * Update cross questions.
* *
* @param stdClass $rec (is a record of cross_questions). * @param stdClass $rec (is a record of cross_questions).
* @param $g * @param string $g
* @param $pos * @param int $pos
* @param int $correctletters * @param int $correctletters
* @param int $wrongletters * @param int $wrongletters
* @param int $restletters * @param int $restletters

40
cryptex/cryptexdb_class.php

@ -166,10 +166,10 @@ class CryptexDB extends CrossDB {
/** /**
* Inserts a char. * Inserts a char.
* *
* @param $letters * @param string $letters
* @param $cols * @param int $cols
* @param $rows * @param int $rows
* @param $char * @param string $char
* @param int $spaces * @param int $spaces
*/ */
public function insertchar( &$letters, $cols, $rows, $char, &$spaces) { public function insertchar( &$letters, $cols, $rows, $char, &$spaces) {
@ -186,10 +186,10 @@ class CryptexDB extends CrossDB {
/** /**
* Inserts chars. * Inserts chars.
* *
* @param $letters * @param string $letters
* @param $cols * @param int $cols
* @param $rows * @param int $rows
* @param $char * @param string $char
* @param int $spaces * @param int $spaces
*/ */
public function insertchars( &$letters, $cols, $rows, $char, &$spaces) { public function insertchars( &$letters, $cols, $rows, $char, &$spaces) {
@ -234,9 +234,9 @@ class CryptexDB extends CrossDB {
* Loads the cryptex from database. * Loads the cryptex from database.
* *
* @param array $crossm * @param array $crossm
* @param $mask * @param string $mask
* @param $corrects * @param int $corrects
* @param $language * @param string $language
* *
* @return questions * @return questions
*/ */
@ -288,9 +288,9 @@ class CryptexDB extends CrossDB {
/** /**
* Calls the setwords of class Cross. * Calls the setwords of class Cross.
* *
* @param $answers * @param string $answers
* @param $maxcols * @param int $maxcols
* @param $reps * @param array $reps
* *
* @return Cross::setwords * @return Cross::setwords
*/ */
@ -301,12 +301,12 @@ class CryptexDB extends CrossDB {
/** /**
* Calls the computedata of class Cross. * Calls the computedata of class Cross.
* *
* @param $crossm * @param stdClass $crossm
* @param $crossd * @param stdClass $crossd
* @param $letters * @param string $letters
* @param $minwords * @param int $minwords
* @param $maxwords * @param int $maxwords
* @param $mtimelimit * @param int $mtimelimit
*/ */
public function computedata( &$crossm, &$crossd, &$letters, $minwords, $maxwords, $mtimelimit=3) { public function computedata( &$crossm, &$crossd, &$letters, $minwords, $maxwords, $mtimelimit=3) {
if (!cross::computedata( $crossm, $crossd, $letters, $minwords, $maxwords, $mtimelimit)) { if (!cross::computedata( $crossm, $crossd, $letters, $minwords, $maxwords, $mtimelimit)) {

20
cryptex/play.php

@ -28,11 +28,11 @@ require_once( "cryptexdb_class.php");
/** /**
* Plays the game cryptex. * Plays the game cryptex.
* *
* @param $id * @param int $id
* @param stdClass $game * @param stdClass $game
* @param stdClass $atttempt * @param stdClass $atttempt
* @param $cryptexrec * @param stdClass $cryptexrec
* @param $endofgame * @param boolean $endofgame
* @param stdClass $context * @param stdClass $context
*/ */
function game_cryptex_continue( $id, $game, $attempt, $cryptexrec, $endofgame, $context) { function game_cryptex_continue( $id, $game, $attempt, $cryptexrec, $endofgame, $context) {
@ -115,10 +115,10 @@ function game_cryptex_continue( $id, $game, $attempt, $cryptexrec, $endofgame, $
* @param int $id * @param int $id
* @param stdClass $game * @param stdClass $game
* @param stdClass $atttempt * @param stdClass $atttempt
* @param $cryptexrec * @param stdClass $cryptexrec
* @param $q (The q means game_queries.id). * @param int $q (The q means game_queries.id).
* @param $answer * @param stdClass $answer
* @param $finishattempt * @param boolean $finishattempt
* @param stdClass $context * @param stdClass $context
*/ */
function game_cryptex_check( $id, $game, $attempt, $cryptexrec, $q, $answer, $finishattempt, $context) { function game_cryptex_check( $id, $game, $attempt, $cryptexrec, $q, $answer, $finishattempt, $context) {
@ -171,8 +171,8 @@ function game_cryptex_check( $id, $game, $attempt, $cryptexrec, $q, $answer, $fi
* @param int $id * @param int $id
* @param stdClass $game * @param stdClass $game
* @param stdClass $atttempt * @param stdClass $atttempt
* @param $cryptexrec * @param stdClass $cryptexrec
* @param $crosssm * @param stdClass $crosssm
* @param boolean $updateattempt * @param boolean $updateattempt
* @param boolean $onlyshow * @param boolean $onlyshow
* @param boolean $showsolution * @param boolean $showsolution
@ -408,7 +408,7 @@ if ($print) {
* @param int $id * @param int $id
* @param stdClass $game * @param stdClass $game
* @param stdClass $atttempt * @param stdClass $atttempt
* @param $cryptexrec * @param stdClass $cryptexrec
*/ */
function game_cryptex_onfinished( $id, $game, $attempt, $cryptexrec) { function game_cryptex_onfinished( $id, $game, $attempt, $cryptexrec) {
global $CFG, $DB; global $CFG, $DB;

2
db/access.php

@ -14,7 +14,7 @@
// 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/>.
/* /**
* Plugin capabilities * Plugin capabilities
* *
* @package mod_game * @package mod_game

2
db/importsnakes.php

@ -71,7 +71,7 @@ function game_importsnakes() {
/** /**
* Insert one board to database * Insert one board to database
* *
* @param $newrec * @param stdClass $newrec
*/ */
function game_importsnakes_do( $newrec) { function game_importsnakes_do( $newrec) {
global $DB; global $DB;

4
export/exporthtml_millionaire.php

@ -112,8 +112,8 @@ function game_millionaire_html_getquestions( $game, $context, &$maxanswers, &$co
* Exports to html a "Millionaire" game. * Exports to html a "Millionaire" game.
* *
* @param stdClass $game * @param stdClass $game
* @param $questions * @param string $questions
* @param $maxquestions * @param int $maxquestions
*/ */
function game_millionaire_html_print( $game, $questions, $maxquestions) { function game_millionaire_html_print( $game, $questions, $maxquestions) {
$color1 = 'black'; $color1 = 'black';

98
export/exportjavame.php

@ -28,7 +28,7 @@ defined('MOODLE_INTERNAL') || die();
* Exports to javame. * Exports to javame.
* *
* @param object $game * @param object $game
* @param $javame * @param object $javame
*/ */
function game_onexportjavame( $game, $javame) { function game_onexportjavame( $game, $javame) {
global $CFG, $DB; global $CFG, $DB;
@ -97,12 +97,12 @@ function game_onexportjavame( $game, $javame) {
/** /**
* Exports data. * Exports data.
* *
* @param $src * @param string $src
* @param $destmobiledir * @param string $destmobiledir
* @param $destdir * @param string $destdir
* @param $game * @param stdClass $game
* @param $maxwidth * @param int $maxwidth
* @param $maxheight * @param int $maxheight
*/ */
function game_exportjavame_exportdata( $src, $destmobiledir, $destdir, $game, $maxwidth, $maxheight) { function game_exportjavame_exportdata( $src, $destmobiledir, $destdir, $game, $maxwidth, $maxheight) {
global $CFG; global $CFG;
@ -157,13 +157,13 @@ function game_exportjavame_exportdata( $src, $destmobiledir, $destdir, $game, $m
/** /**
* Exports data of hangman with pictures. * Exports data of hangman with pictures.
* *
* @param $src * @param string $src
* @param $destmobiledir * @param string $destmobiledir
* @param $destdir * @param string $destdir
* @param $game * @param stdClass $game
* @param $map * @param array $map
* @param $maxwidth * @param int $maxwidth
* @param $maxheight * @param int $maxheight
*/ */
function game_exportjavame_exportdata_hangmanp( $src, $destmobiledir, $destdir, $game, $map, $maxwidth, $maxheight) { function game_exportjavame_exportdata_hangmanp( $src, $destmobiledir, $destdir, $game, $map, $maxwidth, $maxheight) {
global $CFG; global $CFG;
@ -194,11 +194,11 @@ function game_exportjavame_exportdata_hangmanp( $src, $destmobiledir, $destdir,
/** /**
* Exports to javame. * Exports to javame.
* *
* @param $game * @param stdClas $game
* @param $context * @param stdClass $context
* @param $exportattachments * @param boolean $exportattachments
* @param $dest * @param string $dest
* @param $files * @param array $files
*/ */
function game_exmportjavame_getanswers( $game, $context, $exportattachment, $dest, &$files) { function game_exmportjavame_getanswers( $game, $context, $exportattachment, $dest, &$files) {
$map = array(); $map = array();
@ -219,10 +219,10 @@ function game_exmportjavame_getanswers( $game, $context, $exportattachment, $des
/** /**
* Exports to javame. * Exports to javame.
* *
* @param $game * @param stdClass $game
* @param $context * @param stdClass $context
* @param $destdir * @param string $destdir
* @param $files * @param array $files
*/ */
function game_exmportjavame_getanswers_question( $game, $context, $destdir, &$files) { function game_exmportjavame_getanswers_question( $game, $context, $destdir, &$files) {
$select = 'hidden = 0 AND category='.$game->questioncategoryid; $select = 'hidden = 0 AND category='.$game->questioncategoryid;
@ -236,10 +236,10 @@ function game_exmportjavame_getanswers_question( $game, $context, $destdir, &$fi
/** /**
* Exports to javame. * Exports to javame.
* *
* @param $game * @param stdClass $game
* @param $context * @param stdClass $context
* @param $destdir * @param string $destdir
* @param $files * @param array $files
*/ */
function game_exmportjavame_getanswers_quiz( $game, $context, $destdir, $files) { function game_exmportjavame_getanswers_quiz( $game, $context, $destdir, $files) {
global $CFG; global $CFG;
@ -256,14 +256,14 @@ function game_exmportjavame_getanswers_quiz( $game, $context, $destdir, $files)
/** /**
* Exports to javame. * Exports to javame.
* *
* @param $game * @param stdClass $game
* @param $context * @param stdClass $context
* @param $table * @param string $table
* @param $select * @param string $select
* @param $fields * @param string $fields
* @param $courseid * @param int $courseid
* @param $destdir * @param string $destdir
* @param $files * @param array $files
*/ */
function game_exmportjavame_getanswers_question_select( $game, $context, $table, $select, $fields, $courseid, $destdir, &$files) { function game_exmportjavame_getanswers_question_select( $game, $context, $table, $select, $fields, $courseid, $destdir, &$files) {
global $CFG, $DB; global $CFG, $DB;
@ -302,11 +302,11 @@ function game_exmportjavame_getanswers_question_select( $game, $context, $table,
/** /**
* Exports to javame. * Exports to javame.
* *
* @param $game * @param stdClass $game
* @param $context * @param stdClass $context
* @param $exportattachments * @param boolean $exportattachments
* @param $destdir * @param string $destdir
* @param $files * @param array $files
*/ */
function game_exmportjavame_getanswers_glossary( $game, $context, $exportattachment, $destdir, &$files) { function game_exmportjavame_getanswers_glossary( $game, $context, $exportattachment, $destdir, &$files) {
global $CFG, $DB; global $CFG, $DB;
@ -388,9 +388,9 @@ function game_exmportjavame_getanswers_glossary( $game, $context, $exportattachm
/** /**
* Create manifest mf. * Create manifest mf.
* *
* @param $dir * @param string $dir
* @param $javame * @param stdClass $javame
* @param $destmobiledir * @param string $destmobiledir
*/ */
function game_create_manifest_mf( $dir, $javame, $destmobiledir) { function game_create_manifest_mf( $dir, $javame, $destmobiledir) {
$fp = fopen( $dir.'/MANIFEST.MF', "w"); $fp = fopen( $dir.'/MANIFEST.MF', "w");
@ -411,9 +411,9 @@ function game_create_manifest_mf( $dir, $javame, $destmobiledir) {
/** /**
* Creates a jar file. * Creates a jar file.
* *
* @param $srcdir * @param string $srcdir
* @param $course * @param stdClass $course
* @param $javame * @param stdClass $javame
*/ */
function game_create_jar( $srcdir, $course, $javame) { function game_create_jar( $srcdir, $course, $javame) {
global $CFG; global $CFG;
@ -463,9 +463,9 @@ function game_showanswers_appendselect( $form) {
/** /**
* Copy images * Copy images
* *
* @param $filename * @param string $filename
* @param $dest * @param string $dest
* @param $maxwidth * @param int $maxwidth
*/ */
function game_export_javame_smartcopyimage( $filename, $dest, $maxwidth) { function game_export_javame_smartcopyimage( $filename, $dest, $maxwidth) {
if ($maxwidth == 0) { if ($maxwidth == 0) {

2
hangman/play.php

@ -325,7 +325,7 @@ function game_hangman_play( $id, $game, $attempt, $hangman, $onlyshow, $showsolu
* @param boolean $correct * @param boolean $correct
* @param boolean $wrong * @param boolean $wrong
* @param int $max * @param int $max
* @param string wordline * @param string $wordline
* @param string $wordline2 * @param string $wordline2
* @param array $links * @param array $links
* @param stdClass $game * @param stdClass $game

32
hiddenpicture/picture.php

@ -39,14 +39,14 @@ create_image( $id, $attemptid, $foundcells, $cells, $filehash, $cols, $rows, $fi
/** /**
* Create an image. * Create an image.
* *
* @param $id * @param int $id
* @param $attemptid * @param int $attemptid
* @param $foundcells * @param boolean $foundcells
* @param $cells * @param stdClass $cells
* @param $filehash * @param string $filehash
* @param $cols * @param int $cols
* @param $rows * @param int $rows
* @param $filenamenumbers * @param string $filenamenumbers
*/ */
function create_image( $id, $attemptid, $foundcells, $cells, $filehash, $cols, $rows, $filenamenumbers) { function create_image( $id, $attemptid, $foundcells, $cells, $filehash, $cols, $rows, $filenamenumbers) {
global $CFG; global $CFG;
@ -123,14 +123,14 @@ function create_image( $id, $attemptid, $foundcells, $cells, $filehash, $cols, $
/** /**
* Show number. * Show number.
* *
* @param $imghandle * @param object $imghandle
* @param $imgnumbers * @param object $imgnumbers
* @param $number * @param int $number
* @param $x1 * @param int $x1
* @param $y1 * @param int $y1
* @param $width * @param int $width
* @param $height * @param int $height
* @param $sizenumbers * @param int $sizenumbers
*/ */
function shownumber( $imghandle, $imgnumbers, $number, $x1 , $y1, $width, $height, $sizenumbers) { function shownumber( $imghandle, $imgnumbers, $number, $x1 , $y1, $width, $height, $sizenumbers) {
if ($number < 10) { if ($number < 10) {

31
lib.php

@ -181,7 +181,7 @@ function game_before_add_or_update(&$game) {
/** /**
* Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it. * Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it.
* *
* @param int $id Id of the module instance * @param int $gameid Id of the module instance
* @return boolean Success/Failure * @return boolean Success/Failure
**/ **/
function game_delete_instance($gameid) { function game_delete_instance($gameid) {
@ -358,7 +358,7 @@ function game_grades($gameid) {
/** /**
* Return grade for given user or all users. * Return grade for given user or all users.
* *
* @param int $gameid id of game * @param stdClass $game
* @param int $userid optional user id, 0 means all users * @param int $userid optional user id, 0 means all users
* @return array array of grades, false if none * @return array array of grades, false if none
*/ */
@ -393,6 +393,7 @@ function game_get_participants($gameid) {
* This function returns if a scale is being used by one game it it has support for grading and scales. * This function returns if a scale is being used by one game it it has support for grading and scales.
* *
* @param int $gameid ID of an instance of this module * @param int $gameid ID of an instance of this module
* @param int $scaleid
* @return mixed * @return mixed
* @todo Finish documenting this function * @todo Finish documenting this function
**/ **/
@ -407,6 +408,7 @@ function game_scale_used ($gameid, $scaleid) {
* *
* @param object $game null means all games * @param object $game null means all games
* @param int $userid specific user only, 0 mean all * @param int $userid specific user only, 0 mean all
* @param boolean $nullifnone
*/ */
function game_update_grades($game=null, $userid=0, $nullifnone=true) { function game_update_grades($game=null, $userid=0, $nullifnone=true) {
global $CFG; global $CFG;
@ -454,7 +456,7 @@ function game_update_grades($game=null, $userid=0, $nullifnone=true) {
* Create grade item for given game * Create grade item for given game
* *
* @param object $game object with extra cmidnumber * @param object $game object with extra cmidnumber
* @param mixed optional array/object of grade(s); 'reset' means reset grades in gradebook * @param stdClass $grades
* @return int 0 if ok, error code otherwise * @return int 0 if ok, error code otherwise
*/ */
function game_grade_item_update($game, $grades=null) { function game_grade_item_update($game, $grades=null) {
@ -516,10 +518,10 @@ function game_grade_item_delete( $game) {
* @param stdClass $activities * @param stdClass $activities
* @param int $index * @param int $index
* @param int $timestart * @param int $timestart
* @param int courseid * @param int $courseid
* @param int cmid * @param int $cmid
* @param int userid * @param int $userid
* @param int groupid * @param int $groupid
*/ */
function game_get_recent_mod_activity(&$activities, &$index, $timestart, $courseid, $cmid, $userid=0, $groupid=0) { function game_get_recent_mod_activity(&$activities, &$index, $timestart, $courseid, $cmid, $userid=0, $groupid=0) {
global $DB, $COURSE, $USER; global $DB, $COURSE, $USER;
@ -621,7 +623,7 @@ function game_get_recent_mod_activity(&$activities, &$index, $timestart, $course
* @param stdClass $activity * @param stdClass $activity
* @param int $courseid * @param int $courseid
* @param stdClass $detail * @param stdClass $detail
* @param array $modgames * @param array $modnames
*/ */
function game_print_recent_mod_activity($activity, $courseid, $detail, $modnames) { function game_print_recent_mod_activity($activity, $courseid, $detail, $modnames) {
global $CFG, $OUTPUT; global $CFG, $OUTPUT;
@ -662,7 +664,7 @@ function game_print_recent_mod_activity($activity, $courseid, $detail, $modnames
* Removes all grades from gradebook * Removes all grades from gradebook
* *
* @param int $courseid * @param int $courseid
* @param string optional type * @param string optional $type
*/ */
function game_reset_gradebook($courseid, $type='') { function game_reset_gradebook($courseid, $type='') {
global $DB; global $DB;
@ -682,6 +684,7 @@ function game_reset_gradebook($courseid, $type='') {
* What supports. * What supports.
* *
* @uses FEATURE_GRADE_HAS_GRADE * @uses FEATURE_GRADE_HAS_GRADE
* @param string $feature
* @return bool True if quiz supports feature * @return bool True if quiz supports feature
*/ */
function game_supports($feature) { function game_supports($feature) {
@ -814,7 +817,7 @@ function game_get_grading_options() {
* context when this is called * context when this is called
* *
* @param settings_navigation $settings * @param settings_navigation $settings
* @param navigation_node $quiznode * @param navigation_node $gamenode
* @return void * @return void
*/ */
function game_extend_settings_navigation($settings, $gamenode) { function game_extend_settings_navigation($settings, $gamenode) {
@ -1005,6 +1008,8 @@ if (!defined('USE_GET_SHORTCUTS')) {
if (defined('USE_GET_SHORTCUTS')) { if (defined('USE_GET_SHORTCUTS')) {
/** /**
* Returns an array of game type objects to construct menu list when adding new game * Returns an array of game type objects to construct menu list when adding new game
*
* @param stdClass $defaultitem
*/ */
function game_get_shortcuts($defaultitem) { function game_get_shortcuts($defaultitem) {
global $DB, $CFG; global $DB, $CFG;
@ -1143,8 +1148,8 @@ if (defined('USE_GET_SHORTCUTS')) {
* @param stdClass $cm * @param stdClass $cm
* @param stdClass $context * @param stdClass $context
* @param string filearea * @param string filearea
* @param array args * @param array $args
* @param boolean forcedownload * @param boolean $forcedownload
* *
* @return boolean false if not exists file * @return boolean false if not exists file
*/ */
@ -1233,7 +1238,7 @@ function game_reset_course_form_defaults($course) {
/** /**
* Actual implementation of the reset course functionality, delete all the Game responses for course $data->courseid. * Actual implementation of the reset course functionality, delete all the Game responses for course $data->courseid.
* *
* @param $data the data submitted from the reset course. * @param stdClass $data the data submitted from the reset course.
* *
* @return array status array * @return array status array
*/ */

261
locallib.php

@ -104,9 +104,10 @@ function game_upper( $str, $lang='') {
* Returns the HTML of a select control. * Returns the HTML of a select control.
* *
* @param string $name * @param string $name
* @param array a * @param array $a
* @param string $input * @param string $input
* @param array $events * @param array $events
*
* @return string the HTML * @return string the HTML
*/ */
function game_showselectcontrol( $name, $a, $input, $events='') { function game_showselectcontrol( $name, $a, $input, $events='') {
@ -142,10 +143,10 @@ function game_showcheckbox( $name, $value) {
/** /**
* Used by hangman. Returns a short answer. * Used by hangman. Returns a short answer.
* *
* @param string $name * @param stdClass $game
* @param array a * @param boolean $allowspaces
* @param string $input * @param boolean $userepetitions
* @param array $events *
* @return string the HTML * @return string the HTML
*/ */
function game_question_shortanswer( $game, $allowspaces=false, $userepetitions=true) { function game_question_shortanswer( $game, $allowspaces=false, $userepetitions=true) {
@ -165,11 +166,10 @@ function game_question_shortanswer( $game, $allowspaces=false, $userepetitions=t
/** /**
* Used by hangman. Returns a short answer from glossary. * Used by hangman. Returns a short answer from glossary.
* *
* @param string $name * @param stdClass $game
* @param array a * @param boolean $allowspaces
* @param string $input * @param boolean $userepetitions
* @param array $events *
* @return string the HTML
*/ */
function game_question_shortanswer_glossary( $game, $allowspaces, $userepetitions) { function game_question_shortanswer_glossary( $game, $allowspaces, $userepetitions) {
global $DB; global $DB;
@ -215,11 +215,9 @@ function game_question_shortanswer_glossary( $game, $allowspaces, $userepetition
/** /**
* Used by hangman. Returns a short answer from quiz. * Used by hangman. Returns a short answer from quiz.
* *
* @param string $name * @param stdClass $game
* @param array a * @param boolean $allowspaces
* @param string $input * @param boolean $userepetitions
* @param array $events
* @return string the HTML
*/ */
function game_question_shortanswer_quiz( $game, $allowspaces, $userepetitions) { function game_question_shortanswer_quiz( $game, $allowspaces, $userepetitions) {
global $DB; global $DB;
@ -263,10 +261,10 @@ function game_question_shortanswer_quiz( $game, $allowspaces, $userepetitions) {
/** /**
* Used by hangman. Returns a short answer from question. * Used by hangman. Returns a short answer from question.
* *
* @param string $name
* @param stdClass $game * @param stdClass $game
* @param boolean $allowspaces * @param boolean $allowspaces
* @param boolean $userepetitions * @param boolean $userepetitions
*
* @return the short answer record * @return the short answer record
*/ */
function game_question_shortanswer_question( $game, $allowspaces, $userepetitions) { function game_question_shortanswer_question( $game, $allowspaces, $userepetitions) {
@ -318,6 +316,7 @@ function game_question_shortanswer_question( $game, $allowspaces, $userepetition
* @param string $select * @param string $select
* @param string $idfields * @param string $idfields
* @param boolean userepetitions * @param boolean userepetitions
*
* @return stdClass the random question * @return stdClass the random question
*/ */
function game_question_selectrandom( $game, $table, $select, $idfields='id', $userepetitions=true) { function game_question_selectrandom( $game, $table, $select, $idfields='id', $userepetitions=true) {
@ -429,7 +428,8 @@ function game_update_repetitions( $gameid, $userid, $questionid, $glossaryentryi
* *
* @param stdClass $game * @param stdClass $game
* @param int count * @param int count
* @param stdClass the random record(s) *
* @return stdClass the random record(s)
*/ */
function game_questions_selectrandom( $game, $count=1) { function game_questions_selectrandom( $game, $count=1) {
global $DB; global $DB;
@ -528,8 +528,9 @@ function game_questions_selectrandom( $game, $count=1) {
* *
* @param string $table * @param string $table
* @param string $select * @param string $select
@param int $idfield * @param int $idfield
@param int $count * @param int $count
*
* @return stdClass the random record(s) * @return stdClass the random record(s)
*/ */
function game_questions_selectrandom_detail( $table, $select, $idfield="id", $count=1) { function game_questions_selectrandom_detail( $table, $select, $idfield="id", $count=1) {
@ -557,7 +558,7 @@ function game_questions_selectrandom_detail( $table, $select, $idfield="id", $co
/** /**
* Tries to detect the language of word. * Tries to detect the language of word.
* *
* @param $word * @param string $word
* *
* @return the language detected * @return the language detected
*/ */
@ -600,9 +601,9 @@ function game_detectlanguage( $word) {
/** /**
* The words maybe are in two languages e.g. greek or english so I try to find the correct one. * The words maybe are in two languages e.g. greek or english so I try to find the correct one.
* *
* @param $word * @param string $word
* @param $lang * @param string $lang
* @param $userlanguage * @param string $userlanguage
* *
* @return the letters detected * @return the letters detected
*/ */
@ -639,8 +640,8 @@ function game_getallletters( $word, $lang='', $userlanguage='') {
/** /**
* true if exist all the letters * true if exist all the letters
* *
* @param $str * @param string $str
* @param $strfile * @param string $strfile
* *
* @return the letters detected * @return the letters detected
*/ */
@ -659,7 +660,7 @@ function hangman_existall( $str, $strfind) {
/** /**
* return a short answer randomly selected. used by cross * return a short answer randomly selected. used by cross
* *
* @param $game * @param stdClass $game
* *
* @return a question * @return a question
*/ */
@ -682,7 +683,7 @@ function game_questions_shortanswer( $game) {
/** /**
* return a short answer (from glossary) randomly selected. used by cross * return a short answer (from glossary) randomly selected. used by cross
* *
* @param $game * @param stdClass $game
* *
* @return a question * @return a question
*/ */
@ -707,7 +708,7 @@ function game_questions_shortanswer_glossary( $game) {
/** /**
* return a short answer (from quiz) randomly selected. used by cross * return a short answer (from quiz) randomly selected. used by cross
* *
* @param $game * @param stdClass $game
* *
* @return a question * @return a question
*/ */
@ -744,7 +745,7 @@ function game_questions_shortanswer_quiz( $game) {
/** /**
* return a short answer (from question) randomly selected. used by cross * return a short answer (from question) randomly selected. used by cross
* *
* @param $game * @param stdClass $game
* *
* @return a question * @return a question
*/ */
@ -775,9 +776,9 @@ function game_questions_shortanswer_question( $game) {
/** /**
* question fraction * question fraction
* *
* @param $table * @param string $table
* @param $field * @param string $fields
* @param $select * @param string $select
* *
* @return the record * @return the record
*/ */
@ -815,9 +816,9 @@ function game_questions_shortanswer_question_fraction( $table, $fields, $select)
/** /**
* sets char * sets char
* *
* @param $d * @param string $s
* @param $pos * @param int $pos
* @param $char * @param string $char
*/ */
function game_setchar( &$s, $pos, $char) { function game_setchar( &$s, $pos, $char) {
$ret = ""; $ret = "";
@ -832,8 +833,8 @@ function game_setchar( &$s, $pos, $char) {
/** /**
* insert a record * insert a record
* *
* @param $table * @param stdClass $table
* @param $rec * @param stdClass $rec
*/ */
function game_insert_record( $table, $rec) { function game_insert_record( $table, $rec) {
global $DB; global $DB;
@ -862,10 +863,10 @@ function game_insert_record( $table, $rec) {
/** /**
* If score is negative doesn't update the record score is between 0 and 1. * If score is negative doesn't update the record score is between 0 and 1.
* *
* @param $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
* @param $score * @param float $score
* @param $finished * @param boolean $finished
* *
* @return the record * @return the record
*/ */
@ -917,10 +918,10 @@ function game_updateattempts( $game, $attempt, $score, $finished) {
/** /**
* Computes max grade * Computes max grade
* *
* @param $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
* @param $grade * @param float $grade
* @param $finished * @param boolean $finished
* *
* @return the record * @return the record
*/ */
@ -939,12 +940,12 @@ function game_updateattempts_maxgrade( $game, $attempt, $grade, $finished) {
/** /**
* Update queries * Update queries
* *
* @param $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
* @param $query * @param string $query
* @param $score * @param float $score
* @param $studentanswer * @param string $studentanswer
* @param $updatetries * @param boolean $updatetries
* *
* @return the record * @return the record
*/ */
@ -1007,9 +1008,9 @@ function game_update_queries( $game, $attempt, $query, $score, $studentanswer, $
/** /**
* get attempt * get attempt
* *
* @param $game * @param stdClass $game
* @param $detail * @param stdclass $detail
* @param $autoadd * @param boolean $autoadd
*/ */
function game_getattempt( $game, &$detail, $autoadd=false) { function game_getattempt( $game, &$detail, $autoadd=false) {
global $DB, $USER; global $DB, $USER;
@ -1050,6 +1051,7 @@ function game_getattempt( $game, &$detail, $autoadd=false) {
* @param integer $gameid the game id. * @param integer $gameid the game id.
* @param integer $userid the userid. * @param integer $userid the userid.
* @param string $status 'all', 'finished' or 'unfinished' to control * @param string $status 'all', 'finished' or 'unfinished' to control
*
* @return an array of all the user's attempts at this game. Returns an empty array if there are none. * @return an array of all the user's attempts at this game. Returns an empty array if there are none.
*/ */
function game_get_user_attempts( $gameid, $userid, $status = 'finished') { function game_get_user_attempts( $gameid, $userid, $status = 'finished') {
@ -1093,6 +1095,7 @@ function game_get_user_attempt_unfinished( $gameid, $userid) {
* *
* @param object $game the game object. * @param object $game the game object.
* @param integer $userid the id of the user. * @param integer $userid the id of the user.
*
* @return float the user's current grade for this game. * @return float the user's current grade for this game.
*/ */
function game_get_best_score($game, $userid) { function game_get_best_score($game, $userid) {
@ -1113,6 +1116,7 @@ function game_get_best_score($game, $userid) {
* *
* @param object $game the game object. * @param object $game the game object.
* @param integer $userid the id of the user. * @param integer $userid the id of the user.
*
* @return float the user's current grade for this game. * @return float the user's current grade for this game.
*/ */
function game_get_best_grade($game, $userid) { function game_get_best_grade($game, $userid) {
@ -1128,8 +1132,9 @@ function game_get_best_grade($game, $userid) {
/** /**
* Converts score to grade * Converts score to grade
* *
* @param $score * @param float $score
* @param $grade * @param float $grade
*
* @return float the user's current grade for this game. * @return float the user's current grade for this game.
*/ */
function game_score_to_grade($score, $game) { function game_score_to_grade($score, $game) {
@ -1197,7 +1202,7 @@ function game_get_reviewoptions($game, $attempt, $context=null) {
* Compute attempt layout * Compute attempt layout
* *
* @param object $game the game object. * @param object $game the game object.
* @param $attempt * @param stdClass $attempt
* @return float the user's current grade for this game. * @return float the user's current grade for this game.
*/ */
function game_compute_attempt_layout( $game, &$attempt) { function game_compute_attempt_layout( $game, &$attempt) {
@ -1402,10 +1407,10 @@ function game_sudoku_getquestions( $questionlist) {
/** /**
* Filter glossary * Filter glossary
* *
* @param $text * @param string $text
* @param $entryid * @param int $entryid
* @param $contextid * @param int $contextid
* @param $courseid * @param int $courseid
*/ */
function game_filterglossary( $text, $entryid, $contextid, $courseid) { function game_filterglossary( $text, $entryid, $contextid, $courseid) {
global $CFG, $DB; global $CFG, $DB;
@ -1440,10 +1445,10 @@ function game_filterglossary( $text, $entryid, $contextid, $courseid) {
/** /**
* Filter book * Filter book
* *
* @param $text * @param string $text
* @param $chapterid * @param int $chapterid
* @param $contextid * @param int $contextid
* @param $courseid * @param int $courseid
*/ */
function game_filterbook( $text, $chapterid, $contextid, $courseid) { function game_filterbook( $text, $chapterid, $contextid, $courseid) {
global $CFG, $DB; global $CFG, $DB;
@ -1478,10 +1483,10 @@ function game_filterbook( $text, $chapterid, $contextid, $courseid) {
/** /**
* Filter questio * Filter questio
* *
* @param $questiontext * @param string $questiontext
* @param $questionid * @param int $questionid
* @param $contextid * @param int $contextid
* @param $courseid * @param int $courseid
*/ */
function game_filterquestion( $questiontext, $questionid, $contextid, $courseid) { function game_filterquestion( $questiontext, $questionid, $contextid, $courseid) {
global $CFG, $DB; global $CFG, $DB;
@ -1516,10 +1521,10 @@ function game_filterquestion( $questiontext, $questionid, $contextid, $courseid)
/** /**
* Filter question answer * Filter question answer
* *
* @param $questiontext * @param string $questiontext
* @param $questionid * @param int $questionid
* @param $contextid * @param int $contextid
* @param $courseid * @param int $courseid
*/ */
function game_filterquestion_answer( $questiontext, $questionid, $contextid, $courseid) { function game_filterquestion_answer( $questiontext, $questionid, $contextid, $courseid) {
global $CFG, $DB; global $CFG, $DB;
@ -1553,8 +1558,8 @@ function game_filterquestion_answer( $questiontext, $questionid, $contextid, $co
/** /**
* Filter text * Filter text
* *
* @param $text * @param string $text
* @param $courseid * @param int $courseid
*/ */
function game_filtertext( $text, $courseid) { function game_filtertext( $text, $courseid) {
$formatoptions = new stdClass(); $formatoptions = new stdClass();
@ -1580,7 +1585,7 @@ function game_filtertext( $text, $courseid) {
/** /**
* To javascript string * To javascript string
* *
* @param $text * @param string $text
*/ */
function game_tojavascriptstring( $text) { function game_tojavascriptstring( $text) {
$from = array('"', "\r", "\n"); $from = array('"', "\r", "\n");
@ -1597,7 +1602,7 @@ function game_tojavascriptstring( $text) {
/** /**
* Repair question * Repair question
* *
* @param $s * @param string $s
*/ */
function game_repairquestion( $s) { function game_repairquestion( $s) {
if (substr( $s, 0, 3) == '<p>') { if (substr( $s, 0, 3) == '<p>') {
@ -1627,8 +1632,8 @@ function game_repairquestion( $s) {
/** /**
* Delete a game attempt. * Delete a game attempt.
* *
* @param $attempt * @param stdClass $attempt
* @param $game * @param stdClass $game
*/ */
function game_delete_attempt($attempt, $game) { function game_delete_attempt($attempt, $game) {
global $DB; global $DB;
@ -1700,7 +1705,7 @@ function game_get_grading_option_name($option) {
/** /**
* Right to left. * Right to left.
* *
* @param $lang * @param string $lang
*/ */
function game_right_to_left( $lang) { function game_right_to_left( $lang) {
return ( get_string_manager()->get_string('thisdirection', 'langconfig', null, $lang) == 'rtl'); return ( get_string_manager()->get_string('thisdirection', 'langconfig', null, $lang) == 'rtl');
@ -1709,9 +1714,9 @@ function game_right_to_left( $lang) {
/** /**
* Compute reverse print * Compute reverse print
* *
* @param $attempt * @param stdClass $attempt
* @param $wordctrl * @param string $wordctrl
* @param $reverseprint * @param boolean $reverseprint
*/ */
function game_compute_reserve_print( $attempt, &$wordrtl, &$reverseprint) { function game_compute_reserve_print( $attempt, &$wordrtl, &$reverseprint) {
if (function_exists( 'right_to_left')) { if (function_exists( 'right_to_left')) {
@ -1730,9 +1735,9 @@ function game_compute_reserve_print( $attempt, &$wordrtl, &$reverseprint) {
/** /**
* select from repetitions * select from repetitions
* *
* @param $game * @param stdClass $game
* @param $recs * @param stdClass $recs
* @param $need * @param booolean $need
*/ */
function game_select_from_repetitions( $game, $recs, $need) { function game_select_from_repetitions( $game, $recs, $need) {
global $DB, $USER; global $DB, $USER;
@ -1778,11 +1783,11 @@ function game_select_from_repetitions( $game, $recs, $need) {
/** /**
* Grades responses * Grades responses
* *
* @param $question * @param stdClass $question
* @param $responses * @param array $responses
* @param $maxgrade * @param int $maxgrade
* @param $answertext * @param string $answertext
* @param $answered * @param boolean $answered
*/ */
function game_grade_responses( $question, $responses, $maxgrade, &$answertext, &$answered) { function game_grade_responses( $question, $responses, $maxgrade, &$answertext, &$answered) {
$answered = true; $answered = true;
@ -1822,10 +1827,10 @@ function game_grade_responses( $question, $responses, $maxgrade, &$answertext, &
/** /**
* Responses multianswer * Responses multianswer
* *
* @param $question * @param stdClass $question
* @param $responses * @param array $responses
* @param $maxgrade * @param int $maxgrade
* @param $answertext * @param string $answertext
*/ */
function game_grade_responses_multianswer( $question, $responses, $maxgrade, &$answertext) { function game_grade_responses_multianswer( $question, $responses, $maxgrade, &$answertext) {
$name = "resp{$question->id}_"; $name = "resp{$question->id}_";
@ -1850,9 +1855,9 @@ function game_grade_responses_multianswer( $question, $responses, $maxgrade, &$a
/** /**
* Print question * Print question
* *
* @param $game * @param stdClass $game
* @param $question * @param string $question
* @param $context * @param stdClass $context
*/ */
function game_print_question( $game, $question, $context) { function game_print_question( $game, $question, $context) {
if ($question->qtype == 'multichoice') { if ($question->qtype == 'multichoice') {
@ -1869,9 +1874,9 @@ function game_print_question( $game, $question, $context) {
/** /**
* Print question multichoice * Print question multichoice
* *
* @param $game * @param stdClass $game
* @param $question * @param string $question
* @param $context * @param stdClass $context
*/ */
function game_print_question_multichoice( $game, $question, $context) { function game_print_question_multichoice( $game, $question, $context) {
global $CFG; global $CFG;
@ -1933,8 +1938,8 @@ foreach ($anss as $answer) {
* Print question multianswer * Print question multianswer
* *
* @param object $game the game object. * @param object $game the game object.
* @param $question * @param stdClass $question
* @param $context * @param stdClass $context
*/ */
function game_print_question_multianswer( $game, $question, $context) { function game_print_question_multianswer( $game, $question, $context) {
global $CFG; global $CFG;
@ -1997,7 +2002,7 @@ foreach ($anss as $answer) {
* *
* @param stdClass $game * @param stdClass $game
* @param stdClass $question * @param stdClass $question
* @param $context * @param stdClass $context
*/ */
function game_print_question_shortanswer( $game, $question, $context) { function game_print_question_shortanswer( $game, $question, $context) {
$questiontext = $question->questiontext; $questiontext = $question->questiontext;
@ -2157,9 +2162,9 @@ function game_export_createtempdir() {
/** /**
* Create zip * Create zip
* *
* @param $srcdir * @param string $srcdir
* @param $couseid * @param int $courseid
* @param $filename * @param string $filename
*/ */
function game_create_zip( $srcdir, $courseid, $filename) { function game_create_zip( $srcdir, $courseid, $filename) {
global $CFG; global $CFG;
@ -2193,9 +2198,9 @@ function game_create_zip( $srcdir, $courseid, $filename) {
/** /**
* Get string lang * Get string lang
* *
* @param $identifier * @param string $identifier
* @param $module * @param string $module
* @param $lang * @param string $lang
*/ */
function game_get_string_lang( $identifier, $module, $lang) { function game_get_string_lang( $identifier, $module, $lang) {
global $CFG; global $CFG;
@ -2206,9 +2211,9 @@ function game_get_string_lang( $identifier, $module, $lang) {
/** /**
* Get string from file * Get string from file
* *
* @param $identifier * @param string $identifier
* @param $lanfile * @param string $lanfile
* @param $destination * @param string $destination
*/ */
function get_string_from_file($identifier, $langfile, $destination) { function get_string_from_file($identifier, $langfile, $destination) {
static $strings; // Keep the strings cached in memory. static $strings; // Keep the strings cached in memory.
@ -2277,13 +2282,13 @@ function game_get_contexts() {
/** /**
* Export split files * Export split files
* *
* @param $courseid * @param int $courseid
* @param $context * @param stdClass $context
* @param $filearea * @param string $filearea
* @param $id * @param int $id
* @param $line * @param string $line
* @param $destdir * @param string $destdir
* @pram $files * @pram array $files
*/ */
function game_export_split_files( $courseid, $context, $filearea, $id, $line, $destdir, &$files) { function game_export_split_files( $courseid, $context, $filearea, $id, $line, $destdir, &$files) {
global $CFG, $DB; global $CFG, $DB;
@ -2346,7 +2351,7 @@ function game_export_split_files( $courseid, $context, $filearea, $id, $line, $d
/** /**
* Grade questions * Grade questions
* *
* @param $questions * @param array $questions
*/ */
function game_grade_questions( $questions) { function game_grade_questions( $questions) {
$grades = array(); $grades = array();
@ -2445,7 +2450,7 @@ function game_can_start_new_attempt( $game) {
/** /**
* strlen * strlen
* *
* @param $str * @param string $str
*/ */
function game_strlen( $str) { function game_strlen( $str) {
if (game_get_moodle_version() >= '02.08') { if (game_get_moodle_version() >= '02.08') {
@ -2489,7 +2494,7 @@ function game_substr() {
/** /**
* strtoupper * strtoupper
* *
* @param $str * @param string $str
*/ */
function game_strtoupper( $str) { function game_strtoupper( $str) {
if (game_get_moodle_version() >= '02.08') { if (game_get_moodle_version() >= '02.08') {
@ -2507,9 +2512,9 @@ function game_strtoupper( $str) {
/** /**
* strpos * strpos
* *
* @param $haystack * @param string $haystack
* @param $needle * @param string $needle
* @param $offset * @param int $offset
*/ */
function game_strpos( $haystack, $needle, $offset = 0) { function game_strpos( $haystack, $needle, $offset = 0) {
if (game_get_moodle_version() >= '02.08') { if (game_get_moodle_version() >= '02.08') {
@ -2527,8 +2532,8 @@ function game_strpos( $haystack, $needle, $offset = 0) {
* show query * show query
* *
* @param object $game the game * @param object $game the game
* @param $query * @param stdClass $query
* @param $text * @param string $text
*/ */
function game_show_query( $game, $query, $text) { function game_show_query( $game, $query, $text) {
if ($game->glossaryid) { if ($game->glossaryid) {

134
millionaire/play.php

@ -27,11 +27,11 @@ defined('MOODLE_INTERNAL') || die();
/** /**
* Plays the millionaire * Plays the millionaire
* *
* @param $id * @param int $id
* @param $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
* @param $millionaire * @param stdClass $millionaire
* @param $context * @param stdClass $context
*/ */
function game_millionaire_continue( $id, $game, $attempt, $millionaire, $context) { function game_millionaire_continue( $id, $game, $attempt, $millionaire, $context) {
// User must select quiz or question as a source module. // User must select quiz or question as a source module.
@ -68,11 +68,11 @@ function game_millionaire_continue( $id, $game, $attempt, $millionaire, $context
/** /**
* Plays the millionaire * Plays the millionaire
* *
* @param $id * @param int $id
* @param $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
* @param $millionaire * @param stdClass $millionaire
* @param $context * @param stdClass $context
*/ */
function game_millionaire_play( $id, $game, $attempt, $millionaire, $context) { function game_millionaire_play( $id, $game, $attempt, $millionaire, $context) {
global $DB; global $DB;
@ -117,13 +117,13 @@ function game_millionaire_play( $id, $game, $attempt, $millionaire, $context) {
/** /**
* Shows the grid * Shows the grid
* *
* @param $game * @param stdClass $game
* @param $millionaire * @param stdClass $millionaire
* @param $id * @param int $id
* @param $query * @param stdClass $query
* @param $aanswer * @param array $aanswer
* @param $info * @param stdClass $info
* @param $context * @param stdClass $context
*/ */
function game_millionaire_showgrid( $game, $millionaire, $id, $query, $aanswer, $info, $context) { function game_millionaire_showgrid( $game, $millionaire, $id, $query, $aanswer, $info, $context) {
global $CFG, $OUTPUT; global $CFG, $OUTPUT;
@ -317,11 +317,11 @@ function game_millionaire_showgrid( $game, $millionaire, $id, $query, $aanswer,
/** /**
* Show next question * Show next question
* *
* @param $id * @param int $id
* @param $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
* @param $millionaire * @param stdClass $millionaire
* @param $context * @param stdClass $context
*/ */
function game_millionaire_shownextquestion( $id, $game, $attempt, $millionaire, $context) { function game_millionaire_shownextquestion( $id, $game, $attempt, $millionaire, $context) {
game_millionaire_selectquestion( $aanswer, $game, $attempt, $millionaire, $query, $context); game_millionaire_selectquestion( $aanswer, $game, $attempt, $millionaire, $query, $context);
@ -340,12 +340,12 @@ function game_millionaire_shownextquestion( $id, $game, $attempt, $millionaire,
/** /**
* Updates tables: games_millionaire, game_attempts, game_questions. * Updates tables: games_millionaire, game_attempts, game_questions.
* *
* @param $answer * @param string $answer
* @param $game * @param stdClass $game
* @param $attemt * @param stdClasss $attempt
* @param $millionaire * @param stdClass $millionaire
* @param $query * @param stdClass $query
* @param $context * @param stdClass $context
*/ */
function game_millionaire_selectquestion( &$aanswer, $game, $attempt, &$millionaire, &$query, $context) { function game_millionaire_selectquestion( &$aanswer, $game, $attempt, &$millionaire, &$query, $context) {
global $DB, $USER; global $DB, $USER;
@ -475,12 +475,12 @@ function game_millionaire_selectquestion( &$aanswer, $game, $attempt, &$milliona
/** /**
* Select serial question * Select serial question
* *
* @param $game * @param stdClass $game
* @param $table * @param string $table
* @param $select * @param string $select
* @param $idfields * @param string $idfields
* @param $level * @param int $level
* @param $order * @param string $order
*/ */
function game_millionaire_select_serial_question( $game, $table, $select, $idfields = "id", $level, $order) { function game_millionaire_select_serial_question( $game, $table, $select, $idfields = "id", $level, $order) {
global $DB, $USER; global $DB, $USER;
@ -515,11 +515,11 @@ function game_millionaire_select_serial_question( $game, $table, $select, $idfie
/** /**
* Load questions for millionaire * Load questions for millionaire
* *
* @param $game * @param stdClass $game
* @param $millionaire * @param stdClass $millionaire
* @param $query * @param string $query
* @param $aanswer * @param array $aanswer
* @param $context * @param stdClass $context
*/ */
function game_millionaire_loadquestions( $game, $millionaire, &$query, &$aanswer, $context) { function game_millionaire_loadquestions( $game, $millionaire, &$query, &$aanswer, $context) {
global $DB; global $DB;
@ -539,8 +539,8 @@ function game_millionaire_loadquestions( $game, $millionaire, &$query, &$aanswer
/** /**
* Set state. Flag 1 is 5050, 2 is telephone 4 is people. * Set state. Flag 1 is 5050, 2 is telephone 4 is people.
* *
* @param $millionaire * @param stdClass $millionaire
* @param $mask * @param string $mask
*/ */
function game_millionaire_setstate( &$millionaire, $mask) { function game_millionaire_setstate( &$millionaire, $mask) {
global $DB; global $DB;
@ -558,11 +558,11 @@ function game_millionaire_setstate( &$millionaire, $mask) {
/** /**
* One help 50-50 * One help 50-50
* *
* @param $game * @param stdClass $game
* @param $id * @param int $id
* @param $millionaire * @param stdClass $millionaire
* @param $query * @param string $query
* @param $context * @param stdClass $context
*/ */
function game_millionaire_onhelp5050( $game, $id, &$millionaire, $query, $context) { function game_millionaire_onhelp5050( $game, $id, &$millionaire, $query, $context) {
game_millionaire_loadquestions( $game, $millionaire, $query, $aanswer, $context); game_millionaire_loadquestions( $game, $millionaire, $query, $aanswer, $context);
@ -595,11 +595,11 @@ function game_millionaire_onhelp5050( $game, $id, &$millionaire, $query, $conte
/** /**
* One help telephone * One help telephone
* *
* @param $game * @param stdClass $game
* @param $id * @param int $id
* @param $millionaire * @param stdClass $millionaire
* @param $query * @param stdClass $query
* @param $context * @param stdClass $context
*/ */
function game_millionaire_onhelptelephone( $game, $id, &$millionaire, $query, $context) { function game_millionaire_onhelptelephone( $game, $id, &$millionaire, $query, $context) {
game_millionaire_loadquestions( $game, $millionaire, $query, $aanswer, $context); game_millionaire_loadquestions( $game, $millionaire, $query, $aanswer, $context);
@ -638,11 +638,11 @@ function game_millionaire_onhelptelephone( $game, $id, &$millionaire, $query,
/** /**
* One help people * One help people
* *
* @param $game * @param stdClass $game
* @param $id * @param int $id
* @param $millionaire * @param stdClass $millionaire
* @param $query * @param stdClass $query
* @param $context * @param stdClass $context
*/ */
function game_millionaire_onhelppeople( $game, $id, &$millionaire, $query, $context) { function game_millionaire_onhelppeople( $game, $id, &$millionaire, $query, $context) {
game_millionaire_loadquestions( $game, $millionaire, $query, $aanswer, $context); game_millionaire_loadquestions( $game, $millionaire, $query, $aanswer, $context);
@ -687,13 +687,13 @@ function game_millionaire_onhelppeople( $game, $id, &$millionaire, $query, $con
/** /**
* Millionaire on answer * Millionaire on answer
* *
* @param $id * @param int $id
* @param $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
* @param $millionaire * @param stdClass $millionaire
* @param $query * @param stdClass $query
* @param $answer * @param string $answer
* @param $context * @param stdClass $context
*/ */
function game_millionaire_onanswer( $id, $game, $attempt, &$millionaire, $query, $answer, $context) { function game_millionaire_onanswer( $id, $game, $attempt, &$millionaire, $query, $answer, $context) {
global $DB; global $DB;
@ -745,10 +745,10 @@ function game_millionaire_onanswer( $id, $game, $attempt, &$millionaire, $query,
/** /**
* Millionaire on quit * Millionaire on quit
* *
* @param $id * @param int $id
* @param $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
* @param $query * @param stdClass $query
*/ */
function game_millionaire_onquit( $id, $game, $attempt, $query) { function game_millionaire_onquit( $id, $game, $attempt, $query) {
global $CFG, $DB; global $CFG, $DB;

7
mod_form.php

@ -20,6 +20,7 @@
* @package mod_game * @package mod_game
* @author Alastair Munro <alastair@catalyst.net.nz> * @author Alastair Munro <alastair@catalyst.net.nz>
* @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
* @copyright 2007 Vasilis Daloukas
*/ */
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
@ -431,8 +432,8 @@ class mod_game_mod_form extends moodleform_mod {
/** /**
* validation * validation
* *
* @param $data * @param stdClass $data
* @param $files * @param array $files
* *
* @return moodle_url * @return moodle_url
*/ */
@ -451,7 +452,7 @@ class mod_game_mod_form extends moodleform_mod {
/** /**
* Set data * Set data
* *
* @param $defaultvalues * @param array $defaultvalues
*/ */
public function set_data($defaultvalues) { public function set_data($defaultvalues) {
global $DB; global $DB;

6
report/overview/report.php

@ -38,9 +38,9 @@ class game_report extends game_default_report {
/** /**
* Display the report. * Display the report.
* *
* @param $game * @param stdClass $game
* @param $cm * @param stdClass $cm
* @param $course * @param stdClass $course
*/ */
public function display($game, $cm, $course) { public function display($game, $cm, $course) {
global $CFG, $SESSION, $DB; global $CFG, $SESSION, $DB;

38
showanswers.php

@ -58,7 +58,7 @@ echo $OUTPUT->footer();
/** /**
* Compute repetitions * Compute repetitions
* *
* @param $game * @param stdClass $game
*/ */
function game_compute_repetitions($game) { function game_compute_repetitions($game) {
global $DB, $USER; global $DB, $USER;
@ -77,7 +77,7 @@ function game_compute_repetitions($game) {
/** /**
* Show users * Show users
* *
* @param $game * @param stdClass $game
*/ */
function game_showusers($game) { function game_showusers($game) {
global $CFG, $USER; global $CFG, $USER;
@ -142,9 +142,9 @@ function game_showusers($game) {
/** /**
* Show answers * Show answers
* *
* @param $game * @param stdClass $game
* @param $existsbook * @param boolean $existsbook
* @param $context * @param stdClass $context
*/ */
function game_showanswers( $game, $existsbook, $context) { function game_showanswers( $game, $existsbook, $context) {
if ($game->gamekind == 'bookquiz' and $existsbook) { if ($game->gamekind == 'bookquiz' and $existsbook) {
@ -168,7 +168,7 @@ function game_showanswers( $game, $existsbook, $context) {
/** /**
* append select to SQL * append select to SQL
* *
* @param $game * @param stdClass $game
*/ */
function game_showanswers_appendselect( $game) { function game_showanswers_appendselect( $game) {
switch ($game->gamekind) { switch ($game->gamekind) {
@ -190,8 +190,8 @@ function game_showanswers_appendselect( $game) {
/** /**
* Show answers question * Show answers question
* *
* @param $game * @param stdClass $game
* @param $context * @param stdClass $context
*/ */
function game_showanswers_question( $game, $context) { function game_showanswers_question( $game, $context) {
global $DB; global $DB;
@ -228,8 +228,8 @@ function game_showanswers_question( $game, $context) {
/** /**
* Show answers quiz * Show answers quiz
* *
* @param $game * @param stdClass $game
* @param $context * @param stdClass $context
*/ */
function game_showanswers_quiz( $game, $context) { function game_showanswers_quiz( $game, $context) {
global $CFG; global $CFG;
@ -252,14 +252,14 @@ function game_showanswers_quiz( $game, $context) {
/** /**
* Create the select for SQL * Create the select for SQL
* *
* @param $game * @param stdClass $game
* @param $table * @param string $table
* @param $select * @param string $select
* @param $fields * @param string $fields
* @param $order * @param string $order
* @param $showcategoryname * @param boolean $showcategoryname
* @param $courseid * @param int $courseid
* @param $context * @param stdClass $context
*/ */
function game_showanswers_question_select( $game, $table, $select, $fields, $order, $showcategoryname, $courseid, $context) { function game_showanswers_question_select( $game, $table, $select, $fields, $order, $showcategoryname, $courseid, $context) {
global $CFG, $DB, $OUTPUT; global $CFG, $DB, $OUTPUT;
@ -403,7 +403,7 @@ function game_showanswers_question_select( $game, $table, $select, $fields, $ord
/** /**
* Show answers glossary * Show answers glossary
* *
* @param $game * @param stdClass $game
*/ */
function game_showanswers_glossary( $game) { function game_showanswers_glossary( $game) {
global $CFG, $DB; global $CFG, $DB;

Loading…
Cancel
Save