Comments (9)
Update: sorry, i didn't realize that the modal-drop-setup.js was not loading ... so probably take to the trash the change to the code, but be aware that all the plugin documentation seems to point out that a xpdrop is built with it's name: the secret is never used.
from moodle-block_xp.
Another update: why there's no ...js.map files in amd/build at all ? This is blocking js from loading correctly AFAIK. I've managed to load the minified js from amd/src (which is the loaded one if the .map is missing) and noticed that they differs: src scripts lacks of the define() at top.
Anyway, modal-drop-setup.js in amd/src is missing define() which prevents moodle from loading it, And the same is into the block_xp/amd/src/role-button.js ...
from moodle-block_xp.
Hi @rabser,
Thank you for sharing these details.
The drops have always required their secret in their snippet, however we do not expect users to write the snippet themselves that is why the secret is not displayed as is. The other reason is to keep the secret hidden. To obtain the code snippet you can simply click the name of the drop in the drop table.
We apologise if there are some lang strings that refer to the drop name instead of the secret, would you please share their string IDs as we cannot identify which ones those are.
The .js.map
files are not required for JS to load. However if you are using a version of Moodle prior to 3.8, JavaScript assets should be cached or they won't load. This is a known issue that has recently been reported in #140. In more recent versions, Moodle has started requiring that JavaScript is always built and is no longer loaded from the src/
folder.
from moodle-block_xp.
To be honest, it's not written "[xpdrop name]" but "[xpdrop abcdef]" which can lead the reader to misunderstand. I suggest to change to "[xpdrop secretecode]" in the lang of local_xp. Probably we thinked - erroneusly - that the shortcodes had to refer to the drop name (it's what's you choose when you create the drop) and the documentation does'nt mention the secret code so we had a mind shortcircuit ...
For the js.map missing, we found that we had the cachejs set to false (this is a 3.11.10 for testing/developer instance). Enabling the js caching all went fine. This oddities could be overcome if the js files (either modal-drop-setup.min.js and role-button.js) into the amd/src will contain the define() as the other js' have, letting us to run in developer mode.
HTH
from moodle-block_xp.
Thank you for your comment. You're right, there may be confusion with how the shortcode is constructed, we should improve the documentation and help in that regard.
Regarding JavaScript, that is rather odd. The define
calls are no longer expected in src
files, since 3.8 JS files are to be built even during development, but if you had cachejs
set to false then the built files should have loaded. Missing .js.map files should not prevent them from loading.
We'll investigate that, thank you.
Reference: https://docs.moodle.org/dev/Javascript_Modules#Development_mode_.28Moodle_v3.8_and_above.29
from moodle-block_xp.
Thanks for your prompt reply, if you look at the logic in lib/requirejs.lib, you'll find that going in development mode, if the .js.map is not present, the js file is indeed read from amd/src. If the src is missing the define() a debugging error is fired (last else).
If I simply copy the define() function into the corresponding src, all the errors disappear.
from moodle-block_xp.
Oh wow, thank you so much for pointing that out! I frankly had no idea about this behaviour. This is extremely helpful, we'll make sure that the map files are included to prevent this from happening, as indeed, module files cannot be included directly.
from moodle-block_xp.
I'm pretty raw in my behaviour :-), so I overwrote the src one with the corresponding build file and all works fine either with or without the developer mode enabled... the only difference between them is the define() line, that's why I was suggesting the littler change to your code. But obviously, take your choice freely.
from moodle-block_xp.
Thank you for your report, we've included the .map files, that should issues going forward, at least on recent Moodle versions.
from moodle-block_xp.
Related Issues (20)
- The YUI module 'moodle-core-formchangechecker' has been deprecated. It has been replaced with 'core_form/changechecker' HOT 1
- Clarifying supported Moodle versions HOT 3
- Grade-based award HOT 1
- PHP Notice when updating HOT 2
- Default language strings HOT 2
- PHP 8.1: code upgrade or #[\ReturnTypeWillChange] attribute needed. HOT 1
- Usage report cron throws error "Class not found" HOT 1
- Counting words to pass a level HOT 1
- PHP 8.0 Compatibility Issue - Required parameter follows optional parameter in __construct() HOT 2
- Point rules / level descriptions not working properly on course backup / restore HOT 3
- Deprecated events from mod_lesson are loaded in point rules settings, causing debug messages. HOT 5
- Restricting points for reuploading an assignment (assessable) should be possible HOT 1
- Problem with Level Up XP+ message HOT 2
- Moodle Mobile App - Block is Not Visible HOT 3
- dock diary's event meet bug HOT 1
- Deprecation warnings with PHP 8.2 HOT 1
- Label with completion awards points even when competed previously HOT 7
- Very large database table mdl_block_xp_filters HOT 4
- function user_preference_allow_ajax_update deprecation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moodle-block_xp.