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 object $magics
* @param object $poss
* @param int $ccrosspos
* @param int $crosspos
* @param int $crossdir
* @param object $crosssword
* @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
*
* @author bdaloukas
* @package game
* @package mod_game
* @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
**/
class CrossDB extends Cross {
/**
@ -91,7 +92,7 @@ class CrossDB extends Cross {
/**
* Load cross.
*
* @param $g
* @param string $g
* @param boolean $done
* @param string $html
* @param stdClass $game
@ -173,7 +174,7 @@ class CrossDB extends Cross {
*
* @param int $correctletters
* @param int $wrongletters
* @param $restletters
* @param string $restletters
* @param stdClass $game
* @param stdClass $attempt
* @param boolean $done
@ -241,8 +242,8 @@ class CrossDB extends Cross {
* Update cross questions.
*
* @param stdClass $rec (is a record of cross_questions).
* @param $g
* @param $pos
* @param string $g
* @param int $pos
* @param int $correctletters
* @param int $wrongletters
* @param int $restletters

40
cryptex/cryptexdb_class.php

@ -166,10 +166,10 @@ class CryptexDB extends CrossDB {
/**
* Inserts a char.
*
* @param $letters
* @param $cols
* @param $rows
* @param $char
* @param string $letters
* @param int $cols
* @param int $rows
* @param string $char
* @param int $spaces
*/
public function insertchar( &$letters, $cols, $rows, $char, &$spaces) {
@ -186,10 +186,10 @@ class CryptexDB extends CrossDB {
/**
* Inserts chars.
*
* @param $letters
* @param $cols
* @param $rows
* @param $char
* @param string $letters
* @param int $cols
* @param int $rows
* @param string $char
* @param int $spaces
*/
public function insertchars( &$letters, $cols, $rows, $char, &$spaces) {
@ -234,9 +234,9 @@ class CryptexDB extends CrossDB {
* Loads the cryptex from database.
*
* @param array $crossm
* @param $mask
* @param $corrects
* @param $language
* @param string $mask
* @param int $corrects
* @param string $language
*
* @return questions
*/
@ -288,9 +288,9 @@ class CryptexDB extends CrossDB {
/**
* Calls the setwords of class Cross.
*
* @param $answers
* @param $maxcols
* @param $reps
* @param string $answers
* @param int $maxcols
* @param array $reps
*
* @return Cross::setwords
*/
@ -301,12 +301,12 @@ class CryptexDB extends CrossDB {
/**
* Calls the computedata of class Cross.
*
* @param $crossm
* @param $crossd
* @param $letters
* @param $minwords
* @param $maxwords
* @param $mtimelimit
* @param stdClass $crossm
* @param stdClass $crossd
* @param string $letters
* @param int $minwords
* @param int $maxwords
* @param int $mtimelimit
*/
public function computedata( &$crossm, &$crossd, &$letters, $minwords, $maxwords, $mtimelimit=3) {
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.
*
* @param $id
* @param int $id
* @param stdClass $game
* @param stdClass $atttempt
* @param $cryptexrec
* @param $endofgame
* @param stdClass $cryptexrec
* @param boolean $endofgame
* @param stdClass $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 stdClass $game
* @param stdClass $atttempt
* @param $cryptexrec
* @param $q (The q means game_queries.id).
* @param $answer
* @param $finishattempt
* @param stdClass $cryptexrec
* @param int $q (The q means game_queries.id).
* @param stdClass $answer
* @param boolean $finishattempt
* @param stdClass $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 stdClass $game
* @param stdClass $atttempt
* @param $cryptexrec
* @param $crosssm
* @param stdClass $cryptexrec
* @param stdClass $crosssm
* @param boolean $updateattempt
* @param boolean $onlyshow
* @param boolean $showsolution
@ -408,7 +408,7 @@ if ($print) {
* @param int $id
* @param stdClass $game
* @param stdClass $atttempt
* @param $cryptexrec
* @param stdClass $cryptexrec
*/
function game_cryptex_onfinished( $id, $game, $attempt, $cryptexrec) {
global $CFG, $DB;

2
db/access.php

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/*
/**
* Plugin capabilities
*
* @package mod_game

2
db/importsnakes.php

@ -71,7 +71,7 @@ function game_importsnakes() {
/**
* Insert one board to database
*
* @param $newrec
* @param stdClass $newrec
*/
function game_importsnakes_do( $newrec) {
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.
*
* @param stdClass $game
* @param $questions
* @param $maxquestions
* @param string $questions
* @param int $maxquestions
*/
function game_millionaire_html_print( $game, $questions, $maxquestions) {
$color1 = 'black';

98
export/exportjavame.php

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

32
hiddenpicture/picture.php

@ -39,14 +39,14 @@ create_image( $id, $attemptid, $foundcells, $cells, $filehash, $cols, $rows, $fi
/**
* Create an image.
*
* @param $id
* @param $attemptid
* @param $foundcells
* @param $cells
* @param $filehash
* @param $cols
* @param $rows
* @param $filenamenumbers
* @param int $id
* @param int $attemptid
* @param boolean $foundcells
* @param stdClass $cells
* @param string $filehash
* @param int $cols
* @param int $rows
* @param string $filenamenumbers
*/
function create_image( $id, $attemptid, $foundcells, $cells, $filehash, $cols, $rows, $filenamenumbers) {
global $CFG;
@ -123,14 +123,14 @@ function create_image( $id, $attemptid, $foundcells, $cells, $filehash, $cols, $
/**
* Show number.
*
* @param $imghandle
* @param $imgnumbers
* @param $number
* @param $x1
* @param $y1
* @param $width
* @param $height
* @param $sizenumbers
* @param object $imghandle
* @param object $imgnumbers
* @param int $number
* @param int $x1
* @param int $y1
* @param int $width
* @param int $height
* @param int $sizenumbers
*/
function shownumber( $imghandle, $imgnumbers, $number, $x1 , $y1, $width, $height, $sizenumbers) {
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.
*
* @param int $id Id of the module instance
* @param int $gameid Id of the module instance
* @return boolean Success/Failure
**/
function game_delete_instance($gameid) {
@ -358,7 +358,7 @@ function game_grades($gameid) {
/**
* 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
* @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.
*
* @param int $gameid ID of an instance of this module
* @param int $scaleid
* @return mixed
* @todo Finish documenting this function
**/
@ -407,6 +408,7 @@ function game_scale_used ($gameid, $scaleid) {
*
* @param object $game null means all games
* @param int $userid specific user only, 0 mean all
* @param boolean $nullifnone
*/
function game_update_grades($game=null, $userid=0, $nullifnone=true) {
global $CFG;
@ -454,7 +456,7 @@ function game_update_grades($game=null, $userid=0, $nullifnone=true) {
* Create grade item for given game
*
* @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
*/
function game_grade_item_update($game, $grades=null) {
@ -516,10 +518,10 @@ function game_grade_item_delete( $game) {
* @param stdClass $activities
* @param int $index
* @param int $timestart
* @param int courseid
* @param int cmid
* @param int userid
* @param int groupid
* @param int $courseid
* @param int $cmid
* @param int $userid
* @param int $groupid
*/
function game_get_recent_mod_activity(&$activities, &$index, $timestart, $courseid, $cmid, $userid=0, $groupid=0) {
global $DB, $COURSE, $USER;
@ -621,7 +623,7 @@ function game_get_recent_mod_activity(&$activities, &$index, $timestart, $course
* @param stdClass $activity
* @param int $courseid
* @param stdClass $detail
* @param array $modgames
* @param array $modnames
*/
function game_print_recent_mod_activity($activity, $courseid, $detail, $modnames) {
global $CFG, $OUTPUT;
@ -662,7 +664,7 @@ function game_print_recent_mod_activity($activity, $courseid, $detail, $modnames
* Removes all grades from gradebook
*
* @param int $courseid
* @param string optional type
* @param string optional $type
*/
function game_reset_gradebook($courseid, $type='') {
global $DB;
@ -682,6 +684,7 @@ function game_reset_gradebook($courseid, $type='') {
* What supports.
*
* @uses FEATURE_GRADE_HAS_GRADE
* @param string $feature
* @return bool True if quiz supports feature
*/
function game_supports($feature) {
@ -814,7 +817,7 @@ function game_get_grading_options() {
* context when this is called
*
* @param settings_navigation $settings
* @param navigation_node $quiznode
* @param navigation_node $gamenode
* @return void
*/
function game_extend_settings_navigation($settings, $gamenode) {
@ -1005,6 +1008,8 @@ 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
*
* @param stdClass $defaultitem
*/
function game_get_shortcuts($defaultitem) {
global $DB, $CFG;
@ -1143,8 +1148,8 @@ if (defined('USE_GET_SHORTCUTS')) {
* @param stdClass $cm
* @param stdClass $context
* @param string filearea
* @param array args
* @param boolean forcedownload
* @param array $args
* @param boolean $forcedownload
*
* @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.
*
* @param $data the data submitted from the reset course.
* @param stdClass $data the data submitted from the reset course.
*
* @return array status array
*/

261
locallib.php

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

134
millionaire/play.php

@ -27,11 +27,11 @@ defined('MOODLE_INTERNAL') || die();
/**
* Plays the millionaire
*
* @param $id
* @param $game
* @param $attempt
* @param $millionaire
* @param $context
* @param int $id
* @param stdClass $game
* @param stdClass $attempt
* @param stdClass $millionaire
* @param stdClass $context
*/
function game_millionaire_continue( $id, $game, $attempt, $millionaire, $context) {
// 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
*
* @param $id
* @param $game
* @param $attempt
* @param $millionaire
* @param $context
* @param int $id
* @param stdClass $game
* @param stdClass $attempt
* @param stdClass $millionaire
* @param stdClass $context
*/
function game_millionaire_play( $id, $game, $attempt, $millionaire, $context) {
global $DB;
@ -117,13 +117,13 @@ function game_millionaire_play( $id, $game, $attempt, $millionaire, $context) {
/**
* Shows the grid
*
* @param $game
* @param $millionaire
* @param $id
* @param $query
* @param $aanswer
* @param $info
* @param $context
* @param stdClass $game
* @param stdClass $millionaire
* @param int $id
* @param stdClass $query
* @param array $aanswer
* @param stdClass $info
* @param stdClass $context
*/
function game_millionaire_showgrid( $game, $millionaire, $id, $query, $aanswer, $info, $context) {
global $CFG, $OUTPUT;
@ -317,11 +317,11 @@ function game_millionaire_showgrid( $game, $millionaire, $id, $query, $aanswer,
/**
* Show next question
*
* @param $id
* @param $game
* @param $attempt
* @param $millionaire
* @param $context
* @param int $id
* @param stdClass $game
* @param stdClass $attempt
* @param stdClass $millionaire
* @param stdClass $context
*/
function game_millionaire_shownextquestion( $id, $game, $attempt, $millionaire, $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.
*
* @param $answer
* @param $game
* @param $attemt
* @param $millionaire
* @param $query
* @param $context
* @param string $answer
* @param stdClass $game
* @param stdClasss $attempt
* @param stdClass $millionaire
* @param stdClass $query
* @param stdClass $context
*/
function game_millionaire_selectquestion( &$aanswer, $game, $attempt, &$millionaire, &$query, $context) {
global $DB, $USER;
@ -475,12 +475,12 @@ function game_millionaire_selectquestion( &$aanswer, $game, $attempt, &$milliona
/**
* Select serial question
*
* @param $game
* @param $table
* @param $select
* @param $idfields
* @param $level
* @param $order
* @param stdClass $game
* @param string $table
* @param string $select
* @param string $idfields
* @param int $level
* @param string $order
*/
function game_millionaire_select_serial_question( $game, $table, $select, $idfields = "id", $level, $order) {
global $DB, $USER;
@ -515,11 +515,11 @@ function game_millionaire_select_serial_question( $game, $table, $select, $idfie
/**
* Load questions for millionaire
*
* @param $game
* @param $millionaire
* @param $query
* @param $aanswer
* @param $context
* @param stdClass $game
* @param stdClass $millionaire
* @param string $query
* @param array $aanswer
* @param stdClass $context
*/
function game_millionaire_loadquestions( $game, $millionaire, &$query, &$aanswer, $context) {
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.
*
* @param $millionaire
* @param $mask
* @param stdClass $millionaire
* @param string $mask
*/
function game_millionaire_setstate( &$millionaire, $mask) {
global $DB;
@ -558,11 +558,11 @@ function game_millionaire_setstate( &$millionaire, $mask) {
/**
* One help 50-50
*
* @param $game
* @param $id
* @param $millionaire
* @param $query
* @param $context
* @param stdClass $game
* @param int $id
* @param stdClass $millionaire
* @param string $query
* @param stdClass $context
*/
function game_millionaire_onhelp5050( $game, $id, &$millionaire, $query, $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
*
* @param $game
* @param $id
* @param $millionaire
* @param $query
* @param $context
* @param stdClass $game
* @param int $id
* @param stdClass $millionaire
* @param stdClass $query
* @param stdClass $context
*/
function game_millionaire_onhelptelephone( $game, $id, &$millionaire, $query, $context) {
game_millionaire_loadquestions( $game, $millionaire, $query, $aanswer, $context);
@ -638,11 +638,11 @@ function game_millionaire_onhelptelephone( $game, $id, &$millionaire, $query,
/**
* One help people
*
* @param $game
* @param $id
* @param $millionaire
* @param $query
* @param $context
* @param stdClass $game
* @param int $id
* @param stdClass $millionaire
* @param stdClass $query
* @param stdClass $context
*/
function game_millionaire_onhelppeople( $game, $id, &$millionaire, $query, $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
*
* @param $id
* @param $game
* @param $attempt
* @param $millionaire
* @param $query
* @param $answer
* @param $context
* @param int $id
* @param stdClass $game
* @param stdClass $attempt
* @param stdClass $millionaire
* @param stdClass $query
* @param string $answer
* @param stdClass $context
*/
function game_millionaire_onanswer( $id, $game, $attempt, &$millionaire, $query, $answer, $context) {
global $DB;
@ -745,10 +745,10 @@ function game_millionaire_onanswer( $id, $game, $attempt, &$millionaire, $query,
/**
* Millionaire on quit
*
* @param $id
* @param $game
* @param $attempt
* @param $query
* @param int $id
* @param stdClass $game
* @param stdClass $attempt
* @param stdClass $query
*/
function game_millionaire_onquit( $id, $game, $attempt, $query) {
global $CFG, $DB;

7
mod_form.php

@ -20,6 +20,7 @@
* @package mod_game
* @author Alastair Munro <alastair@catalyst.net.nz>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2007 Vasilis Daloukas
*/
defined('MOODLE_INTERNAL') || die();
@ -431,8 +432,8 @@ class mod_game_mod_form extends moodleform_mod {
/**
* validation
*
* @param $data
* @param $files
* @param stdClass $data
* @param array $files
*
* @return moodle_url
*/
@ -451,7 +452,7 @@ class mod_game_mod_form extends moodleform_mod {
/**
* Set data
*
* @param $defaultvalues
* @param array $defaultvalues
*/
public function set_data($defaultvalues) {
global $DB;

6
report/overview/report.php

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

38
showanswers.php

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

Loading…
Cancel
Save