...

View Full Version : Block access after first visit



Supremo
03-28-2007, 06:44 PM
Hello, i'm wondering if any1 can help me with the following.

I want to do a anonymous quiz, but i want the ppl to answer it only once. Since i have no programming skills i used the Frontpage Wizard to create one with Access DB linkage. Everything works fine, i got the required fields, can see results and edit the db, all ok.

Now the problem is i need to limit users to answer the quiz only once. They are not too advanced users, so np if i use cookies (they won't clear cookies) or anything similar, but i don't have any idea how to program this. I wanted the page to display for them until they press the "submit" button from the quiz, and from there on, no more option to submit, or just not showing the quiz page anymore.

Any1 can give a hand ? :)

Spudhead
03-29-2007, 09:27 AM
<%
if request.cookies("doneTheQuiz") = "absolutively" or request.form("doneTheQuiz") = "absolutively" then

request.cookies("doneTheQuiz") = "absolutively"
%>

<p>You have already done the quiz</p>

<%
else
%>

<form action="thisPage.asp">
<input type="hidden" name="doneTheQuiz" value="absolutively"/>
<p>What's your name: <input type="text" name="question1"></p>
<input type="submit" />
</form>

<%
end if
%>

Supremo
03-29-2007, 09:53 AM
Ok, if i think i understood your code, first i change the "thisPage.asp" into the name i gave to my page. It's running, but i put in the same name and it doesn't tell me its done.

Looking at your code, i see that you store the name on the "question1" field, but i don't get any cookie warning or sign on browser, also shouldn't i be checking for the "question1" field information somewhere in the ASP code ?

SSJ
03-29-2007, 09:54 AM
Good Solution.
Me also wanted this one like

SSJ
03-29-2007, 09:55 AM
Post your whole page code

Supremo
03-29-2007, 09:58 AM
Well, it's very big and remember, i'm a Systems Administrator, plz don't laugh at me doin things in Frontpage with wizards :D


<%
' FP_ASP ASP Automatically generated by a FrontPage Component. Do not Edit.

On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
Err.Clear

strErrorUrl = ""

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear

Set fp_conn = Server.CreateObject("ADODB.Connection")
FP_DumpError strErrorUrl, "Cannot create connection"

Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "Cannot create record set"

