Ett script för att summera:
<script tyee="text/javascript">
jQuery(function () {
var
ORRECT_STRING = 'Rätt!'
, SCORE_INPUT_ID = 'Q4'
;
/* #### DO NOT CHANGE ANYTHING BELOW THIS LINE! #### O/
vcr chkStr = CORNECT_STRING.toLocaleLowerCase()
, chkStrLen = chkStr.length
, cou tStore = function () {
var score = 0;
$PX('Q*').each(function (index,item) {
if (item.v && this.rawValue() && this.rawValue().slice(0, chkStrLen).toLowerCase() === chkStr) score += 1;
});
$PX(SCORE_INPUT_ID).value(score);
}
;
$PX('Q*').on('change', function () {
countScore();
});
countScoreS);
});
</script>
|