querycraft 2.7.0__tar.gz → 2.7.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. {querycraft-2.7.0/querycraft.egg-info → querycraft-2.7.1}/PKG-INFO +1 -1
  2. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/PlantUML.py +14 -3
  3. querycraft-2.7.1/querycraft/__init__.py +2 -0
  4. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/config/codemata.json +2 -2
  5. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/templates/config.html +3 -0
  6. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/templates/traces.html +33 -0
  7. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/web/sql_routes.py +46 -1
  8. {querycraft-2.7.0 → querycraft-2.7.1/querycraft.egg-info}/PKG-INFO +1 -1
  9. querycraft-2.7.0/querycraft/__init__.py +0 -2
  10. {querycraft-2.7.0 → querycraft-2.7.1}/AUTHORS +0 -0
  11. {querycraft-2.7.0 → querycraft-2.7.1}/LICENSE +0 -0
  12. {querycraft-2.7.0 → querycraft-2.7.1}/MANIFEST.in +0 -0
  13. {querycraft-2.7.0 → querycraft-2.7.1}/README.md +0 -0
  14. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/LLM.py +0 -0
  15. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/LLM_providers.py +0 -0
  16. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/LRS.py +0 -0
  17. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/SQLException.py +0 -0
  18. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/cache/readme.txt +0 -0
  19. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/cachemanager.py +0 -0
  20. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/config/config-sbs-std.cfg +0 -0
  21. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/config/config-sbs.cfg +0 -0
  22. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/configmanager.py +0 -0
  23. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/data/cinema.db +0 -0
  24. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/data/cours.db +0 -0
  25. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/data/em.db +0 -0
  26. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/data/entreprise.db +0 -0
  27. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/data/librairie.db +0 -0
  28. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/data/lutins.db +0 -0
  29. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/data/robots.db +0 -0
  30. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/data/vols.db +0 -0
  31. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/database/MYSQL.py +0 -0
  32. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/database/PGSQL.py +0 -0
  33. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/database/SQLITE.py +0 -0
  34. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/database/__init__.py +0 -0
  35. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/database/base.py +0 -0
  36. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/exceptions/OperationNotSupportedException.py +0 -0
  37. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/exceptions/__init__.py +0 -0
  38. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/exercicemanager.py +0 -0
  39. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/exos/Didapro11.json +0 -0
  40. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/exos/OENU2026.json +0 -0
  41. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/exos/ex1.json +0 -0
  42. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/exos/exos1.json +0 -0
  43. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/exos/readme.txt +0 -0
  44. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/logger.py +0 -0
  45. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/logs/readme.txt +0 -0
  46. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/__init__.py +0 -0
  47. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/cli/CliOutputFactory.py +0 -0
  48. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/cli/__init__.py +0 -0
  49. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/cli/outputBuilder/CliCodeBuilder.py +0 -0
  50. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/cli/outputBuilder/CliListBuilder.py +0 -0
  51. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/cli/outputBuilder/CliParagraphBuilder.py +0 -0
  52. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/cli/outputBuilder/CliTableBuilder.py +0 -0
  53. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/cli/outputBuilder/CliTextBuilder.py +0 -0
  54. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/cli/outputBuilder/CliTitleBuilder.py +0 -0
  55. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/cli/outputBuilder/__init__.py +0 -0
  56. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/commons/OutputBuilder.py +0 -0
  57. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/commons/OutputCodeFactory.py +0 -0
  58. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/commons/OutputFactory.py +0 -0
  59. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/commons/OutputListBuilder.py +0 -0
  60. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/commons/OutputParagraphFactory.py +0 -0
  61. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/commons/OutputTableBuilder.py +0 -0
  62. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/commons/SimpleOutputBuilder.py +0 -0
  63. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/commons/__init__.py +0 -0
  64. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/commons/utils.py +0 -0
  65. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/html/HtmlOutputFactory.py +0 -0
  66. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/html/__init__.py +0 -0
  67. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/html/outputBuilder/HTMLCodeBuilder.py +0 -0
  68. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/html/outputBuilder/HTMLListBuilder.py +0 -0
  69. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/html/outputBuilder/HTMLParagraphBuilder.py +0 -0
  70. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/html/outputBuilder/HTMLTableBuilder.py +0 -0
  71. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/html/outputBuilder/HTMLTextBuilder.py +0 -0
  72. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/html/outputBuilder/HTMLTitleBuilder.py +0 -0
  73. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/html/outputBuilder/__init__.py +0 -0
  74. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/markdown/MarkdownOutputFactory.py +0 -0
  75. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/markdown/__init__.py +0 -0
  76. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/markdown/outputBuilder/MarkdownCodeBuilder.py +0 -0
  77. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/markdown/outputBuilder/MarkdownListBuilder.py +0 -0
  78. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/markdown/outputBuilder/MarkdownParagraphBuilder.py +0 -0
  79. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/markdown/outputBuilder/MarkdownTableBuilder.py +0 -0
  80. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/markdown/outputBuilder/MarkdownTextBuilder.py +0 -0
  81. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/markdown/outputBuilder/MarkdownTitleBuilder.py +0 -0
  82. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/output/markdown/outputBuilder/__init__.py +0 -0
  83. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/paths.py +0 -0
  84. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/security.py +0 -0
  85. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/sql/SQLContext.py +0 -0
  86. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/sql/SQLExecutionService.py +0 -0
  87. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/sql/SQLNormalizationService.py +0 -0
  88. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/sql/SQLQueryService.py +0 -0
  89. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/sql/SQLStepByStepService.py +0 -0
  90. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/sql/__init__.py +0 -0
  91. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/sqlsbs.py +0 -0
  92. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/static/qc-0973b307dafc25e2b7a5f12be0f68d1786cedbf5ad0371c3f3d5f051fc00b626.puml +0 -0
  93. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/static/qc-18be2287f8920a2975f21fe98022750b27c222b85ac8d6de95a686835f147e9e.puml +0 -0
  94. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/static/qc-3d819e30e542ba328af562eb160d23140f2193d92354b0897289767e1c041e96.puml +0 -0
  95. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/static/qc-54c49d1ad35ea5cf736dfd64c3ed9c42ea90d7b82a5f3783f73f46de99bf0987.puml +0 -0
  96. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/static/qc-5b552498722250bebfe20f44257243a9f9e08d2f3865955c60f4469ff1c12fea.puml +0 -0
  97. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/static/qc-a70191192c2a1640bfec39afd281537d4ede20bb5c9e87ccb32b883e1e58bcab.puml +0 -0
  98. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/static/qc-d1881606867eea2d5f0cf600fa342f8e04e8d5cc388946a09cffb855052b22ad.puml +0 -0
  99. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/static/qc-eb48d0ac9258e52c7715e6313b6da064ed9ab2efab6ba7b3225b9568a3c2545e.puml +0 -0
  100. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/templates/admin_login.html +0 -0
  101. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/templates/base.html +0 -0
  102. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/templates/correction_prompt.md +0 -0
  103. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/templates/credits.html +0 -0
  104. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/templates/database_prompt.md +0 -0
  105. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/templates/didactique.md +0 -0
  106. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/templates/didapro11.html +0 -0
  107. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/templates/erreur_prompt.md +0 -0
  108. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/templates/exercices.html +0 -0
  109. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/templates/index.html +0 -0
  110. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/templates/instance_error.html +0 -0
  111. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/templates/requete_prompt.md +0 -0
  112. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/templates/systeme_prompt.md +0 -0
  113. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/templates/systeme_prompt_factuel.md +0 -0
  114. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/templates/systeme_prompt_valideur.md +0 -0
  115. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/templates/valideur_prompt.md +0 -0
  116. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/tenantadmin.py +0 -0
  117. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/tenantdashboard.py +0 -0
  118. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/tenantlogging.py +0 -0
  119. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/tenantregistry.py +0 -0
  120. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/tools.py +0 -0
  121. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/traceservice.py +0 -0
  122. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/web/__init__.py +0 -0
  123. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/web/admin_routes.py +0 -0
  124. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/web/app.py +0 -0
  125. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/web/context.py +0 -0
  126. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/web/exercices_routes.py +0 -0
  127. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/web/helpers.py +0 -0
  128. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/web/pages.py +0 -0
  129. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/web/tenancy.py +0 -0
  130. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/web/traces_routes.py +0 -0
  131. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft/web_sbs.py +0 -0
  132. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft.egg-info/SOURCES.txt +0 -0
  133. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft.egg-info/dependency_links.txt +0 -0
  134. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft.egg-info/entry_points.txt +0 -0
  135. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft.egg-info/requires.txt +0 -0
  136. {querycraft-2.7.0 → querycraft-2.7.1}/querycraft.egg-info/top_level.txt +0 -0
  137. {querycraft-2.7.0 → querycraft-2.7.1}/setup.cfg +0 -0
  138. {querycraft-2.7.0 → querycraft-2.7.1}/setup.py +0 -0
  139. {querycraft-2.7.0 → querycraft-2.7.1}/test/testAnthropic.py +0 -0
  140. {querycraft-2.7.0 → querycraft-2.7.1}/test/testOllama.py +0 -0
  141. {querycraft-2.7.0 → querycraft-2.7.1}/test/testParse.py +0 -0
  142. {querycraft-2.7.0 → querycraft-2.7.1}/test/test_LLM.py +0 -0
  143. {querycraft-2.7.0 → querycraft-2.7.1}/test/test_SQLNormalizationService.py +0 -0
  144. {querycraft-2.7.0 → querycraft-2.7.1}/test/test_SQLQueryService.py +0 -0
  145. {querycraft-2.7.0 → querycraft-2.7.1}/test/test_configmanager.py +0 -0
  146. {querycraft-2.7.0 → querycraft-2.7.1}/test/test_exercicemanager.py +0 -0
  147. {querycraft-2.7.0 → querycraft-2.7.1}/test/test_litellm_provider.py +0 -0
  148. {querycraft-2.7.0 → querycraft-2.7.1}/test/test_traces_routes.py +0 -0
  149. {querycraft-2.7.0 → querycraft-2.7.1}/test/test_traceservice.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: querycraft
