Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hardcoded role #2

Open
ak4t0sh opened this issue May 15, 2019 · 0 comments
Open

hardcoded role #2

ak4t0sh opened this issue May 15, 2019 · 0 comments

Comments

@ak4t0sh
Copy link

ak4t0sh commented May 15, 2019

In

list ($select, $from, $where, $params) = user_get_participants_sql($courseid, 0, 0, 5);

Role "5" is hardcoded. This role is usually 'student' but you can not be sure that's always true.
A cleaner way would be to fetch the id from database using the role shortname "student".
$DB->get_record('role', array('shortname' => 'student'));

Enhancement (non blocking for approval) :
IMO the best way would be to add a setting to select the students role(s) (some institutions can have several roles for students) :-)

cellule-tice pushed a commit that referenced this issue May 16, 2019
An optiobnal improvment is also done : link to user profile in display
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant