From 3367e7a1df0f83b4a9fdd6a678e925c0f4a63d77 Mon Sep 17 00:00:00 2001 From: Vasilis Daloukas Date: Mon, 28 Dec 2015 02:31:10 +0200 Subject: [PATCH] Fix:Coding style --- classes/plugininfo/booktool.php | 37 --------------------------------- cross/play.php | 34 ++++++++++++++++++------------ cryptex/play.php | 2 +- exporthtml.php | 3 ++- exportjavame.php | 2 +- locallib.php | 2 +- review.php | 2 +- 7 files changed, 27 insertions(+), 55 deletions(-) delete mode 100644 classes/plugininfo/booktool.php diff --git a/classes/plugininfo/booktool.php b/classes/plugininfo/booktool.php deleted file mode 100644 index 687daca..0000000 --- a/classes/plugininfo/booktool.php +++ /dev/null @@ -1,37 +0,0 @@ -. -// You should have received a copy of the GNU General Public License -// along with Moodle. If not, see . - -/** - * Subplugin info class. - * - * @package mod_game - * @copyright 2014 Vasilis Daloukas - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ -namespace mod_game\plugininfo; - -use core\plugininfo\base; - -defined('MOODLE_INTERNAL') || die(); - - -class gametool extends base { - public function is_uninstall_allowed() { - return true; - } -} diff --git a/cross/play.php b/cross/play.php index 326ac18..36b4a4d 100755 --- a/cross/play.php +++ b/cross/play.php @@ -589,17 +589,15 @@ function SelectThisWord(event) else TableCell = CellAt(x, y + i); // Add its contents to the word we're building. - if (TableCell.innerHTML != null && TableCell.innerHTML.length > 0 && TableCell.innerHTML != " " && TableCell.innerHTML.toLowerCase() != " ") - { + if (TableCell.innerHTML != null && TableCell.innerHTML.length > 0 && + TableCell.innerHTML != " " && TableCell.innerHTML.toLowerCase() != " ") { TheirWord += TableCell.innerHTML.toUpperCase(); TheirWordLength++; - } - else - { + } else { TheirWord += "•"; } } - + document.getElementById("wordlabel").innerHTML = TheirWord; - document.getElementById("wordinfo").innerHTML = ((CurrentWord <= LastHorizontalWord) ? ) + WordLength[CurrentWord] + (WordLength[CurrentWord] == 1 ? ); + var s = ((CurrentWord <= LastHorizontalWord) ? ); + s = s + WordLength[CurrentWord] + (WordLength[CurrentWord] == 1 ? ); + document.getElementById("wordinfo").innerHTML = s; + document.getElementById("wordclue").innerHTML = Clue[CurrentWord]; document.getElementById("worderror").style.display = "none"; //document.getElementById("cheatbutton").style.display = (Word.length == 0) ? "none" : ""; @@ -652,13 +653,17 @@ function OKClick() } if (TheirWord.length < WordLength[CurrentWord]) { - document.getElementById("worderror").innerHTML = "" + WordLength[CurrentWord] + " "; + var s = ""; + s = s + WordLength[CurrentWord] + " "; + document.getElementById("worderror").innerHTML = s; document.getElementById("worderror").style.display = "block"; return; } if (TheirWord.length > WordLength[CurrentWord]) { - document.getElementById("worderror").innerHTML = "" + WordLength[CurrentWord] + " ";; + var s = ""; + s = s + WordLength[CurrentWord] + " "; + document.getElementById("worderror").innerHTML = s; document.getElementById("worderror").style.display = "block"; return; } @@ -988,11 +993,13 @@ function CheckHtmlClick() get_string( 'cross_checkbutton', 'game'); echo ''; - echo '     '; - if ($game->param5 == 1 or $game->param5 == NULL) { - echo '     '; } @@ -1004,7 +1011,8 @@ function CheckHtmlClick() } if ($showhtmlsolutions) { - echo ''; } diff --git a/cryptex/play.php b/cryptex/play.php index d9b88a5..d425e88 100755 --- a/cryptex/play.php +++ b/cryptex/play.php @@ -32,7 +32,7 @@ function game_cryptex_continue( $id, $game, $attempt, $cryptexrec, $endofgame, $ $endofgame = false; } - if( $attempt != false and $cryptexrec != false) { + if ($attempt != false and $cryptexrec != false) { $crossm = $DB->get_record( 'game_cross', array( 'id' => $attempt->id)); return game_cryptex_play( $id, $game, $attempt, $cryptexrec, $crossm, false, false, false, $context); } diff --git a/exporthtml.php b/exporthtml.php index 8d4ab23..70281ff 100755 --- a/exporthtml.php +++ b/exporthtml.php @@ -350,7 +350,8 @@ function game_onexporthtml_snakes( $game, $html, $destdir, $context) { $board = game_snakes_get_board( $game); if ( ($game->sourcemodule == 'quiz') or ($game->sourcemodule == 'question')) { - $questionsm = game_millionaire_html_getquestions( $game, $context, $maxquestions, $countofquestionsm, $retfeedback, $destdir, $files); + $questionsm = game_millionaire_html_getquestions( $game, $context, $maxquestions, + $countofquestionsm, $retfeedback, $destdir, $files); } else { $questionsm = array(); $countofquestionsm = 0; diff --git a/exportjavame.php b/exportjavame.php index f023aac..8f095a7 100755 --- a/exportjavame.php +++ b/exportjavame.php @@ -249,7 +249,7 @@ function game_exmportjavame_getanswers_glossary( $game, $context, $exportattachm $fields .= ',attachment'; } $sql = "SELECT $fields FROM $table WHERE $select ORDER BY definition"; - if( ($questions = $DB->get_records_sql( $sql)) === false) { + if (($questions = $DB->get_records_sql( $sql)) === false) { return false; } diff --git a/locallib.php b/locallib.php index 5a26b41..2e23745 100755 --- a/locallib.php +++ b/locallib.php @@ -1525,7 +1525,7 @@ function game_grade_responses( $question, $responses, $maxgrade, &$answertext, & return game_grade_responses_multianswer( $question, $responses, $maxgrade, $answertext); } $name = "resp{$question->id}_"; - if( !isset( $responses->$name)) { + if (!isset( $responses->$name)) { $answered = false; return 0; } diff --git a/review.php b/review.php index ce743d8..027756f 100755 --- a/review.php +++ b/review.php @@ -276,7 +276,7 @@ function game_compute_states( $game, $questions) { $state->responses = array( '' => $question->studentanswer); $state->attempt = $question->iid; - $states[ $question->id] = $state; + $states[ $question->id] = $state; } return $states; }