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:
143 sites
160 downloads
19 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.

To test email features, the DemoStudent account clones the email address of the user who creates it.  For this reason, if your site has TAs/Instructors who are also students in other courses, note that grade imports which match on email will break if any of the graded students have created DemoStudent accounts.  The workaround is to match on another field during the grade import, or update the profile of the DemoStudent account to use a different email address.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2

Contributors

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

Comments RSS

Show comments
  • Dom Royko
    Thu, 17 Oct 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.
  • Blair F.
    Tue, 22 Oct 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.
  • Dom Royko
    Tue, 22 Oct 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: https://moodle.org/mod/forum/discuss.php?d=388850
  • Blair F.
    Tue, 22 Oct 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.
  • Blair F.
    Sat, 2 Nov 2019, 4:29 AM
    Just an update: We implemented the solution mentioned in https://moodle.org/mod/forum/discuss.php?d=388850 and it made no difference. We are still experiencing this strange issue with new users.
  • Blair F.
    Fri, 20 Dec 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.
  • Kirk Martinson
    Fri, 15 Jan 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?
    kirk
  • Dom Royko
    Sat, 16 Jan 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 @example.com 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.
  • Dinis Medeiros
    Mon, 25 Jan 2021, 8:37 PM
    Thanks for the plugin. PT-PT translation on the way.
  • Kees Koopman
    Thu, 18 Mar 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.
    Sincerely,
    Kees Koopman
  • Dom Royko
    Thu, 18 Mar 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.

    Thanks,
    Dom.

  • K Hurt
    Wed, 1 Sept 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.
  • Dom Royko
    Fri, 3 Sept 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.
  • Blair F.
    Tue, 28 June 2022, 11:47 PM
    We've been using this block for several years now. Our I.T. department is moving us over to Azure Single Signon and has found an issue with the fact that this plugin creates accounts with the same email addresses as the original user. They're suggesting we may have to hack the code to change this! Has anyone else experienced this issue and solved it another way? Thanks, in advance.
  • Dom Royko
    Tue, 5 July 2022, 4:11 AM
    Hi Blair,

    Looks similar to what Kirk was experiencing last year (see comments above). Take a look in blocks/demostudent/locallib.php at the function create_demostudent_account(). That's where the email address for the newly created account is set, and you can modify it to something that will work for your system, or something meaningless. If you use something meaningless, like an @example.com address, you will unfortunately lose the ability to test email notifications. Having an email alias which maps to the same user (perhaps using capitalisation?) would be better. For existing demostudent accounts, you can find them in the database using the query "select id,username,email from mdl_user where firstname='DemoStudent';". How you want to replace these will depend on whether you can get aliases working. Hope that helps.
1 2
Please login to post comments