Просмотр файла test_motor18/test_vred_priv.php

Размер файла: 8.16Kb
<?php

require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";
require_once"../template/antidos.php";
require_once"../template/cookies.php";
require_once"../template/gzip.php";
require_once"../template/header.php";
require_once"../template/referer.php";
include_once"../themes/$config_themes/index.php";
include_once"../template/isset.php";
echo '<img src="../images/img/partners.gif" alt=""> <b>Не много ли у тебя вредных привычек?</b><br><br>';

echo '
<script language="JavaScript" type="text/javascript">
function count(){

//first we will check which answer was selected
//and calculate points that person will get
// start checking question 1

if (document.forms[0].q1[0].checked){
var a1 = document.forms[0].q1[0].value}
if (document.forms[0].q1[1].checked){
var a1 = document.forms[0].q1[1].value}
if (document.forms[0].q1[2].checked){
var a1 = document.forms[0].q1[2].value}

// end 1
// start 2

if (document.forms[0].q2[0].checked){
var a2 = document.forms[0].q2[0].value}
if (document.forms[0].q2[1].checked){
var a2 = document.forms[0].q2[1].value}
if (document.forms[0].q2[2].checked){
var a2 = document.forms[0].q2[2].value}

// end 2
// start 3

if (document.forms[0].q3[0].checked){
var a3 = document.forms[0].q3[0].value}
if (document.forms[0].q3[1].checked){
var a3 = document.forms[0].q3[1].value}
if (document.forms[0].q3[2].checked){
var a3 = document.forms[0].q3[2].value}

// end 3
// start 4

if (document.forms[0].q4[0].checked){
var a4 = document.forms[0].q4[0].value}
if (document.forms[0].q4[1].checked){
var a4 = document.forms[0].q4[1].value}
if (document.forms[0].q4[2].checked){
var a4 = document.forms[0].q4[2].value}

// end 4
// start 5

if (document.forms[0].q5[0].checked){
var a5 = document.forms[0].q5[0].value}
if (document.forms[0].q5[1].checked){
var a5 = document.forms[0].q5[1].value}
if (document.forms[0].q5[2].checked){
var a5 = document.forms[0].q5[2].value}

// end 5
// start 6

if (document.forms[0].q6[0].checked){
var a6 = document.forms[0].q6[0].value}
if (document.forms[0].q6[1].checked){
var a6 = document.forms[0].q6[1].value}
if (document.forms[0].q6[2].checked){
var a6 = document.forms[0].q6[2].value}

// end 6

//now we will check whether all questions were answered

if (typeof a1=="string" && typeof a2=="string" && typeof a3=="string" 
&& typeof a4=="string" && typeof a5=="string" && typeof a6=="string"){

//these are variants of conclusion

good = "Молодец!";
pour = "У тебя есть вредные привычки! (Хотя бывает и хуже.) Мобилизуй силу воли и скажи им: Прощайте!";
bad = "У тебя много вредных привычек. Большинство из них тебе нравятся, но надо с ними распрощаться!";

result = parseInt(a1)+parseInt(a2)+parseInt(a3)+parseInt(a4)+
parseInt(a5)+parseInt(a6);

//this is system of assessment

if (result>=0 && result<=1){
document.forms[0].output.value = good;
}
else if (result>=2 && result<=9){
document.forms[0].output.value = pour;
}
else if (result>=10 && result<=12){
document.forms[0].output.value = bad;
}
} else {
alert("Ты ответил не на все вопросы!");
}
}
</script>	
<meta name="Description" content="Прикольные тесты">
<meta name="Keywords" content="Юмористические прикольные тесты">



<div align="right">
  <table cols="1" width="621">
    <tbody>
      <tr>
        <td width="613">
          <form>
            <div align="left">
              <p style="MARGIN-LEFT: 100px"><strong>1. Куришь?<br>
              <input type="radio" value="2" name="q1" checked>Дымлю... Я уже
              достаточно взрослый, чтобы
              сознательно вредить своему
              организму.<br>
              <input type="radio" value="1" name="q1">Курю иногда. А
              разве это вредно?<br>
              <input type="radio" value="0" name="q1">Не курю и не
              тянет.</strong></p>
            </div>
            <hr>
            <p style="MARGIN-LEFT: 100px"><strong>2. Как насчет
            алкоголя?<br>
            <input type="radio" value="2" name="q2" checked>Стараюсь
            выпить этой отравы как можно больше -
            чтобы другим меньше осталось.<br>
            <input type="radio" value="1" name="q2">Бывает иногда...
            Часто не получается - не хватает
            здоровья (денег, времени, поводов...)<br>
            <input type="radio" value="0" name="q2">Не пью и не
            тянет.</strong></p>
            <hr>
            <p style="MARGIN-LEFT: 100px"><strong>3. Грызешь ли ты
            ногти?<br>
            <input type="radio" value="2" name="q3" checked>А что же мне еще
            грызть? Мебель не разрешают...<br>
            <input type="radio" value="1" name="q3">Только когда
            они вырастают слишком длинные.<br>
            <input type="radio" value="0" name="q3">Что я - из
            породы грызунов?</strong></p>
            <hr>
            <p style="MARGIN-LEFT: 100px"><strong>4.&nbsp;
            Используешь ли ты в речи нецензурные
            выражения?<br>
            <input type="radio" value="2" name="q4" checked>Конечно, это
            очень круто!<br>
            <input type="radio" value="1" name="q4">Редко.<br>
            <input type="radio" value="0" name="q4">Никогда. (Кстати,
            кто-то верно подметил, что матерятся
            обычно люди, не имеющие чувства юмора.
            - Прим. ред.)</strong></p>
            <hr>
            <p style="MARGIN-LEFT: 100px"><strong>5. Часто ли ты
            грызешь семечки в общественных
            местах (на улице, в школе, в автобусе и
            пр.):<br>
            <input type="radio" value="2" name="q5" checked>А чего, нельзя,
            что ли? Ну, ваще!..<br>
            <input type="radio" value="1" name="q5">А я в кулечек...<br>
            <input type="radio" value="0" name="q5">Нет, и под
            угрозой расстрела не буду.</strong></p>
            <hr>
            <p style="MARGIN-LEFT: 100px"><strong>6. Смотришь ли ты
            несколько сериалов каждый день?<br>
            <input type="radio" value="2" name="q6" checked>Да, я за них так
            переживаю!<br>
            <input type="radio" value="1" name="q6">Один смотрю,
            самый любимый.<br>
            <input type="radio" value="0" name="q6">Глупости это!</strong></p>
            <hr>
            <div align="center">
              <center>
              <strong>Нажми на кнопку и получишь
              результат</strong></center>
            </div>
            <div align="center">
              <center>
              <strong><textarea name="output" rows="3" cols="50"></textarea></strong></center>
            </div>
            <div align="center">
              <center>
              <strong><input onclick="count()" type="button" value="Проверь себя">
              <input type="reset" value="Очистить форму"></strong></center>
            </div>
          </form>
          <hr align="center">
        </td>
      </tr>
    </tbody>
  </table>
</div>




';
echo '<img src="../images/img/homepage.gif" alt=""> <a href="../index.php?'.SID.'">На главную</a>'; 

include_once "../themes/$config_themes/foot.php";
?>