Coder Social home page Coder Social logo

moodle-mod_game's Introduction

Game module for Moodle Copyright (C) 2004-2015 by Vasilis Daloukas (https://scholar.google.com/citations?user=jFFbeLsAAAAJ&hl=el)

This program 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.

This program 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:

http: www.gnu.org/copyleft/gpl.html

Game module for Moodle

Created by: Vasilis Daloukas (https://scholar.google.com/citations?user=jFFbeLsAAAAJ)

Many ideas and code were taken from other Moodle modules and Moodle itself

This module gets input from quiz, glossary or questions and plays some games. The games are:

  • hangman
  • crossword
  • cryptex
  • millionaire
  • sudoku
  • Snakes and Ladders
  • The hidden picture
  • Book with questions

If you like the Game activity module please consider donating at https://www.paypal.com/donate/?hosted_button_id=V24FXGMRSZ37J&Z3JncnB0= to help me have more time to continue working on this project. This module is and will remain free, but your donation allows me to continue the development, and any amount is greatly appreciated.

Supported languages: Català (ca), Deutsch (de), Ελληνικά (el), English (en), Español - Internacional (es), Euskara (eu), Français (fr), ית (he), Hrvatski (hr), Italiano (it), Nederlands (nl), Norsk - bokmal ( no), Polski (pl), Português - Brasil (pt_br), Русский (ru), Shqip (sq), Українська (uk), 简体中文 (zh_cn).

moodle-mod_game's People

Contributors

adamtppaw avatar ak4t0sh avatar badatos avatar bdaloukas avatar comete-upn avatar egiles avatar flizotte avatar germanvaleroelizondo avatar mwehr avatar nadavkav avatar nrosenquist avatar phmemmel avatar sh-csg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moodle-mod_game's Issues

Crossword Question

Crossword whem admin check for preview questions, works fine, when user goes to play it, the text field does not appears. Also multiple choice question are not displayed.

get_shortcuts now deprecated

Hi,

Whilst running the unit tests in Moodle 3.9, we came across a lot of unit test failures. Example:

1) tests\core_course\caching_content_item_readonly_repository_testcase::test_find_all_for_course
Unexpected debugging() call detected.
Debugging: The callback get_shortcuts has been deprecated. Please use get_course_content_items and
                    get_all_content_items instead. Some features of the activity chooser, such as favourites and recommendations
                    are not supported when providing content items via the deprecated callback.

We have traced the issue down to the use of get_shortcuts method here: https://github.com/bdaloukas/moodle-mod_game/blob/MOODLE_20_STABLE/lib.php#L1062

As per the upgrade.txt of Moodle 3.9, this method has now been marked as deprecated:
https://github.com/moodle/moodle/blob/e746dc75af1f537e56b366b6368ae3f33482687f/mod/upgrade.txt#L7-L10

Database error on mod/game/view.php - Crossword

Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
SELECT id,concept FROM mdl_glossary_entries WHERE glossaryid=
[array (
)]

line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown

line 1273 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()

line 188 of /mod/game/check.php: call to mysqli_native_moodle_database->get_records_sql()

line 173 of /mod/game/check.php: call to game_check_common_problems_shortanswer_glossary()

line 49 of /mod/game/check.php: call to game_check_common_problems_shortanswer()

line 337 of /mod/game/view.php: call to game_check_common_problems()
function game_check_common_problems_shortanswer_glossary($game, &$warnings) {
    global $CFG, $DB;

    $sql = "SELECT id,concept FROM {$CFG->prefix}glossary_entries WHERE glossaryid={$game->glossaryid}";
    $recs = $DB->get_records_sql( $sql);
    $a = array();
    foreach ($recs as $rec) {
        $a[] = $rec->concept;
    }

    game_check_common_problems_shortanswer_allowspaces( $game, $warnings, $a);
    if ($game->gamekind == 'hangman') {
        game_check_common_problems_shortanswer_hangman( $game, $warnings, $a);
    }
}

$game->glossaryid is always null and I saw that the fields were empty in tables:
mdl_glossary
mdl_glossary_alias
mdl_glossary_categories
mdl_glossary_entries ...

hiding game-type doesn´t work with Moodle 4.2 and pg

Today we updated our testing system from Moodle 4.1 to Moodle 4.2. Since then the config for hiding game-types doesn´t work anymore. Though types under /admin/settings.php?section=modsettinggame are set to hide (e.g. game | hidecross), they are shown in the activity chooser. The settings don´t matter, always most game-types are displyed in the chooser, except bookquiz and snakes. bookquiz and snakes are never shown in the chooser, even if the hidebookquiz and hidesnakes checkbox isn´t set.

Moodle 4.2
PostgreSQL 13
PHP 8.0
mod_game: 2023-04-25 (2023042500)

general bug or just with our setting (using game already for many many years)?
any ideas?

thanks!
Klaus

Crossword not working if you have two or more words in the same row/column

There is a problem with referencing a question when you have tow or more words in the same row/column. In this case we get JS error and you can't enter an answer.
Problem is in how crossword references questions in legend and how it references it in JS code.
In legend if there is multiple words in the same row/column it will append letter to it (for example 8A, 8B, 8C...):

$this->mlegendh[$key.game_substr( $letters, $i, 1)] = $value[$i];
$this->mlegendv[$key.game_substr( $letters, $i, 1)] = $value[$i];

so it will create a DIV with that id:

<div id="a8A">
<div id="a8B">

but array passed to JS only refers to row/coll:

$swordx .= ",".($rec->mycol - 1);
$swordy .= ",".($rec->myrow - 1);

This is a problem because now you can't reference created DIV elements:

if( CurrentWord <= LastHorizontalWord) {
    id = 'a' + ( 1 + WordY[ CurrentWord]);
} else {
    id = 'd' + ( 1 + WordX[ CurrentWord]);
}
document.getElementById("wordclue").innerHTML = document.getElementById( id).innerHTML;

var id will only have value "a8" but there is DIV element with this id.
sc1
sc2
sc3

sudoku using glossary does not work with Moodle 4.x

Steps to reproduce

  • Create a sudoku which is using glossary as source.
  • Try to launch the game.

Result

Unknown column 'qv.questionbankentryid' in 'field list'
SELECT ge.id,qv.questionbankentryid,qv.version FROM mdl_glossary_entries ge WHERE (glossaryid='1' OR sourceglossaryid='1') ORDER BY qv.questionbankentryid,qv.version DESC
[array (
)]
Error code: dmlreadexception 

line 494 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
line 1282 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->query_end()
line 621 of /mod/game/locallib.php: call to mysqli_native_moodle_database->get_records_sql()
line 580 of /mod/game/locallib.php: call to game_questions_selectrandom_detail()
line 79 of /mod/game/sudoku/play.php: call to game_questions_selectrandom()
line 280 of /mod/game/attempt.php: call to game_sudoku_continue()
line 242 of /mod/game/attempt.php: call to game_create()
line 40 of /mod/game/attempt.php: call to game_do_attempt()

Analysis

In 9316457 you introduced question/quiz specific fields in the query used in

$sql = "SELECT $idfield{$fields} FROM $table WHERE $select $order";
making it no more compatible with glossary as source.

Solution / Workaround

Waiting a cleaner solution below an ugly patch I've done as workaround to prevent glossaries to crash.

---
 locallib.php | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/locallib.php b/locallib.php
index 87118bd..595bbd3 100644
--- a/locallib.php
+++ b/locallib.php
@@ -614,8 +614,9 @@ function game_questions_selectrandom_detail( $table, $select, $idfield="id", $co
     global $DB;
 
     $versions = game_get_moodle_version() >= '04.00';
-    $fields = $versions ? ',qv.questionbankentryid,qv.version' : '';
-    $order = $versions ? ' ORDER BY qv.questionbankentryid,qv.version DESC' : '';
+    $usequestionbank = !in_array($table, ["{glossary_entries} ge"]);
+    $fields = ($usequestionbank && $versions) ? ',qv.questionbankentryid,qv.version' : '';
+    $order = ($usequestionbank && $versions) ? ' ORDER BY qv.questionbankentryid,qv.version DESC' : '';
 
     $sql = "SELECT $idfield{$fields} FROM $table WHERE $select $order";
     if (($recs = $DB->get_records_sql( $sql)) == false) {
@@ -626,7 +627,7 @@ function game_questions_selectrandom_detail( $table, $select, $idfield="id", $co
     $map = array();
     $a = array();
     foreach ($recs as $rec) {
-        if( $versions) {
+        if( $usequestionback && $versions) {
             if( array_key_exists( $rec->questionbankentryid, $map)) {
                 continue;
             } else {
--

PHP Version Support

Hello,

Hello, we are using a game plugin, and we saw that the plugin is not supported in version 8.x.

Is support for the PHP 8.X version expected?

Also, the plugin probably doesn't work well in PHP 7.4.9 version - sudoku and millionaire games.

sudoku

Thanks,
Ilan

Big performance bug on Moodle 4+

We have found a bug in the millionaire game causing major performance issues on a Moodle 4.1 site. millionaire/play.php contains the following:

 $select2 = '';
        if (game_get_moodle_version() >= '04.00') {
            $table .= ",{$CFG->prefix}question_bank_entries qbe,{$CFG->prefix}question_versions qv ";
            $select2 = 'qbe.id=qv.questionbankentryid AND q.id=qv.questionid AND qbe.questioncategoryid='.$game->questioncategoryid;
            if ($game->subcategories) {
                $cats = question_categorylist( $game->questioncategoryid);
                if (count( $cats) > 0) {
                    $select2 = ' qbe.questioncategoryid in ('.implode( ',', $cats).')';
                }
            }
        }

If there are subcategories, $select2 is being overwritten, resulting in a query like the following:

SELECT COUNT(*) 
FROM mdl_question q, mdl_qtype_multichoice_options qmo,mdl_question_bank_entries qbe,mdl_question_versions qv  
WHERE  qtype='multichoice' AND qmo.single=1 AND qmo.questionid=q.id AND  qbe.questioncategoryid in (148967, ...);

This is joining mdl_question_bank_entries and mdl_question_versions but with no join condition so all records will be joined.

Sudoko throws exception for no glossary selected.

Create an 'empty' sodoku without selecting a Glossary. An exception is thrown.

Although it's clearly an 'error' it's actually a setup that can legitimately be created through users settings. IMO a proper notice should be created explaining the issue.

The snakes and ladders is nicer if you don't select a quiz category. So, at best, it's inconsistent.

Millionaire: German (Deutsch) language

Hello,

probably already known , there are at "millionaire" problems with the German language.

The 4 answer options are not A, B, C, D rather A, Ä, B, C.

I faced the problem a couple of days ago and found out, that the game.php file in the german language-pack a incorrect sorting of the german alphabet.

The correct sorting of the german alphabet is: ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜß

That will fix the problem for the german language!

Kind regards,

Christopher

can't see pictures on hidden picture

HI

I'v set up a hidden picture game. I've set the questions to come form a quiz and I've checked that the quiz has questions in it.

However when I launch the game I can't see any of the questions.

Can you point me in the right way please

Typo in language string

While translating Game plug-in I've noticed a typo in original string:
$string[ 'cross_correct'] = 'corrert character';

Error in Hangman when run out of letters

PROBLEM:
Moodle 3.6.2, mod_game version 2019010500.
Trying to get property of non-object in /var/www/demo/lib/completionlib.php on line 255
Debug info: SELECT * FROM {course} WHERE id IS NULL
[array (
)]
Error code: invalidrecord

RESOLUTION:
In file hangman/play.php in function hangman_onincorrect() you call game_hangman_show_nextword() with last argument "true" but game_hangman_show_nextword() expects the last argument to be object $course.

Secondly, functions hangman_onincorrect() first argument is "id" but should be object $cm because game_hangman_show_nextword(), when called, expects the fist argument to be object $cm.

duplicate require causing error during upgrade

There are 2 appearances of require( 'importsnakes.php'); in upgrade.php, so if version was < 2018060404 upgrade will fail with the error

PHP Fatal error: Cannot redeclare game_importsnakes() (previously declared in /siteroot/mod/game/db/importsnakes.php:33) in /siteroot/mod/game/db/importsnakes.php on line 72
PHP Stack trace:
PHP 1. {main}() /siteroot/admin/cli/upgrade.php:0
PHP 2. upgrade_noncore() /siteroot/admin/cli/upgrade.php:182
PHP 3. upgrade_plugins() /siteroot/lib/upgradelib.php:1857
PHP 4. upgrade_plugins_modules() /siteroot/lib/upgradelib.php:512
PHP 5. xmldb_game_upgrade() /siteroot/lib/upgradelib.php:806

But it will pass on second run since it reached savepoint after first appearance

Invalid mysql call in Sudoku

On line 48 of game/sudoku/play.php there is a invalid mysql function mysql_execute(). Also, you should never do direct mysql calls, but instead use the moodle db api functions.

DB Error while entering the cryptex

While entering the cryptex db error occures:

Error reading from database

More information about this error
Debug info: BŁĄD: dla SELECT DISTINCT, ORDER BY wyrażenia muszą występować na liście wyboru
LINE 1: ...mdl_question_answers WHERE question=1865 ORDER BY fraction D...
^
SELECT DISTINCT answer FROM mdl_question_answers WHERE question=1865 ORDER BY fraction DESC
[array (
)]
Error code: dmlreadexception
Stack trace:

line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 242 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
line 778 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
line 233 of /mod/game/check.php: call to pgsql_native_moodle_database->get_records_sql()
line 171 of /mod/game/check.php: call to game_check_common_problems_shortanswer_question()
line 49 of /mod/game/check.php: call to game_check_common_problems_shortanswer()
line 336 of /mod/game/view.php: call to game_check_common_problems()

We use postgresql db.

Best regards
Adam

Error: Wrong questions are shown in Moodle 4.0+ for quizzes

I noticed that in the 04.00+ version of the plugin, a specfic select is used to get all question_references on a quiz_slot
image

This has given an error when the quiz_slot id and question_reference id is not the same, wrong questions are shown on the correct chosen quiz.

I've looked at Moodle's ERD and it looks like the correct SQL should be:
"qs.quizid='$game->quizid' AND qs.id=qr.itemid ";

https://www.examulator.com/er/4.2/tables/quiz_slots.html
https://www.examulator.com/er/4.2/tables/question_references.html

Error in SQL syntax during install

Error: Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'rows SMALLINT(3),
words SMALLINT(3),
wordsall BIGINT(10),
createscor' at line 4

Gist with complete error

Moodle 3.3
MariaDB 10.2
mod_game commit 6ee163b, also same error with stable version

string('grade') is deprecated

With MDL-71118 and later MDL-71570, the long-string 'grade' was removed and replaced by 'gradenoun' and 'gradeverb' respectively.

The background is the different use of verbs and nouns in different languages.

Deprecated warning in lib.php

Hello,

We’ve noticed a deprecated warning in lib.php:

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in mod/game/lib.php on line 487

We’re on Moodle 3.9 with PHP 7.4.

I’ll make a pull request.

mod_game\privacy\provider::delete_data_for_user

#0 /moodle/lib/dml/mysqli_native_moodle_database.php(1686): moodle_database->query_end(false)
#1 /moodle/lib/dml/moodle_database.php(1977): mysqli_native_moodle_database->delete_records_select('game_grades', 'WHERE game = ? ...', Array)
#2 /moodle/mod/game/lib.php(1566): moodle_database->delete_records('game_grades', Array)
#3 /moodle/mod/game/classes/privacy/provider.php(317): game_delete_user_attempts('2', Object(stdClass))
#4 /moodle/lib/moodlelib.php(8098): mod_game\privacy\provider::delete_data_for_user(Object(core_privacy\local\request\approved_contextlist))
#5 /moodle/privacy/classes/manager.php(578): component_class_callback('mod_game\privac...', 'delete_data_for...', Array)
#6 /moodle/privacy/classes/manager.php(611): core_privacy\manager::component_class_callback('mod_game', 'core_privacy\lo...', 'delete_data_for...', Array)
#7 /moodle/privacy/classes/manager.php(415): core_privacy\manager->handled_component_class_callback('mod_game', 'core_privacy\lo...', 'delete_data_for...', Array)
#8 /moodle/admin/tool/dataprivacy/classes/task/process_data_request_task.php(138): core_privacy\manager->delete_data_for_user(Object(core_privacy\local\request\contextlist_collection))
#9 /moodle/lib/cronlib.php(333): tool_dataprivacy\task\process_data_request_task->execute()
#10 /moodle/lib/cronlib.php(198): cron_run_inner_adhoc_task(Object(tool_dataprivacy\task\process_data_request_task))
#11 /moodle/lib/cronlib.php(76): cron_run_adhoc_tasks(1612355461)
#12 /moodle/admin/cli/cron.php(79): cron_run()
#13 {main}

Error reading from database in Soduku game

In the Soduku game, after I answered all the questions correctly and I tried to guess the number in the rest blank blocks, I got the following error:

Notice: Trying to get property of non-object in /var/www/data/ustbonifacedev/public_html/moodle/mod/game/sudoku/play.php on line 759

Notice: Trying to get property of non-object in /var/www/data/ustbonifacedev/public_html/moodle/mod/game/sudoku/play.php on line 177
Error reading from database

More information about this error

Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
SELECT id, col, score,questionid as id2 FROM mdl_game_queries WHERE attemptid =
[array (
)]
Error code: dmlreadexception
×Stack trace:
line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 1245 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 1400 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
line 190 of /mod/game/sudoku/play.php: call to moodle_database->get_records_select()
line 141 of /mod/game/sudoku/play.php: call to game_sudoku_compute_offsetquestions()
line 762 of /mod/game/sudoku/play.php: call to game_sudoku_play()
line 172 of /mod/game/attempt.php: call to game_sudoku_check_number()
line 40 of /mod/game/attempt.php: call to game_do_attempt()

Design adjustments

Hey bdaloukas,

Just wanted to let you know that I'm doing some design adjustments at millionaire.

Want to have these adjustments then? I have no experience with Github.

Kind regards,

Christopher

hangman repeated questions

When using a glossary as a source, if the number of questions configured in hangman is less than the glossary entries I would like not to repeat them.

An error occurred while generating a crossword puzzle.

Hello! If the minimum number of words for a crossword puzzle is set equal to the total number of questions, then sometimes an error occurs when generating a crossword puzzle, and sometimes the crossword puzzle is generated normally.

Game does not show in timeline

The crossword game does not show in the student's timeline on the dashboard even though activity completion date is set.

Add source code

Hi @bdaloukas,

I don't know if you have the source code in other repository, but you should add it here to allow us to fork and pull request changes to your project. I would love to add some changes to add an option to set a time interval before be able to reattempt a game.

Bes regards,
Daniel.

Book with question issue

When clicking the "Associate question categories to chapter of book" in the Book with question in Moodle 3.5, it returns a blank page.

Incompatible with PostgreSQL

Hi there, I'm getting the following front end error on a Postgres-backed Moodle when attempting to view a mod_game activity:

Debug info: ERROR: column "mdl_game_attempts.score" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: ...gameid=187 AND score > 0 GROUP BY userid ORDER BY score DESC
^
SELECT userid, MAX(score) as maxscore FROM mdl_game_attempts WHERE gameid=187 AND score > 0 GROUP BY userid ORDER BY score DESC
[array (
)]
Error code: dmlreadexception 

    line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
    line 329 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
    line 977 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
    line 359 of /mod/game/view.php: call to pgsql_native_moodle_database->get_records_sql()
    line 332 of /mod/game/view.php: call to game_highscore()

Troubleshooting on the command line, this does appear to be a discrepancy between the way MySQL and Postgres handle GROUP BY:

=> select userid, max(score) from mdl_game_attempts where gameid = 187 and score > 0 group by userid order by score desc;
ERROR:  column "mdl_game_attempts.score" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: ...meid = 187 and score > 0 group by userid order by score desc...

This discrepancy is explained more fully on this StackExchange page: https://stackoverflow.com/questions/1769361/postgresql-group-by-different-from-mysql

Furthermore it looks like Moodle has some helper functions in it's database API that might ease cross-compatibility here: https://docs.moodle.org/dev/Data_manipulation_API#Cross-DB_compatibility

Moodle version: 3.9.4
Postgres version: 11.8
mod_game version: 2020-08-19 (2020081901)

Thanks!

Missing INTRO field on mdl_game table

Teachers are unable to add instructions to students, as the Moodle standard "intro" field is missing from the game form (and DB)

Please see if you can add it.

Hangman - Not calling questions or quiz

We are configuring Hangman on Moodle 3.9. Hangman game is calling Glossary fine from "source of question", however Hangman is not able to call Questions nor Quiz at the front end.

When we select Questions as "Source of Question", Moodle does not display all the available question category in "Select question category" drop down.

When we select Quiz as "Source of Question", Moodle displays all the available quiz in "Select Quiz" option, however when we attempt game. Moodle says 'There are no words

More information about this error".

Any help would be highly appreciated.

Thanks in advance.

Implementing core_userlist_provider for Moodle 3.6+

In Nov 2018, a new unit test was implemented requiring all plugins to implement \core_privacy\local\request\core_userlist_provider in the classes/privacy/provider.php class. The intent is to adhere to GDPR.

Two methods need to be implemented:

    /**
     * Get the list of users who have data within a context.
     *
     * @param   userlist    $userlist   The userlist containing the list of users who have data in this context/plugin combination.
     */
    public static function get_users_in_context(userlist $userlist);

    /**
     * Delete multiple users within a single context.
     *
     * @param   approved_userlist       $userlist The approved context and user information to delete information for.
     */
    public static function delete_data_for_users(approved_userlist $userlist);

Are there any plans to implement this?

Thanks

Make plugin GDPR compliant

Hello,

Since Moodle 3.5 all plugins should be GDPR compliant - they should notify if userdata is stored and provide a way to download/delete it. Is there a work going on for game plugin?

Thanks,
Ilya

Database error when attempting to load view.php

Hi there, in my Moodle I just fixed what appears to be a code issue in version 2020081901 of this plugin. When attempting to view a game assignment I get the following error output:

Debug info: ERROR: column "mdl_game_attempts.score" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: ... gameid=69 AND score > 0 GROUP BY userid ORDER BY score DESC
^
SELECT userid, MAX(score) as maxscore FROM mdl_game_attempts WHERE gameid=69 AND score > 0 GROUP BY userid ORDER BY score DESC
[array (
)]
Error code: dmlreadexception

Stack trace: 

    line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
    line 329 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
    line 920 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
    line 359 of /mod/game/view.php: call to pgsql_native_moodle_database->get_records_sql()
    line 332 of /mod/game/view.php: call to game_highscore()

By changing line 356 of view.php from:
" GROUP BY userid".
To:
" GROUP BY userid,score".

I was able to resolve the error. If it matters, my database type is postgres and Moodle version is 2020061501.00 / 3.9.1 (Build: 20200713). Thanks!

Millionaire highlights incorrect response on wrong answer

Variable $stylequestionselected applies $color2 (defined as orange) and applies it to the selected button and answer on the page following an incorrect answer.

The button and answer combination that receives this orange color appears to be random, and most of the time is not applied to the answer selected by the user.

Workaround
I have found that a workaround is to change the variable $color2 to black.

Work to do
I haven't been able to trace in millionaire/play.php how the application of this orange color is done, and how it selects the answer based on the users response. Any help is appreciated. As I learn more about PHP, I will also try to contribute.

Prevent Style Override of Crossword

The Crossword stylings in cross/play.php line 146 to 260 need a container, e.g. #region-main to prevent the style overrides of h1, h2, etc.

For example: h1 {} becomes #region-main h1 {}
You should change this for all custom game stylings.

I checked it in our custom theme and the clean theme as well.

Thanks and best regards
Andre

$string['game:addinstance'] = '';

Hi,

Debugging shows me this error:

Invalid get_string() identifier: 'game:addinstance' or component 'mod_game'. Perhaps you are missing $string['game:addinstance'] = ''; in mod/game/lang/en/game.php?

line 293 of /lib/classes/string_manager_standard.php: call to debugging()
line 6905 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
line 2977 of /lib/accesslib.php: call to get_string()
line 2835 of /lib/accesslib.php: call to get_capability_string()
line 113 of /admin/roles/classes/capability_table_base.php: call to get_capability_docs_link()
line 139 of /admin/roles/classes/capability_table_with_risks.php: call to core_role_capability_table_base->display()
line 624 of /admin/roles/classes/define_role_table_advanced.php: call to core_role_capability_table_with_risks->display()
line 267 of /admin/roles/define.php: call to core_role_define_role_table_advanced->display()

I can add the string to /lang/en/game.php but I don't know if this is a solution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.