I have some javascript tests and I am trying to collect the answers using PHP and put them into a database. These tests are were created using javascript and do not have the regular HTML form names like <input etc. There are images you click on to choose your answers and I was wondering how to implement the php into these tests. The code looks like this for one question. the table will have unique values and tracks the user sessions as well. I'm a newbee and I can't find any good info on the Net for PHP and test creation.
<form name="G01choices">
<font face="Verdana, Arial, Helvetica, sans-serif" size="2"><span name="G01choice1">
<a name="G01choice1Inp" href="#"
onClick="G01.e['choice1'].update('onclick');return false"
onMouseOver="G01.e['choice1'].update('onmouseover');"
onMouseOut="G01.e['choice1'].update('onmouseout');"
onMouseDown="G01.e['choice1'].update('onmousedown');"> <img name="G01choice1Btn" src="images/buttons/checkbox_red.gif" border=0 align="absmiddle"></a>a.
High <br>
</span> <span name="G01choice2"> <a name="G01choice2Inp" href="#"
onClick="G01.e['choice2'].update('onclick');return false"
onMouseOver="G01.e['choice2'].update('onmouseover');"
onMouseOut="G01.e['choice2'].update('onmouseout');"
onMouseDown="G01.e['choice2'].update('onmousedown');"> <img name="G01choice2Btn" src="images/buttons/checkbox_red.gif" border=0 align="absmiddle"></a>b.
Intermediate <br>
</span> <span name="G01choice3"> <a name="G01choice3Inp" href="#"
onClick="G01.e['choice3'].update('onclick');return false"
onMouseOver="G01.e['choice3'].update('onmouseover');"
onMouseOut="G01.e['choice3'].update('onmouseout');"
onMouseDown="G01.e['choice3'].update('onmousedown');"> <img name="G01choice3Btn" src="images/buttons/checkbox_red.gif" border=0 align="absmiddle"></a>c.
Low <br>
</span> <span name="G01choice4"> <a name="G01choice4Inp" href="#"
onClick="G01.e['choice4'].update('onclick');return false"
onMouseOver="G01.e['choice4'].update('onmouseover');"
onMouseOut="G01.e['choice4'].update('onmouseout');"
onMouseDown="G01.e['choice4'].update('onmousedown');"> <img name="G01choice4Btn" src="images/buttons/checkbox_red.gif" border=0 align="absmiddle"></a>d.
Very low</span></font><span name="G01choice4"><br>
</span>
</form>
<form name="G01controls">
</form>
</div>]
\this code calculates the answers and you hit a submit button at the end to grade the test.
<script language="JavaScript">
<!--
// Copyright 1998,1999 All rights reserved.
function newG01() {
G01 = new MM_interaction('G01',0,0,0,null,0,0,0,'','','c','',0);
G01.add('ibtn','choice1',0,1,0,0,1,'sdhSDH');
G01.add('ibtn','choice2',0,1,1,1,1,'sdhSDH');
G01.add('ibtn','choice3',0,1,0,0,1,'sdhSDH');
G01.add('ibtn','choice4',0,1,0,0,1,'sdhSDH');
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','Unknown Response','G01.knownResponse == false',0);
G01.am('actn','Popup Message','MM_popupMsg(\'You forgot to answer question one.\')','');
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>