Faire des qcm simplement - retour accueil
git clone git://bebou.netlib.re/qcm
Log | Files | Refs | README |
commit 718634381ac5241bd56b84f92375d2625cafeef2 parent c79131dab4b434959191b26c906ba60c91a29965 Auteurice: Arthur Pons <arthur.pons@unistra.fr> Date: Thu, 7 Nov 2024 10:40:30 +0100 Normalisation des variables par défaut Toutes initialisées au début maintenant Diffstat:
M | qcm.sh | | | 7 | ++++--- |
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/qcm.sh b/qcm.sh @@ -27,7 +27,8 @@ done url="${u:-http://bebou.netlib.re}" nbq="${n:-4}" -logs="$l" +refresh="${r:-1}" +logs="${l:-/var/log/nginx/access.log}" playout() { <<-. cat @@ -49,7 +50,7 @@ trap "kill 0" EXIT possibleanswers="ABCDEFGHIJQLMNOPQRSTUVWXYZ" answers=$(echo "$possibleanswers" | sed -E "s/(.{$nbq}).*/\1/") -tail -fn0 ${logs:-/var/log/nginx/access.log} | +tail -fn0 "$logs" | stdbuf -oL grep -E "GET /$id/[$answers]" >> $tmpd/in & while :;do @@ -58,6 +59,6 @@ while :;do && tot=$(( $(echo "$dat" | awk '{print $1}' | paste -s -d+ -) )) clear playout - sleep ${r:-1} + sleep $refresh done