From 7de91d78bceee7de937415756180e1000f18558f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20M=2E=20Thi=C3=A9ry?= <nthiery@users.sf.net> Date: Fri, 3 Oct 2014 00:28:05 +0200 Subject: [PATCH] WIMS: peaufinage exercice guess output --- TODO | 19 +++-------------- .../src/cpp/guess_output.cpp | 21 ++++++++----------- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/TODO b/TODO index c496f6e..568bfdf 100644 --- a/TODO +++ b/TODO @@ -1,12 +1,10 @@ * Collections de programmes + randomisation + rÃĐsultat ** Features - [X] Code colorization +- [X] Code area just of the proper height - [X] Selection of topic based on file prefix -- [ ] Output dans un textarea - `symtext` almost does the job but the comparison is not yet - configured properly: - - 1 2 4 8 mauvaise rÃĐponse, la bonne rÃĐponse est 1. +- [X] Output dans un textarea +- [ ] Why are empty lines on top and bottom of the text aread - [ ] Randomization of the variable names - [ ] Randomization of the output by substitution (preprocessing) - [ ] Implement more logic in WIMS @@ -19,17 +17,6 @@ ** Substitution des variables? \text{code=\wims(replace internal resultat par \resultat)} -** Utiliser un textarea pour les entrÃĐes -Fonctionalite à rajouter à WIMS? - -Il est possible de dÃĐfinir ses propres types d'entrÃĐes. Voir -public_html/scripts/anstype pour des exemples. En particulier -symtext. Voir la documentation; il doit y avoir des options pour ne -pas - -Ãtat actuel: - - * Choisir l'entrÃĐe pour que ... * Ãcrire un programme qui ... par exemple pour n=5 ... copier coller le rÃĐsultat ici * Exercices existant: U1 / algo diff --git a/test~coding~readingCppPrograms.fr/src/cpp/guess_output.cpp b/test~coding~readingCppPrograms.fr/src/cpp/guess_output.cpp index e4f0be5..7e857fe 100644 --- a/test~coding~readingCppPrograms.fr/src/cpp/guess_output.cpp +++ b/test~coding~readingCppPrograms.fr/src/cpp/guess_output.cpp @@ -31,7 +31,9 @@ target=variable if loop function \text{programs=wims(lookup TARGET in data/index)} \text{program=randomitem(\programs)} \text{code=wims(record 0 of data/\program)} -\text{output=wims(record 0 of data/\program.output)} +\text{output=wims(lines2words wims(record 0 of data/\program.output))} +\integer{height=wims(linecnt \code)+3} +\integer{heightpixels=10*\height} \css{ <script type="text/javascript" src="scripts/js/edit_area/edit_area_full.js"></script> @@ -40,10 +42,11 @@ target=variable if loop function id: "wims_show" ,start_highlight: true ,allow_toggle: false + ,allow_resize: true ,language: "fr" ,syntax: "cpp" - ,min_height: 400 - ,min_width: 400 + ,min_height: 200 + ,min_width: 300 ,is_editable:false ,toolbar: "" ,show_line_colors: false @@ -55,15 +58,9 @@ target=variable if loop function \statement{ <p>Quel affichage exact produit le programme C++ suivant?</p> -<p>Si l'affichage comporte plusieurs lignes, les donner les unes ā la -suite des autres, séparées par des espaces.</p> +<p>Les espaces, tabulations et sauts de lignes dans la réponse sont considérés comme équivalents.</p> -\special{tabs2lines -<textarea id="wims_show" cols="100" rows="15" name="wims_show" readonly="readonly"> -\code -</textarea> +<textarea id="wims_show" cols="80" rows="\height" name="wims_show" readonly="readonly">\special{tabs2lines \code}</textarea> } -} - -\answer{}{\output}{type=text} +\answer{}{\output}{type=symtext} -- GitLab