Results of user logged in

Results of user logged in

by James Asante -
Number of replies: 5

Hi

I wish to get the results of the logged user. The query below returns not results. Please help.

SELECT u.username AS 'UserName', u.firstname AS 'Name' , u.lastname AS 'Surname', u.city AS City, u.email AS Email, c.fullname AS 'Course', cc.name AS 'Category', gi.itemname AS 'Item Name',
ROUND(gg.finalgrade,2) AS Score,ROUND(gg.rawgrademax,2) AS MAX, ROUND(gg.finalgrade / gg.rawgrademax * 100 ,2) AS Percentage,
IF (ROUND(gg.finalgrade / gg.rawgrademax * 100 ,2) > 79,'Yes' , 'No') AS Pass
FROM prefix_course AS c
JOIN prefix_context AS ctx ON c.id = ctx.instanceid
JOIN prefix_role_assignments AS ra ON ra.contextid = ctx.id
JOIN prefix_user AS u ON u.id = ra.userid
JOIN prefix_grade_grades AS gg ON gg.userid = u.id
JOIN prefix_grade_items AS gi ON gi.id = gg.itemid
JOIN prefix_course_categories AS cc ON cc.id = c.category
WHERE u.username=Current_User()
ORDER BY `Name` ASC

Average of ratings: -
In reply to James Asante

Re: Results of user logged in

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

1.  Configurable reports is designed to pull data from across the site.  So, what exactly are you trying to achieve here?

2.  Logged in users already have access to their grades...

3.  Student should not necessarily have access to this plugin...

Sorry, it is just this makes no sense to me as to why you would ever want to use configurable reports for a report like this..

In reply to Emma Richardson

Re: Results of user logged in

by James Asante -

Hi Emma

I am trying to get students to access all their results across different courses in one place. The grade report does not do that. Or, is it not possible?

Regards

James Asante

In reply to James Asante

Re: Results of user logged in

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

The grades overview report already does that (linked to from the dropdown menu by their name in the top navbar)...what version of Moodle?

Average of ratings: Useful (1)