rem: if (f[i]=='CheckShortAnswer') {  x = "var g=(Finished||State[QNum].length==0||State[QNum][0]>-1)?'':document.getElementById('Q_'+QNum+'_Guess');"; x += "if(g){var args=new Array(QNum, g.value);hpClick(3,args)}"; } else { x = "if(!Finished&&State[QNum].length&&State[QNum][0]<0)hpClick(3,QNum);"; 
add: var x = ""; if (f[i]=='CheckMCAnswer') { x += "var args=new Array(QNum,I[QNum][3][ANum][0]);";  } else if (f[i]=='CheckShortAnswer') { x += "" + "var obj=document.getElementById('Q_'+QNum+'_Guess');" + "var args=new Array(QNum,obj.value);" ;  } else if (f[i]=='CheckMultiSelAnswer') { x += "" + "var g='';" + "for (var ANum=0; ANum<I[QNum][3].length; ANum++){" + 	"var obj=document.getElementById('Q_'+QNum+'_'+ANum+'_Chk');" + 	"if (obj.checked)g+=(g?'&#43;':'')+I[QNum][3][ANum][0];" + "}" + "var args=new Array(QNum,g);" ; 
context: function hpInterceptChecks() {	// modify the function which handles checks	//	JBC:    none	//	JCloze  none	//	JCross  none	//	JMatch  HP5 v3, v5, v6: CheckAnswer(), HP5 v4: CheckResults(), HP6: CheckAnswers()	//	JMix    CheckAnswer(CheckType)	//	JQuiz 	//		HP5: CheckAnswer(ShowHint, QNum)	//		HP6: CheckMCAnswer, CheckMultiSelAnswer, CheckShortAnswer	//	Sequitur CheckAnswer(Chosen, Btn)	// HP6 JQuiz has three "Check Answer" functions	var f = new Array('CheckMCAnswer', 'CheckMultiSelAnswer', 'CheckShortAnswer');	for (var i=0; i<f.length; i++) {		if (eval('window.' + f[i])) {			var a = getFuncArgs(f[i], true);			if (f[i]=='CheckShortAnswer') {				// get guess for ShortAnswer and Hydrid				x = "var g=(Finished||State[QNum].length==0||State[QNum][0]>-1)?'':document.getElementById('Q_'+QNum+'_Guess');";				x += "if(g){var args=new Array(QNum, g.value);hpClick(3,args)}";			} else {				x = "if(!Finished&&State[QNum].length&&State[QNum][0]<0)hpClick(3,QNum);";			}			var s = getFuncCode(f[i], x, '', true);			eval('window.' + f[i] + '=new Function(' + getArgsStr(a) + 's);');		}	}	if (window.CheckAnswer) {		var x = ''; // extra code, if any		var f = 'CheckAnswer';		var a = getFuncArgs(f, true);		if (a[0]=='ShowHint') {			if (a[1]=='QNum') {				// JQuiz v3, v5-v6[HP5]				x = 'if(!ShowHint&&Status[QNum][0]<1)hpClick(3,QNum);'; 			} else {				// JQuiz v4				x = 'if(!ShowHint&&State[QNum-1][0]<1)hpClick(3,QNum-1);'; // QNum is a global variable			}		} else if (a[0]=='CheckType') {			// JMix v5-v6			x = 'if(CheckType==0)hpClick(3,0);'; // question number is always 0;		} else if (a[0]=='Chosen') {			// Sequitur			// x = 'if(!(CurrentNumber==TotalSegments||AllDone||Btn.innerHTML==IncorrectIndicator||(CurrentCorrect==Chosen&&CurrentNumber>=(TotalSegments-1))))Finish()';		}		if (x) {			var s = getFuncCode(f, x, '', true);			eval('window.' + f + '=new Function(' + getArgsStr(a) + 's);');		}	}	// JMatch has three possible check functions, depending on the version	// (NB: other quiz types also have these functions)	var f = new Array('CheckAnswers', 'CheckAnswer', 'CheckResults');	for (var i=0; i<f.length; i++) {		if (eval('window.' + f[i])) {			var a = getFuncArgs(f[i], true);			if (a.length==0) {				var s = getFuncCode(f[i], "hpClick(3);", '', true);				eval('window.' + f[i] + '=new Function(' + getArgsStr(a) + 's);');				break; // out of the loop			}		}	}}
meta: 2641	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/2641/5237207862290e6950c71339743289f4d2d5f4d3/hotpot-full.js/buggy/mod/hotpot/hotpot-full.js