Blocks ::: block_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
Latest release:
1476 sites
107 fans
Current versions available: 3

The stash block is a good way to encourage more interaction with activities and is invaluable for teachers looking to gamify their course.

This plugin introduces a block that shows students items that they have picked up through the course.

The teacher can create items and then place them in activities and resources for students to find.

Items can be set to be collected once and encourages exploration of the course material. It is also possible to set an item to have an unlimited supply from a set location. This could encourage  students to return to specific areas to collect more items. 

You can also check out this video:

Quick start

We've crafted a sample course for you to try, it is the best way to see what this plugin has to offer. Please accurately follow those steps:

1/ Get your hands on a Moodle installation
2/ Install the three following plugins (without exception)
3/ Enable conditional access, named enableavailability under "Site administration > Advanced features"
4/ Restore this backup file as a new course

5/ Enrol a student in the new course
Now, login as that student and try the course

Important note

In order to make this plugin easier to use and fully featured, please also install:

They are highly recommended.


This plugin is part of sets Stash, Gamification.


Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4
Screenshot #5
Screenshot #6


Adrian Greeve (Lead maintainer)
Frédéric Massart ⭐
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Adrian Greeve
    Mon, Feb 13, 2023, 10:03 AM
    Hell Brian, Do you have access to the database? If so then go to mdl_block_stash_items and delete the courseid column. I don't know how this column got created on your installation. Please let me know if this worked for you.

  • Brian Evans
    Mon, Feb 13, 2023, 6:59 PM
    Adrian, there is no column called 'courseid' or anything like that in the mdl_block_stash_items table. There is a courseid column in mdl_block_stash but it doesn't appear in any other stash tables.

    I am not a developer but isn't the problem that the query is asking for a column that doesn't exist - not that there is a column that shouldn't be there?
  • Brian Evans
    Mon, Feb 13, 2023, 11:02 PM
    So I looked at the PHP and I see where the query is pulling field names from the database. I have checked multiple times and there is no courseid field in any stash table except mdl_block_stash. I tried adding that field to the database but then noticed that the query is asking for other fields that don't exist either: ui.courseid AS useritemcourseid, AS useritemname

    I uninstalled Stash and verified that all files were deleted and all tables removed from the database. When I reinstalled, the same problems occurred.
  • Frédéric Massart ⭐
    Mon, Feb 13, 2023, 11:22 PM
    Hi Brian, this issue got me curious, that is definitely a strange one. Could you please confirm the version (and where you found it) of Stash, as well as your version of Moodle, and version of PHP.

    Meanwhile, if you're comfortable opening PHP files, could you please try to comment the following highlighted line 193 (in classes/persistent.php):
  • Brian Evans
    Tue, Feb 14, 2023, 1:21 AM
    Good news! Commenting out that line eliminates the error. I was able to create an item and my students can see the block as well.

    I got the plugin zip file from this morning. Here are the software versions I am using:

    Moodle 4.1.1+ (Build: 20230210)
    Stash 1.3.4 (Build: 2022042100)
    PHP Version 8.1.12
  • Adrian Greeve
    Tue, Feb 14, 2023, 1:45 PM
    Thanks Fred for your help here. I changed my php version to 8.1 and am getting the same error. I'll look into publishing a fix.
    Please note that Moodle does not currently support php version 8.1 (see MDL-73016) and so you are likely to find other errors running Moodle as well.
  • Brian Evans
    Tue, Feb 14, 2023, 6:52 PM
    Thanks for the help Adrian and Fred. I look forward to using this plugin! I was unaware of the PHP 8.1 issue since my server environment check is green all the way down - even the PHP line.
    If you want me to run any more tests I would be happy to do so.
    Thanks again.
  • Britta Mertel
    Thu, Feb 16, 2023, 5:52 AM
    Hi! Thanks for this really nice plugin!
    My students have a lot of fun collecting items and "buying" some additional stuff in the shop using the collected items.
    Our students have now expressed the wish that collected objects or objects purchased in the store can be given to other students.
    In our courses, for example, you can buy a virtual cup of cappuccino with collected coins. At the end of the course, students wanted to invite each other for coffee and cake or even a beer.
    It would be great if this function could be integrated.

    However, there would have to be the ability to set whether the item can be given away or not - so that things can't be given away that each student should actually work out for him/herself. smile

    as far as i know, giving items to each other is not possible among students at the moment. if it is, i would be very happy to know how to do it.

    thanks a lot!
  • Adrian Greeve
    Thu, Feb 16, 2023, 2:49 PM
    Hello Britta,
    I do actually have a proof of concept for students trading with each other, but I'm not happy with the user experience for it, and I think that I still have race conditions that need to be ironed, out to avoid both students getting the item (rather than a trade). Does anyone else like the idea of students being able to trade with each other? How would it work?
  • Joseph Liaw
    Fri, Feb 17, 2023, 2:04 AM
    Hi Adrian and Britta:

    Brilliant plugin for gamification, and adding in once you added in the ability to make "rare" items (e.g. only 2 Golden Unicorns in the class--be the first to find one!) made it even more fun!

    For the trade idea, very cool idea! Perhaps you could set it up for what students do in fantasy league sports for basketball, baseball, football, etc.--a trade proposal is sent to both students (usually a notification or email), and just like the interface you used for doing Stash trades, the Trade / Swap proposal only goes through if both parties accept the trade!

    Just an idea....thanks again for sharing your brilliant work for gamification with the Moodle community!
  • Adrian Greeve
    Wed, Apr 19, 2023, 1:27 PM
    If you're interested in a sneak peek at user trading, the latest main branch on github contains this feature. It requires Moodle version 4.1. I'm currently fixing up a few minor things before I release it properly. Please let me know what you think.
  • Clarence Prudhoe
    Tue, Aug 22, 2023, 7:47 AM
    Thanks for developing Stash.
    Is there a way to fetch different stash images based on a user's score? I tried using JavaScript to set up conditions and call a different stash for a range of scores (ie. score > 89 & score < 95 then show stash image). But I can't find a way to use the stash call inside of a JavaScript condition.
  • Baltasar Ortega Bort
    Mon, Sep 18, 2023, 11:05 PM
    Great plugin!
    It's possible make that the student lost an object if fail an activity?
    Thanks in advanced.
    Best regards
  • Adrian Greeve
    Mon, Oct 23, 2023, 10:06 AM
    Hello, I've had numerous people as about making it possible to lose items (or objects). I'm looking into an idea on how this might be possible. It might be limited in some situations. It's not a quick feature to implement so it might be a while before this is possible (if at all).
  • Adrian Greeve
    Mon, Oct 23, 2023, 10:12 AM
    Another common question is "Can I turn off the trade center?" Yes, you can turn on editing for the course and go to the settings to the stash block and disable trading.
1 2 3 4 5 6 7 8 9 10
Please login to post comments