fp_conn.Open Application("questionario_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"

fp_rs.Open "Results", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"

fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(10)
Dim arFormDBFields0(10)
Dim arFormValues0(10)

arFormFields0(0) = "a1"
arFormDBFields0(0) = "a1"
arFormValues0(0) = Request("a1")
arFormFields0(1) = "a2"
arFormDBFields0(1) = "a2"
arFormValues0(1) = Request("a2")
arFormFields0(2) = "a3"
arFormDBFields0(2) = "a3"
arFormValues0(2) = Request("a3")
arFormFields0(3) = "b4"
arFormDBFields0(3) = "b4"
arFormValues0(3) = Request("b4")
arFormFields0(4) = "b5"
arFormDBFields0(4) = "b5"
arFormValues0(4) = Request("b5")
arFormFields0(5) = "c6"
arFormDBFields0(5) = "c6"
arFormValues0(5) = Request("c6")
arFormFields0(6) = "c7"
arFormDBFields0(6) = "c7"
arFormValues0(6) = Request("c7")
arFormFields0(7) = "c8"
arFormDBFields0(7) = "c8"
arFormValues0(7) = Request("c8")
arFormFields0(8) = "d9"
arFormDBFields0(8) = "d9"
arFormValues0(8) = Request("d9")
arFormFields0(9) = "e"
arFormDBFields0(9) = "e"
arFormValues0(9) = Request("e")

FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0


fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the database"

fp_rs.Close
fp_conn.Close

FP_FormConfirmationFromArrays "text/html; charset=windows-1252",_
"Form Confirmation",_
"Thank you for submitting the following information:",_
"submission_form.asp",_
"Return to the form.",_
arFormDBFields0,_
arFormValues0

End If
End If

Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")

%>
<% Response.Buffer = True %>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Results -- New</title>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>

<body bgcolor="#FFFFFF">

<table width="100%" align=left>
<tr>
<td width="50%">
<b><font size=+3 color="#000080"> Avaliação da Satisfação Qualidade de Serviço da Area de Sistemas da Precision
</font></b>
<p>Seleccionar um valor relativo à Satisfação, ou indique quando Não Aplicável.</td>
<td width="50%" align=right>
<table>
<tr>
<td>
<a href="../results_page.asp" target="_top">Results Page</a> |
Submission Form
| <a href="database_editor.asp" target="_top">Database Editor</a>

</td>
</tr>
</table>
</td>
</tr>
</table>


<p>
<br clear="all">
<hr>
<p>

<form METHOD="POST" action="--WEBBOT-SELF--">

<!--webbot bot="SaveDatabase" SuggestedExt="asp" S-DataConnection="questionario" S-RecordSource="Results" S-Form-Fields="a1 a2 a3 b4 b5 c6 c7 c8 d9 e" S-Form-DBFields="a1 a2 a3 b4 b5 c6 c7 c8 d9 e " B-UseDBFieldsForConfirmation="True" U-ASP-Include-Url="../../../_fpclass/fpdbform.inc" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include file="../../../_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase" i-checksum="52631" endspan -->

<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table1">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Adequação das aplicações informáticas ao trabalho a realizar</td>
</tr>
</table>

<p>
<p><input type="radio" name="a1" value="Option 1" >Excelente</p>
<p><input type="radio" name="a1" value="Option 2" >Bom</p>
<p><input type="radio" name="a1" value="Option 3" >Razoavél</p>
<p><input type="radio" name="a1" value="Option 4" >Fraco</p>
<p><input type="radio" name="a1" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table2">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Fiabilidade das aplicações (os sistemas não estarem &quot;em baixo&quot;)</td>
</tr>
</table>
<p>
<p><input type="radio" name="a2" value="Option 1" >Excelente</p>
<p><input type="radio" name="a2" value="Option 2" >Bom</p>
<p><input type="radio" name="a2" value="Option 3" >Razoavél</p>
<p><input type="radio" name="a2" value="Option 4" >Fraco</p>
<p><input type="radio" name="a2" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table3">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height:15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Velocidade de processamento das aplicações</td>
</tr>
</table>
<p>
<p><input type="radio" name="a3" value="Option 1" >Excelente</p>
<p><input type="radio" name="a3" value="Option 2" >Bom</p>
<p><input type="radio" name="a3" value="Option 3" >Razoavél</p>
<p><input type="radio" name="a3" value="Option 4" >Fraco</p>
<p><input type="radio" name="a3" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table4">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Eficácia na resolução de problemas (a resposta resolveu o problema)</td>
</tr>
</table>
<p>
<p><input type="radio" name="b4" value="Option 1" >Excelente</p>
<p><input type="radio" name="b4" value="Option 2" >Bom</p>
<p><input type="radio" name="b4" value="Option 3" >Razoavél</p>
<p><input type="radio" name="b4" value="Option 4" >Fraco</p>
<p><input type="radio" name="b4" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table5">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Eficiência na resolução de problemas (a resposta foi rápida)</td>
</tr>
</table>
<p>
<p><input type="radio" name="b5" value="Option 1" >Excelente</p>
<p><input type="radio" name="b5" value="Option 2" >Bom</p>
<p><input type="radio" name="b5" value="Option 3" >Razoavél</p>
<p><input type="radio" name="b5" value="Option 4" >Fraco</p>
<p><input type="radio" name="b5" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table6">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Preocupação da Equipa de Sistemas em me manter informado sobre questões
críticas</td>
</tr>
</table>
<p>
<p><input type="radio" name="c6" value="Option 1" >Excelente</p>
<p><input type="radio" name="c6" value="Option 2" >Bom</p>
<p><input type="radio" name="c6" value="Option 3" >Razoavél</p>
<p><input type="radio" name="c6" value="Option 4" >Fraco</p>
<p><input type="radio" name="c6" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table7">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Adequação das acções preventivas para evitar o aparecer de problemas</td>
</tr>
</table>
<p>
<p><input type="radio" name="c7" value="Option 1" >Excelente</p>
<p><input type="radio" name="c7" value="Option 2" >Bom</p>
<p><input type="radio" name="c7" value="Option 3" >Razoavél</p>
<p><input type="radio" name="c7" value="Option 4" >Fraco</p>
<p><input type="radio" name="c7" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table8">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Satisfação com a evolução sentida na qualidade de Prestação de Serviço</td>
</tr>
</table>
<p>
<p><input type="radio" name="c8" value="Option 1" >Excelente</p>
<p><input type="radio" name="c8" value="Option 2" >Bom</p>
<p><input type="radio" name="c8" value="Option 3" >Razoavél</p>
<p><input type="radio" name="c8" value="Option 4" >Fraco</p>
<p><input type="radio" name="c8" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table9">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Qualidade e estado de conservação do equipamento informático</td>
</tr>
</table>
<p>
<p><input type="radio" name="d9" value="Option 1" >Excelente</p>
<p><input type="radio" name="d9" value="Option 2" >Bom</p>
<p><input type="radio" name="d9" value="Option 3" >Razoavél</p>
<p><input type="radio" name="d9" value="Option 4" >Fraco</p>
<p><input type="radio" name="d9" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table10">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-weight: 700; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Satisfação global com o serviço prestado</td>
</tr>
</table>
<p>
<p><input type="radio" name="e" value="Option 1" >Excelente</p>
<p><input type="radio" name="e" value="Option 2" >Bom</p>
<p><input type="radio" name="e" value="Option 3" >Razoavél</p>
<p><input type="radio" name="e" value="Option 4" >Fraco</p>
<p><input type="radio" name="e" value="Option 5" >Não aplicavél</p>
<br>
</p>


<p><input type="submit" value=" OK "><input type="reset" value=" Reset "></p>

</form>

</body>

</html>

Supremo
03-29-2007, 10:04 AM
Well, now that i posted the whole thing, might as well explain a bit about it.

It's a satisfaction quiz, it's supposed to be anonymous (as much as possible) but to maintain a good lvl of usefullness, it's supposed the ppl only fill it once ofc, otherwise some might be tempted to answer it several times corrupting the value of the quiz.

SSJ
03-29-2007, 10:17 AM
Try this one and let me know if it is okay...



<%
' FP_ASP ASP Automatically generated by a FrontPage Component. Do not Edit.

On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
Err.Clear

strErrorUrl = ""

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear

Set fp_conn = Server.CreateObject("ADODB.Connection")
FP_DumpError strErrorUrl, "Cannot create connection"

Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "Cannot create record set"

fp_conn.Open Application("questionario_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"

fp_rs.Open "Results", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"

fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(10)
Dim arFormDBFields0(10)
Dim arFormValues0(10)

arFormFields0(0) = "a1"
arFormDBFields0(0) = "a1"
arFormValues0(0) = Request("a1")
arFormFields0(1) = "a2"
arFormDBFields0(1) = "a2"
arFormValues0(1) = Request("a2")
arFormFields0(2) = "a3"
arFormDBFields0(2) = "a3"
arFormValues0(2) = Request("a3")
arFormFields0(3) = "b4"
arFormDBFields0(3) = "b4"
arFormValues0(3) = Request("b4")
arFormFields0(4) = "b5"
arFormDBFields0(4) = "b5"
arFormValues0(4) = Request("b5")
arFormFields0(5) = "c6"
arFormDBFields0(5) = "c6"
arFormValues0(5) = Request("c6")
arFormFields0(6) = "c7"
arFormDBFields0(6) = "c7"
arFormValues0(6) = Request("c7")
arFormFields0(7) = "c8"
arFormDBFields0(7) = "c8"
arFormValues0(7) = Request("c8")
arFormFields0(8) = "d9"
arFormDBFields0(8) = "d9"
arFormValues0(8) = Request("d9")
arFormFields0(9) = "e"
arFormDBFields0(9) = "e"
arFormValues0(9) = Request("e")

FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0


fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the database"

fp_rs.Close
fp_conn.Close
Response.Cookies("QuizDone")="Yes"

FP_FormConfirmationFromArrays "text/html; charset=windows-1252",_
"Form Confirmation",_
"Thank you for submitting the following information:",_
"submission_form.asp",_
"Return to the form.",_
arFormDBFields0,_
arFormValues0

End If
End If

Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")

%>
<% Response.Buffer = True %>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Results -- New</title>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>

<body bgcolor="#FFFFFF">

<table width="100%" align=left>
<tr>
<td width="50%">
<b><font size=+3 color="#000080"> Avaliação da Satisfação Qualidade de Serviço da Area de Sistemas da Precision
</font></b>
<p>Seleccionar um valor relativo à Satisfação, ou indique quando Não Aplicável.</td>
<td width="50%" align=right>
<table>
<tr>
<td>
<a href="../results_page.asp" target="_top">Results Page</a> |
Submission Form
| <a href="database_editor.asp" target="_top">Database Editor</a>

</td>
</tr>
</table>
</td>
</tr>
</table>


<p>
<br clear="all">
<hr>
<p>
<% if Trim(Request.Cookies("QuizDone")) = "Yes" then %>
<p>You have already done the quiz</p>
<% Else %>
<form METHOD="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveDatabase" SuggestedExt="asp" S-DataConnection="questionario" S-RecordSource="Results" S-Form-Fields="a1 a2 a3 b4 b5 c6 c7 c8 d9 e" S-Form-DBFields="a1 a2 a3 b4 b5 c6 c7 c8 d9 e " B-UseDBFieldsForConfirmation="True" U-ASP-Include-Url="../../../_fpclass/fpdbform.inc" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include file="../../../_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase" i-checksum="52631" endspan -->

<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table1">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Adequação das aplicações informáticas ao trabalho a realizar</td>
</tr>
</table>

<p>
<p><input type="radio" name="a1" value="Option 1" >Excelente</p>
<p><input type="radio" name="a1" value="Option 2" >Bom</p>
<p><input type="radio" name="a1" value="Option 3" >Razoavél</p>
<p><input type="radio" name="a1" value="Option 4" >Fraco</p>
<p><input type="radio" name="a1" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table2">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Fiabilidade das aplicações (os sistemas não estarem &quot;em baixo&quot</td>
</tr>
</table>
<p>
<p><input type="radio" name="a2" value="Option 1" >Excelente</p>
<p><input type="radio" name="a2" value="Option 2" >Bom</p>
<p><input type="radio" name="a2" value="Option 3" >Razoavél</p>
<p><input type="radio" name="a2" value="Option 4" >Fraco</p>
<p><input type="radio" name="a2" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table3">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height:15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Velocidade de processamento das aplicações</td>
</tr>
</table>
<p>
<p><input type="radio" name="a3" value="Option 1" >Excelente</p>
<p><input type="radio" name="a3" value="Option 2" >Bom</p>
<p><input type="radio" name="a3" value="Option 3" >Razoavél</p>
<p><input type="radio" name="a3" value="Option 4" >Fraco</p>
<p><input type="radio" name="a3" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table4">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Eficácia na resolução de problemas (a resposta resolveu o problema)</td>
</tr>
</table>
<p>
<p><input type="radio" name="b4" value="Option 1" >Excelente</p>
<p><input type="radio" name="b4" value="Option 2" >Bom</p>
<p><input type="radio" name="b4" value="Option 3" >Razoavél</p>
<p><input type="radio" name="b4" value="Option 4" >Fraco</p>
<p><input type="radio" name="b4" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table5">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Eficiência na resolução de problemas (a resposta foi rápida)</td>
</tr>
</table>
<p>
<p><input type="radio" name="b5" value="Option 1" >Excelente</p>
<p><input type="radio" name="b5" value="Option 2" >Bom</p>
<p><input type="radio" name="b5" value="Option 3" >Razoavél</p>
<p><input type="radio" name="b5" value="Option 4" >Fraco</p>
<p><input type="radio" name="b5" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table6">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Preocupação da Equipa de Sistemas em me manter informado sobre questões
críticas</td>
</tr>
</table>
<p>
<p><input type="radio" name="c6" value="Option 1" >Excelente</p>
<p><input type="radio" name="c6" value="Option 2" >Bom</p>
<p><input type="radio" name="c6" value="Option 3" >Razoavél</p>
<p><input type="radio" name="c6" value="Option 4" >Fraco</p>
<p><input type="radio" name="c6" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table7">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Adequação das acções preventivas para evitar o aparecer de problemas</td>
</tr>
</table>
<p>
<p><input type="radio" name="c7" value="Option 1" >Excelente</p>
<p><input type="radio" name="c7" value="Option 2" >Bom</p>
<p><input type="radio" name="c7" value="Option 3" >Razoavél</p>
<p><input type="radio" name="c7" value="Option 4" >Fraco</p>
<p><input type="radio" name="c7" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table8">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Satisfação com a evolução sentida na qualidade de Prestação de Serviço</td>
</tr>
</table>
<p>
<p><input type="radio" name="c8" value="Option 1" >Excelente</p>
<p><input type="radio" name="c8" value="Option 2" >Bom</p>
<p><input type="radio" name="c8" value="Option 3" >Razoavél</p>
<p><input type="radio" name="c8" value="Option 4" >Fraco</p>
<p><input type="radio" name="c8" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table9">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Qualidade e estado de conservação do equipamento informático</td>
</tr>
</table>
<p>
<p><input type="radio" name="d9" value="Option 1" >Excelente</p>
<p><input type="radio" name="d9" value="Option 2" >Bom</p>
<p><input type="radio" name="d9" value="Option 3" >Razoavél</p>
<p><input type="radio" name="d9" value="Option 4" >Fraco</p>
<p><input type="radio" name="d9" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table10">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-weight: 700; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Satisfação global com o serviço prestado</td>
</tr>
</table>
<p>
<p><input type="radio" name="e" value="Option 1" >Excelente</p>
<p><input type="radio" name="e" value="Option 2" >Bom</p>
<p><input type="radio" name="e" value="Option 3" >Razoavél</p>
<p><input type="radio" name="e" value="Option 4" >Fraco</p>
<p><input type="radio" name="e" value="Option 5" >Não aplicavél</p>
<br>
</p>


<p><input type="submit" value=" OK "><input type="reset" value=" Reset "></p>

</form>
<%End IF%>

</body>

</html>

Supremo
03-29-2007, 10:24 AM
I'm afraid it let me fill the quiz just right after i filled it

SSJ
03-29-2007, 10:38 AM
Hey man this is working fine for me

SSJ
03-29-2007, 10:39 AM
Try clearing your cookies

felgall
03-29-2007, 10:46 AM
There are only three ways of trying to identify someone on the web.

1. To set a cookie to keep track of their computer. They can of course refuse to have the cookie set in the first place or delete it after you set it and they are then a new visitor again 2 seconds after their last visit.

2. Record their IP address and assume that anyone with that IP address who visits again in a certain period is the same person. Note that anyone on dial-up will get a different address each time they dial in. Many on broadband also have a dynamic IP address that is regularly changed on them. This means that the same person may have different IP addresses at different times and the same IP address may be allocated to different people at different times (or even at the same time if they are on the same network eg. 1000 people all working in the same office may have the same IP).

3. Set up a membership site and make it available only to members so that you can flag those members who have participated. Then all you need to do is to make it difficult for one person to get multiple accounts (eg. by collecting lots of info about them and not allowing too much of it to be duplicated).

Supremo
03-29-2007, 11:09 AM
Cleared my cookies, deleted all offline files, made sure file on webserver was the updated one.

I'm wondering if it's not a thing with all these Frontpage controls ? These class files got a lot of coding on them, and these "webbot" definitions...

Like in Spudhead example i tried to find what was different, and even changed the

<input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"> //right after form

with

<input TYPE="hidden" NAME="QuizDone" VALUE="Yes"> //out of your example

Felgall, this is on a intranet :), so no dialups, i guess i could also go for IP check, since it's also supposed to be 1 submit for each PC.

felgall
03-29-2007, 11:51 AM
Provided that your intranet uses static IP addresses that is probably the best way to go.

Supremo
03-29-2007, 12:07 PM
Well, i'm still trying to figure it out, but eventually what i might do if i don't get it working, is maybe do this check on a previous page, like a frontpage where you click something and then u can do the quiz.

Maybe it gets easier to do it outside of this frontpage messy code

SSJ
03-29-2007, 12:29 PM
Hey,

Forgot cookies, Use Session.
I think this will be the best for you.

Supremo
03-29-2007, 01:31 PM
hum, session won't work, won't that allow the client to rerun the quiz all over again as soon as he closes his browser or logout of his PC or something like that ?

What i'm trying to do atm is:
1) Go with cookies on a more simple page that then redirects to the quiz one
2) Learn a bit more, but will take me ages, since i'm no coder :(

