From 489175eda5c1470530b0419a791053799f3bd2b1 Mon Sep 17 00:00:00 2001
From: daxid <david.rouquet@tetras-libre.fr>
Date: Fri, 10 Jan 2025 19:34:49 +0100
Subject: [PATCH] modify to work with the new quiz.js. Comments are now at the
 root

---
 tetras_extraction/script/templates/quiz.rq | 34 +++++++++++-----------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/tetras_extraction/script/templates/quiz.rq b/tetras_extraction/script/templates/quiz.rq
index 53c1c7c..a23845b 100644
--- a/tetras_extraction/script/templates/quiz.rq
+++ b/tetras_extraction/script/templates/quiz.rq
@@ -12,26 +12,27 @@ template mt:quiz(?quiz) {
             "{"
             box {
                 st:call-template(mt:qcu, ?quiz)
-                st:call-template(mt:json_in_ttl, ?quiz)
-                # Optional correct/incorrect comments for the quiz.
-                # Unfortunately, STTL doesn't have a concise syntax for blocks
-                # that depend on a variable being bound, we have to use 
-                # SPARQL functions and st:format
-                coalesce(st:format(
-                    '%s"correctComment": "%s"',
-                    mt:sep(),
-                    mt:json_escape(?correct_comment)
-                ), "")
-                coalesce(st:format(
-                    '%s"incorrectComment": "%s"',
-                    mt:sep(),
-                    mt:json_escape(?incorrect_comment)
-                ), "")
+                st:call-template(mt:qcm, ?quiz)
+                #st:call-template(mt:json_in_ttl, ?quiz)
             }
             "}"
         }
         ']'
     }
+    # Optional correct/incorrect comments for the quiz.
+    # Unfortunately, STTL doesn't have a concise syntax for blocks
+    # that depend on a variable being bound, we have to use
+    # SPARQL functions and st:format
+    coalesce(st:format(
+        '%s"correctComment": "%s"',
+        mt:sep(),
+        mt:json_escape(?correct_comment)
+    ), "")
+    coalesce(st:format(
+        '%s"incorrectComment": "%s"',
+        mt:sep(),
+        mt:json_escape(?incorrect_comment)
+    ), "")
     '}'
     st:nl()
 }
@@ -49,5 +50,4 @@ where {
 # which creates multiple matches for the WHERE clause and thus duplicate files.
 # We'll have to deal with them at some point, but for now just filter the first
 # one arbitrarily to avoid messing with the output.
-limit 1
-
+LIMIT 1
-- 
GitLab