3
- Version: 2.7.0
3
+ Version: 2.7.1
4
4
  Summary: Provide usefully SQL classes and functions to execute SQL queries step by step
5
5
  Home-page: https://gitlab.univ-nantes.fr/ls2n-didactique/querycraft
6
6
  Author: Emmanuel Desmontils
@@ -34,7 +34,14 @@ class PlantUML:
34
34
  # MultiplexedPath dont str() n'est pas un chemin exploitable.
35
35
  self.images_dir = Path(__file__).parent / "static" / "images"
36
36
 
37
- def createModel(self):
37
+ def createModel(self, force=False):
38
+ """Génère (ou renvoie depuis le cache) le PNG du schéma relationnel.
39
+
40
+ Args:
41
+ force: si ``True``, ignore le cache et régénère le diagramme même si le
42
+ PNG existe déjà (bouton « Régénérer le schéma » du mode enseignant,
43
+ utile quand le schéma de la base a changé depuis le dernier rendu).
44
+ """
38
45
  self.__logger.info(f"Création du modèle PlantUML pour {self.db.getType()} avec {self.db.getDatabaseName()}")
39
46
  if 'querycraft/querycraft/data' in self.db.getDatabaseName() :
40
47
  name = "qc-"
@@ -46,7 +53,7 @@ class PlantUML:
46
53
  tmp_file_name = f'{name}.puml'