Daemonspyre
03-29-2007, 07:14 PM
Sessions unfortunately won't work in this scenario, as they are cleared after the user closes their browser window.

Try this:

1) Add a field into your database called `IPLoc` VARCHAR(16)

2) Add a Hidden field on your form:
<input type="hidden" name="IPLoc" size="1" value="<%= Request.ServerVariables("REMOTE_HOST") %>">

Change


Dim arFormFields0(10) ==> Dim arFormFields0(11)
Dim arFormDBFields0(10) ==> Dim arFormFields0(11)
Dim arFormValues0(10) ==> Dim arFormValues0(11)
'
AND
'
S-Form-Fields="a1 a2 a3 b4 b5 c6 c7 c8 d9 e IPLoc" S-Form-DBFields="a1 a2 a3 b4 b5 c6 c7 c8 d9 e IPLoc "


Then add this to your FP-driven code:

arFormFields0(10)="IPLoc"
arFormDBFields0(10) = "IPLoc"
arFormValues0(10) = Request("IPLoc")

This will capture your user's IP address and store it in your database.

3) Change your line
<% if Trim(Request.Cookies("QuizDone")) = "Yes" then %>
to


<% if Trim(Request.Cookies("QuizDone")) = "" OR Trim(Request.Cookies("QuizDone")) = "NO" then

