<%@ LANGUAGE=VBSCRIPT %> <% 'Variables Dim Name, cStandAns, grades, trynums Dim DB_CONNECTIONSTRING, defaultQuestions 'grades = 0 'Editable Dim ansText(50) ' Correct or Incorrect Dim studAns(50) ' Student answers array Dim standAns(50) ' Standard answers array defaultQuestions = 9 ' If you want to add in more question, make sure the NAME in the HTML tag and ' the array index are in running sequence. %> <% 'Functions Sub getStandAnsRec(connectionStr, tablename) Dim objRecordset, conn Set conn=Server.CreateObject("ADODB.Connection") conn.Open connectionStr cStandAns = 0 Set objRecordset = Server.CreateObject("ADODB.Recordset") objRecordset.Open "SELECT * FROM " & tablename, conn,1,3 if not objRecordset.EOF then while not objRecordset.EOF standAns(cStandAns) = objRecordset("Observations") objRecordset.MoveNext() cStandAns = cStandAns + 1 wend end if objRecordset.close conn.close conn = null End Sub Sub addNewStudAnsRec(connectionStr, tablename, grades, trynums) Dim objRecordset, conn Set conn=Server.CreateObject("ADODB.Connection") conn.Open connectionStr Set objRecordset = Server.CreateObject("ADODB.Recordset") objRecordset.Open tablename, connectionStr, adOpenStatic, adLockPessimistic objRecordset.AddNew objRecordset.Fields("Name") = Name objRecordset.Fields("userName") = Session("MyRealName") objRecordset.Fields("Class") = Session("MyClass") objRecordset.Fields("Date Added") = Now() 'Editable If studAns(0) <> "" Then objRecordset.Fields("Ans 1") = studAns(0) End If If studAns(1) <> "" Then objRecordset.Fields("Ans 2") = studAns(1) End If If studAns(2) <> "" Then objRecordset.Fields("Ans 3") = studAns(2) End If If studAns(3) <> "" Then objRecordset.Fields("Ans 4") = studAns(3) End IF If studAns(4) <> "" Then objRecordset.Fields("Ans 5") = studAns(4) End If If studAns(5) <> "" Then objRecordset.Fields("Ans 6") = studAns(5) End If If studAns(6) <> "" Then objRecordset.Fields("Ans 7") = studAns(6) End If If studAns(7) <> "" Then objRecordset.Fields("Ans 8") = studAns(7) End If If studAns(8) <> "" Then objRecordset.Fields("Ans 9") = studAns(8) End If objRecordset.Fields("Grades") = grades objRecordset.Fields("Try Number") = trynums objRecordset.Update objRecordset.Close conn.close conn = null End Sub Function concate (studAns) studAns = Replace(studAns, "vbCrLf", " ") studAns = Replace(studAns, ",", " ") studAns = Replace(studAns, ".", " ") studAns = Replace(studAns, ";", " ") studAns = Replace(studAns, "_", " ") studAns = Replace(studAns, "-", " ") studAns = Replace(studAns, "precipitate", "ppt ") studAns = Replace(studAns, "sol ", "solution ") studAns = Replace(studAns, "visible ", "apparent ") studAns = Replace(studAns, "relights ", "rekindled ") studAns = Replace(studAns, "decolorise ", "turned colourless ") studAns = Replace(studAns, "dissolves ", "dissolved ") studAns = Replace(studAns, "dissolved ", "dissolved ") studAns = Replace(studAns, "turn ", "turned ") studAns = Replace(studAns, "evolve ", "evolved ") studAns = Replace(studAns, "form ", "formed ") studAns = Replace(studAns, "pale ", "light ") studAns = Replace(studAns, "deep ", "dark ") studAns = Trim(studAns) Do While InStr(1, studAns, " ") studAns = Replace(studAns, " ", " ") Loop End Function Function isAnswerCorrect(standAns, studAns) Dim i, ansFound Dim standAnsArr, studAnsArr Call concate (studAns) studAnsArr = Split(studAns, " ") standAnsArr = Split(standAns, " ") For i = 0 to UBound(standAnsArr) ansFound = false For j = 0 to UBound(studAnsArr) if LCase(studAnsArr(j)) = LCase(standAnsArr(i)) then ansFound = true Exit For end if next if ansFound = false then isAnswerCorrect = false Exit Function end if next isAnswerCorrect = true End Function %> <% ' Conditions DB_CONNECTIONSTRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.Mappath("checkdata.mdb") & ";" if Request.Form("Submit") = "Submit Answers" Then Name = Session("MyName") trynums = Session("trynums") Call getStandAnsRec(DB_CONNECTIONSTRING, "2001") if trynums = "" then trynums = 1 else trynums = CInt(trynums) + 1 end if Session("trynums") = trynums For i = 0 To defaultQuestions studAns(i) = Request.form("q" & (i+1)) Next grades = -1 'if trynums < 2 then ' For i = 0 To defaultQuestions ' if isAnswerCorrect(standAns(i), studAns(i)) then ' ' grades = grades + 1 ' ' ansText(i) = "Correct" ' else ' ansText(i) = "Incorrect" ' end if ' Next 'else ' For i = 0 To defaultQuestions ' if isAnswerCorrect(standAns(i), studAns(i)) then ' grades = grades + 1 ' ansText(i) = "Correct
" & standAns(i) ' else ' ansText(i) = "Incorrect
" & standAns(i) ' end if ' Next 'end if Call addNewStudAnsRec(DB_CONNECTIONSTRING, "stuans2001", grades, trynums) End If ' grades = 0 %> Virtual CrezLab - Qualitative Analysis - The Laboratory Challenge
 
 
 


The Laboratory Challenge

Lab Challenge 5

Modified GCE `O' Level Chemistry Practical

Observe the following demo experiment on solution S. Record your observations in the table given. You should identify and name any gas evolved.

Solution S
Test
Play Movie
Observations

1a) To a portion of solution S, add aqueous sodium hydroxide until a change is seen.

b) Add excess aqueous sodium hydroxide to the mixture from (a).

1a)
Ask the expert

1b)
Ask the expert

2a) To a portion of solution S, add aqueous ammonia until a change is seen.

b) Add excess aqueous ammonia to the mixture from (a).

2a)
Ask the expert

2b)
Ask the expert

3a) To a portion of solution S, add an equal volume of aqueous Barium nitrate and leave to stand fora few minutes.

b) Add dilute nitric acid to the mixture in (a).

3a)
Ask the expert


Ask the expert

4) To a portion of S in a boiling tube, slowly add an equal volume of aqueous sodium chlorate(I).Warm the mixture from (a) gently. Allow the mixture to cool and use it for Test 5.

4)
Ask the expert

5) To the mixture in Test 4, add an equal volume of aqueous hydrogen peroxide.

5)
Ask the expert

Conclusions
The formula of the anion (negative ion) present in solution S is


 

<% 'Else 'Session("trynums") = "" 'End if%>

Prev     1     2     3     4     5     Next

Copyright © 2001 Crescent Girls' School, ASKnLearn.com Pte Ltd.

All rights reserved.