Browse Source

Fix:Coding style

MOODLE_20_STABLE
Vasilis Daloukas 9 years ago
parent
commit
3367e7a1df
  1. 37
      classes/plugininfo/booktool.php
  2. 34
      cross/play.php
  3. 2
      cryptex/play.php
  4. 3
      exporthtml.php
  5. 2
      exportjavame.php
  6. 2
      locallib.php
  7. 2
      review.php

37
classes/plugininfo/booktool.php

@ -1,37 +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/>.
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* 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;
}
}

34
cross/play.php

@ -589,17 +589,15 @@ function SelectThisWord(event)
else else
TableCell = CellAt(x, y + i); TableCell = CellAt(x, y + i);
// Add its contents to the word we're building. // Add its contents to the word we're building.
if (TableCell.innerHTML != null && TableCell.innerHTML.length > 0 && TableCell.innerHTML != " " && TableCell.innerHTML.toLowerCase() != "&nbsp;") if (TableCell.innerHTML != null && TableCell.innerHTML.length > 0 &&
{ TableCell.innerHTML != " " && TableCell.innerHTML.toLowerCase() != "&nbsp;") {
TheirWord += TableCell.innerHTML.toUpperCase(); TheirWord += TableCell.innerHTML.toUpperCase();
TheirWordLength++; TheirWordLength++;
} } else {
else
{
TheirWord += "&bull;"; TheirWord += "&bull;";
} }
} }
document.getElementById("wordlabel").innerHTML = TheirWord; document.getElementById("wordlabel").innerHTML = TheirWord;
<?php <?php
$msg = "\"".get_string( 'cross_across', 'game').", \" : \"". $msg = "\"".get_string( 'cross_across', 'game').", \" : \"".
@ -607,7 +605,10 @@ function SelectThisWord(event)
$letters = "\" ".get_string( 'letter', 'game').".\" : \" ". $letters = "\" ".get_string( 'letter', 'game').".\" : \" ".
get_string( 'letters', 'game').".\""; get_string( 'letters', 'game').".\"";
?> ?>
document.getElementById("wordinfo").innerHTML = ((CurrentWord <= LastHorizontalWord) ? <?php echo $msg ?>) + WordLength[CurrentWord] + (WordLength[CurrentWord] == 1 ? <?php echo $letters;?>); var s = ((CurrentWord <= LastHorizontalWord) ? <?php echo $msg ?>);
s = s + WordLength[CurrentWord] + (WordLength[CurrentWord] == 1 ? <?php echo $letters;?>);
document.getElementById("wordinfo").innerHTML = s;
document.getElementById("wordclue").innerHTML = Clue[CurrentWord]; document.getElementById("wordclue").innerHTML = Clue[CurrentWord];
document.getElementById("worderror").style.display = "none"; document.getElementById("worderror").style.display = "none";
//document.getElementById("cheatbutton").style.display = (Word.length == 0) ? "none" : ""; //document.getElementById("cheatbutton").style.display = (Word.length == 0) ? "none" : "";
@ -652,13 +653,17 @@ function OKClick()
} }
if (TheirWord.length < WordLength[CurrentWord]) if (TheirWord.length < WordLength[CurrentWord])
{ {
document.getElementById("worderror").innerHTML = "<?php echo get_string( 'cross_error_wordlength1', 'game');?>" + WordLength[CurrentWord] + " <?php echo get_string( 'cross_error_wordlength2', 'game');?>"; var s = "<?php echo get_string( 'cross_error_wordlength1', 'game');?>";
s = s + WordLength[CurrentWord] + " <?php echo get_string( 'cross_error_wordlength2', 'game');?>";
document.getElementById("worderror").innerHTML = s;
document.getElementById("worderror").style.display = "block"; document.getElementById("worderror").style.display = "block";
return; return;
} }
if (TheirWord.length > WordLength[CurrentWord]) if (TheirWord.length > WordLength[CurrentWord])
{ {
document.getElementById("worderror").innerHTML = "<?php echo get_string( 'cross_error_wordlength1', 'game');?>" + WordLength[CurrentWord] + " <?php echo get_string( 'cross_error_wordlength2', 'game');?>";; var s = "<?php echo get_string( 'cross_error_wordlength1', 'game');?>";
s = s + WordLength[CurrentWord] + " <?php echo get_string( 'cross_error_wordlength2', 'game');?>";
document.getElementById("worderror").innerHTML = s;
document.getElementById("worderror").style.display = "block"; document.getElementById("worderror").style.display = "block";
return; return;
} }
@ -988,11 +993,13 @@ function CheckHtmlClick()
get_string( 'cross_checkbutton', 'game'); get_string( 'cross_checkbutton', 'game');
echo '</button>'; echo '</button>';
echo ' &nbsp;&nbsp;&nbsp;&nbsp;<button id="finishattemptbutton" type="button" onclick="CheckServerClick( 1);" style="display: none;">'. echo ' &nbsp;&nbsp;&nbsp;&nbsp;<button id="finishattemptbutton" '.
' type="button" onclick="CheckServerClick( 1);" style="display: none;">'.
get_string( 'cross_endofgamebutton', 'game'); get_string( 'cross_endofgamebutton', 'game');
echo '</button>'; echo '</button>';
if ($game->param5 == 1 or $game->param5 == NULL) { if ($game->param5 == 1 or $game->param5 == null) {
echo ' &nbsp;&nbsp;&nbsp;&nbsp;<button id="printbutton" type="button" onclick="OnPrint( 0);" style="display: none;">'.get_string( 'print', 'game'); echo ' &nbsp;&nbsp;&nbsp;&nbsp;<button id="printbutton" type="button" ';
' onclick="OnPrint( 0);" style="display: none;">'.get_string( 'print', 'game');
echo '</button>'; echo '</button>';
} }
@ -1004,7 +1011,8 @@ function CheckHtmlClick()
} }
if ($showhtmlsolutions) { if ($showhtmlsolutions) {
echo '<button id="checkhtmlbutton" type="button" onclick="CheckHtmlClick();" visible=true>'.get_string( 'cross_checkbutton', 'game'); echo '<button id="checkhtmlbutton" type="button" '.
' onclick="CheckHtmlClick();" visible=true>'.get_string( 'cross_checkbutton', 'game');
echo '</button>'; echo '</button>';
} }

