#!/bin/sh addr=$REMOTE_ADDR list=/dev/shm/test.$addr eval `./convert` echo -e "Content-type: text/html\n" cat header.txt if [ "$name" = "" ]; then echo "

Введите ваше имя!

" exit fi if [ "$file" = "" ]; then echo "

Выберите тест!

" exit fi [ "$num" = "" ] && num=1 total=`cat ../Tests/$file/total` if [ $num = 1 ]; then echo -e "\n\n\n" >> $list date >> $list echo -e "\n$name\t---\t$file\n" >> $list else LASST="не" echo -e "$[num-1]\t\c" >> $list fi if [ "$last" = "$a1" -a "$last" != "" ]; then echo "+" >> $list LASST="" right=$[right+1] else [ "$last" != "" ] && echo "-" >> $list fi if [ "$num" -le "$total" ]; then echo -e "
\n" i=0 echo -e "

Вопрос $num из $total

" while read Qwest do if [ $i = 0 ]; then echo -e "

$Qwest

\n" elif [ $i -lt 5 ]; then echo -e "

$Qwest

" fi i=$[i+1] Answ=$Qwest done <../Tests/$file/$num num=$[num+1] echo -e " " echo -e "
" # [ $num -ne 2 ] && echo -e "

На предыдущий вопрос ответ был" $LASST"верным

" else echo -e "

$name!

Вы дали $right правильных ответов

\n" BAL=`echo -e "scale=3\n oz=$right/$total\n if (oz<.5) 2 else if (oz<.7) 3 else if (oz<.9) 4 else 5"|bc` echo -e "

Ваша оценка: $BAL

\n" echo -e "

Вернуться

\n" echo -e "\n\n\t\tИтоговая оценка:\t$BAL\n\n\n\n\n" >> $list fi echo ""