Learning Site Question

This is a discussion on "Learning Site Question" within the Classic ASP section. This forum, and the thread "Learning Site Question are both part of the Program Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Closed Thread
 
LinkBack Thread Tools
  #1  
Old Sep 24th, 2004, 20:46
New Member
Join Date: Sep 2004
Location: Germany
Age: 44
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Learning Site Question

Sorry to trouble you with this, but I don't know ASP very well. I have created some quizzes with Macromedia Learning Site and everything is working except for one thing. I can't get the text input from a textbox via form input to write into one column in an Access database. It writes everything that it is supposed to except the columns to the right are filled with text that should be in the previous column. I am pasting the code below. What can I change to make the textbox input stay in one column. Anytime there is more than one word entered in the textbox, it carries over to the next column. How can I tell it this is a string of data please? The textboxes (in this case) are ReceivedData(6) and ReceivedData(5).

I am having whitespace problems and I can't figure out what to insert and where.

I am really desperate for an answer and your whitespace article on your wesite seemed to be the answer, but I can't seem to get it to work.

If you need to look at the files, I can provide them by email.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old Sep 25th, 2004, 03:32
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
You forgot to paste your code.
( I don't know the answer to your question, but I'm sure our many ASP gurus will )
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Sep 25th, 2004, 08:00
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 23
Posts: 1,668
Blog Entries: 1
Thanks: 1
Thanked 4 Times in 4 Posts
doesnt sound like an ugly problem.
you've probably just got the field names wrong somewhere.

post a link so we can have a look
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old Sep 25th, 2004, 14:45
New Member
Join Date: Sep 2004
Location: Germany
Age: 44
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
I can't post a link to it as it lives on my laptop and our School Intranet. I can email the files to you if at all possible.
Would you consider this as an option???

I have to say, that my first impression of this forum is EXCELLENT!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #5  
Old Sep 26th, 2004, 13:18
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,160
Blog Entries: 7
Thanks: 27
Thanked 19 Times in 16 Posts
Hi Barlows...

Is it possible you can paste the section of code thats throwing an error? We should sort this pretty quick at that point.

Welcome to Webforumz.com!! :wink:
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #6  
Old Sep 26th, 2004, 13:26
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,160
Blog Entries: 7
Thanks: 27
Thanked 19 Times in 16 Posts
I will say barlows to just make sure text field names are contained in quotes. Also, make sure values (If you set default ones) are contained in quotes too. Also, make sure that you escape apostrophes from your SQL when you do a database update / insert.

Example of a WRONG input element
Code: Select all
<input type=text name=mytextbox value=This is my textbox value />
This however, is CORRECT:-[code][code]<input type="text" name="mytextbox" value="This is my textbox value" />[/code]

When updating or inserting to the database, make sure you escape apostrophes, like this:-[code]mytextbox1 = request.form("mytextbox1")
mytextbox1 = replace(mytextbox1,"'","''")
mytextbox2 = request.form("mytextbox2")
mytextbox2 = replace(mytextbox2,"'","''")

SQL = "INSERT INTO MYTABLE (mytextbox1, mytextbox2) VALUES ('" _
& mytextbox1 & "', '" _
& mytextbox2 & "')"[/code]

Hope this helps.
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #7  
Old Sep 26th, 2004, 14:59
New Member
Join Date: Sep 2004
Location: Germany
Age: 44
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for the reply Rob, it helped me understand ASP better, but did not help my problem. The problem is whitespaces.

Here is a snippet of the code that "I think" might be the problem. the section 'Build SQLString based on that data is where I think there might be a way to handle the whitespace issue. I hope this is enough to solve my problem.

Code: Select all
<form name="form1" method="post" action="">
  <input type="hidden" name="session_id">
  <input type="hidden" name="Date">
  <input type="hidden" name="aicc_data">
</form>

<%' Get the UserID and ActivityID from the Session_IDs Table
  SQLString = "SELECT Session_IDs.UserID, Session_IDs.ActivityID FROM Session_IDs WHERE Session_IDs.SessionID=" & request.form("session_id") & ";"

  set Recordset1 = Server.CreateObject("ADODB.Recordset")
  Recordset1.ActiveConnection = MM_LearningSite_STRING
  Recordset1.Source = SQLString
  Recordset1.CursorType = 0
  Recordset1.CursorLocation = 2
  Recordset1.LockType = 3
  Recordset1.Open
  Recordset1_numRows = 0

' assign values to variables
  UserIDVar = Recordset1.Fields.Item("UserID").Value 
  ActivityIDVar = Recordset1.Fields.Item("ActivityID").Value%>

<%' --------------------------------------------------------
 if request.form("command") = "initialize" then
' clear out status table
' clear out details table
end if%> 

<%' Here is where the different commands are processed.
' --------------------------------------------------------

if request.form("command") = "putinteractions" then
  'Get aicc data that CourseBuilder based objects are sending
  ReceivedString = request.form("aicc_data")
  
  ' get the second return delimited block of data

  if (InStr(ReceivedString, Chr(13)&Chr(10)) = 0) then
    ReceivedString = replace(ReceivedString, "latency""", "latency"""&Chr(13)&Chr(10))
  end if

  ReceivedDataTemp = Split(ReceivedString, Chr(13)&Chr(10))
  ReceivedData = ReceivedDataTemp(1)
  
 'remove the quotes from the Data
  ReceivedData = replace(ReceivedData, """", "")

  ' make the data into an array for easier reference
  ReceivedData = Split(ReceivedData)

  ' clean up each position - take out the extra commas 
 for index = 0 to UBound(ReceivedData)
   if Right(ReceivedData(index), 1) = "," then
        ReceivedData(index) = Left(ReceivedData(index), Len(ReceivedData(index))-1)
   end if
 next

  'Build SQLString based on that data
 SQLString = "INSERT INTO Activity_Detail (ActivityID, UserID, Question, UserResponse, Result, QuestionTime, QuestionDate, TypeInteraction, CorrectResponse, ResponseValue, Weight, Latency, ObjectiveID) Values ( '" & ActivityIDVar & "', '" & UserIDVar & "','" & ReceivedData(2) & "', '" & ReceivedData(6) & "', '" & ReceivedData(7) & "', '" &  ReceivedData(1) & "', '" & ReceivedData(0) & "', '" & ReceivedData(4) & "', '" & ReceivedData(5) & "', '" & "" & "', '" &  ReceivedData(8) & "', '" & ReceivedData(9) & "', '" & ReceivedData(3) & "');"

  'Write SQLString into database
  set Recordset1 = Server.CreateObject("ADODB.Recordset")
  Recordset1.ActiveConnection = MM_LearningSite_STRING
  Recordset1.Source = SQLString
  Recordset1.CursorType = 0
  Recordset1.CursorLocation = 2
  Recordset1.LockType = 3
  Recordset1.Open
  Recordset1_numRows = 0

 end if%> 

<%' --------------------------------------------------------
  if request.form("command") = "putparam" then

  ' hold data as it is coming in
  receivedString = request.form("aicc_data")
  'response.write(receivedString)

  ' make the data into an array for easier reference
  receivedData = Split(receivedString, Chr(13)&Chr(10))
  
   ' repeat for each position of the array
   For i = LBound(receivedData) to UBound(receivedData)
     ' get each line one at a time
     dataString = receivedData(i)
          
     ' find positions of the = divider for each line
	 index = Instr(dataString, "=")
	 index2 = Len(dataString) - index

    ' separate the label and the content
	dataStringLabel = Left(dataString, index)
	dataStringContent = Right(dataString, index2)
		
  if index > 0 then
	' Check for what type of content we have on this line
' ------------------
		if InStr(dataStringLabel,"Lesson_Status=") then
           ' do lesson Status stuff
           SQLString = "UPDATE Activity_Status SET Activity_Status.Status = '" & dataStringContent & "' WHERE Activity_Status.ActivityID = '" & ActivityIDVar & "' AND Activity_Status.UserID = '" & UserIDVar & "';"
		end if
' ------------------
	if InStr(dataStringLabel,"score=") then
    	    ' do Score stuff

		' get score content from database
		SQLString = "SELECT Score FROM Activity_Status WHERE Activity_Status.ActivityID = '" & ActivityIDVar & "' AND Activity_Status.UserID = '" & UserIDVar & "';"

		set dbGetScore = Server.CreateObject("ADODB.Recordset")
		dbGetScore.ActiveConnection = MM_LearningSite_STRING
		dbGetScore.Source = SQLString
		dbGetScore.CursorType = 0
		dbGetScore.CursorLocation = 2
		dbGetScore.LockType = 3
		dbGetScore.Open
		dbGetScore_numRows = 0

		if (dataStringContent - dbGetScore.Fields.Item("Score").Value) > 0 then
			'if new score is greater, write it to the database
			SQLString = "UPDATE Activity_Status SET Activity_Status.Score = '" & dataStringContent & "' WHERE Activity_Status.ActivityID = '" & ActivityIDVar & "' AND Activity_Status.UserID = '" & UserIDVar & "';"
		end if
	end if
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #8  
Old Sep 26th, 2004, 15:46
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,160
Blog Entries: 7
Thanks: 27
Thanked 19 Times in 16 Posts
Hi Barlow....

What would a typical form submit be? aicc_data .... what would that contain. Also, where does the 'command' variable appear in the form? I'm just trying pin down your problem.

For future referece mate, please surround chunks of code with [*code] and [*/code] (REMOVE asterisks)
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #9  
Old Sep 26th, 2004, 17:25
New Member
Join Date: Sep 2004
Location: Germany
Age: 44
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Okay, that is where it gets to be bit over my head. The aicc form data is submitted from different pages depending on the quiz that is selected. It consists of the data that is entered on the quiz such as true/false, multiple choice or text box entry. Everything works perfectly except for the text box entries. the whitespaces are getting stripped out. There are several Javascript pages that are included with each and every quiz. The other possiblity of the whitespace issue would be a Javascript issue. Here is a tiny part of the code for one of the Javascript files that appear to have somethig to do with it. I just don't know what to manipulate to keep the whitespace and text string together.

Code: Select all
function CMIAddInteraction(date, time, intid, objid, intrtype, correct, student, result, weight, latency) {
  MM_SVal("command","putinteractions")
  MM_SVal(aicd,'"date", "time", "interaction_id", "objective_id", "type_interaction", "correct_response", "student_response", "result", "weighting", "latency"\r\n' +
    '"' + date + '", ' +
    '"' + time + '", ' +
    '"' + intid + '", ' +
    '"' + objid + '", ' +
    '"' + intrtype + '", ' +
    '"' + correct + '", ' +
    '"' + student + '", ' +
    '"' + result + '", ' +
    '"' + weight + '", ' +
    '"' + latency+ '"',1);
}
Here is the complete tracking.asp file code

Code: Select all
<%@LANGUAGE="VBSCRIPT" %>

<%Response.Buffer = true %>
<html>


<head>
<title>Tracking</title>
</head>

<body bgcolor="#FFFFFF">
<form name="form1" method="post" action="">
  <input type="hidden" name="session_id">
  <input type="hidden" name="Date">
  <input type="hidden" name="aicc_data">
</form>

<%' Get the UserID and ActivityID from the Session_IDs Table
  SQLString = "SELECT Session_IDs.UserID, Session_IDs.ActivityID FROM Session_IDs WHERE Session_IDs.SessionID=" & request.form("session_id") & ";"

  set Recordset1 = Server.CreateObject("ADODB.Recordset")
  Recordset1.ActiveConnection = MM_LearningSite_STRING
  Recordset1.Source = SQLString
  Recordset1.CursorType = 0
  Recordset1.CursorLocation = 2
  Recordset1.LockType = 3
  Recordset1.Open
  Recordset1_numRows = 0

' assign values to variables
  UserIDVar = Recordset1.Fields.Item("UserID").Value 
  ActivityIDVar = Recordset1.Fields.Item("ActivityID").Value%>

<%' --------------------------------------------------------
 if request.form("command") = "initialize" then
' clear out status table
' clear out details table
end if%> 

<%' Here is where the different commands are processed.
' --------------------------------------------------------

if request.form("command") = "putinteractions" then
  'Get aicc data that CourseBuilder based objects are sending
  ReceivedString = request.form("aicc_data")
  
  ' get the second return delimited block of data

  if (InStr(ReceivedString, Chr(13)&Chr(10)) = 0) then
    ReceivedString = replace(ReceivedString, "latency""", "latency"""&Chr(13)&Chr(10))
  end if

  ReceivedDataTemp = Split(ReceivedString, Chr(13)&Chr(10))
  ReceivedData = ReceivedDataTemp(1)
  
 'remove the quotes from the Data
  ReceivedData = replace(ReceivedData, """", "")

  ' make the data into an array for easier reference
  ReceivedData = Split(ReceivedData)

  ' clean up each position - take out the extra commas 
 for index = 0 to UBound(ReceivedData)
   if Right(ReceivedData(index), 1) = "," then
        ReceivedData(index) = Left(ReceivedData(index), Len(ReceivedData(index))-1)
   end if
 next

  'Build SQLString based on that data
 SQLString = "INSERT INTO Activity_Detail (ActivityID, UserID, Question, UserResponse, Result, QuestionTime, QuestionDate, TypeInteraction, CorrectResponse, ResponseValue, Weight, Latency, ObjectiveID) Values ( '" & ActivityIDVar & "', '" & UserIDVar & "','" & ReceivedData(2) & "', '" & ReceivedData(6) & "', '" & ReceivedData(7) & "', '" &  ReceivedData(1) & "', '" & ReceivedData(0) & "', '" & ReceivedData(4) & "', '" & ReceivedData(5) & "', '" & "" & "', '" &  ReceivedData(8) & "', '" & ReceivedData(9) & "', '" & ReceivedData(3) & "');"

  'Write SQLString into database
  set Recordset1 = Server.CreateObject("ADODB.Recordset")
  Recordset1.ActiveConnection = MM_LearningSite_STRING
  Recordset1.Source = SQLString
  Recordset1.CursorType = 0
  Recordset1.CursorLocation = 2
  Recordset1.LockType = 3
  Recordset1.Open
  Recordset1_numRows = 0

 end if%> 

<%' --------------------------------------------------------
  if request.form("command") = "putparam" then

  ' hold data as it is coming in
  receivedString = request.form("aicc_data")
  'response.write(receivedString)

  ' make the data into an array for easier reference
  receivedData = Split(receivedString, Chr(13)&Chr(10))
  
   ' repeat for each position of the array
   For i = LBound(receivedData) to UBound(receivedData)
     ' get each line one at a time
     dataString = receivedData(i)
          
     ' find positions of the = divider for each line
	 index = Instr(dataString, "=")
	 index2 = Len(dataString) - index

    ' separate the label and the content
	dataStringLabel = Left(dataString, index)
	dataStringContent = Right(dataString, index2)
		
  if index > 0 then
	' Check for what type of content we have on this line
' ------------------
		if InStr(dataStringLabel,"Lesson_Status=") then
           ' do lesson Status stuff
           SQLString = "UPDATE Activity_Status SET Activity_Status.Status = '" & dataStringContent & "' WHERE Activity_Status.ActivityID = '" & ActivityIDVar & "' AND Activity_Status.UserID = '" & UserIDVar & "';"
		end if
' ------------------
	if InStr(dataStringLabel,"score=") then
    	    ' do Score stuff

		' get score content from database
		SQLString = "SELECT Score FROM Activity_Status WHERE Activity_Status.ActivityID = '" & ActivityIDVar & "' AND Activity_Status.UserID = '" & UserIDVar & "';"

		set dbGetScore = Server.CreateObject("ADODB.Recordset")
		dbGetScore.ActiveConnection = MM_LearningSite_STRING
		dbGetScore.Source = SQLString
		dbGetScore.CursorType = 0
		dbGetScore.CursorLocation = 2
		dbGetScore.LockType = 3
		dbGetScore.Open
		dbGetScore_numRows = 0

		if (dataStringContent - dbGetScore.Fields.Item("Score").Value) > 0 then
			'if new score is greater, write it to the database
			SQLString = "UPDATE Activity_Status SET Activity_Status.Score = '" & dataStringContent & "' WHERE Activity_Status.ActivityID = '" & ActivityIDVar & "' AND Activity_Status.UserID = '" & UserIDVar & "';"
		end if
	end if
' ------------------
		if InStr(dataStringLabel,"Time=") then
    	    ' do lesson Time stuff

			' break received data into an array receivedTime
if Instr(dataStringContent, ":") > 0 then
			receivedTime = Split(dataStringContent, ":")
			receivedTime(0) = Int(receivedTime(0))
			receivedTime(1) = Int(receivedTime(1))
			receivedTime(2) = Int(receivedTime(2))

else 
			receivedTime(0) = 0
			receivedTime(1) = 0
			receivedTime(2) = 0
end if
			' get time content from database
			SQLString = "SELECT TotalTime FROM Activity_Status WHERE Activity_Status.ActivityID = '" & ActivityIDVar & "' AND Activity_Status.UserID = '" & UserIDVar & "';"

			set dbGetTime = Server.CreateObject("ADODB.Recordset")
			dbGetTime.ActiveConnection = MM_LearningSite_STRING
			dbGetTime.Source = SQLString
			dbGetTime.CursorType = 0
			dbGetTime.CursorLocation = 2
			dbGetTime.LockType = 3
			dbGetTime.Open
			dbGetTime_numRows = 0

if Instr(dbGetTime.Fields.Item("TotalTime").Value, ":") > 0 then
			' break database content into an array dbTime
			dbTime = Split( dbGetTime.Fields.Item("TotalTime").Value, ":")
dbTime(0) = Int(dbTime(0))
dbTime(1) = Int(dbTime(1))
dbTime(2) = Int(dbTime(2))
else 
   receivedTime(0) = 0
   receivedTime(1) = 0
   receivedTime(2) = 0
end if

			' add seconds  
			totalTimeSecs = receivedTime(2) + dbTime(2)
				' if total is over 60, add (total/60) to minutes, and keep remainder(total - what we add to minutes) as seconds
				if totalTimeSecs > 60 then
					totalTimeMins = Int(totalTimeSecs/60)
					totalTimeSecs = totalTimeSecs - (Int(totalTimeSecs/60)*60)
				end if

			' add minutes  
			totalTimeMins = totalTimeMins + receivedTime(1) + dbTime(1)
				' if total is over 60, add Int(total/60) to hours, and keep remainder( total - Int(total/60) ) as minutes
				if totalTimeMins > 60 then
					totalTimeHours = Int(totalTimeMins/60)
					totalTimeMins = totalTimeMins - (Int(totalTimeMins/60)*60)
				end if

			' add hours
			totalTimeHours = totalTimeHours + receivedTime(0) + dbTime(0)

			' adjust for 2 zeros 
			if totalTimeHours < 10 then totalTimeHours = "0" & totalTimeHours 
			if totalTimeMins < 10 then totalTimeMins = "0" & totalTimeMins 
			if totalTimeSecs < 10 then totalTimeSecs = "0" & totalTimeSecs 

			SQLString = "UPDATE Activity_Status SET Activity_Status.TotalTime = '" & totalTimeHours & ":" & totalTimeMins & ":" & totalTimeSecs & "' WHERE Activity_Status.ActivityID = '" & ActivityIDVar & "' AND Activity_Status.UserID = '" & UserIDVar & "';"
		end if

' ------------------
		if InStr(dataStringLabel,"Lesson_Location=") then
    	    ' do Location stuff
			 SQLString = "UPDATE Activity_Status SET Activity_Status.Location = '" & dataStringContent & "' WHERE Activity_Status.ActivityID = '" & ActivityIDVar & "' AND Activity_Status.UserID = '" & UserIDVar & "';"
		end if
' ------------------
	end if

	if SQLString <> "" then
	' execute SQLString
	
	Set MM_insertCmd = Server.CreateObject("ADODB.Command")
	MM_insertCmd.ActiveConnection = MM_LearningSite_STRING
	MM_insertCmd.CommandText = SQLString
	MM_insertCmd.Execute
	end if

   Next 

end if
%>

<%'--------------------------------------------------------------------
 if request.form("command") = "getparam" then
end if %> 

</body>
</html>
Here is the code for a one question quiz that has a two word answer. This is where the data would come from that populates the form aicc_data

Code: Select all
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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="http://"+aurl;
   }
   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>
<script language='JavaScript' src='scripts/behCourseBuilder.js'></script>
<script language="JavaScript" src="scripts/behActions.js"></script>
<script language="JavaScript" src="scripts/interactionClass.js"></script>
<script language="JavaScript" src="scripts/elemTextClass.js"></script>
<script language="JavaScript" src="scripts/cmi.js"></script>
</head>

<body bgcolor="#FFFFFF" onLoad="MM_initInteractions()">
<interaction name="Text_Multiline01" object="G01" template="050_Text Entry/020_Text_Multiline_03.agt" includesrc="interactionClass.js,elemTextClass.js,cmi.js"> 
<div name="G01Layer"> <span name="G01question">Does this work?

  </span> 
  <form name="G01elem">
    <textarea name="G01elemInp" rows=4 cols=40
    onBlur="G01.e['elem'].update()"
    onFocus="G01.e['elem'].focus()">
  </textarea>
  </form>
  <form name="G01controls">
    <input name="G01judge" type="BUTTON" value="Submit" onClick="MM_judgeInt('G01')">
  </form>
</div>
<script language="JavaScript">
<!--
  // Copyright 1998,1999 Macromedia, Inc. All rights reserved.
  function newG01() {
    G01 = new MM_interaction('G01',0,0,0,0,0,0,0,'','','f','',1);
    G01.add('text','elem','');
    G01.add('textComp','elem','Response1','25-32-###-ilatks jfddaoASeDlsad',1,100,0,0);
    G01.add('textComp','elem','Response2','26-32-###-isjftdaA SDldadkoa37eaUksd09 s91nsX9oseatO9d',0,0,0,0);
    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('end');
    G01.am('cond','Incorrect_01','G01.correct == false',0);
    G01.am('end');
    G01.am('cond','Unknown Response_','G01.knownResponse == false',0);
    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');
    G01.am('segm','Judge_',1,0);
    G01.am('actn','Send Score','MM_cmiSendScore(\'G01\', \'\')','');
  }
  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>
Thanks for code tip, this is way cool!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #10  
Old Sep 27th, 2004, 09:57
New Member
Join Date: Sep 2004
Location: Germany
Age: 44
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
I have posted a working example on a free hosting site

http://www.websamba.com/barlows

The login is stu and so is the password. Additional logins are stu1, stu2, stu3 and stu4 with password matching the login.

The answer to the question is "it does" (without quotations). After you answer the question, click submit and wait until the page stops processing. Then click on Finish at the top and it will send the data to the databse and display the results page where you can see what I am talking about under the User Response and Result columns. The answer "it does" should be in the User Response column and the "c" (meaning correct) should be in the result column.

If you need FTP access to look at all the files let me know and I'll set it up so you can get access to all the files involved.

Thanks!!!
There is an error loading te page, as my frames fight witht the advertisement frame, but it does load and works just as it does on my system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #11  
Old Sep 27th, 2004, 14:20
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,160
Blog Entries: 7
Thanks: 27
Thanked 19 Times in 16 Posts
Hi Barlows.... I cant really see whats going on here.

Send me a private message with details to access the files, and I'll take a peek.

I'm almost certain it's a javascript issue, but I can run some tests to find out.
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #12  
Old Sep 27th, 2004, 15:42
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,160
Blog Entries: 7
Thanks: 27
Thanked 19 Times in 16 Posts
Hi Barlows....

This is a complete nightmare. This is one of the many Many MANY reasons NOT to use dreamweaver. It generates needless code, and ploghing your way through it takes ages. Add to that the hassle of not being able to do a global search through your code, and it's just very time consuming.

You could really help me by zipping up the code and posting me the url (via private message) where i can download it from.

Sorry, but I've had all I can bear from that online file manager.
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #13  
Old Sep 27th, 2004, 17:00
New Member
Join Date: Sep 2004
Location: Germany
Age: 44
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Yea, it does kind of suck, but it was free and I won't use it after this anyway. I put the zip file in the same place as the sucky file manager. The download shouldn't get to ya too much.

I wish I could offer you a beer, but I hadn't figured out how to FTP a bottle yet.

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
learning, site, question

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Intranet Site - Navbar question klonopin Web Page Design 7 Mar 14th, 2007 17:53
First site. 1 question. tengu Web Page Design 3 Nov 27th, 2006 21:08
Question about flash site base system Blue Flash & Multimedia Forum 5 Nov 26th, 2005 21:23


All times are GMT. The time now is 02:19.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved