Skip to content
Snippets Groups Projects
Commit a32ed727 authored by David Rouquet's avatar David Rouquet
Browse files

generate json with surveyjs_json in ttl

parent dd75eec2
Branches
No related tags found
1 merge request!4Main
...@@ -18,6 +18,7 @@ template mt:activite(?act) { ...@@ -18,6 +18,7 @@ template mt:activite(?act) {
# Insert a Hugo shortcode to load the quiz if this is a quiz activity # Insert a Hugo shortcode to load the quiz if this is a quiz activity
if (exists { ?act a :Exercice }, "\n{{< quiz >}}", "") if (exists { ?act a :Exercice }, "\n{{< quiz >}}", "")
st:call-template(mt:quiz, ?act) st:call-template(mt:quiz, ?act)
st:call-template(mt:json_in_ttl, ?act)
} }
where { where {
?act a :Activite . ?act a :Activite .
......
...@@ -4,7 +4,10 @@ PREFIX st: <http://ns.inria.fr/sparql-template/> ...@@ -4,7 +4,10 @@ PREFIX st: <http://ns.inria.fr/sparql-template/>
# Template for the JSON definition of QCU activities # Template for the JSON definition of QCU activities
template mt:json_in_ttl(?quiz) { template mt:json_in_ttl(?quiz) {
st:nl()
mt:start_marker(?quiz) "/quiz.json" st:nl()
?json ?json
st:nl()
} }
where { where {
?quiz :surveyjs_json ?json ?quiz :surveyjs_json ?json
......
...@@ -45,6 +45,7 @@ where { ...@@ -45,6 +45,7 @@ where {
optional { optional {
?quiz :commentaireSugg_md ?incorrect_comment . ?quiz :commentaireSugg_md ?incorrect_comment .
} }
FILTER(NOT EXISTS{?quiz :surveyjs_json ?json})
} }
# FIXME: some exercises have multiple incorrect comments, almost identical, # FIXME: some exercises have multiple incorrect comments, almost identical,
# which creates multiple matches for the WHERE clause and thus duplicate files. # which creates multiple matches for the WHERE clause and thus duplicate files.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment