Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<%@LANGUAGE="VBSCRIPT" %>
<!--#include file="Connections/LearningSite.asp" -->
<%Response.Buffer = true %>
<%On Error Resume Next%>
<% Dim UserNameVar
UserNameVar = ""
Dim PasswordVar
PasswordVar = ""
UserNameVar = Request.form("UserName")
PasswordVar = Request.form("Password")
%>
<%
ActivityIDVar = Request.form("ActivityIDfield")
if ActivityIDVar = "" then ActivityIDVar = Request.querystring("ActivityID")
ActivityNameVar = Request.form("ActivityNamefield")
if ActivityNameVar = "" then ActivityNameVar = Request.querystring("ActivityName")
ReferringPage = Request.form("ReferringPagefield")
if ReferringPage = "" then ReferringPage = Request.querystring("ReferringPage")
%>
<%'Check to see if the Activity exists. If not- add it.
SQLString = "SELECT * FROM Activities WHERE ActivityID ='" & ActivityIDVar & "';"
set CheckActivity = Server.CreateObject("ADODB.Recordset")
CheckActivity.ActiveConnection = MM_LearningSite_STRING
CheckActivity.Source = SQLString
CheckActivity.CursorLocation = 2
CheckActivity.LockType = 1
CheckActivity.Open
if Err.Number <> 0 then
Response.write "The following Error has occured:<br>"& Err.description & "<br>On line: " & Err.Line
Response.write "<br>"
end if
If CheckActivity.Fields.Item("ActivityName").Value = "" then
SQLString = "INSERT INTO Activities (ActivityID, ActivityName, ActivityURL) VALUES ('" & ActivityIDVar & "', '" & ActivityNameVar & "', '" & ReferringPage & "');"
set CheckActivity = Server.CreateObject("ADODB.Recordset")
CheckActivity.ActiveConnection = MM_LearningSite_STRING
CheckActivity.Source = SQLString
CheckActivity.CursorLocation = 2
CheckActivity.LockType = 3
CheckActivity.Open
end if
Err.Clear%>
<html>
<head>
<title>Student Login</title>
</head>
<body bgcolor="#FFFFFF">
<%' Have they entered the info?
if Request.Form("Submit") = "Login" then ' they have pressed the Login button.
if (UserNameVar <> "")=True AND (PasswordVar <> "")=True then 'Are there values in the Name & Password?
%>
<b>
<% ' check to see if they are a student
SQLString = "SELECT * FROM Student_Data WHERE Student_Data.UserID = '"& UserNameVar& "' AND Student_Data.Password= '" & PasswordVar & "';"
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_LearningSite_STRING
Recordset1.Source = SQLString
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open
%>
</b>
<%
'if Err.Number = 0 then
if NOT Recordset1.EOF then
' -- Delete Session ID
SQLString = "DELETE * FROM Session_IDs WHERE UserID ='" & UserNameVar & "' AND ActivityID='" & ActivityIDVar & "';"
' finish the sql and execute it
Set sessionDelete = Server.CreateObject("ADODB.Command")
sessionDelete.ActiveConnection = MM_LearningSite_STRING
sessionDelete.CommandText = SQLString
sessionDelete.Execute
%>
<%
'-- Write in new SessionID info
SQLString = "INSERT INTO Session_IDs (UserID, ActivityID) VALUES ('"& UserNameVar &"', '" & ActivityIDVar & "');"
' finish the sql and execute it
set sessionInsert = Server.CreateObject("ADODB.Recordset")
sessionInsert.ActiveConnection = MM_LearningSite_STRING
sessionInsert.Source = SQLString
sessionInsert.Open
Dan = sessionInsert("SessionID")
%>
<%'block 4 was moved to block 8 due to a speed issue. Renumber when possible.%>
<%
' -- Delete Activity_Detail
SQLString = "DELETE * FROM Activity_Detail WHERE UserID ='" & UserNameVar & "' AND ActivityID='" & ActivityIDVar & "';"
' finish the sql and execute it
Set detailDelete = Server.CreateObject("ADODB.Command")
detailDelete.ActiveConnection = MM_LearningSite_STRING
detailDelete.CommandText = SQLString
detailDelete.Execute
%>
<%
'-- Delete Activity_Status
%>
<%
set GetStatus = Server.CreateObject("ADODB.Recordset")
GetStatus.ActiveConnection = MM_LearningSite_STRING
GetStatus.Source = "SELECT Status FROM Activity_Status WHERE UserID= '" & UserNameVar & "' AND ActivityID = '" & ActivityIDVar & "';"
GetStatus.CursorType = 0
GetStatus.CursorLocation = 2
GetStatus.LockType = 3
GetStatus.Open()
GetStatus_numRows = 0
StatusVar = GetStatus.Fields.Item("Status").Value
if StatusVar = "" then
'do optional update
end if
'-- Write in Activity_Status
if StatusVar = "" then
SQLString = "INSERT INTO Activity_Status (ActivityID, ActivityName, UserID, ActivityDate, Location, Status) VALUES ('"&ActivityIDVar&"', '"&ActivityNameVar&"', '"&UserNameVar&"', '"& Date() & "', '"& "" &"', '"& StatusVar &"');"
else
SQLString = "UPDATE Activity_Status SET ActivityDate='" & Date() & "', Status='" & StatusVar & "' WHERE UserID= '" & UserNameVar & "' AND ActivityID = '" & ActivityIDVar & "';"
end if
set Recordset7 = Server.CreateObject("ADODB.Recordset")
Recordset7.ActiveConnection = MM_LearningSite_STRING
Recordset7.Source = SQLString
Recordset7.CursorType = 0
Recordset7.CursorLocation = 2
Recordset7.LockType = 3
Recordset7.Open
%>
<%' ----------------------------------------------------------------------------------------
' add a delay
for i=1 to 100000
next
'-- Get new SessionID
SQLString = "Select * From Session_IDs Where UserID= '" & UserNameVar & "' AND ActivityID = '"&ActivityIDVar&"';"
response.write ("<br>GetSID<br>" & SQLString & "<br><br>" )
set GetSID = Server.CreateObject("ADODB.Recordset")
GetSID.ActiveConnection = MM_LearningSite_STRING
GetSID.Source = SQLString
GetSID.CursorType = adOpenStatic
GetSID.CursorLocation = 2
GetSID.LockType = 1
GetSID.Open
response.write "Count: " & GetSID.recordcount & "<br>"
AICC_SessionID = GetSID.Fields.Item("SessionID").Value
err.clear
'End if
response.write "AICC_SessionID=" & AICC_SessionID & "<br>"
' ---------------------------------------------------------------------------------------- %>
<% 'if AICC_SessionID > 0 then
response.redirect referringpage & "?aicc_sid="& AICC_SessionID & "&aicc_URL=initializing"
else 'record was not found
%>
<script language = "javascript">
alert("That user was not found.")
{history.back()}
</script>
<% end if 'was student record found? %>
<% else 'Username and Password are not both filled out
%>
<script language = "javascript">
alert("You must enter a UserName and a Password.")
{history.back()}
</script>
<%'response.write ("You must enter a UserName and a Password.")
end if ' were UserName & Password filled out?
else 'no submit button or one of the fields is null
%>
<form name="form1" method="post" action="studentLogin.asp">
<table width="270" border="0" align="center">
<tr name="login">
<td> </td>
<td><img src="images/login.gif" name="login" alt="Login"></td>
</tr>
<tr>
<td>
<div align="right">User ID: </div>
</td>
<td>
<input type="text" name="UserName" value="<%= Request.Form("UserName") %>">
</td>
</tr>
<tr>
<td>
<div align="right">Password: </div>
</td>
<td>
<input type="password" name="Password" value="<%= Request.Form("Password") %>">
</td>
</tr>
<tr>
<td> </td>
<td>
<input type="reset" name="Reset" value="Reset">
<input type="submit" name="Submit" value="Login">
<input type="hidden" name="ActivityIDfield" value="<%=Request.querystring("ActivityID")%>">
<input type="hidden" name="ActivityNameField" value="<%=Request.querystring("ActivityName")%>">
<input type="hidden" name="ReferringPagefield" value="<%=Request.querystring("ReferringPage")%>">
</td>
</tr>
</table>
</form>
<p>
<%end if 'check for submit button
%>
</p>
<p> </p>
</body>
</html>
<%
GetStatus.Close()
%>
<html>
<head>
<title>Practise Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language='JavaScript' src='scripts/behActions.js'></script>
<script language='JavaScript' src='scripts/behCourseBuilder.js'></script>
<script language='JavaScript' src='scripts/behDragLayer.js'></script>
<script language='JavaScript' src='scripts/behTimeline.js'></script>
<script language='JavaScript' src='scripts/cmi.js'></script>
<script language='JavaScript' src='scripts/elemDragClass.js'></script>
<script language='JavaScript' src='scripts/elemHotaClass.js'></script>
<script language='JavaScript' src='scripts/elemIbtnClass.js'></script>
<script language='JavaScript' src='scripts/elemInptClass.js'></script>
<script language='JavaScript' src='scripts/elemSldrClass.js'></script>
<script language='JavaScript' src='scripts/elemTextClass.js'></script>
<script language='JavaScript' src='scripts/elemTimrClass.js'></script>
<script language='JavaScript' src='scripts/interactionClass.js'></script>
<script language="JavaScript" name="cmifrag">
<!--
//CMI tracking code inserted by CourseBuilder for Dreamweaver
//Copyright 1998-2001 Macromedia, Inc. All rights reserved.
function findcmiframe(sp) {
if (sp==null) sp=window.parent;
if (sp.frames.length && sp.MM_cmiframe != null)
return sp.MM_cmiframe;
else if (sp != window.top)
return findcmiframe(sp.parent);
else return null;
}
var aurl;
function setaurl(url) {
tmpp=url.toUpperCase();
if ((pos=tmpp.indexOf('AICC_URL'))>-1) {
aurl=url.substring(pos+9,url.length);
if (aurl.indexOf('&')>0)
aurl=aurl.substring(0,aurl.indexOf('&'));
aurl=unescape(aurl);
var tmpurl = window.location.href;
tmpurl = tmpurl.substring(0,tmpurl.lastIndexOf('/'));
if (aurl.indexOf('/')==-1){
aurl=tmpurl+"/"+aurl;
}
else if (aurl.indexOf('./')==0){
aurl=tmpurl + aurl.substring(1,aurl.length);
}
else if (aurl.indexOf("http")==-1){
aurl="[URL unfurl="true"]http://"+aurl;[/URL]
}
return true;
}
return false;
}
function fndUrl(win) {
if (setaurl(win.document.location+'') == false) {
if (win == window.top) return false;
return (fndUrl(win.parent));
}
return true;
}
if (findcmiframe(null)==null) {
var cmi;
if (document.command == null) {
if (fndUrl(window)) {
document.write('<form action='+aurl+' method=\'POST\' target=\'cmiresults\' name=\'command\'><input type=\'hidden\' name=\'command\'><input type=\'hidden\' name=\'session_id\'><input type=\'hidden\' name=\'version\' value=\'2.0\'><input type=\'hidden\' name=\'aicc_data\'></form>');
}}
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" onLoad="MM_initInteractions()">
<interaction name="Text_Singleline01" object="G01" template="050_Text Entry/010_Text_Singleline_03.agt" includesrc="interactionClass.js,elemTextClass.js">
<div name="G01Layer">
<div align="center">
<p><span name="G01question"><strong><font size="2" face="Arial, Helvetica, sans-serif">Practice
Test </font></strong><br>
</span></p>
<p><font size="2" face="Arial, Helvetica, sans-serif">This is your chance to practice
the typing test before doing it for real.</font></p>
<p><font size="2" face="Arial, Helvetica, sans-serif">Simply copy the text below into
the box provided. Trying to type as quickly and accuratly as possible.</font></p>
<table width="900" border="1">
<tr>
<td><font size="3" face="Arial, Helvetica, sans-serif">From April 2003 changes
to the policing boundaries in Worcestershire will enable West Mercia
Constabulary to work more closely in partnership with local authorities
to tackle crime and improve the quality of the life for local communities.
Following a detailed consultation programme, the force has established
a new structure to re-align divisional boundaries to coincide with those
of local authority areas across the county. Worcestershire will be served
by two divisions – North Worcestershire, which will cover Bromsgrove,
Redditch and Wyre Forest Council areas and South Worcestershire, embracing
the whole of Malvern Hills, Worcester City and Wychavon Council areas.
The new arrangements will provide greater opportunities for the police
and other agencies to work towards joint performance targets for the
benefits of local communities. They will also further enhance partnership
working in such areas as youth offending teams, the management of potentially
dangerous offenders and child protection issues.</font></td>
</tr>
</table>
<p> </p>
</div>
<form name="G01elem" onSubmit="return false">
<div align="center">
<textarea name="G01elemInp" cols="145" rows="10" onFocus="G01.e['elem'].focus()" onBlur="G01.e['elem'].update()"></textarea>
</div>
</form>
<form name="G01controls">
<div align="center">
<input name="G01judge" type="BUTTON" value="Submit" onClick="MM_judgeInt('G01')">
<input name="G01reset" type="BUTTON" value="Reset" onClick="MM_resetInt('G01','reset')">
</div>
</form>
</div>
<script language="JavaScript">
<!--
// Copyright 1998,1999 Macromedia, Inc. All rights reserved.
function newG01() {
G01 = new MM_interaction('G01',0,0,1,null,0,1,90,'Practice','','f','0',1);
G01.add('text','elem','');
G01.add('textComp','elem','Response1','25-32-###-wlaoksrjfdda1AS',1,1,1,1);
G01.init();
G01.am('segm','Segment: Check Time_',1,1);
G01.am('cond','Time At Limit_','G01.timeAtLimit == true',0);
G01.am('actn','Popup Message','MM_popupMsg(\'You are out of time\')','pm');
G01.am('actn','Set Interaction Properties: Disable Interaction','MM_setIntProps(\'G01.setDisabled(true);\')','sp');
G01.am('end');
G01.am('segm','Segment: Correctness_',1,0);
G01.am('cond','Correct_01','G01.correct == true',0);
G01.am('actn','Popup Message','MM_popupMsg(\'Correct\')','pm');
G01.am('end');
G01.am('cond','Incorrect_01','G01.correct == false',0);
G01.am('actn','Popup Message','MM_popupMsg(\'Incorrect\')','pm');
G01.am('end');
G01.am('cond','Unknown Response_','G01.knownResponse == false',0);
G01.am('actn','Popup Message','MM_popupMsg(\'Unknown Response\')','pm');
G01.am('end');
G01.am('segm','Segment: Check Tries_',1,1);
G01.am('cond','Tries At Limit_','G01.triesAtLimit == true',0);
G01.am('actn','Popup Message','MM_popupMsg(\'You are out of tries\')','pm');
G01.am('actn','Set Interaction Properties: Disable Interaction','MM_setIntProps(\'G01.setDisabled(true);\')','sp');
G01.am('end');
}
if (window.newG01 == null) window.newG01 = newG01;
if (!window.MM_initIntFns) window.MM_initIntFns = ''; window.MM_initIntFns += 'newG01();';
//-->
</script>
<cbi-select object="G01"></interaction>
</body>
</html>
<input type="hidden" name="ReferringPagefield" value="<%=Request.querystring("ReferringPage")%>">
to
<input type="hidden" name="ReferringPagefield" value="<%=
%>">