Make whole cell clickable in single and multi grids

From Catglobe Wiki
Revision as of 15:47, 27 January 2010 by Phongha (talk | contribs) (Challenge)
Jump to: navigation, search

Challenge

Normally, the grid question require a click on the checkbox or radiobutton. Now, we want it to register the answer when the user click on the cell for the answer option.

Example

Clickable cell.gif

Script

 1 quest.onInit = function()
 2 {
 3    $(".grid_subquestion_odd,.grid_subquestion_even").click(
 4             function(evt)
 5             {
 6                if(evt.target.nodeName == "INPUT")
 7                   return true;
 8                $(this).children("input").click();
 9                return false;
10             });
11  }