Faire des qcm simplement - retour accueil
git clone git://bebou.netlib.re/qcm
Log | Files | Refs | README |
commit 8688a939f5c6460fdaffa4c6a057ba44eb3629d9 parent 52b747dc1ef8a8d96ac0b606394177c0078b804a Auteurice: Arthur Pons <arthur.pons@unistra.fr> Date: Sat, 9 Nov 2024 12:16:32 +0100 Ménage divers Suppression de variables plus utilisées etc Diffstat:
M | qcm.sh | | | 18 | +++++++----------- |
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/qcm.sh b/qcm.sh @@ -22,8 +22,7 @@ usage() <<-. cat http://arthur.bebou.netlib.re/qcm . -playout() { - <<-. cat +show() <<-. cat url : $url/$id $question @@ -33,8 +32,7 @@ playout() { $groupedanswers total : $tot - . -} +. calcandshow() { if [ -z "$uniqueanswers" ];then tot=0 @@ -61,7 +59,7 @@ calcandshow() { esac) clear - playout + show } demander() { @@ -84,8 +82,7 @@ demander() { tail2pid=$! calcandshow - cat $tmpd/notif | - while read newanswer ;do + cat $tmpd/notif | while read newanswer ;do uniqueanswers=$(< $tmpd/in sort $uopt -k1,1) [ "$olduniqueanswers" != "$uniqueanswers" ] && calcandshow olduniqueanswers="$uniqueanswers" @@ -96,15 +93,14 @@ demander() { kill $disppid $tail1pid $tail2pid; rm $tmpd/in } -while getopts "hl:u:n:r:f:" opt; do +while getopts "hl:u:" opt; do case $opt in - ( l | u | r ) [ ! -z $OPTARG ] && eval "$opt='$OPTARG'" ;; - ( h ) usage; exit ;; + ( l | u ) [ ! -z $OPTARG ] && eval "$opt='$OPTARG'" ;; + ( h ) usage; exit ;; esac done url="${u:-http://bebou.netlib.re}" -refresh="${r:-0.5}" logs="${l:-/var/log/nginx/access.log}" nbq=4