Skip to content
Snippets Groups Projects
Commit 0f7b744a authored by Eliott Sammier's avatar Eliott Sammier
Browse files

Add QC correct answers to graph

parent 47bb907d
No related branches found
No related tags found
No related merge requests found
......@@ -64,6 +64,18 @@
# Data properties
#################################################################
### http://www.semanticweb.org/eliott/ontologies/2024/4/macao/aReponseCorrecte
:aReponseCorrecte rdf:type owl:DatatypeProperty ;
rdfs:domain :Exercice ;
rdfs:range xsd:positiveInteger .
### http://www.semanticweb.org/eliott/ontologies/2024/4/macao/aReponseIncorrecte
:aReponseIncorrecte rdf:type owl:DatatypeProperty ;
rdfs:domain :Exercice ;
rdfs:range xsd:positiveInteger .
### http://www.semanticweb.org/eliott/ontologies/2024/4/macao/cheminFichier
:cheminFichier rdf:type owl:DatatypeProperty ;
rdfs:domain :MacaoRessource ;
......
This diff is collapsed.
......@@ -54,8 +54,14 @@ class RegexParser:
# Save to graph
self.graph.add((NS[self.act_id], RDF.type, NS[activity_type]))
print(activity_type, end="", file=output)
if activity_type.startswith("ExerciceQC"):
print(" ", self._parse_qc_answers(body), end="", file=output)
# Parse correct answers and add them to the graph
correct_answers = self._parse_qc_answers(body)
print(" ", correct_answers, end="", file=output)
for i, correct in enumerate(correct_answers):
property = NS["aReponseCorrecte" if correct else "aReponseIncorrecte"]
self.graph.add((NS[self.act_id], property, Literal(i)))
def _parse_activity_constructor(self, code: str) -> tuple[str, str]:
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment