diff --git a/Documentation/CSV_export.sql b/Documentation/CSV_export.sql index f6091758cd96d57b1522e8883879d83273e651c9..4a8067fd4593de305091c64edf1f2d0401c76991 100644 --- a/Documentation/CSV_export.sql +++ b/Documentation/CSV_export.sql @@ -1,39 +1,50 @@ -SELECT 'URL', - 'Date', - 'Statut', - 'Erreurs', - 'Tests non-applicables', - 'Tests conformes', - 'Tests non-conformes', - 'Tests pré-qualifiés', - 'Tests non-testés', - 'Note Asqatasun' -UNION ALL -(SELECT * - FROM (SELECT WR.Url as 'URL', - a.Dt_Creation as 'Date', - a.Status as 'Statut', - COALESCE(WRS.Nb_Failed_Occurrences, '') as 'Erreurs', - COALESCE(WRS.Nb_Na, '') as 'Tests non-applicables', - COALESCE(WRS.Nb_Passed, '') as 'Tests conformes', - COALESCE(WRS.Nb_Failed, '') as 'Tests non-conformes', - COALESCE(WRS.Nb_Nmi, '') as 'Tests pré-qualifiés', - COALESCE(WRS.Nb_Not_Tested, '') as 'Tests non-testés', - (CASE - WHEN WRS.Raw_Mark IS NULL THEN '' - WHEN WRS.Raw_Mark > 99 THEN 'A' - WHEN WRS.Raw_Mark > 90 THEN 'B' - WHEN WRS.Raw_Mark > 85 THEN 'C' - WHEN WRS.Raw_Mark > 75 THEN 'D' - WHEN WRS.Raw_Mark > 60 THEN 'E' - ELSE 'F' - END) as 'Note Asqatasun' - FROM AUDIT as a - INNER JOIN WEB_RESOURCE WR on a.Id_Audit = WR.Id_Audit - LEFT JOIN WEB_RESOURCE_STATISTICS WRS on a.Id_Audit = WRS.Id_Audit) as csv_export) -INTO OUTFILE '/tmp/Observatoire_Accessibilite_2023-09-19.csv' +# First create the view + +CREATE VIEW monitoring_synthesis AS +( +SELECT WR.Url 'URL', + a.Dt_Creation 'Date', + a.Status 'Statut', + COALESCE(WRS.Nb_Failed_Occurrences, "") 'Erreurs', + COALESCE(WRS.Nb_Na, "") 'Tests non-applicables', + COALESCE(WRS.Nb_Passed, "") 'Tests conformes', + COALESCE(WRS.Nb_Failed, "") 'Tests non-conformes', + COALESCE(WRS.Nb_Nmi, "") 'Tests pré-qualifiés', + COALESCE(WRS.Nb_Not_Tested, "") 'Tests non-testés', + (CASE + WHEN WRS.Raw_Mark IS NULL THEN "" + WHEN WRS.Raw_Mark > 99 THEN "A" + WHEN WRS.Raw_Mark > 90 THEN "B" + WHEN WRS.Raw_Mark > 85 THEN "C" + WHEN WRS.Raw_Mark > 75 THEN "D" + WHEN WRS.Raw_Mark > 60 THEN "E" + ELSE "F" + END) as 'Note Asqatasun' +FROM AUDIT as a + INNER JOIN WEB_RESOURCE WR on a.Id_Audit = WR.Id_Audit + LEFT JOIN WEB_RESOURCE_STATISTICS WRS on a.Id_Audit = WRS.Id_Audit +ORDER BY WR.Url + ); + +# Then export data into CSV file +SELECT * +INTO OUTFILE '/tmp/Observatoire_Accessibilite_2023-12-29.csv' CHARACTER SET utf8mb4 FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' -; \ No newline at end of file +FROM (SELECT 'URL', + 'Date', + 'Statut', + 'Erreurs', + 'Tests non-applicables', + 'Tests conformes', + 'Tests non-conformes', + 'Tests pré-qualifiés', + 'Tests non-testés', + 'Note Asqatasun' + UNION ALL + SELECT * + from monitoring_synthesis) + as mycsv +; diff --git a/README.md b/README.md index dbfbe2e629544ee78390e81975aa69eafb530ac2..f9ca682ffe7d4ef917eb2adcd14e63ca01dde6fb 100644 --- a/README.md +++ b/README.md @@ -33,5 +33,7 @@ La mesure porte sur la page d'accueil du site. À l'avenir, elle sera opérée s L'observatoire ne traite que la partie automatisable du RGAA et ne saurait remplacer un audit complet fait par un spécialiste. -L'audit automatisé est assuré par le [logiciel libre Asqatasun](https://gitlab.com/asqatasun/Asqatasun). À l'automne -2023, ce sont Asqatasun v5.0.0 et le RGAA 4.0 qui sont utilisés. +L'audit automatisé est assuré par le [logiciel libre Asqatasun](https://gitlab.com/asqatasun/Asqatasun). Ce dernier +couvre [45% du RGAA](https://doc.asqatasun.org/v5/en/Business-rules/RGAA-v4/) (117 tests couverts sur les 257 du RGAA) + +À l'automne 2023, ce sont Asqatasun v5.0.0 et le RGAA 4.0 qui sont utilisés.