Is there a way to show logs of guest activity?

Is there a way to show logs of guest activity?

by stefan weber -
Number of replies: 3
Picture of Plugin developers

I would like to show the activity of users that view courses as a guest at our site.

Unfortunately, there does not seem to be any way to filter for this, as user roles are not included in logs.

In theory, according to the help tooltip, this should work by setting the event type:

  • Teaching - actions performed by a teacher
  • Participating - actions performed by a student
  • Other - actions performed by a user with a role other than teacher or student

However, in reality, guest actions such as viewing the course are logged as "participating".


So, is there any other way to show activity for guests?

Average of ratings: -
In reply to stefan weber

Re: Is there a way to show logs of guest activity?

by Randy Thornton -
Picture of Documentation writers


You can filter by the User 'Guest'. 

Guest is both a special pre-defined Role and a predefined User at the same time. So filtering by user will get you the same results as filtering by role would (if you could).

Attachment screenshot_2853.jpg
Average of ratings: Useful (1)
In reply to Randy Thornton

Re: Is there a way to show logs of guest activity?

by stefan weber -
Picture of Plugin developers

but if I access a course as a guest, that event is logged with the user name I accessed it with, not with "guest".

thus, filtering by "guest" always gives me an empty list, even if i previously generated activity with a user that uses guest access.

In reply to stefan weber

Re: Is there a way to show logs of guest activity?

by Randy Thornton -
Picture of Documentation writers


Ah, indeed, you are quite right. 

In this particular case, if I understand properly, the user is not in the site as guest, but is already logged in as a real user. Then accessing a course using the Guest role, the log just shows them accessing it normally as that user. 

it makes sense to me that it would use the real user name here. But what is missing is what role you are using to access the course. Student and Guest are lumped together as 'Participating' as opposed to 'Teaching' just as you noted originally. 

I don't see in the log table in the database that it tracks the exact role. There is a column for "edulevel" which reflects the constants in the code to log for Teaching (1) versus Participating (2). It seems to lump in Guest as Participating the same as a Student. (See attachment from base.php constants.)

I think the only way around this is to fix it in the code. It should really not lump the Guest user in as Participating but at least use Other (0) or better have its own level. Right now, the log data that this is a Guest use just doesn't exist as far as I can tell.


Randy

Attachment screenshot_2943.jpg