2
cryptex/play.php

@ -32,7 +32,7 @@ function game_cryptex_continue( $id, $game, $attempt, $cryptexrec, $endofgame, $
$endofgame = false; $endofgame = false;
} }
if( $attempt != false and $cryptexrec != false) { if ($attempt != false and $cryptexrec != false) {
$crossm = $DB->get_record( 'game_cross', array( 'id' => $attempt->id)); $crossm = $DB->get_record( 'game_cross', array( 'id' => $attempt->id));
return game_cryptex_play( $id, $game, $attempt, $cryptexrec, $crossm, false, false, false, $context); return game_cryptex_play( $id, $game, $attempt, $cryptexrec, $crossm, false, false, false, $context);
} }

3
exporthtml.php

@ -350,7 +350,8 @@ function game_onexporthtml_snakes( $game, $html, $destdir, $context) {
$board = game_snakes_get_board( $game); $board = game_snakes_get_board( $game);
if ( ($game->sourcemodule == 'quiz') or ($game->sourcemodule == 'question')) { 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 { } else {
$questionsm = array(); $questionsm = array();
$countofquestionsm = 0; $countofquestionsm = 0;

2
exportjavame.php

@ -249,7 +249,7 @@ function game_exmportjavame_getanswers_glossary( $game, $context, $exportattachm
$fields .= ',attachment'; $fields .= ',attachment';
} }
$sql = "SELECT $fields FROM $table WHERE $select ORDER BY definition"; $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; return false;
} }

2
locallib.php

@ -1525,7 +1525,7 @@ function game_grade_responses( $question, $responses, $maxgrade, &$answertext, &
return game_grade_responses_multianswer( $question, $responses, $maxgrade, $answertext); return game_grade_responses_multianswer( $question, $responses, $maxgrade, $answertext);
} }
$name = "resp{$question->id}_"; $name = "resp{$question->id}_";
if( !isset( $responses->$name)) { if (!isset( $responses->$name)) {
$answered = false; $answered = false;
return 0; return 0;
} }

2
review.php

@ -276,7 +276,7 @@ function game_compute_states( $game, $questions) {
$state->responses = array( '' => $question->studentanswer); $state->responses = array( '' => $question->studentanswer);
$state->attempt = $question->iid; $state->attempt = $question->iid;
$states[ $question->id] = $state; $states[ $question->id] = $state;
} }
return $states; return $states;
} }

Loading…
Cancel
Save