Browse Source

Fix:Coding style

MOODLE_20_STABLE
Vasilis Daloukas 9 years ago
parent
commit
3367e7a1df
  1. 37
      classes/plugininfo/booktool.php
  2. 32
      cross/play.php
  3. 3
      exporthtml.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;
}
}

32
cross/play.php

@ -589,13 +589,11 @@ 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;";
} }
} }
@ -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>';
} }

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;

Loading…
Cancel
Save