pull/1/head
Optimal Sup-Spé 3 years ago
parent 768f6cd1b4
commit a419391ccd
  1. 36
      src/GenerateurH5P.elm

@ -1459,7 +1459,9 @@ h5pParser depth =
let let
build content = build content =
new branchingScenarioField new branchingScenarioField
|> with2 startScreenField startScreenSubtitleField record.headline |> with2 startScreenField
startScreenSubtitleField
record.headline
|> with contentField content |> with contentField content
|> BranchingScenarioH5P |> BranchingScenarioH5P
in in
@ -1479,7 +1481,12 @@ h5pParser depth =
TrueFalseH5pSubContext -> TrueFalseH5pSubContext ->
inContext TrueFalseContext <| inContext TrueFalseContext <|
succeed (R.map TrueFalseH5P <| trueFalseBuilder record.headline record.blocContent) succeed
(R.map TrueFalseH5P <|
trueFalseBuilder
record.headline
record.blocContent
)
InteractiveVideoH5pSubContext -> InteractiveVideoH5pSubContext ->
inContext InteractiveVideoContext <| inContext InteractiveVideoContext <|
@ -1589,9 +1596,23 @@ branchingScenarioParser depth state =
succeed state succeed state
) )
) )
, succeed , let
changeLastId contentList =
case contentList of
c :: cc ->
c
|> with nextContentIdField (Just -1)
|> (\x -> x :: cc)
[] ->
contentList
in
succeed
{ state { state
| content = R.map L.reverse state.content | content =
state.content
|> R.map changeLastId
|> R.map L.reverse
} }
] ]
@ -1618,8 +1639,8 @@ branchingQuestionParser depth state =
|> andThen |> andThen
(\alternative -> (\alternative ->
branchingScenarioParser (depth + 1) branchingScenarioParser (depth + 1)
{ content = R.constant [] { content = state.content
, lastIdUsed = state.lastIdUsed + 1 , lastIdUsed = state.lastIdUsed
} }
|> andThen |> andThen
(\content -> (\content ->
@ -1658,11 +1679,10 @@ branchingQuestionParser depth state =
content = content =
state.content state.content
|> R.map2 (::) branchingQuestion |> R.map2 (::) branchingQuestion
|> R.map L.reverse
in in
succeed succeed
{ content = content { content = content
, lastIdUsed = state.lastIdUsed + 1 , lastIdUsed = state.lastIdUsed
} }
] ]

Loading…
Cancel
Save