Set fp_rs = Server.CreateObject("ADODB.Recordset")
fp_conn.Open Application("questionario_ConnectionString")

fp_rs.open "SELECT * FROM Results WHERE IPLoc = '" & Request.ServerVariables("REMOTE_HOST") & "'", fp_conn

if fp_rs.eof then
'do nothing, they are not in the database
else
'they have taken the quiz...
response.write("<p>You have already done the quiz</p>")
end if

fp_rs.close
fp_conn.close
'
Elseif Trim(Request.Cookies("QuizDone")) = "Yes" then
response.write("<p>You have already done the quiz</p>")
Else %>



Now... The only problem with the above is that a) it's untested and b) if you are using a NAT between your intranet to your webserver, you will have the same IP all the time.

Let me know if this works or if you need a little more insight to the above.

SSJ
03-30-2007, 12:10 PM
I really can't able to understand why that cookie code is not working at your side as it is working here at my side...

Supremo
03-30-2007, 12:24 PM
SSJ: Did u make a exact replica of the scenario i'm using ?

uau

ok

I've done all the updating, (there's no NAT btw) and now i get no error, but the HTML is also not displaying below the last script part

(I've checked the db to check if just in case my IP is already blocked and it ain't)

Thx for the effort btw :>

I display now the full code:



<%
' FP_ASP ASP Automatically generated by a FrontPage Component. Do not Edit.

