Table des matières

Catalogue de requêtes génériques

Block Dashboard (Elément de tableau de bord)

Utilisateurs non connectés par cohortes

Affiche la liste des utilisateurs non connectés par cohortes avec en données de sortie les catégorie et sous-catégorie de cours concernés, les shortnames et les cours, le nom des cohortes. Pour les utilisateurs : le nom, prénom, l' email, l'identifiant, son rôle et un champs de profil personnalisé sur sa fonction sur Moodle)

SELECT

 CONCAT(c.id,'-',u.id) as pkey,
 c.shortname as cs,
 c.fullname as cf,
 c.id as cid,
 cc1.name as cc1,
 cc2.name as cc2,
 ch.name as ch,
  u.firstname as fn,
  u.lastname as ln,
  u.email as em,
  u.username as un,
  GROUP_CONCAT(DISTINCT r.shortname ORDER BY r.sortorder DESC SEPARATOR ', ') as roles,
 uid.data as profil

FROM

 {user} u

JOIN

 {cohort_members} cm ON cm.userid = u.id

JOIN

 {cohort} ch ON cm.cohortid = ch.id

JOIN

 {course} c

JOIN

 {course_categories} cc1 ON c.category = cc1.id

JOIN

 {course_categories} cc2 ON cc1.parent = cc2.id

JOIN

 {enrol} e ON e.courseid = c.id AND e.status = 0

JOIN

 {context} ctx ON c.id = ctx.instanceid AND ctx.contextlevel = 50

JOIN

 {role_assignments} ra ON ctx.id = ra.contextid AND ra.userid = u.id

JOIN

 {role} r ON ra.roleid = r.id

LEFT JOIN

 {user_lastaccess} ul ON ul.userid = u.id AND c.id = ul.courseid

LEFT JOIN

 {user_info_data} uid ON u.id = uid.userid AND uid.fieldid = 2

WHERE

 (ul.timeaccess = 0 OR ul.timeaccess IS NULL)
 <%%FILTERS%%>

GROUP BY

  CONCAT(c.id,'-',u.id)

ORDER BY

 cc2,cc1,cf,ch

Configuration

Tzo4OiJzdGRDbGFzcyI6MTA0OntzOjU6InRpdGxlIjtzOjQyOiJWb2x1bcOpdHJpZSBkZXMgbm9uIGNvbm5lY3TDqXMgcGFyIGNvaG9ydGUiO3M6MTM6ImluYmxvY2tsYXlvdXQiO3M6MToiMCI7czo2OiJ0YXJnZXQiO3M6NjoibW9vZGxlIjt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M6MDoiIjtzOjE3OiJ0aW1lbGluZWV2ZW50bGluayI7czowOiIiO3M6MTc6InRpbWVsaW5lZXZlbnRkZXNjIjtzOjA6IiI7czoxNDoidGltZWxpbmVjb2xvcnMiO3M6MDoiIjtzOjE4OiJ0aW1lbGluZWNvbG9yZmllbGQiO3M6MDoiIjtzOjE3OiJ0aW1lbGluZWNvbG9ya2V5cyI7czowOiIiO3M6NzoibnVtc3VtcyI7czo2OiJuY3U7dXMiO3M6MTM6Im51bXN1bWZvcm1hdHMiO3M6NToiJWQ7JWQiO3M6MTI6Im51bXN1bWxhYmVscyI7czozOToiVG90YWwgdXRpbGlzYXRldXJzO1RvdGFsIG5vbiBjb25uZWN0w6lzIjtzOjg6ImNyb25tb2RlIjtzOjk6Im5vcmVmcmVzaCI7czo4OiJjcm9uaG91ciI7czowOiIiO3M6NzoiY3Jvbm1pbiI7czowOiIiO3M6MTM6ImNyb25mcmVxdWVuY3kiO3M6NToiZGFpbHkiO3M6ODoibWFrZWZpbGUiO3M6MToiMCI7czoxMDoiZmlsZW91dHB1dCI7czowOiIiO3M6MTc6ImZpbGVvdXRwdXRmb3JtYXRzIjtzOjA6IiI7czoxMDoiZmlsZWZvcm1hdCI7czozOiJDU1YiO3M6MTU6ImZpbGVzcWxvdXR0YWJsZSI7czowOiIiO3M6MTI6ImZpbGVsb2NhdGlvbiI7czowOiIiO3M6MjE6ImZpbGVwYXRoYWRtaW5vdmVycmlkZSI7czowOiIiO3M6ODoic2F2ZXZpZXciO3M6MjM6IkVucmVnaXN0cmVyIGV0IGFmZmljaGVyIjtzOjk6InNxbHBhcmFtcyI7TjtzOjk6ImlzcnVubmluZyI7aTowO3M6ODoibGFzdGNyb24iO2k6MDt9

Crédits

Revenir au catalogue de requêtes génériques - Index du composant - Revenir à l'index des plugins - Revenir au catalogue