Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "max failed attempts" condition #24

Open
frncesc opened this issue Oct 22, 2017 · 1 comment
Open

Add "max failed attempts" condition #24

frncesc opened this issue Oct 22, 2017 · 1 comment

Comments

@frncesc
Copy link
Member

frncesc commented Oct 22, 2017

Improvement suggested by Nicolás Cabello.
JClic allows to set a maximum number of "tries" or "moves" per activity. When this number of attempts is achieved the activity is marked as "failed", without taking in account if they where good or bad moves.
It will be great to have also the possibility to set a "maximum number of bad moves", acting like the "current lifes" in arcade games. Each bad move will substract a "life" from the counter.

@ncabello2222
Copy link

ncabello2222 commented May 4, 2024

Hello,

The implementation is successful! I couldn't configure a working maxFailedActions directly through JClic Author. Instead, I utilized the maxActions value from JClic Author and repurposed it as a "max failed actions" value in the jclicplayer.js. The action counter now displays this maxActions value but decreases only when a failed action occurs. Once it reaches zero (indicating all attempts are used up), the activity terminates as failed. This adjustment does not affect the internal values and logic, so calculations for percentages and the total number of actions remain accurate. Modifications were made in jclicplayer.js and counter.js.

Additionally, it's important to use jclic.min.js in JClic Author before exporting to HTML. If you're working with Moodle, you'll need to upload the modified jclic.min.js to your server and specify its URL in the JClic extension settings. You'll also need to use a customized jclicplugin.js file, as the default one from https://clic.xtec.cat/dist/jclic/jclicplugin.js points to the standard jclic.min.js. Ensure to update the URL in your jclicplugin.js file and host it on your server as well.

You can find the complete project here: Google Drive Link. While you only need the files in JClic Proyecto\jclic.js-html5\jclic.js-master\dist, feel free to review the source code which includes the src for JClic, though no modifications have been made there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants