Browse Source

phpdoc compatibility

MOODLE_20_STABLE
bdaloukas 8 years ago
parent
commit
79c7fc0fe0
  1. 4
      cross/crossdb_class.php
  2. 13
      cryptex/play.php
  3. 8
      db/importsnakes.php
  4. 2
      db/upgrade.php
  5. 4
      export/exportjavame.php
  6. 48
      export/html/snakes/js/snakes-mod.js
  7. 58
      hiddenpicture/play.php
  8. 10
      lib.php
  9. 26
      locallib.php
  10. 2
      millionaire/play.php
  11. 6
      print.php
  12. 2
      report/overview/report.php
  13. 2
      showanswers.php
  14. 8
      showattempts.php
  15. 130
      snakes/createboard.php
  16. 14
      snakes/play.php
  17. 85
      sudoku/sdd/class.logfile.php
  18. 14
      translate.php

4
cross/crossdb_class.php

@ -26,7 +26,7 @@
defined('MOODLE_INTERNAL') || die(); 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
* *
* @package mod_game * @package mod_game
@ -100,7 +100,7 @@ class CrossDB extends Cross {
* @param stdClass $crossrec * @param stdClass $crossrec
* @param boolean $onlyshow * @param boolean $onlyshow
* @param boolean $showsolution * @param boolean $showsolution
* @param $finishattempt * @param boolean $finishattempt
* @param boolean $showhtmlsolutions * @param boolean $showhtmlsolutions
* @param string $language * @param string $language
* @param boolean $showstudentguess * @param boolean $showstudentguess

13
cryptex/play.php

@ -17,8 +17,9 @@
/** /**
* This page plays the cryptex game * This page plays the cryptex game
* *
* @author bdaloukas * @package mod_game
* @package game * @copyright 2007 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
**/ **/
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
@ -30,7 +31,7 @@ require_once( "cryptexdb_class.php");
* *
* @param int $id * @param int $id
* @param stdClass $game * @param stdClass $game
* @param stdClass $atttempt * @param stdClass $attempt
* @param stdClass $cryptexrec * @param stdClass $cryptexrec
* @param boolean $endofgame * @param boolean $endofgame
* @param stdClass $context * @param stdClass $context
@ -114,7 +115,7 @@ 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 $attempt
* @param stdClass $cryptexrec * @param stdClass $cryptexrec
* @param int $q (The q means game_queries.id). * @param int $q (The q means game_queries.id).
* @param stdClass $answer * @param stdClass $answer
@ -170,7 +171,7 @@ 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 $attempt
* @param stdClass $cryptexrec * @param stdClass $cryptexrec
* @param stdClass $crosssm * @param stdClass $crosssm
* @param boolean $updateattempt * @param boolean $updateattempt
@ -407,7 +408,7 @@ if ($print) {
* *
* @param int $id * @param int $id
* @param stdClass $game * @param stdClass $game
* @param stdClass $atttempt * @param stdClass $attempt
* @param stdClass $cryptexrec * @param stdClass $cryptexrec
*/ */
function game_cryptex_onfinished( $id, $game, $attempt, $cryptexrec) { function game_cryptex_onfinished( $id, $game, $attempt, $cryptexrec) {

8
db/importsnakes.php

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

2
db/upgrade.php

@ -44,7 +44,7 @@ defined('MOODLE_INTERNAL') || die();
/** /**
* Upgrades database * Upgrades database
* *
* @param $oldversion * @param int $oldversion
*/ */
function xmldb_game_upgrade($oldversion) { function xmldb_game_upgrade($oldversion) {

4
export/exportjavame.php

@ -196,7 +196,7 @@ function game_exportjavame_exportdata_hangmanp( $src, $destmobiledir, $destdir,
* *
* @param stdClas $game * @param stdClas $game
* @param stdClass $context * @param stdClass $context
* @param boolean $exportattachments * @param boolean $exportattachment
* @param string $dest * @param string $dest
* @param array $files * @param array $files
*/ */
@ -304,7 +304,7 @@ function game_exmportjavame_getanswers_question_select( $game, $context, $table,
* *
* @param stdClass $game * @param stdClass $game
* @param stdClass $context * @param stdClass $context
* @param boolean $exportattachments * @param boolean $exportattachment
* @param string $destdir * @param string $destdir
* @param array $files * @param array $files
*/ */

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

@ -3,8 +3,6 @@ Husain Limdiyawala(MSc IT DA-IICT) */
// Global Variables. // Global Variables.
var totblocks = 0; var totblocks = 0;
var data = "";
var currentblock = 0;
var lastposition = new Array(); var lastposition = new Array();
var randomno = 0; var randomno = 0;
var tots = new Array(); var tots = new Array();
@ -78,7 +76,9 @@ function snakescheck(k) {
for(i = 0; i <= srcsnake.length; i++) { for(i = 0; i <= srcsnake.length; i++) {
if (srcsnake[i] == tots[k]) { if (srcsnake[i] == tots[k]) {
alert("Ωχ! Σε τσίμπησε φίδι στο τετράγωνο " + srcsnake[i] + " και θα πρέπει να γυρίσεις στο τετράγωνο " + destsnake[i] + ", εκτός κι αν απαντήσεις σωστά στην ερώτηση που ακολουθεί."); var s = "Ωχ! Σε τσίμπησε φίδι στο τετράγωνο " + srcsnake[i] + " και θα πρέπει να γυρίσεις στο τετράγωνο " + destsnake[i];
s = s + ", εκτός κι αν απαντήσεις σωστά στην ερώτηση που ακολουθεί.";
alert( s);
document.getElementById(destsnake[i]).style.background = "url(images/pawn1.png)"; document.getElementById(destsnake[i]).style.background = "url(images/pawn1.png)";
document.getElementById(tots[k]).style.background = "url(images/square52.png)"; document.getElementById(tots[k]).style.background = "url(images/square52.png)";
lastposition[k] = destsnake[i]; lastposition[k] = destsnake[i];
@ -111,22 +111,6 @@ function laddercheck(k) {
} }
} }
// The below function will register a snake.
function registerSnake(tp, lft, dv, src, dest, i) {
document.getElementById(dv).style.top = tp + "px";
document.getElementById(dv).style.left = lft + "px";
srcsnake[i] = src;
destsnake[i] = dest;
}
// The below function will register a ladder.
function registerLadder(tp, lft, dv, src, dest, i) {
document.getElementById(dv).style.top = tp + "px";
document.getElementById(dv).style.left = lft + "px";
ladsrc[i] = src;
laddest[i] = dest;
}
// The below function regulates the play. // The below function regulates the play.
function doit(i) { function doit(i) {
throwDice(i); throwDice(i);
@ -146,29 +130,3 @@ function checkWin(i) {
return true; return true;
} }
} }
// The below function will disable both the combobox .
function disableField() {
document.getElementById("players").disabled = "disabled";
document.getElementById("boardtype").disabled = "disabled";
}
function question() {
var picked, q1;
picked = selectQuest(allQuest);
alert("Randomly selected number:" + picked);
q1 = prompt(quest[picked * 4], "Απάντηση");
if (q1 == quest[picked * 4 + 1]) {
alert("Σωστά!");
doit(l);
coranswered.concat(quest.splice(picked * 4, 4));
} else {
alert("Η απάντηση δεν ήταν σωστή. Χάνεις τη σειρά σου για αυτό το γύρο!");
wroanswered.concat(quest.splice(picked * 4, 4));
}
// Remove question and answers from available questions - (thus not allowing to have a Repeated question).
allQuest--;
}

58
hiddenpicture/play.php

@ -233,12 +233,12 @@ function game_hiddenpicture_selectglossaryentry( $game, $attempt) {
/** /**
* Plays the game "Hidden picture" * Plays the game "Hidden picture"
* *
* @param $id * @param int $id
* @param $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
* @param $hiddenpicture * @param stdClass $hiddenpicture
* @param $showsolution * @param boolean $showsolution
* @param $context * @param stdClass $context
*/ */
function game_hiddenpicture_play( $id, $game, $attempt, $hiddenpicture, $showsolution, $context) { function game_hiddenpicture_play( $id, $game, $attempt, $hiddenpicture, $showsolution, $context) {
if ($game->toptext != '') { if ($game->toptext != '') {
@ -276,8 +276,8 @@ function game_hiddenpicture_play( $id, $game, $attempt, $hiddenpicture, $showsol
/** /**
* "Hidden picture" compute score * "Hidden picture" compute score
* *
* @param $game * @param stdClass $game
* @param $hiddenpicture * @param stdClass $hiddenpicture
*/ */
function game_hidden_picture_computescore( $game, $hiddenpicture) { function game_hidden_picture_computescore( $game, $hiddenpicture) {
$correct = $hiddenpicture->correct; $correct = $hiddenpicture->correct;
@ -298,11 +298,11 @@ function game_hidden_picture_computescore( $game, $hiddenpicture) {
/** /**
* Show hidden picture * Show hidden picture
* *
* @param $id * @param int $id
* @param $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
* @param $hiddenpicture * @param stdClass $hiddenpicture
* @param $showsolution * @param boolean $showsolution
*/ */
function game_hiddenpicture_showhiddenpicture( $id, $game, $attempt, $hiddenpicture, $showsolution, function game_hiddenpicture_showhiddenpicture( $id, $game, $attempt, $hiddenpicture, $showsolution,
$offsetquestions, $correctquestions) { $offsetquestions, $correctquestions) {
@ -335,9 +335,9 @@ function game_hiddenpicture_showhiddenpicture( $id, $game, $attempt, $hiddenpict
/** /**
* hidden picture. show question glossary * hidden picture. show question glossary
* *
* @param $game * @param stdClass $game
* @param $id * @param int $id
* @param $query * @param stdClass $query
*/ */
function game_hiddenpicture_showquestion_glossary( $game, $id, $query) { function game_hiddenpicture_showquestion_glossary( $game, $id, $query) {
global $CFG, $DB; global $CFG, $DB;
@ -373,12 +373,12 @@ function game_hiddenpicture_showquestion_glossary( $game, $id, $query) {
/** /**
* Check main question * Check main question
* *
* @param $id * @param int $id
* @param $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
* @param $hiddenpicture * @param stdClass $hiddenpicture
* @param $finishattempt * @param boolean $finishattempt
* @param $context * @param stdClass $context
*/ */
function game_hiddenpicture_check_mainquestion( $id, $game, &$attempt, &$hiddenpicture, $finishattempt, $context) { function game_hiddenpicture_check_mainquestion( $id, $game, &$attempt, &$hiddenpicture, $finishattempt, $context) {
global $CFG, $DB; global $CFG, $DB;
@ -448,13 +448,13 @@ function game_hiddenpicture_check_mainquestion( $id, $game, &$attempt, &$hiddenp
/** /**
* Show picture * Show picture
* *
* @param $id * @param int $id
* @param $game * @param stdClass $game
* @param $attempt * @param stdClass $attempt
* @param $query * @param stdClass $query
* @param $cells * @param object $cells
* @param $foundcells * @param int $foundcells
* @param $usemap * @param boolean $usemap
*/ */
function game_showpicture( $id, $game, $attempt, $query, $cells, $foundcells, $usemap) { function game_showpicture( $id, $game, $attempt, $query, $cells, $foundcells, $usemap) {
global $CFG; global $CFG;

10
lib.php

@ -665,7 +665,7 @@ function game_print_recent_mod_activity($activity, $courseid, $detail, $modnames
* *
* @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;
@ -1147,7 +1147,7 @@ if (defined('USE_GET_SHORTCUTS')) {
* @param stdClass $course * @param stdClass $course
* @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
* *
@ -1412,7 +1412,8 @@ function game_get_context_module_instance( $moduleid) {
* *
* This is used to find out if scale used anywhere * This is used to find out if scale used anywhere
* *
* @param int $moduleid * @param int $courseid
*
* @return stdClass context * @return stdClass context
*/ */
function game_get_context_course_instance( $courseid) { function game_get_context_course_instance( $courseid) {
@ -1427,7 +1428,8 @@ function game_get_context_course_instance( $courseid) {
* Returns the url of a pix file. Is the same for all versions of Moodle. * Returns the url of a pix file. Is the same for all versions of Moodle.
* *
* @param string $filename * @param string $filename
* @param string module * @param string $module
*
* @return stdClass url * @return stdClass url
*/ */
function game_pix_url( $filename, $module='') { function game_pix_url( $filename, $module='') {

26
locallib.php

@ -315,7 +315,7 @@ function game_question_shortanswer_question( $game, $allowspaces, $userepetition
* @param string $table * @param string $table
* @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
*/ */
@ -427,7 +427,7 @@ function game_update_repetitions( $gameid, $userid, $questionid, $glossaryentryi
* Select random questions for Sudoku. * Select random questions for Sudoku.
* *
* @param stdClass $game * @param stdClass $game
* @param int count * @param int $count
* *
* @return stdClass the random record(s) * @return stdClass the random record(s)
*/ */
@ -641,7 +641,7 @@ function game_getallletters( $word, $lang='', $userlanguage='') {
* true if exist all the letters * true if exist all the letters
* *
* @param string $str * @param string $str
* @param string $strfile * @param string $strfind
* *
* @return the letters detected * @return the letters detected
*/ */
@ -1133,7 +1133,7 @@ function game_get_best_grade($game, $userid) {
* Converts score to grade * Converts score to grade
* *
* @param float $score * @param float $score
* @param float $grade * @param stdClass $game
* *
* @return float the user's current grade for this game. * @return float the user's current grade for this game.
*/ */
@ -1150,8 +1150,7 @@ function game_score_to_grade($score, $game) {
* *
* @param object $game the game instance. * @param object $game the game instance.
* @param object $attempt the attempt in question. * @param object $attempt the attempt in question.
* @param $context the roles and permissions context, * @param $context the roles and permissions context, for game module instance
* normally the context for the game module instance.
* *
* @return object an object with boolean fields responses, scores, feedback, * @return object an object with boolean fields responses, scores, feedback,
* correct_responses, solutions and general feedback * correct_responses, solutions and general feedback
@ -1229,8 +1228,7 @@ function game_compute_attempt_layout( $game, &$attempt) {
* *
* @param object $game the game instance. * @param object $game the game instance.
* @param array $attempts an array of attempt objects. * @param array $attempts an array of attempt objects.
* @param $context the roles and permissions context, * @param $context the roles and permissions context, the game instance
* normally the context for the game module instance.
* *
* @return array of two options objects, one showing which options are true for * @return array of two options objects, one showing which options are true for
* at least one of the attempts, the other showing which options are true * at least one of the attempts, the other showing which options are true
@ -1257,8 +1255,8 @@ function game_get_combined_reviewoptions($game, $attempts, $context=null) {
/** /**
* Save the overall grade for a user at a game in the game_grades table * Save the overall grade for a user at a game in the game_grades table
* *
* @param object $quiz The game for which the best grade is to be calculated and then saved. * @param object $game The game for which the best grade is to be calculated and then saved.
* @param integer $userid The userid to calculate the grade for. Defaults to the current user. *
* @return boolean Indicates success or failure. * @return boolean Indicates success or failure.
*/ */
function game_save_best_score($game) { function game_save_best_score($game) {
@ -1382,7 +1380,7 @@ function game_calculate_best_attempt($game, $attempts) {
/** /**
* get questions for sudoku * get questions for sudoku
* *
* @param $questionlist * @param string $questionlist
*/ */
function game_sudoku_getquestions( $questionlist) { function game_sudoku_getquestions( $questionlist) {
global $CFG, $DB; global $CFG, $DB;
@ -1715,7 +1713,7 @@ function game_right_to_left( $lang) {
* Compute reverse print * Compute reverse print
* *
* @param stdClass $attempt * @param stdClass $attempt
* @param string $wordctrl * @param string $wordrtl
* @param boolean $reverseprint * @param boolean $reverseprint
*/ */
function game_compute_reserve_print( $attempt, &$wordrtl, &$reverseprint) { function game_compute_reserve_print( $attempt, &$wordrtl, &$reverseprint) {
@ -2212,7 +2210,7 @@ function game_get_string_lang( $identifier, $module, $lang) {
* Get string from file * Get string from file
* *
* @param string $identifier * @param string $identifier
* @param string $lanfile * @param string $langfile
* @param string $destination * @param string $destination
*/ */
function get_string_from_file($identifier, $langfile, $destination) { function get_string_from_file($identifier, $langfile, $destination) {
@ -2288,7 +2286,7 @@ function game_get_contexts() {
* @param int $id * @param int $id
* @param string $line * @param string $line
* @param string $destdir * @param string $destdir
* @pram array $files * @param 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;

2
millionaire/play.php

@ -340,7 +340,7 @@ 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 string $answer * @param array $aanswer
* @param stdClass $game * @param stdClass $game
* @param stdClasss $attempt * @param stdClasss $attempt
* @param stdClass $millionaire * @param stdClass $millionaire

6
print.php

@ -55,9 +55,9 @@ function game_print( $game, $update, $context) {
/** /**
* Prints a cross. * Prints a cross.
* *
* @param $game * @param stdClass $game
@param $update @param boolean $update
* @param $context * @param stdClass $context
*/ */
function game_print_cross( $game, $update, $context) { function game_print_cross( $game, $update, $context) {
require( "cross/play.php"); require( "cross/play.php");

2
report/overview/report.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/>.
/* /**
* This script lists student attempts. * This script lists student attempts.
* *
* @package mod_game * @package mod_game

2
showanswers.php

@ -486,7 +486,7 @@ function game_showanswers_glossary( $game) {
/** /**
* Show answers bookquiz * Show answers bookquiz
* *
* @param $game * @param stdClass $game
*/ */
function game_showanswers_bookquiz( $game, $context) { function game_showanswers_bookquiz( $game, $context) {
global $CFG; global $CFG;

8
showattempts.php

@ -50,7 +50,7 @@ echo $OUTPUT->footer();
/** /**
* Show users * Show users
* *
* @param $game * @param stdClass $game
*/ */
function game_showusers($game) { function game_showusers($game) {
global $CFG, $USER, $DB; global $CFG, $USER, $DB;
@ -122,7 +122,7 @@ function game_showusers($game) {
/** /**
* Show groups * Show groups
* *
* @param $game * @param stdClass $game
*/ */
function game_showgroups($game) { function game_showgroups($game) {
global $CFG, $USER, $DB; global $CFG, $USER, $DB;
@ -180,7 +180,7 @@ function game_showgroups($game) {
/** /**
* Show attempts * Show attempts
* *
* @param $game * @param stdClass $game
*/ */
function game_showattempts($game) { function game_showattempts($game) {
global $CFG, $DB, $OUTPUT; global $CFG, $DB, $OUTPUT;
@ -282,7 +282,7 @@ function game_showattempts($game) {
/** /**
* One delete attempt * One delete attempt
* *
* @param $game * @param stdClass $game
*/ */
function game_ondeleteattempt( $game) { function game_ondeleteattempt( $game) {
global $CFG, $DB; global $CFG, $DB;

130
snakes/createboard.php

@ -27,11 +27,11 @@ defined('MOODLE_INTERNAL') || die();
/** /**
* Create snakes board * Create snakes board
* *
* @param $imageasstring * @param string $imageasstring
* @param $colsx * @param int $colsx
* @param $colsy * @param int $colsy
* @param $ofstop * @param int $ofstop
* @param $ofsbottom * @param int $ofsbottom
*/ */
function game_createsnakesboard($imageasstring, $colsx, $colsy, $ofstop, $ofsbottom, function game_createsnakesboard($imageasstring, $colsx, $colsy, $ofstop, $ofsbottom,
$ofsright, $ofsleft, $board, $setwidth, $setheight) { $ofsright, $ofsleft, $board, $setwidth, $setheight) {
@ -97,11 +97,11 @@ function game_createsnakesboard($imageasstring, $colsx, $colsy, $ofstop, $ofsbot
/** /**
* Compute coordinates * Compute coordinates
* *
* @param $pos * @param int $pos
* @param $x * @param int $x
* @param $y * @param int $y
* @param $colsx * @param int $colsx
* @param $colsy * @param int $colsy
*/ */
function computexy( $pos, &$x, &$y, $colsx, $colsy) { function computexy( $pos, &$x, &$y, $colsx, $colsy) {
$x = ($pos - 1) % $colsx; $x = ($pos - 1) % $colsx;
@ -114,14 +114,14 @@ function computexy( $pos, &$x, &$y, $colsx, $colsy) {
/** /**
* Make board * Make board
* *
* @param $im * @param object $im
* @param $cs * @param int $cs
* @param $cy * @param int $cy
* @param $board * @param $object $board
* @param $colsx * @param int $colsx
* @param $colsy * @param int $colsy
* @param $ofsleft * @param int $ofsleft
* @param $ofstop * @param int $ofstop
*/ */
function makeboard( $im, $dir, $cx, $cy, $board, $colsx, $colsy, $ofsleft, $ofstop) { function makeboard( $im, $dir, $cx, $cy, $board, $colsx, $colsy, $ofsleft, $ofstop) {
$a = explode( ',', $board); $a = explode( ',', $board);
@ -138,14 +138,14 @@ function makeboard( $im, $dir, $cx, $cy, $board, $colsx, $colsy, $ofsleft, $ofst
/** /**
* Make board ladders * Make board ladders
* *
* @param $im * @param object $im
* @param $dir * @param string $dir
* @param $cx * @param int $cx
* @param $s * @param string $s
* @param $colsx * @param int $colsx
* @param $colsy * @param int $colsy
* @param $ofsleft * @param int $ofsleft
* @param $ofstop * @param int $ofstop
*/ */
function makeboardl( $im, $dir, $cx, $cy, $s, $colsx, $colsy, $ofsleft, $ofstop) { function makeboardl( $im, $dir, $cx, $cy, $s, $colsx, $colsy, $ofsleft, $ofstop) {
$pos = strpos( $s, '-'); $pos = strpos( $s, '-');
@ -207,15 +207,15 @@ function makeboardl( $im, $dir, $cx, $cy, $s, $colsx, $colsy, $ofsleft, $ofstop)
/** /**
* Make board snakes * Make board snakes
* *
* @param $im * @param object $im
* @param $dit * @param string $dit
* @param $cx * @param int $cx
* @param $cy * @param int $cy
* @param $s * @param string $s
* @param $colsx * @param int $colsx
* @param $colsy * @param int $colsy
* @param $ofsleft * @param int $ofsleft
* @param $ofstop * @param int $ofstop
*/ */
function makeboards( $im, $dir, $cx, $cy, $s, $colsx, $colsy, $ofsleft, $ofstop) { function makeboards( $im, $dir, $cx, $cy, $s, $colsx, $colsy, $ofsleft, $ofstop) {
$pos = strpos( $s, '-'); $pos = strpos( $s, '-');
@ -297,7 +297,7 @@ function makeboards( $im, $dir, $cx, $cy, $s, $colsx, $colsy, $ofsleft, $ofstop)
/** /**
* Image create from png * Image create from png
* *
* @param $file * @param string $file
*/ */
function game_imagecreatefrompng( $file) { function game_imagecreatefrompng( $file) {
if (file_exists( $file)) { if (file_exists( $file)) {
@ -310,14 +310,14 @@ function game_imagecreatefrompng( $file) {
/** /**
* Show number * Show number
* *
* @param $imghandle * @param int $imghandle
* @param $imgnumbers * @param string $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) {
@ -341,11 +341,11 @@ function shownumber( $imghandle, $imgnumbers, $number, $x1 , $y1, $width, $heigh
/** /**
* Return rotated point * Return rotated point
* *
* @param $x * @param int $x
* @param $y * @param int $y
* @param $cx * @param int $cx
* @param $cy * @param int $cy
* @param $a * @param float $a
*/ */
function returnrotatedpoint($x, $y, $cx, $cy, $a) { function returnrotatedpoint($x, $y, $cx, $cy, $a) {
// Radius using distance formula. // Radius using distance formula.
@ -364,14 +364,14 @@ function returnrotatedpoint($x, $y, $cx, $cy, $a) {
/** /**
* Print ladder * Print ladder
* *
* @param $im * @param int $im
* @param $file * @param string $file
* @param $x * @param int $x
* @param $y * @param int $y
* @param $width * @param int $width
* @param $height * @param int $height
* @param $cellx * @param int $cellx
* @param $celly * @param int $celly
*/ */
function game_printladder( $im, $file, $x, $y, $width, $height, $cellx, $celly) { function game_printladder( $im, $file, $x, $y, $width, $height, $cellx, $celly) {
$color = imagecolorallocate($im, 0, 0, 255); $color = imagecolorallocate($im, 0, 0, 255);
@ -393,14 +393,14 @@ function game_printladder( $im, $file, $x, $y, $width, $height, $cellx, $celly)
/** /**
* Print snake * Print snake
* *
* @param $im * @param int $im
* @param $file * @param string $file
* @param $x * @param int $x
* @param $y * @param int $y
* @param $width * @param int $width
* @param $height * @param int $height
* @param $cellx * @param int $cellx
* @param $celly * @param int $celly
*/ */
function game_printsnake( $im, $file, $x, $y, $width, $height, $cellx, $celly) { function game_printsnake( $im, $file, $x, $y, $width, $height, $cellx, $celly) {
$color = imagecolorallocate($im, 0, 255, 0); $color = imagecolorallocate($im, 0, 255, 0);

14
snakes/play.php

@ -149,6 +149,12 @@ function game_snakes_play( $id, $game, $attempt, $snakes, $context) {
} }
} }
/**
* Show dice
*
* @param stdClass $snake
* @param boolean $board
*/
function game_snakes_showdice( $snakes, $board) { function game_snakes_showdice( $snakes, $board) {
$pos = game_snakes_computeplayerposition( $snakes, $board); $pos = game_snakes_computeplayerposition( $snakes, $board);
?> ?>
@ -207,7 +213,7 @@ function game_snakes_computeplayerposition( $snakes, $board) {
* *
* @param stdClass $game * @param stdClass $game
* @param stdClass $snakes * @param stdClass $snakes
* @param stdClass $quert * @param stdClass $query
*/ */
function game_snakes_computenextquestion( $game, &$snakes, &$query) { function game_snakes_computenextquestion( $game, &$snakes, &$query) {
global $DB, $USER; global $DB, $USER;
@ -451,7 +457,7 @@ function game_snakes_check_glossary( $id, $game, $attempt, $snakes, $context) {
* @param stdClass $game * @param stdClass $game
* @param stdClass $attempt * @param stdClass $attempt
* @param stdClass $snakes * @param stdClass $snakes
* @param $correct * @param boolean $correct
* @param stsdClass $correct * @param stsdClass $correct
* @param stdClasss $query * @param stdClasss $query
* @param stdClass $context * @param stdClass $context
@ -497,7 +503,7 @@ function game_snakes_position( $id, $game, $attempt, $snakes, $correct, $query,
* In lander go forward. * In lander go forward.
* *
* @param int $position * @param int $position
* @param $data * @param string $data
*/ */
function game_snakes_foundlander( $position, $data) { function game_snakes_foundlander( $position, $data) {
preg_match( "/L$position-([0-9]*)/", $data, $matches); preg_match( "/L$position-([0-9]*)/", $data, $matches);
@ -513,7 +519,7 @@ function game_snakes_foundlander( $position, $data) {
* In snake go backward. * In snake go backward.
* *
* @param int $position * @param int $position
* @param $data * @param string $data
*/ */
function game_snakes_foundsnake( $position, $data) { function game_snakes_foundsnake( $position, $data) {
preg_match( "/S([0-9]*)-$position,/", $data.',', $matches); preg_match( "/S([0-9]*)-$position,/", $data.',', $matches);

85
sudoku/sdd/class.logfile.php

@ -1,85 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @author Dick Munroe <munroe@csworks.com>
* @copyright copyright @ by Dick Munroe, 2004
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @package StructuredDataDumper
*/
/*
* Edit History:
*
* Dick Munroe munroe@cworks.com 23-Dec-2004
* Initial version created/
*/
defined('MOODLE_INTERNAL') || die();
require_once('SDD/class.SDD.php');
/**
* log file
*
* @package mod_game
* @copyright 2014 Vasilis Daloukas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class logfile extends SDD {
/*
* The open file handle.
*
* @access private
*/
protected $m_handle;
/**
* Constructor
*
* @param $thefilename
*/
public function init($thefilename) {
if (file_exists($thefilename)) {
$this->m_handle = fopen($thefilename, 'a');
} else {
$this->m_handle = fopen($thefilename, 'w');
}
}
/**
* Close
*
* @param $thefilename
*/
public function close() {
fclose($this->m_handle);
}
/*
* Write a debugging value to a log file.
*
* @access public
* @abstract
* @param mixed Data to be logged.
* @return integer number of bytes written to the log.
*/
public function log(&$thedata) {
return fwrite($this->m_handle, date('[Y-m-d H:i:s]: ') . $this->dump($thedata) . "\n");
}
}

14
translate.php

@ -256,7 +256,7 @@ if ($ret != '') {
* Returns the language file for lang * Returns the language file for lang
* *
* @param string $lang * @param string $lang
* @param string module *
* @return the path of language file * @return the path of language file
*/ */
function getlangfile( $lang) { function getlangfile( $lang) {
@ -309,7 +309,7 @@ function readlangfile( $lang, &$header) {
* *
* @param string $line * @param string $line
* @param string $name * @param string $name
* @return string $trans * @param string $trans
*/ */
function splitlangdefinition($line, &$name, &$trans) { function splitlangdefinition($line, &$name, &$trans) {
$pos1 = strpos( $line, '='); $pos1 = strpos( $line, '=');
@ -475,11 +475,11 @@ function read_dir($dir, $ext) {
* *
* @param string $en * @param string $en
* @param string $lang * @param string $lang
* @param $strings * @param string $strings
* @param $langfile * @param string $langfile
* @param $sum * @param int $sum
* @param $outdir * @param string $outdir
* @param $utranslated * @param int $utranslated
*/ */
function computediff( $en, $lang, $strings, $langname, &$sum, $outdir, &$untranslated) { function computediff( $en, $lang, $strings, $langname, &$sum, $outdir, &$untranslated) {
global $CFG; global $CFG;

Loading…
Cancel
Save