diff --git a/tetras_extraction/script/templates/qcm.rq b/tetras_extraction/script/templates/qcm.rq new file mode 100644 index 0000000000000000000000000000000000000000..671b42d9e6ad2fb1b267cb280d5df7c268d31850 --- /dev/null +++ b/tetras_extraction/script/templates/qcm.rq @@ -0,0 +1,36 @@ +PREFIX : <http://www.semanticweb.org/eliott/ontologies/2024/4/macao/> +PREFIX mt: <http://www.semanticweb.org/eliott/ontologies/2024/4/macao/template/> +PREFIX st: <http://ns.inria.fr/sparql-template/> + + + + +# Template for the JSON definition of QCM activities +template mt:qcm(?qcm) { +'"name": "quizQuestion"' mt:sep() +'"type": "checkbox"' mt:sep() +'"name": "' ?id '"' mt:sep() +'"choices": [' +box { + group { + "{" + '"value": "' ?reponseId '"' mt:sep() + '"text": "' mt:json_escape(REPLACE(?reponse_md, "•", "")) '"' + if (CONTAINS(?reponse_md,"•"), '', mt:sep()) + if (CONTAINS(?reponse_md,"•"), '', '"enableIf": "false"') + "}" + ; separator=mt:sep() + } +} +']' + +} +WHERE { + ?qcm a :ExerciceQC_QCM ; + :id ?id . + ?qcm :aReponse ?reponse . + ?reponse :html_md ?reponse_md ; + :html ?reponse_html ; + :id ?reponseId . + FILTER(?reponse_md != '') +}