On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
Err.Clear

strErrorUrl = ""

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear

Set fp_conn = Server.CreateObject("ADODB.Connection")
FP_DumpError strErrorUrl, "Cannot create connection"

Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "Cannot create record set"

fp_conn.Open Application("questionario_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"

fp_rs.Open "Results", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"

fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(11)
Dim arFormDBFields0(11)
Dim arFormValues0(11)

arFormFields0(0) = "a1"
arFormDBFields0(0) = "a1"
arFormValues0(0) = Request("a1")
arFormFields0(1) = "a2"
arFormDBFields0(1) = "a2"
arFormValues0(1) = Request("a2")
arFormFields0(2) = "a3"
arFormDBFields0(2) = "a3"
arFormValues0(2) = Request("a3")
arFormFields0(3) = "b4"
arFormDBFields0(3) = "b4"
arFormValues0(3) = Request("b4")
arFormFields0(4) = "b5"
arFormDBFields0(4) = "b5"
arFormValues0(4) = Request("b5")
arFormFields0(5) = "c6"
arFormDBFields0(5) = "c6"
arFormValues0(5) = Request("c6")
arFormFields0(6) = "c7"
arFormDBFields0(6) = "c7"
arFormValues0(6) = Request("c7")
arFormFields0(7) = "c8"
arFormDBFields0(7) = "c8"
arFormValues0(7) = Request("c8")
arFormFields0(8) = "d9"
arFormDBFields0(8) = "d9"
arFormValues0(8) = Request("d9")
arFormFields0(9) = "e"
arFormDBFields0(9) = "e"
arFormValues0(9) = Request("e")
arFormFields0(10) = "IPLoc"
arFormDBFields0(10) = "IPLoc"
arFormValues0(10) = Request("IPLoc")

FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0


fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the database"

fp_rs.Close
fp_conn.Close
Response.Cookies("QuizDone")="Yes"

FP_FormConfirmationFromArrays "text/html; charset=windows-1252",_
"Form Confirmation",_
"Thank you for submitting the following information:",_
"submission_form.asp",_
"Return to the form.",_
arFormDBFields0,_
arFormValues0

End If
End If

Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")

%>
<% Response.Buffer = True %>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Results -- New</title>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>

<body bgcolor="#FFFFFF">

<table width="100%" align=left>
<tr>
<td width="50%">
<b><font size=+3 color="#000080"> Avaliação da Satisfação Qualidade de Serviço da Area de Sistemas da Precision
</font></b>
<p>Seleccionar um valor relativo à Satisfação, ou indique quando Não Aplicável.</td>
<td width="50%" align=right>
<table>
<tr>
<td>
<a href="../results_page.asp" target="_top">Results Page</a> |
Submission Form
| <a href="database_editor.asp" target="_top">Database Editor</a>

</td>
</tr>
</table>
</td>
</tr>
</table>


<p>
<br clear="all">
<hr>
<p>
<% if Trim(Request.Cookies("QuizDone")) = "" OR Trim(Request.Cookies("QuizDone")) = "NO" then

Set fp_rs = Server.CreateObject("ADODB.Recordset")
fp_conn.Open Application("questionario_ConnectionString")

fp_rs.open "SELECT * FROM Results WHERE IPLoc = '" & Request.ServerVariables("REMOTE_HOST") & "'", fp_conn

if fp_rs.eof then
'do nothing, they are not in the database
else
'they have taken the quiz...
response.write("<p>You have already done the quiz</p>")
end if

fp_rs.close
fp_conn.close
'
Elseif Trim(Request.Cookies("QuizDone")) = "Yes" then
response.write("<p>You have already done the quiz</p>")
Else %>
<p>You have already done the quiz</p>
<form METHOD="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveDatabase" SuggestedExt="asp" S-DataConnection="questionario" S-RecordSource="Results" S-Form-Fields="a1 a2 a3 b4 b5 c6 c7 c8 d9 e IPLoc" S-Form-DBFields="a1 a2 a3 b4 b5 c6 c7 c8 d9 e IPLoc" B-UseDBFieldsForConfirmation="True" U-ASP-Include-Url="../../../_fpclass/fpdbform.inc" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include file="../../../_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase" i-checksum="52631" endspan -->

<input type="hidden" name="IPLoc" size="1" value="<%= Request.ServerVariables("REMOTE_HOST") %>">

<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table1">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Adequação das aplicações informáticas ao trabalho a realizar</td>
</tr>
</table>

<p>
<p><input type="radio" name="a1" value="Option 1" >Excelente</p>
<p><input type="radio" name="a1" value="Option 2" >Bom</p>
<p><input type="radio" name="a1" value="Option 3" >Razoavél</p>
<p><input type="radio" name="a1" value="Option 4" >Fraco</p>
<p><input type="radio" name="a1" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table2">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Fiabilidade das aplicações (os sistemas não estarem &quot;em baixo&quot</td>
</tr>
</table>
<p>
<p><input type="radio" name="a2" value="Option 1" >Excelente</p>
<p><input type="radio" name="a2" value="Option 2" >Bom</p>
<p><input type="radio" name="a2" value="Option 3" >Razoavél</p>
<p><input type="radio" name="a2" value="Option 4" >Fraco</p>
<p><input type="radio" name="a2" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table3">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height:15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Velocidade de processamento das aplicações</td>
</tr>
</table>
<p>
<p><input type="radio" name="a3" value="Option 1" >Excelente</p>
<p><input type="radio" name="a3" value="Option 2" >Bom</p>
<p><input type="radio" name="a3" value="Option 3" >Razoavél</p>
<p><input type="radio" name="a3" value="Option 4" >Fraco</p>
<p><input type="radio" name="a3" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table4">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Eficácia na resolução de problemas (a resposta resolveu o problema)</td>
</tr>
</table>
<p>
<p><input type="radio" name="b4" value="Option 1" >Excelente</p>
<p><input type="radio" name="b4" value="Option 2" >Bom</p>
<p><input type="radio" name="b4" value="Option 3" >Razoavél</p>
<p><input type="radio" name="b4" value="Option 4" >Fraco</p>
<p><input type="radio" name="b4" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table5">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Eficiência na resolução de problemas (a resposta foi rápida)</td>
</tr>
</table>
<p>
<p><input type="radio" name="b5" value="Option 1" >Excelente</p>
<p><input type="radio" name="b5" value="Option 2" >Bom</p>
<p><input type="radio" name="b5" value="Option 3" >Razoavél</p>
<p><input type="radio" name="b5" value="Option 4" >Fraco</p>
<p><input type="radio" name="b5" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table6">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Preocupação da Equipa de Sistemas em me manter informado sobre questões
críticas</td>
</tr>
</table>
<p>
<p><input type="radio" name="c6" value="Option 1" >Excelente</p>
<p><input type="radio" name="c6" value="Option 2" >Bom</p>
<p><input type="radio" name="c6" value="Option 3" >Razoavél</p>
<p><input type="radio" name="c6" value="Option 4" >Fraco</p>
<p><input type="radio" name="c6" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table7">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Adequação das acções preventivas para evitar o aparecer de problemas</td>
</tr>
</table>
<p>
<p><input type="radio" name="c7" value="Option 1" >Excelente</p>
<p><input type="radio" name="c7" value="Option 2" >Bom</p>
<p><input type="radio" name="c7" value="Option 3" >Razoavél</p>
<p><input type="radio" name="c7" value="Option 4" >Fraco</p>
<p><input type="radio" name="c7" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table8">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Satisfação com a evolução sentida na qualidade de Prestação de Serviço</td>
</tr>
</table>
<p>
<p><input type="radio" name="c8" value="Option 1" >Excelente</p>
<p><input type="radio" name="c8" value="Option 2" >Bom</p>
<p><input type="radio" name="c8" value="Option 3" >Razoavél</p>
<p><input type="radio" name="c8" value="Option 4" >Fraco</p>
<p><input type="radio" name="c8" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table9">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Qualidade e estado de conservação do equipamento informático</td>
</tr>
</table>
<p>
<p><input type="radio" name="d9" value="Option 1" >Excelente</p>
<p><input type="radio" name="d9" value="Option 2" >Bom</p>
<p><input type="radio" name="d9" value="Option 3" >Razoavél</p>
<p><input type="radio" name="d9" value="Option 4" >Fraco</p>
<p><input type="radio" name="d9" value="Option 5" >Não aplicavél</p>
<br>
</p>
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse:
collapse;width:382pt" id="table10">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-weight: 700; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Satisfação global com o serviço prestado</td>
</tr>
</table>
<p>
<p><input type="radio" name="e" value="Option 1" >Excelente</p>
<p><input type="radio" name="e" value="Option 2" >Bom</p>
<p><input type="radio" name="e" value="Option 3" >Razoavél</p>
<p><input type="radio" name="e" value="Option 4" >Fraco</p>
<p><input type="radio" name="e" value="Option 5" >Não aplicavél</p>
<br>
</p>


<p><input type="submit" value=" OK "><input type="reset" value=" Reset "></p>

</form>
<%End IF%>

</body>

</html>

Daemonspyre
03-30-2007, 01:59 PM
OK, so like I said in the last Post, it was untested. You replied that there were no errors, yet you have On Error Resume Next on the top, so you will never see any of them. I have commented that whole section out and have altered the code (with commentary).

Let me know if this works for you...



<%
Response.Buffer = True
'
' FP_ASP ASP Automatically generated by a FrontPage Component. Do not Edit.

'Line below stops all errors from displaying. Remove the single quote (known as a comment) to use this feature
'On Error Resume Next
'
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
'
'Line below clears all errors. Remove the single quote if you use On Error Resume Next
'Err.Clear

strErrorUrl = ""

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear

Set fp_conn = Server.CreateObject("ADODB.Connection")
FP_DumpError strErrorUrl, "Cannot create connection"

Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "Cannot create record set"

fp_conn.Open Application("questionario_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"

fp_rs.Open "Results", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"

fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(11)
Dim arFormDBFields0(11)
Dim arFormValues0(11)

arFormFields0(0) = "a1"
arFormDBFields0(0) = "a1"
arFormValues0(0) = Request("a1")
arFormFields0(1) = "a2"
arFormDBFields0(1) = "a2"
arFormValues0(1) = Request("a2")
arFormFields0(2) = "a3"
arFormDBFields0(2) = "a3"
arFormValues0(2) = Request("a3")
arFormFields0(3) = "b4"
arFormDBFields0(3) = "b4"
arFormValues0(3) = Request("b4")
arFormFields0(4) = "b5"
arFormDBFields0(4) = "b5"
arFormValues0(4) = Request("b5")
arFormFields0(5) = "c6"
arFormDBFields0(5) = "c6"
arFormValues0(5) = Request("c6")
arFormFields0(6) = "c7"
arFormDBFields0(6) = "c7"
arFormValues0(6) = Request("c7")
arFormFields0(7) = "c8"
arFormDBFields0(7) = "c8"
arFormValues0(7) = Request("c8")
arFormFields0(8) = "d9"
arFormDBFields0(8) = "d9"
arFormValues0(8) = Request("d9")
arFormFields0(9) = "e"
arFormDBFields0(9) = "e"
arFormValues0(9) = Request("e")
arFormFields0(10) = "IPLoc"
arFormDBFields0(10) = "IPLoc"
arFormValues0(10) = Request("IPLoc")

FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0


fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the database"

fp_rs.Close
fp_conn.Close
Response.Cookies("QuizDone")="Yes"

FP_FormConfirmationFromArrays "text/html; charset=windows-1252",_
"Form Confirmation",_
"Thank you for submitting the following information:",_
"submission_form.asp",_
"Return to the form.",_
arFormDBFields0,_
arFormValues0

End If
End If

Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")
'
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Results -- New</title>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>

<body bgcolor="#FFFFFF">

<table width="100%" align=left>
<tr>
<td width="50%"><b><font size=+3 color="#000080"> Avaliação da Satisfação Qualidade de Serviço da Area de Sistemas da Precision</font></b>
<p>Seleccionar um valor relativo à Satisfação, ou indique quando Não Aplicável.</p>
</td>
<td width="50%" align=right>
<table>
<tr><td><a href="../results_page.asp" target="_top">Results Page</a> | Submission Form | <a href="database_editor.asp" target="_top">Database Editor</a></td></tr>
</table>
</td>
</tr>
</table>

<br style="line-height: 36px;" clear="all">
<hr>
<p>
<%
If Trim(Request.Cookies("QuizDone")) = "Yes" Then
'they have taken the quiz and the cookies are set.
response.write("<p>You have already done the quiz</p>")
'
Elseif Trim(Request.Cookies("QuizDone")) = "" OR Trim(Request.Cookies("QuizDone")) = "NO" then
'either they have not taken the quiz or the cookies have been cleared. Check db to see if cookies cleared.
'
fp_conn.Open Application("questionario_ConnectionString")
fp_rs.open "SELECT * FROM Results WHERE IPLoc = '" & Request.ServerVariables("REMOTE_HOST") & "'", fp_conn
'
If Not fp_rs.EOF Then
'they have taken the quiz, but cleared their cookies.
response.write("<p>You have already done the quiz</p>")
Else
'no cookies and IP not in the database
fp_rs.close
fp_conn.close
'
'write out the quiz
%>
<form METHOD="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveDatabase" SuggestedExt="asp" S-DataConnection="questionario" S-RecordSource="Results" S-Form-Fields="a1 a2 a3 b4 b5 c6 c7 c8 d9 e IPLoc" S-Form-DBFields="a1 a2 a3 b4 b5 c6 c7 c8 d9 e IPLoc" B-UseDBFieldsForConfirmation="True" U-ASP-Include-Url="../../../_fpclass/fpdbform.inc" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include file="../../../_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase" i-checksum="52631" endspan -->
<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse: collapse;width:382pt" id="table1">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Adequação das aplicações informáticas ao trabalho a realizar</td>
</tr>
</table>

<p>
<p><input type="radio" name="a1" value="Option 1" >Excelente</p>
<p><input type="radio" name="a1" value="Option 2" >Bom</p>
<p><input type="radio" name="a1" value="Option 3" >Razoavél</p>
<p><input type="radio" name="a1" value="Option 4" >Fraco</p>
<p><input type="radio" name="a1" value="Option 5" >Não aplicavél</p>
<br>
</p>

<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse: collapse;width:382pt" id="table2">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height: 15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Fiabilidade das aplicações (os sistemas não estarem &quot;em baixo&quot</td>
</tr>
</table>

<p>
<p><input type="radio" name="a2" value="Option 1" >Excelente</p>
<p><input type="radio" name="a2" value="Option 2" >Bom</p>
<p><input type="radio" name="a2" value="Option 3" >Razoavél</p>
<p><input type="radio" name="a2" value="Option 4" >Fraco</p>
<p><input type="radio" name="a2" value="Option 5" >Não aplicavél</p>
<br>
</p>

<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse: collapse;width:382pt" id="table3">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height:15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Velocidade de processamento das aplicações</td>
</tr>
</table>

<p>
<p><input type="radio" name="a3" value="Option 1" >Excelente</p>
<p><input type="radio" name="a3" value="Option 2" >Bom</p>
<p><input type="radio" name="a3" value="Option 3" >Razoavél</p>
<p><input type="radio" name="a3" value="Option 4" >Fraco</p>
<p><input type="radio" name="a3" value="Option 5" >Não aplicavél</p>
<br>
</p>

<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse: collapse;width:382pt" id="table3">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height:15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Eficácia na resolução de problemas (a resposta resolveu o problema)</td>
</tr>
</table>

<p>
<p><input type="radio" name="b4" value="Option 1" >Excelente</p>
<p><input type="radio" name="b4" value="Option 2" >Bom</p>
<p><input type="radio" name="b4" value="Option 3" >Razoavél</p>
<p><input type="radio" name="b4" value="Option 4" >Fraco</p>
<p><input type="radio" name="b4" value="Option 5" >Não aplicavél</p>
<br>
</p>

<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse: collapse;width:382pt" id="table3">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height:15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Eficiência na resolução de problemas (a resposta foi rápida)</td>
</tr>
</table>

<p>
<p><input type="radio" name="b5" value="Option 1" >Excelente</p>
<p><input type="radio" name="b5" value="Option 2" >Bom</p>
<p><input type="radio" name="b5" value="Option 3" >Razoavél</p>
<p><input type="radio" name="b5" value="Option 4" >Fraco</p>
<p><input type="radio" name="b5" value="Option 5" >Não aplicavél</p>
<br>
</p>

<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse: collapse;width:382pt" id="table3">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height:15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Preocupação da Equipa de Sistemas em me manter informado sobre questões críticas</td>
</tr>
</table>

<p>
<p><input type="radio" name="c6" value="Option 1" >Excelente</p>
<p><input type="radio" name="c6" value="Option 2" >Bom</p>
<p><input type="radio" name="c6" value="Option 3" >Razoavél</p>
<p><input type="radio" name="c6" value="Option 4" >Fraco</p>
<p><input type="radio" name="c6" value="Option 5" >Não aplicavél</p>
<br>
</p>

<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse: collapse;width:382pt" id="table3">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height:15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Adequação das acções preventivas para evitar o aparecer de problemas</td>
</tr>
</table>

<p>
<p><input type="radio" name="c7" value="Option 1" >Excelente</p>
<p><input type="radio" name="c7" value="Option 2" >Bom</p>
<p><input type="radio" name="c7" value="Option 3" >Razoavél</p>
<p><input type="radio" name="c7" value="Option 4" >Fraco</p>
<p><input type="radio" name="c7" value="Option 5" >Não aplicavél</p>
<br>
</p>

<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse: collapse;width:382pt" id="table3">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height:15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Satisfação com a evolução sentida na qualidade de Prestação de Serviço</td>
</tr>
</table>

<p>
<p><input type="radio" name="c8" value="Option 1" >Excelente</p>
<p><input type="radio" name="c8" value="Option 2" >Bom</p>
<p><input type="radio" name="c8" value="Option 3" >Razoavél</p>
<p><input type="radio" name="c8" value="Option 4" >Fraco</p>
<p><input type="radio" name="c8" value="Option 5" >Não aplicavél</p>
<br>
</p>

<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse: collapse;width:382pt" id="table3">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height:15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Qualidade e estado de conservação do equipamento informático</td>
</tr>
</table>

<p>
<p><input type="radio" name="d9" value="Option 1" >Excelente</p>
<p><input type="radio" name="d9" value="Option 2" >Bom</p>
<p><input type="radio" name="d9" value="Option 3" >Razoavél</p>
<p><input type="radio" name="d9" value="Option 4" >Fraco</p>
<p><input type="radio" name="d9" value="Option 5" >Não aplicavél</p>
<br>
</p>

<table x:str border="0" cellpadding="0" cellspacing="0" width="509" style="border-collapse: collapse;width:382pt" id="table3">
<colgroup>
<col width="509" style="width: 382pt">
</colgroup>
<tr height="21" style="height:15.75pt">
<td height="21" width="509" style="height: 15.75pt; width: 382pt; color: #333333; font-family: 'Palatino Linotype', serif; font-size: 10.0pt; font-weight: 400; font-style: normal; text-decoration: none; text-align: general; vertical-align: bottom; white-space: nowrap; border: medium none; padding: 0px">
Satisfação global com o serviço prestado</td>
</tr>
</table>

<p>
<p><input type="radio" name="e" value="Option 1" >Excelente</p>
<p><input type="radio" name="e" value="Option 2" >Bom</p>
<p><input type="radio" name="e" value="Option 3" >Razoavél</p>
<p><input type="radio" name="e" value="Option 4" >Fraco</p>
<p><input type="radio" name="e" value="Option 5" >Não aplicavél</p>
<br>
</p>

<input type="hidden" name="IPLoc" size="1" value="<%= Request.ServerVariables("REMOTE_HOST") %>">
<p><input type="submit" value=" OK "><input type="reset" value=" Reset "></p>

</form>
<% End If
'
Else
'catch all scenario. You don't need this, so you can take it out if you wish.
response.write("<p>You have already taken the quiz</p>")
End If %>
</body>
</html>


Modifications:

1) Commented out the On Error Resume Next. This will force your browser to display errors.

2) Modified the original IF...THEN...ELSEIF...THEN...ELSE...ENDIF statement.

