Stash
Maintained by
Adrian Greeve, Frédéric Massart ⭐
Add an inventory of items to your course and let your students find items by exploring the activities. #game #gamification
Comments
Comments are no longer open for new posts. Existing comments remain available to read.
Any suggestions welcome pls!
Mignon
Just to drop a note that managed to get the item picked up automatically (with or with delay). So that's solved.
I just see now that the editor filtered out the code I added to my comment yesterday. Not really useful like that...
Thanks,
Pascal
Thanks a lot for your answer (some weeks ago). I am only getting back to it now. Together with the despription on https://docs.moodle.org/33/en/Stash_block, I manage to get the Generate the javascript snippet. Like this:
This works fine, as long as I use the full hash - not if I shorten it.
Where I I stuck now, is calling d.pickup(). I tried calling it from a text link or with
$( document ).ready(function(){
d.pickup();
});
without success.
Can you help?
Thanks again!
Pascal
Another interesting feature (related to previous one) is the possibility off adding/deleting items manually to/from the stash of a particular user.
Thanks a lot for your work
Yes block stash has an 'item_acquired' event. You can use this with Level Up to give XP to students that gain stash items.
Here you can see the old-fashioned JavaScript snippet: https://github.com/FMCorz/moodle-block_stash/blob/master/amd/src/drop-snippet-maker.js#L206 In short, what you need to do is instantiate the Drop object with ID and the hash of the drop, and then call the d.pickup() method. You set the rules as to when the pickup method has to be called. You can find the ID and Hash when you go to the UI to get the snippet for your item. Note that the full hash should never be included (5 chars is enough IIRC).
Let me know how you go.
Cheers,
Fred
PS: Sorry, quick message but it's the end of the day and my brain isn't functioning any more.
Thanks. In fact, I think that your plugin can be a good alternative also to the "normal" access control in Moodle. I would like to set up a rule like "The learner has to access 80% of all content before proceeding to the exam". With the normal access control, one can define every activity to be mandatory, but not a percentage, If they would pic up an item on each page automatically, that can be easily done.
If you can direct me, I will try. I have a bit experience in JavaScript and have done a bit of editing of Moodle plugins, but I don't know how the event listeners work. I guess the picking up is done by the function "pickup_item($itemorid, $quantity = 1, $userid = null)", but how can I trigger the event from the Moodle page if I know (only) the drop snippet?
Thanks!
Pascal
That is something Adrian and I have considered since the early stage of development but never got around doing it. We had in mind that an item could be automatically found, perhaps after spending a certain amount of time on a page. Perhaps to give more incentive to students to actually read the content rather than clicking everywhere to find items.
There might be ways to achieve this, but you'd have to play around inserting JavaScript (similar to how the plugin used to work without the filter plugin), however, see this as an advanced and error-prone approach. Let me know if you're interested in getting your hands dirty and I'll guide you through it.
Thanks for this plugin - it's really cool. I would like to let the learner pick up some items automatically when they view the page. Would you have a trick to achieve that?
Thanks.