DemoStudent block

Blocks ::: block_demostudent
Maintained by Greg Gibeau, Dom Royko
The DemoStudent block gives instructors a way to enroll a "demostudent" in their course, then switch back and forth between their instructor view and the student view.
Latest release:
133 sites
12 fans
Current versions available: 4

Students have a different view of your course than instructors do. This block provides a way to test the student experience beyond the existing Switch role to... link in the Settings block.  Instructors in a course can use the DemoStudent block to create a personal "demostudent" account, and then switch between the demostudent user and their instructor role.  The demostudent user can complete assignments and quizzes with persistent data to verify grading, and can be used to test restricted access using groups or groupings.


Screenshot #0
Screenshot #1
Screenshot #2


Greg Gibeau (Lead maintainer)
Dom Royko: Lead Maintainer
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Wed, Oct 16, 2019, 3:44 AM
    Any news for fixing the problem?

    Thank you!
  • Thu, Oct 17, 2019, 6:19 AM
    Officially, the latest version of the plugin DOES support Moodle 3.6 and 3.7.Go to the "Versions" tab on this page and see for yourself:

    In any case, I guess it would help the developer if you'll give more details about your issue - Which error did you encounter when trying to install the plugin?
  • Thu, Oct 17, 2019, 7:08 AM
    I've confirmed the bug on a fresh install of Moodle 3.7.2. Andreas sent me the error messages and I'm looking for a fix. Same issue as before (MDL ticket linked above) - on installation, the plugin is trying to assign a capability that has not been created yet. Users who are upgrading an existing installation already containing the block, will most likely not see the error.
  • Tue, Oct 22, 2019, 4:30 AM
    Is anyone else getting the error message, "Exception - Call to undefined method cachestore_dummy::find_by_prefix()" when a user tries to create a DemoStudent account for the very first time? We're using Moodle 3.6.6.
  • Tue, Oct 22, 2019, 4:46 AM
    Hi Blair, I was just testing a fresh install with 3.7.2, and did not see this. The plugin certainly never explicitly calls cache functions. However, it sounds like it could be another manifestation of this issue:
  • Tue, Oct 22, 2019, 6:00 AM
    Thanks, Dom. I'm not sure, but we have a bunch of new instructors experiencing this, or similar, since updating to Moodle 3.6. In SOME cases, the above message doesn't occur, but when they try to switch to demostudent, they are taken to a user profile account with missing username fields that are also disabled. They are unable to get past that point. When I look at the Participation list for those classes, I notice a demostudent account with no username, id, etc.
  • Sat, Nov 2, 2019, 4:29 AM
    Just an update: We implemented the solution mentioned in and it made no difference. We are still experiencing this strange issue with new users.
  • Fri, Dec 20, 2019, 2:36 AM
    Is anyone else still experiencing the issue that prevents NEW teachers from creating DemoStudent accounts? This is really starting to become a problem for us, since we have more and more new faculty every term, so more and more faculty are not able to use this wonderfully useful plugin.
  • Fri, Jan 15, 2021, 5:12 AM
    Dom (or Greg or anyone else who may have experienced this) -
    We're having sporadic incidents of a teacher creating a DemoStudent, and at the same time as the creation/enrolment of the DemoStudent and them being given the role of demostudent, they are given a teacher role, and then ANOTHER DemoStudent (of the DemoStudent) is created/enrolled/given student role. This seems to also cause the teacher to be suspended from the course when the next sync with our registration database happens (likely due to the fact that the teacher DemoStudent and the teacher have the same email). Additionally, the DemoStudent teacher then shows up as being a database enrolled user and not a manual one. Therefore you can't alter the user in the course, the user needs to be completely removed from the site at the admin level. After doing this, the teacher gets reinstated from the database. Lots of strangeness. Any ideas?
  • Sat, Jan 16, 2021, 3:29 AM
    Hi, Kirk. We have not seen what you describe. It sounds like it's at least partially due to an interaction between the manual accounts and your sync process. It should be fairly simple to change the email address of the created DemoStudent user to or some such, though you would then lose any email sent to them. (Creating a subdomain or alias would be better, but more work on the infrastructure side.) It would probably be good to have a sanity check that DemoStudent users are not creating other DemoStudent accounts, which might help with the first part of the issue you're seeing. I haven't looked at the code in a couple of years, and since it's stable here, it's a backburner project for us, alas.
  • Mon, Jan 25, 2021, 8:37 PM
    Thanks for the plugin. PT-PT translation on the way.
  • Thu, Mar 18, 2021, 10:22 PM
    Hi Greg,

    Thank you for the DemoStudent plugin.
    We now use Moodle 3.9
    Can your plug-in be used there too?
    I see that the last update is from October 2019.

    Thank you in advance for your response.
    Kees Koopman
  • Thu, Mar 18, 2021, 11:35 PM
    Hi Kees,

    We have not tested the plugin with 3.9. We plan to upgrade to 3.10 this summer, so we will be looking at it again in the next 3-4 months. A preliminary test after upgrade to 3.10 seems to work fine. If you run into any problems with the plugin on 3.9, let us know.


  • Wed, Sep 1, 2021, 10:45 PM
    Currently experiencing an issue where switching to the instructor role completely logs out of Moodle and we have to sign in again. We are on Moodle version 3.9 and using version 2019101800 of the block.
  • Fri, Sep 3, 2021, 1:43 AM
    Hi K,

    Needing to log in again when switching back to the instructor role is required, depending on the authentication settings of your site. The workaround we suggest to our instructors is to have two browsers open (or one browser using a regular as well as an incognito/private window), with one logged in as themselves, and one switched to the demostudent role. This also allows easier checking of effects as settings are changed.
1 2
Please login to post comments