Moodle Plugins directory: ChessBlock | Moodle.org
ChessBlock
Blocks ::: block_chessblock
Maintained by
Ardit Dika
Chess game.
Latest release:
13 sites
10 downloads
17 fans
Current versions available: 1
Moodle Chess Game.
The chessblock plugin offers you the possibility to play chess in moodle dashboard page versus the computer.
Installation
First way
- Clone this repository into the folder blocks.
- Access the notification area in moodle and install
Second way
- Download this repository
- Extract the content
- Put the folder into the folder blocks of your moodle
- Access the notification area in moodle and install
Contributors
Ardit Dika (Lead maintainer)
Thomas Mellemseter
Nikita Uvarov
Joakim Fredriksen
Mile Stojkovski
Jan Greger Hem
Please login to view contributors details and/or to contact them
https://integration.moodle.org/job/Precheck%20remote%20branch/28738/artifact/work/smurf.html
Here are some comments regarding the code itself:
1- I would recommend create a lib directory and place chessboardjs library into it.
2- Un-used global, also do not use upper case for php key words (GLOBAL in this case): https://github.com/TheGlobalATeam/moodle-block_chessblock/blob/master/block_chessblock.php#L54
3- Please, use just 8 spaces for wraping, also this line could be wrapped just in 1 lines, not 2 as it is now:
https://github.com/TheGlobalATeam/moodle-block_chessblock/blob/master/block_chessblock.php#L86
4- Have you considered use moodle Jquery library instead of loading through CDN?
https://github.com/TheGlobalATeam/moodle-block_chessblock/blob/master/block_chessblock.php#L92
That won't work for sites that does not have direct access to internet or if it is behind a proxy.
5- Also, the thirdpartylibs.xml seems incorrect, accordingly to https://github.com/oakmac/chessboardjs chessboardjs github their software is under MIT license, not GPL and I believe the correct version is 0.3.0 and not 66.77 as stated on the file. In this case, you can remove tag.
6- The globals $CFG, $OUTPUT, $USER, $DB are un-used all could be removed from this line: https://github.com/TheGlobalATeam/moodle-block_chessblock/blob/master/block_chessblock.php#L75
7- It is not recommended concatenate extra values to language strings, for example here:
https://github.com/TheGlobalATeam/moodle-block_chessblock/blob/master/block_chessblock.php#L89
You could change the language string to $string['gamestatus'] = 'Status: {$a}'; and just pass the status as the third parameter of get_string call.
8- A bit more of help would be good, for explaining what's the purpose of Download FEN and Download PGN links.
9- Also, I don't see why display User ID:{ID} might be necessary to the end user.
10- Typo found: intenral https://github.com/TheGlobalATeam/moodle-block_chessblock/blob/master/version.php#L29
11- Typo found: initalizing https://github.com/TheGlobalATeam/moodle-block_chessblock/blob/master/block_chessblock.php#L20
12- Typo found: upgarde https://github.com/TheGlobalATeam/moodle-block_chessblock/blob/master/db/upgrade.php#L20
13- Several functions are missing ; on main.js.
14- What's the purpose of use rand() on block_chessblock.php?
Some of those points are just recommendations and won't prevent this plugin of being approved.
Thanks for the awesome work!
Thanks guys for sharing the block with the community, and thanks Simey for providing a peer-review for it. All the raised issues are good suggestions for further improvements of the block. With the hope they will be addressed in a future version of the block, I am happy to approve this now.