<% Const adOpenForwardOnly = 0 Const adOpenKeyset = 1 Const adOpenDynamic = 2 Const adOpenStatic = 3 Const adLockReadOnly = 1 Const adLockPessimistic = 2 Const adLockOptimistic = 3 Const adLockBatchOptimistic = 4 ordre = Request.QueryString("ordre") Set dcnDB = Server.CreateObject("ADODB.Connection") %> <% dcnDB.Open strDatabaseLocation strSQL = "SELECT * FROM Usagers " strSQL = strSQL & " WHERE " strSQL = strSQL & " Usager = '" & Session("UserID") & "' " strSQL = strSQL & " AND motdepasse = '" & Session("Motdepasse") & "' " Set rsProd = dcnDB.Execute(strSQL) strSQL = "SELECT * FROM Questionnaire " If (ordre = 1) Then strSQL = strSQL & " ORDER BY Nom, date_ordre DESC" End If If (ordre = 2) Then strSQL = strSQL & " ORDER BY date_ordre DESC, Nom" End If If (ordre = 3) Then strSQL = strSQL & " ORDER BY NoteNumerique DESC, date_ordre DESC, Nom" End If Set rsProd = dcnDB.Execute(strSQL) %> Netquiz : Résultats

Résultats des participants

<% ij = 0 Do While Not rsProd.EOF Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" ij = ij + 1 rsProd.MoveNext Loop %>
Date et heure

Nom

Titre

Note

" Response.Write rsProd("date_heure") & "" Response.Write rsProd("nom") & "

" & rsProd("titre") & "

" & rsProd("note") & "



Statistiques

<% If (ij > 0) Then strSQL = "SELECT * FROM Questionnaire" Set rsProd = dcnDB.Execute(strSQL) ' Do While Not rsProd.EOF titre = rsProd("Titre") Response.Write "" Response.Write "" strSQL = "SELECT COUNT(*) FROM Questionnaire" Set rsProd2 = dcnDB.Execute(strSQL) nombre = rsProd2(0) Response.Write "" strSQL = "SELECT * FROM Questionnaire" Set rsProd2 = dcnDB.Execute(strSQL) mini = 1000.0 maxi = 0.0 moyenne = 0.0 n_mini = "" n_maxi = "" n = 0 total = 100 test = FormatNumber(total, 2, -1) If (inStr(1, test, ".", 1) > 0) Then delimiteur = "." End If If (inStr(1, test, ",", 1) > 0) Then delimiteur = "," End If Do While Not rsProd2.EOF note = rsProd2("note") i = inStr(1, note, " / ", 1) x0 = Mid(note, 1, i) x0 = Replace(x0, ".", delimiteur) x0 = Replace(x0, ",", delimiteur) y0 = Mid(note, i+3, len(note)) y0 = Replace(y0, ".", delimiteur) x0 = Replace(x0, ",", delimiteur) x = CCur(x0) y = CCur(y0) if (y > 0.0) Then numerateur = x * 100.0 / y moyenne = moyenne + numerateur n = n + 1 if (numerateur < mini) Then mini = numerateur n_mini = FormatNumber(x, 2, -1) & " / " & FormatNumber(y, 2, -1) End If if (numerateur >= maxi) Then maxi = numerateur n_maxi = FormatNumber(x, 2, -1) & " / " & FormatNumber(y, 2, -1) End If End If ' Ramener sur 100 rsProd2.MoveNext Loop if (n > 0) then moyenne = moyenne / n End if Response.Write "" Response.Write "" Response.Write "" Response.Write "" ' Rangee vide Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" strSQL = "SELECT MAX(NoQuestion) FROM RESULTAT_QUESTION" Set rsProd3 = dcnDB.Execute(strSQL) max_q = rsProd3(0) For j = 1 to max_q strSQL = "SELECT * FROM RESULTAT_QUESTION WHERE NoQuestion LIKE '" & j & "'" Set rsProd3 = dcnDB.Execute(strSQL) ' Questions mini = 1000.0 maxi = 0.0 moyenne = 0.0 n_mini = "" n_maxi = "" n = 0 Do While Not rsProd3.EOF id = rsProd3("ID_Participant") strSQL = "SELECT COUNT(*) FROM Questionnaire WHERE participantID LIKE '" & id & "'" Set rsProd4 = dcnDB.Execute(strSQL) If (rsProd4(0) > 0) Then note = rsProd3("resultat") i = inStr(1, note, " / ", 1) x0 = Mid(note, 1, i) x0 = Replace(x0, ".", delimiteur) x0 = Replace(x0, ",", delimiteur) y0 = Mid(note, i+3, len(note)) y0 = Replace(y0, ".", delimiteur) x0 = Replace(x0, ",", delimiteur) x = CCur(x0) y = CCur(y0) if (y > 0.0) Then numerateur = x * 100.0 / y moyenne = moyenne + numerateur n = n + 1 if (numerateur < mini) Then mini = numerateur n_mini = FormatNumber(x, 2, -1) & " / " & FormatNumber(y, 2, -1) End If if (numerateur >= maxi) Then maxi = numerateur n_maxi = FormatNumber(x, 2, -1) & " / " & FormatNumber(y, 2, -1) End If End If End If rsProd3.MoveNext Loop ' Ramener sur 100 if (n > 0) then moyenne = moyenne / n Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" End if rsProd3.Close Next Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" 'rsProd.MoveNext 'Loop rsProd2.Close End If %>

Titre

Nombre de participants

Note minimale

Note maximale

Moyenne

" & titre & "

" & nombre & "

" & n_mini & "

" & n_maxi & "

" & FormatNumber(moyenne, 2, -1) & " %

 

Question " & j & "

" & n & "

" & n_mini & "

" & n_maxi & "

" & FormatNumber(moyenne, 2, -1) & " %

 

<% rsProd.Close dcnDB.Close %>