Gestion très préliminaire des vrai-faux pour EvalBox

pull/1/head
Jean-Christophe Jameux 4 years ago
parent 0cf2b871c8
commit 57a503dfad
  1. 1
      .gitignore
  2. 14008
      CalculateurDeNotes.html
  3. 15458
      GenerateurDeProblemes.html
  4. BIN
      elm-stuff/0.19.1/GenerateurDeProblemes.elmo
  5. BIN
      elm-stuff/0.19.1/d.dat
  6. 17202
      index.html
  7. 1
      indexNu.html
  8. 3349
      prof.js
  9. BIN
      prof.min.js.gzhh
  10. 1
      prof.min.jshh
  11. 25
      src/Echologo.elm
  12. 18
      src/GenerateurDeProblemes.elm
  13. 35
      src/Prof.elm
  14. 32
      src/Style.elm

1
.gitignore vendored

@ -0,0 +1 @@
elm-stuff/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

@ -1 +0,0 @@
<!DOCTYPE html><html><head></head><body><div id="a"></div><script src="./prof.js"></script><script>Elm.Prof.init({node:document.getElementById("a")})</script></body></html>

3349
prof.js

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because one or more lines are too long

@ -1,15 +1,26 @@
module Echologo exposing (echologo) module Echologo exposing (echologo)
import Element exposing (..)
import Svg exposing (..) import Svg exposing (..)
import Svg.Attributes as SvgA exposing (cx, cy, d, r, strokeWidth, viewBox) import Svg.Attributes
exposing
( cx
, cy
, d
, fill
, fontFamily
, fontSize
, height
, r
, strokeWidth
, viewBox
, x
, y
)
echologo taille = echologo =
html <| [ circle [ cx "15", cy "15", r "15", fill "#64c29b", strokeWidth "0" ] []
svg [ viewBox "0 0 30 30", SvgA.height <| String.fromInt taille ] , g [ fill "#fff", strokeWidth "0" ]
[ circle [ cx "15", cy "15", r "15", SvgA.fill "#64c29b", strokeWidth "0" ] []
, g [ SvgA.fill "#fff", strokeWidth "0" ]
[ circle [ cx "13.8", cy "9", r "2" ] [] [ circle [ cx "13.8", cy "9", r "2" ] []
, path [ d "M 12.3,6.4019238 A 3,3 0 0 0 11.201924,10.5 5,5 0 0 1 12.3,2.1592831 a 3,3 0 0 0 0,4.2426407" ] [] , path [ d "M 12.3,6.4019238 A 3,3 0 0 0 11.201924,10.5 5,5 0 0 1 12.3,2.1592831 a 3,3 0 0 0 0,4.2426407" ] []
, path [ d "m13.8 6a3 3 0 0 1 3 3 6 6 0 0 1 8.485281 0 8 8 0 0 0-11.485281-3" ] [] , path [ d "m13.8 6a3 3 0 0 1 3 3 6 6 0 0 1 8.485281 0 8 8 0 0 0-11.485281-3" ] []

@ -812,15 +812,27 @@ remplacerLaVariableDansLeBloc ar blc =
|> remplacerLaVariableDansLesBlocs ar |> remplacerLaVariableDansLesBlocs ar
Entete mcr blcs -> Entete mcr blcs ->
List.map (\x -> Entete x []) (remplacerLaVariableDansLaMacro ar mcr) case qcmsDepuisVraiFauxx mcr blcs of
Just qcms ->
remplacerLaVariableDansLesBlocs ar qcms
Nothing ->
[ Entete [ Texte "Je ne peux pas prendre en charge une telle imbrication :(" ] [] ]
-- List.map (\x -> Entete x []) (remplacerLaVariableDansLaMacro ar mcr)
--( remplacerLaVariableDansLesBlocs ar blcs ) --( remplacerLaVariableDansLesBlocs ar blcs )
QCM mcr prps -> QCM mcr prps ->
List.map (\x -> QCM x []) (remplacerLaVariableDansLaMacro ar mcr) let
f vlr =
QCM
(remplacerLaVariableParLaValeurDansLaMacro ar.var vlr mcr)
(L.map (remplacerLaVariableParLaValeurDansLaProposition ar.var vlr) prps)
in
L.map f ar.vals
--( L.map (remplacerLaVariableParLaValeurDansLaProposition vrbl vlr) prps ) --( L.map (remplacerLaVariableParLaValeurDansLaProposition vrbl vlr) prps )
VraiFaux prps -> VraiFaux prps ->
[] [ Entete [ Texte "J'ai besoin d'un entête pour générer des QCM à partir de vrai-faux :(" ] [] ]
remplacerLaVariableDansLesBlocs : Aremplacer -> Blocs -> Blocs remplacerLaVariableDansLesBlocs : Aremplacer -> Blocs -> Blocs

@ -26,7 +26,7 @@ import Url
-} -}
main : Program () Model Msg main : Program Flags Model Msg
main = main =
Browser.application Browser.application
{ init = init { init = init
@ -46,6 +46,8 @@ type alias Model =
{ key : Nav.Key { key : Nav.Key
, url : Url.Url , url : Url.Url
, page : Page , page : Page
, largeur : Int
, hauteur : Int
, modeleGenerateurDeProblemes : GenerateurDeProblemes.Model , modeleGenerateurDeProblemes : GenerateurDeProblemes.Model
, modeleCalculateurDeNotes : CalculateurDeNotes.Model , modeleCalculateurDeNotes : CalculateurDeNotes.Model
} }
@ -56,13 +58,21 @@ type Page
| CalculateurDeNotes | CalculateurDeNotes
init : () -> Url.Url -> Nav.Key -> ( Model, Cmd Msg ) type alias Flags =
{ l : Int
, h : Int
}
init : Flags -> Url.Url -> Nav.Key -> ( Model, Cmd Msg )
init flags url key = init flags url key =
case url.fragment of case url.fragment of
Just "CalculateurDeNotes" -> Just "CalculateurDeNotes" ->
( Model key ( Model key
url url
CalculateurDeNotes CalculateurDeNotes
flags.l
flags.h
GenerateurDeProblemes.init GenerateurDeProblemes.init
CalculateurDeNotes.init CalculateurDeNotes.init
, Cmd.none , Cmd.none
@ -72,6 +82,8 @@ init flags url key =
( Model key ( Model key
url url
GenerateurDeProblemes GenerateurDeProblemes
flags.l
flags.h
GenerateurDeProblemes.init GenerateurDeProblemes.init
CalculateurDeNotes.init CalculateurDeNotes.init
, Cmd.none , Cmd.none
@ -81,6 +93,8 @@ init flags url key =
( Model key ( Model key
{ url | fragment = Just "GenerateurDeProblemes" } { url | fragment = Just "GenerateurDeProblemes" }
GenerateurDeProblemes GenerateurDeProblemes
flags.l
flags.h
GenerateurDeProblemes.init GenerateurDeProblemes.init
CalculateurDeNotes.init CalculateurDeNotes.init
, Nav.pushUrl key (Url.toString { url | fragment = Just "GenerateurDeProblemes" }) , Nav.pushUrl key (Url.toString { url | fragment = Just "GenerateurDeProblemes" })
@ -183,7 +197,9 @@ view model =
, body = , body =
[ CalculateurDeNotes.view model.modeleCalculateurDeNotes [ CalculateurDeNotes.view model.modeleCalculateurDeNotes
|> Element.map CalculateurDeNotesMsg |> Element.map CalculateurDeNotesMsg
|> designGeneral CalculateurDeNotes.titre |> designGeneral
(model.largeur - 2 * (petitEspacement + grandEspacement))
CalculateurDeNotes.titre
] ]
} }
@ -192,12 +208,14 @@ view model =
, body = , body =
[ GenerateurDeProblemes.view model.modeleGenerateurDeProblemes [ GenerateurDeProblemes.view model.modeleGenerateurDeProblemes
|> Element.map GenerateurDeProblemesMsg |> Element.map GenerateurDeProblemesMsg
|> designGeneral GenerateurDeProblemes.titre |> designGeneral
(model.largeur - 2 * (petitEspacement + grandEspacement))
GenerateurDeProblemes.titre
] ]
} }
designGeneral titre elm = designGeneral largeur titre elmt =
layout layout
[ height fill [ height fill
, width fill , width fill
@ -212,7 +230,9 @@ designGeneral titre elm =
, Border.rounded 13 , Border.rounded 13
] ]
[ row [] [ row []
[ echologo 135 [ entete 135 largeur titre
{-
, el , el
[ Font.size 120 [ Font.size 120
, Font.color <| vert 0.2 , Font.color <| vert 0.2
@ -224,8 +244,9 @@ designGeneral titre elm =
] ]
<| <|
text titre text titre
-}
] ]
, elm , elmt
] ]

@ -2,10 +2,25 @@ module Style exposing (..)
import Color import Color
import Color.Manipulate import Color.Manipulate
import Echologo exposing (..)
import Element exposing (..) import Element exposing (..)
import Element.Background as Background import Element.Background as Background
import Element.Border as Border import Element.Border as Border
import Element.Input as Input import Element.Input as Input
import Svg exposing (..)
import Svg.Attributes as SvgA
exposing
( color
, fill
, fontFamily
, fontSize
, height
, r
, strokeWidth
, viewBox
, x
, y
)
{-| HSL = 155, 43.5, 57.6 {-| HSL = 155, 43.5, 57.6
@ -51,5 +66,20 @@ bouton fonction label =
} }
] ]
{ onPress = Just fonction { onPress = Just fonction
, label = text label , label = Element.text label
} }
entete hauteur largeur titre =
html <|
svg [ viewBox <| "0 0 " ++ String.fromInt largeur ++ " 30", SvgA.height <| String.fromInt hauteur ] <|
echologo
++ [ text_
[ x "40"
, y "20"
, fontFamily "Verdana"
, SvgA.fill "white"
, fontSize "15"
]
[ Svg.text titre ]
]

Loading…
Cancel
Save