47
54
  self.images_dir.mkdir(parents=True, exist_ok=True)
48
55
  output_file = self.images_dir / output_file_name
49
- if existFile(output_file):
56
+ if not force and existFile(output_file):
50
57
  return output_file_name
51
58
 
52
59
  try:
@@ -64,8 +71,12 @@ class PlantUML:
64
71
  with open(lock_file, "w") as lock:
65
72
  fcntl.flock(lock, fcntl.LOCK_EX)
66
73
  try:
67
- if existFile(output_file):
74
+ if not force and existFile(output_file):
68
75
  return output_file_name
76
+ if force and existFile(output_file):
77
+ # Supprimé avant régénération : si le rendu échoue, on doit le
78
+ # détecter (absence du fichier) plutôt que resservir l'ancien PNG.
79
+ output_file.unlink()
69
80
 
70
81
  tmp_file = self.images_dir / tmp_file_name
71
82
  try:
@@ -0,0 +1,2 @@
1
+
2
+ __version__ = "2.7.1"
@@ -30,12 +30,12 @@
30
30
  }
31
31
  ],
32
32
  "dateCreated": "2024-07-15",
33
- "dateModified": "2026-07-30",
33
+ "dateModified": "2026-07-31",
34
34
  "datePublished": "2024-12-04",
