Hi Friend´s
Actually im using Moodle 3.4, and im development a php system that consult database moodle.
My question is next:
In Moodle when you see grade report, Moodle show all activities that have pondetarion in the course, if the user don´t do it some activitie, moodle show just (-) but if the user make an activitie show the calification.
Actually i have the next mysql query:
SELECT
u.id,
c.fullname AS curso,
CASE
WHEN nombre_ejercicio is NULL THEN 'Promedio_Final' ELSE nombre_ejercicio END AS 'tipo_eval',
COALESCE(ROUND(gg.finalgrade,0),0) as Calificacion_Final
FROM mdl_user u
INNER JOIN mdl_role_assignments ra ON ra.userid = u.id
INNER JOIN mdl_context ct ON ct.id = ra.contextid
INNER JOIN mdl_course c ON c.id = ct.instanceid
INNER JOIN mdl_role r ON r.id = ra.roleid
LEFT JOIN
(
SELECT
Distinct
u.id AS userid,
c.id as courseid,
g.finalgrade AS finalgrade,
gi.itemname AS nombre_ejercicio
FROM mdl_user u
JOIN mdl_grade_grades g ON g.userid = u.id
JOIN mdl_grade_items gi ON g.itemid = gi.id
JOIN mdl_course c ON c.id = gi.courseid
) gg ON gg.userid = u.id and gg.courseid = c.id
WHERE r.id = 5
AND c.id=139
Order BY u.id
This query show the activities of the course and show the calification, this query also includes the final grade,
but if the user don´t make any activitie my query just show the final grade, not show the activities with (-).
Somebody can helpme how can edit my query for: No matter if the user not make an activitie, always show the activitie name but with (-) in case that user no make any activitie, and if the user make the activitie, show the calification.
I want to show the same report that moodle show it in grade report but in my php system.
I think that this part is make it in php logic to put the signal (-), but i don´t sure how to make it,
somebody can´t helpme please.
Thanks