pull/1/head
Jean-Christophe Jameux 3 years ago
parent 1e247022be
commit 4410ab1d31
  1. 36
      src/GenerateurH5P.elm

@ -1476,8 +1476,8 @@ h5psParser =
h5pParser : Parser (H5P bSC cPC) h5pParser : Parser (H5P bSC cPC)
h5pParser = h5pParser =
oneOf oneOf
[ branchingScenarioParser 1 [ backtrackable <| branchingScenarioParser 1
, coursePresentationParser 1 , backtrackable <| coursePresentationParser 1
, trueFalseParser 1 , trueFalseParser 1
] ]
@ -1496,7 +1496,7 @@ questionParser =
tillEndOfLine tillEndOfLine
alternativeParser = alternativeAnswerParser =
tillEndOfLine tillEndOfLine
@ -1532,7 +1532,7 @@ blankLines =
else else
problem problem
("N'y aurait-il pas des espaces en trop au débul de la ligne ?" ("N'y aurait-il pas des espaces en trop au début de la ligne ?"
++ String.fromInt row ++ String.fromInt row
) )
) )
@ -1608,12 +1608,14 @@ branchingScenarioParserHelp profondeur ( contentList, contentId ) =
contentParser profondeur contentId = contentParser profondeur contentId =
oneOf oneOf
[ branchingQuestionParser profondeur contentId [ backtrackable <| branchingQuestionParser profondeur contentId
, succeed (\x -> ( [ x ], contentId + 1 )) , succeed (\x -> ( [ x ], contentId + 1 ))
|= oneOf |= oneOf
[ coursePresentationParser profondeur [ backtrackable <| coursePresentationParser profondeur
, trueFalseParser profondeur , trueFalseParser profondeur
] ]
--, problem "Oups"
] ]
@ -1678,7 +1680,7 @@ branchingQuestionAlternativeParser profondeur ( branchList, contentId ) =
in in
succeed f succeed f
|. stars profondeur |. stars profondeur
|= alternativeParser |= alternativeAnswerParser
|= loop ( [], contentId ) (branchingQuestionAlternativeParserHelp (profondeur + 1)) |= loop ( [], contentId ) (branchingQuestionAlternativeParserHelp (profondeur + 1))
, (succeed () , (succeed ()
|> P.map (\_ -> List.concat branchList) |> P.map (\_ -> List.concat branchList)
@ -1687,7 +1689,7 @@ branchingQuestionAlternativeParser profondeur ( branchList, contentId ) =
(\xx -> (\xx ->
case xx of case xx of
[] -> [] ->
problem "Un embranchement doit avoir au moins deux branches !" problem "Un embranchement doit avoir des branches !"
x :: [] -> x :: [] ->
problem "Un embranchement doit avoir au moins deux branches !" problem "Un embranchement doit avoir au moins deux branches !"
@ -1703,8 +1705,14 @@ branchingQuestionAlternativeParser profondeur ( branchList, contentId ) =
-} -}
branchingQuestionAlternativeParserHelp profondeur ( branchList, contentId ) = branchingQuestionAlternativeParserHelp profondeur ( branchList, contentId ) =
oneOf oneOf
[ succeed () [ succeed
|> P.map (\_ -> Done ( [], contentId )) (Done
( [ [ CoursePresentationH5P nouveauCoursePresentation ]
, [ TrueFalseH5P nouveauTrueFalse ]
]
, contentId
)
)
] ]
@ -1782,3 +1790,11 @@ voirErreur err =
++ String.fromInt err.row ++ String.fromInt err.row
++ " | Colonne : " ++ " | Colonne : "
++ String.fromInt err.col ++ String.fromInt err.col
++ "\n"
++ (case err.problem of
Problem p ->
p
_ ->
""
)

Loading…
Cancel
Save