35
35
  "description": "Ce programme permet de proposer une exécution \"pas à pas\" d'une requête SQL. Il doit être utilisé dans le cadre d'un enseignement de SQL en bases de données. Cette bibliothèque propose des classes Python permettant de manipuler des requêtes SQL. Elle propose aussi des applications pour décomposer l'exécution d'une requête SQL sur une base de données PostgreSQL, MySQL ou SQLite.",
36
36
  "downloadUrl": "https://gitlab.univ-nantes.fr/ls2n-didactique/querycraft.git",
37
37
  "license": "https://spdx.org/licenses/GPL-3.0",
38
38
  "name": "QueryCraft",
39
39
  "programmingLanguage": "Python 3",
40
- "version": "2.7.0"
40
+ "version": "2.7.1"
41
41
  }
@@ -170,6 +170,9 @@
170
170
  <div>
171
171
  <button type="button" class="btn btn-info js-upload-db" disabled>⬆️ Téléverser</button>
172
172
  </div>
173
+ <div class="alert alert-warning show">⚠️ Si le nom du fichier correspond à une base déjà
174
+ présente, celle-ci sera <strong>remplacée définitivement</strong> (écrasée), sans
175
+ confirmation ni conservation de l'ancienne version.</div>
173
176
  <div class="alert" id="alertBoxUpload"></div>
174
177
  </div>
175
178
  </div>
@@ -180,6 +180,39 @@
180
180
  </tbody>
181
181
  </table>
182
182
  </div>
183
+ <div class="traces-legend">
184
+ <div class="traces-legend-group">
185
+ <span class="traces-legend-title">Résultat :</span>
186
+ <span class="badge badge-succes traces-legend-item" title="La requête a été exécutée sans erreur, jusqu'au bout.">✅ Succès</span>
187
+ <span class="badge badge-erreur traces-legend-item" title="La requête a été bloquée avant exécution par le contrôle de sécurité (instruction interdite, motif suspect...).">🚫 Erreur sécurité</span>
188
+ <span class="badge badge-erreur traces-legend-item" title="La requête n'a pas pu être analysée : erreur de syntaxe SQL.">❌ Erreur syntaxe</span>
189
+ <span class="badge badge-warning traces-legend-item" title="La requête est syntaxiquement correcte mais ne respecte pas une règle pédagogique attendue (ex. ce n'est pas un SELECT, colonne du SELECT absente du GROUP BY...).">⚠️ Non conforme</span>
190
+ <span class="badge badge-erreur traces-legend-item" title="La requête a été acceptée et envoyée à la base, mais son exécution a échoué (erreur retournée par le SGBD).">💥 Erreur exécution</span>
191
+ <span class="badge badge-erreur traces-legend-item" title="Une erreur inattendue (bug interne à QueryCraft) s'est produite pendant le traitement de la requête.">🐛 Erreur interne</span>
192
+ </div>
193
+ <div class="traces-legend-group">
194
+ <span class="traces-legend-title">Type :</span>
195
+ <span class="badge traces-legend-item" title="L'élève a soumis et exécuté une requête SQL.">▶️ Exécution SQL</span>
196
+ <span class="badge traces-legend-item" title="L'élève a consulté le schéma (diagramme/structure) de la base sans exécuter de requête.">🧭 Consultation du schéma</span>
197
+ </div>
198
+ <div class="traces-legend-group">
199
+ <span class="traces-legend-title">Réponse exo :</span>
200
+ <span class="traces-legend-item" title="La requête était liée à une question d'exercice et son résultat correspond à la solution attendue.">✅ Correcte</span>
201
+ <span class="traces-legend-item" title="La requête était liée à une question d'exercice mais son résultat diffère de la solution attendue.">❌ Incorrecte</span>
202
+ <span class="traces-legend-item" title="La tentative n'est rattachée à aucun exercice/question : il n'y a donc pas de solution à comparer.">— Non évaluée (pas de code exercice/question)</span>
203
+ </div>
204
+ <div class="traces-legend-group">
205
+ <span class="traces-legend-title">IA :</span>
206
+ <span class="traces-legend-item" title="L'élève n'a pas coché l'aide de l'IA pour cette tentative.">— Non sollicitée</span>
207
+ <span class="traces-legend-item" title="L'élève a demandé l'aide de l'IA en niveau standard (explication de la requête ou de l'erreur).">🤖 Normale</span>
208
+ <span class="traces-legend-item" title="L'élève a demandé l'aide de l'IA en mode renforcé (feedback tenant compte de son historique de tentatives sur cette question).">🚀 Renforcée</span>
209
+ </div>
210
+ <div class="traces-legend-group">
211
+ <span class="traces-legend-title">Pas-à-pas :</span>
212
+ <span class="traces-legend-item" title="La requête a été exécutée étape par étape (décomposition pédagogique de la requête).">👣 Oui</span>
213
+ <span class="traces-legend-item" title="La requête a été exécutée directement, sans décomposition pas-à-pas.">— Non (exécution directe)</span>
214
+ </div>
215
+ </div>
183
216
  <div class="pagination" id="pagination">
