Dim popytka11
Dim popytka12
Dim popytka13
popytka11 = Cbyte(1)
popytka12 = Cbyte(1)
popytka13 = Cbyte(1)

Sub znaok11_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(0.74)
tochn=CDbl(0.01)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans1.zna11.value="") OR (Not IsNumeric(Document.ans1.zna11.value)) Then
Alert "Необходимо ввести число"
ans1.zna11.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans1.zna11.value)
If ((Abs(otwet - potwet)) <= tochn AND (popytka11 <= 3)) or ( (Abs(otwet - potwet)) > tochn AND ((popytka11 >= 1)and(popytka11 <= 3))) Then 
   Top.Hlp.Help.Document.Open
   Top.Hlp.Help.Document.Write "<HTML>"
   Top.Hlp.Help.Document.Write "<HEAD><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'><STYLE>"
   Top.Hlp.Help.Document.Write "A { text-decoration: none}"
   Top.Hlp.Help.Document.Write "A:hover {text-decoration: underline; color: #FF00FF}"
   Top.Hlp.Help.Document.Write "BODY {background-image : URL(img/b_help.gif); font-variant: normal; font-family: Times New Roman; background-color: #DFEFFF; color: black;}"
   Top.Hlp.Help.Document.Write "</STYLE></HEAD>"
   Top.Hlp.Help.Document.Write "<BODY LINK='#0000FF' ALINK='#0000FF' VLINK='#0000FF'>"
End If
If (Abs(otwet - potwet) <= tochn) AND (popytka11 <= 3) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 1, вопрос 1: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "Отвечайте на следующий вопрос."
   popytka11 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka11 = 1) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 1, вопрос 1: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka11 = popytka11 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka11 = 2) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 1, вопрос 1: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka11 = popytka11 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka11 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 1, вопрос 1: Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z10.htm TARGET=Main>Выход в меню занятия</A>"
   popytka11 = popytka11 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka11 <= 3)) or ( (Abs(otwet - potwet)) >tochn AND ((popytka11 >= 1)and(popytka11 <= 3))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub


Sub znaok12_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(0.50)
tochn=CDbl(0.01)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans1.zna12.value="") OR (Not IsNumeric(Document.ans1.zna12.value)) Then
Alert "Необходимо ввести число"
ans1.zna12.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans1.zna12.value)
If ((Abs(otwet - potwet)) <= tochn AND (popytka12 <= 3)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka12 >= 1)and(popytka12 <= 3))) Then 
   Top.Hlp.Help.Document.Open
   Top.Hlp.Help.Document.Write "<HTML>"
   Top.Hlp.Help.Document.Write "<HEAD><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'><STYLE>"
   Top.Hlp.Help.Document.Write "A { text-decoration: none}"
   Top.Hlp.Help.Document.Write "A:hover {text-decoration: underline; color: #FF00FF}"
   Top.Hlp.Help.Document.Write "BODY {background-image : URL(img/b_help.gif); font-variant: normal; font-family: Times New Roman; background-color: #DFEFFF; color: black;}"
   Top.Hlp.Help.Document.Write "</STYLE></HEAD>"
   Top.Hlp.Help.Document.Write "<BODY LINK='#0000FF' ALINK='#0000FF' VLINK='#0000FF'>"
End If
If (Abs(otwet - potwet) <= tochn) AND (popytka12 <= 3) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 1, вопрос 2: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "Отвечайте на следующий вопрос."
   popytka12 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka12 = 1) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 1, вопрос 2: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka12 = popytka12 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka12 = 2) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 1, вопрос 2: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka12 = popytka12 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka12 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 1, вопрос 2: Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z10.htm TARGET=Main>Выход в меню занятия</A>"
   popytka12 = popytka12 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka12 <= 3)) or ( (Abs(otwet - potwet) > tochn) AND ((popytka12 >= 1)and(popytka12 <= 3))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub

Sub znaok13_OnClick
Dim otwet,potwet,tochn

' Правильный ответ
potwet=CDbl(0.25)
tochn=CDbl(0.01)

' Проверка вводимого числа (Текст или не текст)
If (Document.ans1.zna13.value="") OR (Not IsNumeric(Document.ans1.zna13.value)) Then
Alert "Необходимо ввести число"
ans1.zna13.focus
Exit Sub
End If

' Проверка вводимого числа (на попадание в диапазон)
otwet=CDbl(Document.ans1.zna13.value)
If ((Abs(otwet - potwet)) <= tochn AND (popytka13 <= 3)) or ( (Abs(otwet - potwet)) > tochn AND ((popytka13 >= 1)and(popytka13 <= 3))) Then 
   Top.Hlp.Help.Document.Open
   Top.Hlp.Help.Document.Write "<HTML>"
   Top.Hlp.Help.Document.Write "<HEAD><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'><STYLE>"
   Top.Hlp.Help.Document.Write "A { text-decoration: none}"
   Top.Hlp.Help.Document.Write "A:hover {text-decoration: underline; color: #FF00FF}"
   Top.Hlp.Help.Document.Write "BODY {background-image : URL(img/b_help.gif); font-variant: normal; font-family: Times New Roman; background-color: #DFEFFF; color: black;}"
   Top.Hlp.Help.Document.Write "</STYLE></HEAD>"
   Top.Hlp.Help.Document.Write "<BODY LINK='#0000FF' ALINK='#0000FF' VLINK='#0000FF'>"
End If
If (Abs(otwet - potwet) <= tochn) AND (popytka13 <= 3) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 1, вопрос 3: <font color=#009933><b>Ответ верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z10.htm TARGET=Main>Выход в меню занятия</A>"
   popytka13 = 5
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka13 = 1) Then 
   Top.Hlp.Help.Document.Write "Контрольная задача 1, вопрос 3: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#99CC00><B>Осталось две попытки</B></FONT>."
   popytka13 = popytka13 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka13 = 2) Then
   Top.Hlp.Help.Document.Write "Контрольная задача 1, вопрос 3: <font color=#FF0066><b>Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<font color=#FF9900><B>Осталась последняя попытка</B></font>."
   popytka13 = popytka13 + 1
ElseIf (Abs(otwet - potwet) > tochn) AND (popytka13 = 3) Then
   Top.Hlp.Help.Document.Write "<font color=#FF3399><b>Контрольная задача 1, вопрос 3: Ответ не верный !</B></font><BR>"
   Top.Hlp.Help.Document.Write "<A HREF=z10.htm TARGET=Main>Выход в меню занятия</A>"
   popytka13 = popytka13 + 1
End If
If ((Abs(otwet - potwet)) <= tochn AND (popytka13 <= 3)) or ( (Abs(otwet - potwet)) >tochn AND ((popytka13 >= 1)and(popytka13 <= 3))) Then 
   Top.Hlp.Help.Document.Write "</BODY>"
   Top.Hlp.Help.Document.Write "</HTML>"
   Top.Hlp.Help.Document.Close
End If
End Sub

