diff --git a/Questions/TSP - DST 1 - Sujet A.log b/Questions/TSP - DST 1 - Sujet A.log index dd73e58..3d20e44 100644 --- a/Questions/TSP - DST 1 - Sujet A.log +++ b/Questions/TSP - DST 1 - Sujet A.log @@ -1,4 +1,4 @@ -This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.11) (preloaded format=pdflatex 2020.11.23) 5 NOV 2021 16:54 +This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.11) (preloaded format=pdflatex 2020.11.23) 8 NOV 2021 08:25 entering extended mode **"./TSP - DST 1 - Sujet A.tex" ("TSP - DST 1 - Sujet A.tex" @@ -298,24 +298,25 @@ Package: epstopdf-base 2020-01-24 v2.11 Base part for package epstopdf Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4 85. ) -LaTeX Font Info: Trying to load font information for U+msa on input line 49. +\c@question=\count279 +LaTeX Font Info: Trying to load font information for U+msa on input line 51. ("C:\Program Files\MiKTeX\tex/latex/amsfonts\umsa.fd" File: umsa.fd 2013/01/14 v3.01 AMS symbols A ) -LaTeX Font Info: Trying to load font information for U+msb on input line 49. +LaTeX Font Info: Trying to load font information for U+msb on input line 51. ("C:\Program Files\MiKTeX\tex/latex/amsfonts\umsb.fd" File: umsb.fd 2013/01/14 v3.01 AMS symbols B ) -LaTeX Font Info: Trying to load font information for U+stmry on input line 4 -9. +LaTeX Font Info: Trying to load font information for U+stmry on input line 5 +1. (C:\Users\Echophile\AppData\Roaming\MiKTeX\tex/latex/stmaryrd\ustmry.fd) LaTeX Font Info: Trying to load font information for U+bbold on input line 5 -5. +7. (C:\Users\Echophile\AppData\Roaming\MiKTeX\tex/latex/jknappen\ubbold.fd File: ubbold.fd 1996/01/01 Blackboard Bold Font Definition File (jk) @@ -324,7 +325,7 @@ File: ubbold.fd 1996/01/01 Blackboard Bold Font Definition File (jk) {C:/Users/Echophile/AppData/Local/MiKTeX/pdftex/config/pdftex.map}] [2] -Overfull \hbox (5.8505pt too wide) in paragraph at lines 308--309 +Overfull \hbox (5.8505pt too wide) in paragraph at lines 311--312 []\T1/cmr/m/n/10 On con-sid-ère deux tri-an-gles non plat $\OML/cmm/m/it/10 ABC $ \T1/cmr/m/n/10 et $\OML/cmm/m/it/10 A[]B[]C[]$ \T1/cmr/m/n/10 tels que $[] \O ML/cmm/m/it/10 == []$\T1/cmr/m/n/10 , $[] \OML/cmm/m/it/10 == []$ \T1/cmr/m/n/1 @@ -332,7 +333,7 @@ ML/cmm/m/it/10 == []$\T1/cmr/m/n/10 , $[] \OML/cmm/m/it/10 == []$ \T1/cmr/m/n/1 [] -Overfull \hbox (5.8505pt too wide) in paragraph at lines 323--324 +Overfull \hbox (5.8505pt too wide) in paragraph at lines 326--327 []\T1/cmr/m/n/10 On con-sid-ère deux tri-an-gles non plat $\OML/cmm/m/it/10 ABC $ \T1/cmr/m/n/10 et $\OML/cmm/m/it/10 A[]B[]C[]$ \T1/cmr/m/n/10 tels que $[] \O ML/cmm/m/it/10 == []$\T1/cmr/m/n/10 , $[] \OML/cmm/m/it/10 == []$ \T1/cmr/m/n/1 @@ -341,13 +342,13 @@ ML/cmm/m/it/10 == []$\T1/cmr/m/n/10 , $[] \OML/cmm/m/it/10 == []$ \T1/cmr/m/n/1 [3] ("TSP - DST 1 - Sujet A.aux") ) Here is how much of TeX's memory you used: - 4771 strings out of 479799 - 70734 string characters out of 2879534 - 376878 words of memory out of 3000000 - 21708 multiletter control sequences out of 15000+200000 + 4775 strings out of 479799 + 70776 string characters out of 2879534 + 376869 words of memory out of 3000000 + 21712 multiletter control sequences out of 15000+200000 541864 words of font info for 48 fonts, out of 3000000 for 9000 1141 hyphenation exceptions out of 8191 - 66i,8n,73p,411b,307s stack positions out of 5000i,500n,10000p,200000b,50000s + 66i,8n,73p,411b,309s stack positions out of 5000i,500n,10000p,200000b,50000s < C:/Program Files/MiKTeX/fonts/type1/public/amsfonts/symbols/msam10.pfb> -Output written on "TSP - DST 1 - Sujet A.pdf" (3 pages, 105136 bytes). +Output written on "TSP - DST 1 - Sujet A.pdf" (3 pages, 105139 bytes). PDF statistics: 138 PDF objects out of 1000 (max. 8388607) 0 named destinations out of 1000 (max. 500000) diff --git a/Questions/TSP - DST 1 - Sujet A.pdf b/Questions/TSP - DST 1 - Sujet A.pdf index 1302e41..659d5b6 100644 Binary files a/Questions/TSP - DST 1 - Sujet A.pdf and b/Questions/TSP - DST 1 - Sujet A.pdf differ diff --git a/Questions/TSP - DST 1 - Sujet A.tex b/Questions/TSP - DST 1 - Sujet A.tex index c8e1714..7518cc5 100644 --- a/Questions/TSP - DST 1 - Sujet A.tex +++ b/Questions/TSP - DST 1 - Sujet A.tex @@ -36,6 +36,8 @@ \def\MauvaiseReponse#1\par{\textcolor{red}{#1}} \def\BonneReponse#1\par{\textcolor{green}{#1}} +\newcounter{question} +\setcounter{question}{0} {\bf Merci de répondre sur la grille fournie et de rendre le sujet avec la grille.} \vspace{2em} @@ -71,7 +73,8 @@ \end{enumerate} - +\stepcounter{question} +\setcounter{enumi}{\thequestion} diff --git a/elm-stuff/0.19.1/ParserArbre.elmi b/elm-stuff/0.19.1/ParserArbre.elmi new file mode 100644 index 0000000..f37e617 Binary files /dev/null and b/elm-stuff/0.19.1/ParserArbre.elmi differ diff --git a/elm-stuff/0.19.1/ParserArbre.elmo b/elm-stuff/0.19.1/ParserArbre.elmo new file mode 100644 index 0000000..5ef41c9 Binary files /dev/null and b/elm-stuff/0.19.1/ParserArbre.elmo differ diff --git a/elm-stuff/0.19.1/QCM.elmi b/elm-stuff/0.19.1/QCM.elmi index af879c5..dd38e7b 100644 Binary files a/elm-stuff/0.19.1/QCM.elmi and b/elm-stuff/0.19.1/QCM.elmi differ diff --git a/elm-stuff/0.19.1/QCM.elmo b/elm-stuff/0.19.1/QCM.elmo index b63d227..c4d273c 100644 Binary files a/elm-stuff/0.19.1/QCM.elmo and b/elm-stuff/0.19.1/QCM.elmo differ diff --git a/elm-stuff/0.19.1/d.dat b/elm-stuff/0.19.1/d.dat index daa6b29..a524002 100644 Binary files a/elm-stuff/0.19.1/d.dat and b/elm-stuff/0.19.1/d.dat differ diff --git a/src/QCM.elm b/src/QCM.elm index b113fe6..a11506d 100644 --- a/src/QCM.elm +++ b/src/QCM.elm @@ -28,6 +28,7 @@ import Html.Attributes as A -- exposing (..) import Html.Events exposing (onInput, onClick) import Random import Random.Extra +import Random.List sujetTest = @@ -156,7 +157,7 @@ view model = -- :: button [ onClick GenererQuestion ] [ text "Générer les questions" ] :: button [ onClick GenererSujet ] [ text "Générer un sujet au hasard" ] -- :: ( section [] <| L.map (\q -> p [] [ text q ]) model.questions ) - :: [ ( section [] [ p [] [ text model.sujetGenere ] ] ) ] + :: [ ( Html.output [] [ Html.code [] [ text model.sujetGenere ] ] ) ] -- fonction text réécrite ci-dessous {-- :: text ( @@ -235,7 +236,7 @@ type Probleme = VariableAremplacer Aremplacer Sujet | Entete Macro Sujet -- | ProblemeOuvert NombreDeLigne TexteVariable - -- | QCM Propositions + | QCM Macro Propositions | VraiFaux Propositions type alias Propositions = List Proposition @@ -246,11 +247,6 @@ type Proposition = type alias NombreDeLigne = Int -type alias Alternative = - { vraies : List Macro - , fausses : List Macro - } - {-- voirSujetParse sujetPotentiel = case P.run (withIndent -1 sujet) sujetPotentiel of @@ -333,6 +329,7 @@ probleme = flip withIndent <| oneOf [ vraiFaux + , qcm , backtrackable variableAremplacer , entete ] in @@ -374,6 +371,14 @@ vraiFaux = |. keyword "vrfx" |= propositions +qcm = + -- Debug.log "vraiFaux " <| + succeed QCM + |. keyword "qcm" + |. espaces + |= macro + |= propositions + propositions = let suiteBis prps = @@ -577,12 +582,14 @@ problemeAleatoire prblm = Random.andThen (f sjt) vlr Entete mcr sjt -> Random.map (L.singleton << Entete mcr) (sujetAleatoire sjt) - VraiFaux prps -> propositionAleatoire prps - -propositionAleatoire prps = - Random.map - (L.singleton << VraiFaux << L.singleton) - ( valeurAleatoire ( Vrai [ Texte "Le prof de maths est le meilleur." ] ) prps ) + VraiFaux prps -> + Random.map + (L.singleton << VraiFaux << L.singleton) + ( valeurAleatoire ( Vrai [ Texte "Le prof de maths est le meilleur." ] ) prps ) + QCM mcr prps -> + Random.map + (L.singleton << QCM mcr) + (Random.List.shuffle prps ) {-| Permet de prendre un élément aléatoire dans une liste avec une valeur par défaut si la liste est vide. @@ -607,6 +614,13 @@ remplacerLaVariableDansLeProblemeAleatoire vrbl vlr prblm = <| Random.map2 Entete ( Random.constant <| remplacerLaVariableParLaValeurDansLaMacro vrbl vlr mcr ) ( remplacerLaVariableDansLeSujetAleatoire vrbl vlr sjt ) + QCM mcr prps -> + Random.map L.singleton + <| Random.map2 QCM + ( Random.constant <| remplacerLaVariableParLaValeurDansLaMacro vrbl vlr mcr ) + ( Random.List.shuffle + <| L.map (remplacerLaVariableParLaValeurDansLaProposition vrbl vlr) prps + ) VraiFaux prps -> Random.map ( L.singleton @@ -640,7 +654,9 @@ remplacerLaVariableParLaValeurDansLaProposition vrbl vlr prp = quizScanVoirSujet : Sujet -> String quizScanVoirSujet sjt = - S.join "\n" <| L.map quizScanVoirProbleme sjt + "\n\\begin{Sujet}\n" + ++ ( S.join "\n" <| L.map quizScanVoirProbleme sjt ) + ++ "\n\\end{Sujet}" quizScanVoirProbleme prblm = case prblm of @@ -648,16 +664,31 @@ quizScanVoirProbleme prblm = voirMacro mcr ++ "\n" ++ quizScanVoirSujet sjt + QCM mcr prps -> + let + f prp = + case prp of + Vrai mc -> + " \\Vrai{" ++ voirMacro mc ++ "}" + Faux mc -> + " \\Faux{" ++ voirMacro mc ++ "}" + in + "\n \\begin{QCM}\n" + ++ voirMacro mcr + ++ "\n" + ++ ( S.join "\n" <| L.map f prps ) + ++ "\n" + ++ "\n \\end{QCM}" VraiFaux prps -> let f prp = case prp of - Vrai mcr -> - " \\item\\Vrai{" ++ voirMacro mcr ++ "}\n" - Faux mcr -> - " \\item\\Faux{" ++ voirMacro mcr ++ "}\n" + Vrai mc -> + "\n \\begin{VraiFaux}\n \\Vrai{" ++ voirMacro mc ++ "}\n \\end{VraiFaux}" + Faux mc -> + "\n \\begin{VraiFaux}\n \\Faux{" ++ voirMacro mc ++ "}\n \\end{VraiFaux}" in - S.join "\n" <| L.map f prps + S.concat <| L.map f prps VariableAremplacer ar sjt -> "" ++ quizScanVoirSujet sjt {- ███ ███ ██ ██ ██ ███████ ██ ██ ██████