184
217
  <!-- Rempli en JS -->
185
218
  </div>
@@ -23,6 +23,7 @@ from querycraft.tools import colorize_sql
23
23
  from querycraft.traceservice import IA_NIVEAU_NON, IA_NIVEAU_NORMALE, IA_NIVEAU_RENFORCEE
24
24
  from querycraft.web.context import app_config
25
25
  from querycraft.web.helpers import error_ref, get_or_create_pseudo, set_pseudo_cookie
26
+ from querycraft.web.tenancy import admin_required
26
27
 
27
28
  sql_bp = Blueprint("sql", __name__)
28
29
 
@@ -337,7 +338,19 @@ def schema():
337
338
 
338
339
  model_div = getOutputFactory(app_config.type_output, 'block')
339
340
  model_div.addTitle("Modèle relationnel de la base", 4)
340
- model_div.addText(f'<img src="{img_url}" alt="{database.getDatabaseName()}" style="max-width:85%;">')
341
+ model_div.addText(
342
+ f'<img src="{img_url}" alt="{database.getDatabaseName()}" '
343
+ 'style="max-width:85%;" id="schema-diagram-img">'
344
+ )
345
+ if g.is_admin:
346
+ model_div.addText(
347
+ '<div class="schema-regenerate">'
348
+ '<button type="button" id="btn-regenerate-schema" class="btn btn-secondary btn-small" '
349
+ 'title="Régénérer le diagramme si le schéma de la base a été modifié">'
350
+ '🔄 Régénérer le schéma</button>'
351
+ '<span id="regenerate-schema-status" class="regenerate-status"></span>'
352
+ '</div>'
353
+ )
341
354
  legend_factory = getOutputFactory(app_config.type_output, 'block')
342
355
  legend_factory.setStyle(Style("", 'class="legend"', ""))
343
356
  legend_factory.addText("Légende :")
@@ -444,3 +457,35 @@ def schema():
444
457
  if is_new:
445
458
  set_pseudo_cookie(response, pseudo)
446
459
  return response
460
+
461
+
462
+ @sql_bp.route("/schema/regenerate", methods=["POST"])
463
+ @admin_required
464
+ def regenerate_schema():
465
+ """Force la régénération du diagramme PlantUML du schéma (mode enseignant).
466
+
467
+ Réservé à l'enseignant : utile quand la structure de la base a changé depuis
468
+ le dernier rendu, le cache PNG existant n'étant sinon jamais invalidé.
469
+ """
470
+ try:
471
+ database = app_config.database
472
+ if database is None:
473
+ raise Exception("Database unreachable")
474
+ with database:
475
+ pumlfile = app_config.plant_uml.createModel(force=True)
476
+ if pumlfile is None:
477
+ return jsonify({
478
+ "success": False,
479
+ "error": "Le diagramme n'a pas pu être régénéré (voir les journaux de l'instance).",
480
+ })
481
+ img_url = f'{g.base_path}/images/{pumlfile}?t={int(time.time())}'
482
+ return jsonify({"success": True, "img_url": img_url})
483
+ except Exception as e:
484
+ ref = error_ref()
485
+ get_logger("querycraft.web.schema").error(
486
+ "[réf %s] Erreur lors de la régénération du schéma : %s", ref, e, exc_info=True
487
+ )
488
+ return jsonify({
489
+ "success": False,
490
+ "error": f"Erreur lors de la régénération du schéma (réf: {ref}).",
491
+ })
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: querycraft
3
- Version: 2.7.0
3
+ Version: 2.7.1
4
4
  Summary: Provide usefully SQL classes and functions to execute SQL queries step by step
5
5
  Home-page: https://gitlab.univ-nantes.fr/ls2n-didactique/querycraft
6
6
  Author: Emmanuel Desmontils
@@ -1,2 +0,0 @@
1
-
2
- __version__ = "2.7.0"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes