jlapdog
08-09-2003, 11:10 AM
Problem: Need a working javascript to send users to a url based on their score.
Background: I am designing a course using Dreamweaver for the Rules of the Road (Maritime). I am utilizing the CourseBuilder Exntension, which has been helpful thus far, but now I need human interaction and need help. I have a twenty question test, each question on a different page, setup in frames, where the bottom frame keeps track of the users score. After the user submits their answer to the 20th question, the user is sent to a results page and I am trying to put a javascript in there that will send the student to a different page if his score is less than an 80. Here is the code that I did myself, which is not working.
<script language="JavaScript">
if ((top.cmiresults.total)>=80) then {window.content='testa-results.htm'} else {window.content='testa-retest.htm'};
</script>
My frames are named content (99%) and results (1%)
Also, is it possible to add a script to the 20th question button that will do the same function on that page? I have two other scripts which add the number correct and to the total score already for that button.
Any help?
Background: I am designing a course using Dreamweaver for the Rules of the Road (Maritime). I am utilizing the CourseBuilder Exntension, which has been helpful thus far, but now I need human interaction and need help. I have a twenty question test, each question on a different page, setup in frames, where the bottom frame keeps track of the users score. After the user submits their answer to the 20th question, the user is sent to a results page and I am trying to put a javascript in there that will send the student to a different page if his score is less than an 80. Here is the code that I did myself, which is not working.
<script language="JavaScript">
if ((top.cmiresults.total)>=80) then {window.content='testa-results.htm'} else {window.content='testa-retest.htm'};
</script>
My frames are named content (99%) and results (1%)
Also, is it possible to add a script to the 20th question button that will do the same function on that page? I have two other scripts which add the number correct and to the total score already for that button.
Any help?