<% Server.ScriptTimeout=5000 %> <% Dim ReptileReptileSpeciesCommonNames Set ReptileSpeciesCommonNames = New HashTable ReptileSpeciesCommonNames.Add "1", "Adder" ReptileSpeciesCommonNames.Add "2", "Smooth snake" ReptileSpeciesCommonNames.Add "3", "Grass snake" ReptileSpeciesCommonNames.Add "4", "Aesculapian snake" ReptileSpeciesCommonNames.Add "5", "Slow worm" ReptileSpeciesCommonNames.Add "6", "Common lizard" ReptileSpeciesCommonNames.Add "7", "Sand lizard" ReptileSpeciesCommonNames.Add "8", "Western green lizard" ReptileSpeciesCommonNames.Add "9", "Common wall lizard" Dim ReptileReptileSpeciesAbbreviation Set ReptileSpeciesAbbreviation = New HashTable ReptileSpeciesAbbreviation.Add "1", "Vb" ReptileSpeciesAbbreviation.Add "2", "Ca" ReptileSpeciesAbbreviation.Add "3", "Nn" ReptileSpeciesAbbreviation.Add "4", "El" ReptileSpeciesAbbreviation.Add "5", "Af" ReptileSpeciesAbbreviation.Add "6", "Zv" ReptileSpeciesAbbreviation.Add "7", "La" ReptileSpeciesAbbreviation.Add "8", "Lb" ReptileSpeciesAbbreviation.Add "9", "Pm" Dim AmphibianReptileSpeciesCommonNames Set AmphibianSpeciesCommonNames = New HashTable AmphibianSpeciesCommonNames.Add "1", "Common frog" AmphibianSpeciesCommonNames.Add "2", "Pool frog" AmphibianSpeciesCommonNames.Add "3", "Marsh frog" AmphibianSpeciesCommonNames.Add "4", "Edible frog" AmphibianSpeciesCommonNames.Add "5", "North-American Bullfrog" AmphibianSpeciesCommonNames.Add "6", "Common toad" AmphibianSpeciesCommonNames.Add "7", "Natterjack toad" AmphibianSpeciesCommonNames.Add "8", "Midwife toad" AmphibianSpeciesCommonNames.Add "9", "Great crested newt" AmphibianSpeciesCommonNames.Add "10", "Palmate newt" AmphibianSpeciesCommonNames.Add "11", "Smooth newt" AmphibianSpeciesCommonNames.Add "12", "Alpine newt" AmphibianSpeciesCommonNames.Add "13", "European tree frog" Dim AmphibianSpeciesAbbreviation Set AmphibianSpeciesAbbreviation = New HashTable AmphibianSpeciesAbbreviation.Add "1", "Rt" AmphibianSpeciesAbbreviation.Add "2", "Pl" AmphibianSpeciesAbbreviation.Add "3", "Rr" AmphibianSpeciesAbbreviation.Add "4", "Re" AmphibianSpeciesAbbreviation.Add "5", "Rc" AmphibianSpeciesAbbreviation.Add "6", "Bb" AmphibianSpeciesAbbreviation.Add "7", "Ec" AmphibianSpeciesAbbreviation.Add "8", "Ao" AmphibianSpeciesAbbreviation.Add "9", "Tc" AmphibianSpeciesAbbreviation.Add "10", "Lh" AmphibianSpeciesAbbreviation.Add "11", "Lv" AmphibianSpeciesAbbreviation.Add "12", "Ma" AmphibianSpeciesAbbreviation.Add "13", "Ha" %> SARG ID Quiz
<% NoReptileSpecies = ReptileSpeciesCommonNames.Count TotalGoofs = CountGoofs() Dim GoofArray(20,20) For F = 1 to NoReptileSpecies For G = 1 to NoReptileSpecies GoofArray(F, G) = GetMatchingGoofs(ReptileSpeciesCommonNames.GetValue(Cstr(F)), ReptileSpeciesCommonNames.GetValue(Cstr(G))) Next 'G Next 'F Dim ColourArray(20,20) For F = 1 to NoReptileSpecies For G = 1 to NoReptileSpecies GoofArray(F, G) = INT(GoofArray(F, G)/TotalGoofs*1000)/10 ColourArray(F,G) = GetColour(GoofArray(F, G)) Next 'G Next 'F %>

Reptiles - N=<%= TotalGoofs %>

<% for F = 1 to NoReptileSpecies %> <% next 'F %> <% For F = 1 to NoReptileSpecies%> <% For G = 1 to NoReptileSpecies %> <% Next 'G %> <% Next 'F %>
Species
pictured
>Species wrongly identified from image
<%= ReptileSpeciesAbbreviation.GetValue(Cstr(F)) %>
<%= ReptileSpeciesAbbreviation.GetValue(Cstr(F)) %><%= GoofArray(F, G) %>%
<% NoAmphibianSpecies = AmphibianSpeciesCommonNames.Count For F = 1 to NoAmphibianSpecies For G = 1 to NoAmphibianSpecies GoofArray(F, G) = GetMatchingGoofs(AmphibianSpeciesCommonNames.GetValue(Cstr(F)), AmphibianSpeciesCommonNames.GetValue(Cstr(G))) Next 'G Next 'F For F = 1 to NoAmphibianSpecies For G = 1 to NoAmphibianSpecies GoofArray(F, G) = INT(GoofArray(F, G)/TotalGoofs*1000)/10 ColourArray(F,G) = GetColour(GoofArray(F, G)) Next 'G Next 'F %>

Amphibians - N=<%= TotalGoofs %>

<% for F = 1 to NoAmphibianSpecies %> <% next 'F %> <% For F = 1 to NoAmphibianSpecies%> <% For G = 1 to NoAmphibianSpecies %> <% Next 'G %> <% Next 'F %>
Species
pictured
>Species wrongly identified from image
<%= AmphibianSpeciesAbbreviation.GetValue(Cstr(F)) %>
<%= AmphibianSpeciesAbbreviation.GetValue(Cstr(F)) %><%= GoofArray(F, G) %>%
<% For F = 1 to NoReptileSpecies For G = 1 to NoAmphibianSpecies GoofArray(F, G) = GetMatchingGoofs(ReptileSpeciesCommonNames.GetValue(Cstr(F)), AmphibianSpeciesCommonNames.GetValue(Cstr(G))) Next 'G Next 'F For F = 1 to NoReptileSpecies For G = 1 to NoAmphibianSpecies GoofArray(F, G) = INT(GoofArray(F, G)/TotalGoofs*1000)/10 ColourArray(F,G) = GetColour(GoofArray(F, G)) Next 'G Next 'F %>

Reptiles to Amphibians - N=<%= TotalGoofs %>

<% for F = 1 to NoAmphibianSpecies %> <% next 'F %> <% For F = 1 to NoReptileSpecies%> <% For G = 1 to NoAmphibianSpecies %> <% Next 'G %> <% Next 'F %>
Species
pictured
>Species wrongly identified from image
<%= AmphibianSpeciesAbbreviation.GetValue(Cstr(F)) %>
<%= ReptileSpeciesAbbreviation.GetValue(Cstr(F)) %><%= GoofArray(F, G) %>%
<% For F = 1 to NoAmphibianSpecies For G = 1 to NoReptileSpecies GoofArray(F, G) = GetMatchingGoofs(AmphibianSpeciesCommonNames.GetValue(Cstr(F)), ReptileSpeciesCommonNames.GetValue(Cstr(G))) Next 'G Next 'F For F = 1 to NoAmphibianSpecies For G = 1 to NoReptileSpecies GoofArray(F, G) = INT(GoofArray(F, G)/TotalGoofs*1000)/10 ColourArray(F,G) = GetColour(GoofArray(F, G)) Next 'G Next 'F %>

Amphibians to Reptiles - N=<%= TotalGoofs %>

<% for F = 1 to NoReptileSpecies %> <% next 'F %> <% For F = 1 to NoAmphibianSpecies%> <% For G = 1 to NoReptileSpecies %> <% Next 'G %> <% Next 'F %>
Species
pictured
>Species wrongly identified from image
<%= ReptileSpeciesAbbreviation.GetValue(Cstr(F)) %>
<%= AmphibianSpeciesAbbreviation.GetValue(Cstr(F)) %><%= GoofArray(F, G) %>%

Individual question analysis

<% For F = 1 to GetNumberOfEntries() %> <% Next 'F %>
Question No.No. wrong answersSpeciesThumbnail
<%= F %> <%= CountWrongAnswers(F) %> <%= GetCommonNameAnswer(F) %> " />
<% FUNCTION GetMatchingGoofs(RightAnswer, WrongAnswer) 'Find path and filename of photograph for this question Dim LineIn Set FS = Server.CreateObject("Scripting.FileSystemObject") Set RS = FS.OpenTextFile(Server.MapPath("/SARG/17000-IDquiz/SARG_Quiz_Goofs.XML"),1) GetMatchingGoofs = 0 KeyStringRight = "" & RightAnswer & "" KeyStringWrong = "" & WrongAnswer & "" Do LineIn = RS.Readline If LineIn = KeyStringRight then LineIn = RS.Readline If LineIn = KeyStringWrong then GetMatchingGoofs = GetMatchingGoofs + 1 End if End If Loop Until (RS.AtEndOfStream) 'Tidy up resources by closing file RS.Close Set FS = Nothing END FUNCTION FUNCTION CountGoofs() 'Find path and filename of photograph for this question Dim LineIn Set FS = Server.CreateObject("Scripting.FileSystemObject") Set RS = FS.OpenTextFile(Server.MapPath("/SARG/17000-IDquiz/SARG_Quiz_Goofs.XML"),1) CountGoofs = 0 KeyString = "" Do LineIn = RS.Readline If left(LineIn,13) = KeyString then CountGoofs = CountGoofs + 1 End If Loop Until (RS.AtEndOfStream) 'Tidy up resources by closing file RS.Close Set FS = Nothing END FUNCTION FUNCTION GetColour(DataValue) If (DataValue > 0) AND (Datavalue < 1) Then GetColour = "black" ElseIf (DataValue >= 1) AND (DataValue < 2) Then GetColour = "yellow" ElseIf (DataValue >= 2) AND (DataValue < 4) Then GetColour = "orange" ElseIf (DataValue >= 5) Then GetColour = "red" Else ColourArray(F,G) = "black" End if END FUNCTION FUNCTION CountWrongAnswers(QuestionNumber) 'Find path and filename of photograph for this question Dim LineIn Set FS = Server.CreateObject("Scripting.FileSystemObject") Set RS = FS.OpenTextFile(Server.MapPath("/SARG/17000-IDquiz/SARG_Quiz_Goofs.XML"),1) CountWrongAnswers = 0 KeyString = "" & QuestionNumber & "" Do LineIn = RS.Readline If LineIn = KeyString then CountWrongAnswers = CountWrongAnswers + 1 End If Loop Until (RS.AtEndOfStream) 'Tidy up resources by closing file RS.Close Set FS = Nothing END FUNCTION FUNCTION GetNumberOfEntries() Dim LineIn Set FS = Server.CreateObject("Scripting.FileSystemObject") Set RS = FS.OpenTextFile(Server.MapPath("/SARG/17000-IDquiz/SARG_Quiz.XML"),1) GetNumberOfEntries = 0 Do LineIn = RS.Readline If LineIn = "" then GetNumberOfEntries = GetNumberOfEntries + 1 end if Loop Until (RS.AtEndOfStream) 'Tidy up resources by closing file RS.Close Set FS = Nothing END FUNCTION FUNCTION GetPictureURL(PictureNumber) 'Find path and filename of photograph for this question Dim LineIn, Line Set FS = Server.CreateObject("Scripting.FileSystemObject") Set RS = FS.OpenTextFile(Server.MapPath("/SARG/17000-IDquiz/SARG_Quiz.XML"),1) counter = 0 Do Do LineIn = RS.Readline Loop Until (LineIn = "") OR (LineIn = "" ) If LineIn <> "" then LineIn = RS.Readline Line = RemoveXMLtag(LineIn) 'response.write("Line: " & Line & "
") if Cint(Line) = Cint(PictureNumber) Then LineIn = RS.Readline LineIn = RS.Readline 'response.write("LineIn: " & LineIn & "
") GetPictureURL = RemoveXMLtag(LineIn) end if End if Loop Until (RS.AtEndOfStream) 'Tidy up resources by closing file RS.Close Set FS = Nothing END FUNCTION FUNCTION GetCommonNameAnswer(QuizNumber) 'Find path and filename of photograph for this question Dim LineIn, Line Set FS = Server.CreateObject("Scripting.FileSystemObject") Set RS = FS.OpenTextFile(Server.MapPath("/SARG/17000-IDquiz/SARG_Quiz.XML"),1) counter = 0 Do Do LineIn = RS.Readline Loop Until (LineIn = "") OR (LineIn = "" ) If LineIn <> "" then LineIn = RS.Readline 'quiz question number 'response.write("Q number: " & LineIn & "
") Line = RemoveXMLtag(LineIn) if Cint(Line) = Cint(QuizNumber) Then LineIn = RS.Readline 'Reptile or Amphibian LineIn = RS.Readline 'Image URL LineIn = RS.Readline 'Common Name 'response.write("Common Name: " & LineIn & "
") GetCommonNameAnswer = RemoveXMLtag(LineIn) end if End if Loop Until (RS.AtEndOfStream) 'Tidy up resources by closing file RS.Close Set FS = Nothing END FUNCTION FUNCTION RemoveXMLtag(XMLstring) Position = Cint(InStr(1, Cstr(XMLstring), ">", 1)) Start = Position + 1 Length = Len(Cstr(XMLstring)) - Position - Position -1 RemoveXMLtag = mid(Cstr(XMLstring), Start, Length) END FUNCTION %>