Ordinal Question Type Problem / Solution
November 2, 2008 12:00 AM
Took a little while to figure this one out -If you leave an apostrophe in the text of an ordinal question it throws an error (at least in Firefox). The update function called by Lectora thinks the apostrophe is the END of the string that is passed as a parameter and it doesn't know what to do with the remainder.So DON'T use an apostrophe in the text of an ordinal question. I removed them, and VOILA it worked as expected.Next - if you want the results from an ordinal question in terms of what NUMBER was selected instead of what the text of the selected item was, use the code below:var selectedArray = textArray = new Array();function myValueInArray(pos,name) { var titleMgr = getTitleMgrHandle(); myPos = --pos myVal = eval("document.getElementById('" + name + "id').selectedIndex"); selectedArray[myPos]=++myVal titleMgr.sArray = selectedArray; } function getSelectPos(pos) { var titleMgr = getTitleMgrHandle(); newPos=--pos rightValue = titleMgr.sArray[newPos] return rightValue; }Place an action on EACH dropdown in the ordinal to call this javascript function passing in TWO parameters:javascript:myValueInArray(1,'combo53194')1 is the number of the dropdown as it appears on the page (first or second etc)'combo53194' is the HTML name of the dropdown object. The apostrophes are required.On the next page call this function to get the value of each dropdown in sequence:javascript:getSelectPos(1)Any interest I'll post an example
Discussions have been disabled for this post