If Cookie = yes then
no form
Elseif Cookie <> Exist
Check db
If in db,
no form
Else
*** Show Form ***
End If
Else
Just in case, no form
End If

3) As much as I like WYSIWYG editors, FP does not write HTML well. I have edited some of the HTML to clean up the FP crap.

Again, this is untested, but my coffee was waning yesterday, and today I have had a fresh cup.

Should work just fine.

HTH!

Supremo
03-30-2007, 04:01 PM
Seems to be close.

It says i've already taken the quiz in first access and doesn't show form. I tested a lil bit and notice that the lines:


If Not fp_rs.EOF Then
'they have taken the quiz, but cleared their cookies.
response.write("<p>You have already done the quiz</p>")

are the last to execute, that "<p>You have already done the quiz</p>" is the last thing showing.

Daemonspyre
04-02-2007, 01:40 PM
Supremo,

Is your IP in the database? Remember, if your cookies are blank and your IP is in the database, then you will have that error come up.

ELSE...

Would you be willing to post your table definitions (either here or in a personal message to me) and I will be happy to get this working for you.

HTH!

Supremo
04-19-2007, 11:00 AM
Hello, i went on vacations and family kinda... enforced a computer free time :cool:

Anyway, i'm gonna try to put the database file online, i guess it's easier to check it out, since i'm not absolutly sure about what u're asking me, i'll try to give u the max info on the meanwhile.

Access 2003 sp2

I have fields: a1, a2, a3, a4, a5, a6, a7, a8, a9, e, IPLoc all with "Data Type" = Text

Single table in the whole DB.
I'm gonna get my attention back on this and post any news.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum