context: function GetJClozeQuestionDetails(hp, v) {	var qDetails = '';	// check the quiz version	if (hp==5 || hp==6) {		var r = hpRottmeier();		// get details for each question		var q_max = (r==0) ? State.length :  GapList.length;		for (var q=0; q<q_max; q++) {			// format 'Q' (a padded, two-digit version of 'q')			var Q = getQ('JCloze', q);			// add separator, if required			if (JCloze[0]) qDetails += makeSeparator(Q);			// score (as %)			var x = (hp==5) ? State[q][3] : (r==0) ? State[q].ItemScore : GapList[q][1].Score;			qDetails += hpHiddenField(Q+'score', Math.floor(x*100)+'%');			// create Guesses array for Rottmeier Find-it v3.1a			if (r==2 && GapList[q][1].Guesses==null) {					GapList[q][1].Guesses = new Array();					GapList[q][1].Guesses[0] = I[q][1][0][0];			}			// shortcut to guesses to this answer			var guesses = (hp==5) ? null : (r==0) ? State[q].Guesses : GapList[q][1].Guesses;			// is this question correctly answered yet?			var is_correct = (hp==5) ? State[q][4] : (r==0) ? State[q].AnsweredCorrectly : (r==1) ? GapList[q][1].GapLocked : (r==2) ? GapList[q][1].ErrorFound : true;				// shortcut ot correct answer			var correct = '';			if (is_correct) {				correct = (hp==5) ? State[q][5] : guesses[guesses.length-1];			}			if (JCloze[1]) { // student's correct answer				qDetails += hpHiddenField(Q+'correct', correct);			}			if (JCloze[2]) { // other correct answers				var ignored = new Array();				if (r==0) {					for (var i=0, ii=0; i<I[q][1].length; i++) {						if (I[q][1][i][0] && (I[q][1][i][0].toUpperCase() != correct.toUpperCase())) {							ignored[ii++] = I[q][1][i][0];						}					}				} else if (r==1 || r==2) { // rottmeier quizzes					// do nothing				}				if (DB[0] || ignored.length>0) qDetails += hpHiddenField(Q+'ignored', ignored);			}			if (JCloze[3]) {				if (guesses) {					var wrong = new Array();					var i_max = guesses.length - (is_correct ? 1 : 0);					for (var i=0, ii=0; i<i_max; i++) {						if (guesses[i]) {							for (var iii=0; iii<ii; iii++) {								if (wrong[iii]==guesses[i]) break;							}							// add guess if it has not already been added							if (iii==ii) wrong[ii++] = guesses[i];						}					}					if (DB[0] || ii>0) qDetails += hpHiddenField(Q+'wrong', wrong);				}			}			var HintsAndChecks = (hp==5) ? State[q][1] : (r==0) ? State[q].HintsAndChecks : (r==1) ?  GapList[q][1].NumOfTrials : (r==2) ?  GapList[q][1].HintsAndChecks : 0;			var Hints = (HP[_hints][q] ? HP[_hints][q] : 0);			if (JCloze[4]) { // number of penalties				qDetails += hpHiddenField(Q+'penalties', HintsAndChecks);			}			if (JCloze[5]) { // clue shown?				var x = (hp==5) ? State[q][0] : (r==0) ? State[q].ClueGiven: (r==1) ? GapList[q][1].ClueAskedFor : false;				qDetails += hpHiddenField(Q+'clue_shown', (x ? 'YES' : 'NO'));			}			if (JCloze[6]) { // clue text				qDetails += hpHiddenField(Q+'clue_text', I[q][2]);			}			if (JCloze[7]) { // number of hints				qDetails += hpHiddenField(Q+'hints', Hints);			}			if (JCloze[8]) { // number of clues				x = HP[_clues][q] ? HP[_clues][q] : 0;				qDetails += hpHiddenField(Q+'clues', x);			}			if (JCloze[9]) { // number of checks (including the final one for the correct answer)				qDetails += hpHiddenField(Q+'checks', HintsAndChecks - Hints + (is_correct ? 1 : 0));			}		} // end for	}	return qDetails;}
meta: 2641	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/2641/5237207862290e6950c71339743289f4d2d5f4d3/hotpot-full.js/buggy/mod/hotpot/hotpot-full.js