ATutor

Learning Management Tools







Pages:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


test if user is a student


  • 2009-05-25 23:01:41

    test if user is a student

    I am trying to write some code for the question themeing files (truefalse_result.tmpl.php) which tests if the current user is a student but i don't know the variable to test.

    Can anyone please tell me which variable stores the current user's type of account (student/instructor/admin/etc)?

  • 2009-05-26 11:50:25

    Re: test if user is a student

    There's a few different way to test if a user is a student. $_SESSION('is_admin') is true for instructors, so test to see if this is false.

    I suggest you turn on debugging in the include/vitals.inc.php file, near the top. You then get a list of all the session variables available to work with, among other useful information.