diff --git a/tetras_extraction/script/templates/activite.rq b/tetras_extraction/script/templates/activite.rq index 440a4387a7b1c73a6b8602b66ff45569e4c84749..5c430b7aa73a56adf51568cadeb3175b3b9a87ec 100644 --- a/tetras_extraction/script/templates/activite.rq +++ b/tetras_extraction/script/templates/activite.rq @@ -18,6 +18,7 @@ template mt:activite(?act) { # Insert a Hugo shortcode to load the quiz if this is a quiz activity if (exists { ?act a :Exercice }, "\n{{< quiz >}}", "") st:call-template(mt:quiz, ?act) + st:call-template(mt:json_in_ttl, ?act) } where { ?act a :Activite . diff --git a/tetras_extraction/script/templates/json_in_ttl.rq b/tetras_extraction/script/templates/json_in_ttl.rq index e4eb26b7e4d58027fdafbac5db6fd152cb6220a5..0ee874ed719b9211e72278ba83d54cdfa24a6d1a 100644 --- a/tetras_extraction/script/templates/json_in_ttl.rq +++ b/tetras_extraction/script/templates/json_in_ttl.rq @@ -4,7 +4,10 @@ PREFIX st: <http://ns.inria.fr/sparql-template/> # Template for the JSON definition of QCU activities template mt:json_in_ttl(?quiz) { + st:nl() + mt:start_marker(?quiz) "/quiz.json" st:nl() ?json + st:nl() } where { ?quiz :surveyjs_json ?json diff --git a/tetras_extraction/script/templates/quiz.rq b/tetras_extraction/script/templates/quiz.rq index a23845b380f7a1be1074af9c3011d353f9e38ad4..2fd129806a62ac232e9c8c3ebabe78a3ad3542b3 100644 --- a/tetras_extraction/script/templates/quiz.rq +++ b/tetras_extraction/script/templates/quiz.rq @@ -45,6 +45,7 @@ where { optional { ?quiz :commentaireSugg_md ?incorrect_comment . } + FILTER(NOT EXISTS{?quiz :surveyjs_json ?json}) } # FIXME: some exercises have multiple incorrect comments, almost identical, # which creates multiple matches for the WHERE clause and thus duplicate files.