A true 'Student test' account (Switch role to / Guest access)

A true 'Student test' account (Switch role to / Guest access)

by Matt Jenner -
Number of replies: 10

At University College London we get asked by academics and support staff if they can see Moodle from a true student perspective. We don't allow them to have the 'log in as' functionality as that offers a little too much. The 'switch role to' offers too little functionality, and we need something in the middle. 

In response to some requests, we have given out a Moodle-only (manual authentication) 'student test account' but these get difficult as they're not bound to the same operational mechanisms as 'real' LDAP accounts. Also, I'd like to give a fair experience to all staff, thus creating the need for potentially hundreds (thousands!) of these accounts - which isn't ideal. 

My thoughts are along the lines of a special 'student' account which works in a similar way to Guest. It's an account that can't actually be used as a role, but it offers an experience of a real person. The single account can be used, much like a hybrid of log in as/switch role to/guest access. 

I have not thought too much along the lines of how it would operate from a technical level - I wanted to ask in here what other's thought, perhaps try to gather a list of user requirements and see if there's any natural momentum in it. If so, then put it into the tracker and get some votes, and think how it may actually be achieved. 

An initial search around didn't discover any previous requests for this, but if there are please do point me in that direction) 

Average of ratings: -
In reply to Matt Jenner

Re: A true 'Student test' account (Switch role to / Guest access)

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

We made a block at the OU the provides two links "View as student" and "View as tutor". When you click the link if creates a fake user and enrols them in the course (if that has not aready been done before) and then logs the user in as that fake user.

There is then some hackery in the theme, so that if you have switched to the alternate user, it displays a message in the header, with an option to switch back.

In fact, the whole thing is a bit of a hack, but seems to work quite well. We have not released the code yet. I could see if we are allowed to.

Average of ratings: Useful (2)
In reply to Tim Hunt

Re: A true 'Student test' account (Switch role to / Guest access)

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Wow - what a cool hack! cool

In reply to Tim Hunt

Re: A true 'Student test' account (Switch role to / Guest access)

by Matt Jenner -

That's a great little hack, I wonder how it may work in our environment. 

Do other Moodler's require functionality like this? Personally I'd like to see it in core, but then again I'm not aversed to branching out a little. 

As a side note; it's funny how I feel a lot better when the OU have done it (it's like comparing parental home cooked food to something your housemate created from the contents of the cupboard...)

In reply to Tim Hunt

Re: A true 'Student test' account (Switch role to / Guest access)

by Tracey Johnson -

The request from teaching staff to "login as a student" has come up again at our university.  We are running Moodle 2.7 with "switch role to function" which allows staff to view the course as a student based on a selected grouping.

Their issue is that the switch role function does not allow them to actually do an activity i.e. submit an assessment.

Has anyone made any progress on this issue?


Thanks in advance for any feedback.

Cheers,  Tracey

In reply to Matt Jenner

Re: A true 'Student test' account (Switch role to / Guest access)

by ben reynolds -

I like that OU approach, but until it is released, why not just create one system wide student user? Make the role not visible (which means only Teachers and above can see it).

In reply to ben reynolds

Re: A true 'Student test' account (Switch role to / Guest access)

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I can probably shove the code onto github tomorrow. I would not recommend using it as-is, since it hard codes some thigns to do with groups and are particular (peculiar?) roles set-up, which should probably be done using admin settings. Still, if someone else has time to clean it up generic-ify it, it might be useful.

Just to make it clear, this is nothing to do with me. sam marshall designed it and Al Thompson coded it. My only contribution will be pushing it onto github.

I did find out a bit about how it works. It uses the standard Moodel login-as feature. However, it does not require teachers to have the capability to log in as any other users. Instead, there is a new capability block:loginasexample:loginasexamplestudent, and people with that capability can only log in as the special example student user.

In reply to Tim Hunt

Re: A true 'Student test' account (Switch role to / Guest access)

by Matt Jenner -

Tim,

If you have a moment to put this up somewhere it would be much appreciated. I think we would try to get it to work, the worst case scenario with something like this is that one day it stops working and we're back to where we started - rather than further behind. 

If we can make any improvements/standardisations/headway then I'll be sure to post it back up again. We're using quite a plain Moodle 2 so that'll help identify any bugs. 

Thanks,

Matt

In reply to Matt Jenner

Re: A true 'Student test' account (Switch role to / Guest access)

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Oops sorry, I forgot about this.

Code now available at https://github.com/moodleou/moodle-block_viewasexample. Use at your own risk. Certainly compatible with 2.1+. Probably works with 2.0.

Use at your own risk.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: A true 'Student test' account (Switch role to / Guest access)

by Matt Jenner -

Tim,

Thank you! Very kind of you to share. It's been added on our list of 'things to do' for Moodle 2 and I'm crossing my fingers that it'll work in our environment. 

If we make any changes I'll be sure to come and post them back here, if there's enough interest we'll see how far it can go.

In reply to ben reynolds

Re: A true 'Student test' account (Switch role to / Guest access)

by Matt Jenner -

Ben - it's not a bad idea, but I don't think it would work too well when shared in thousands of courses with an equal number of staff. I felt a solution needs to be slightly more technical and transparent to a member of staff, like a flick of a switch - Strudent mode ON, Student mode OFF etc.