core/js/IAT_gform.js
// insert instruction text based on stage in IAT
insert instruction text based on stage in IAT
insert instruction text based on stage in IAT
function instructionPage()
{	
	switch (session)
    {
		case 0:
			$('#left_cat').ready(function() { $('#left_cat').html(openA+template.catA.label+closeA); });
			$('#right_cat').ready(function() { $('#right_cat').html(openA+template.catB.label+closeA); });
			break;
        case 1:    
			$("#left_cat").html(open1+template.cat1.label+close1);
			$("#right_cat").html(open1+template.cat2.label+close1);
            break;
        case 2:
        case 3:
			$("#left_cat").html(openA+template.catA.label+closeA+'<br>or<br>'+open1+template.cat1.label+close1);
			$("#right_cat").html(openA+template.catB.label+closeA+'<br>or<br>'+open1+template.cat2.label+close1);
            break;
        case 4:
			$("#left_cat").html(openA+template.catB.label+closeA);
			$("#right_cat").html(openA+template.catA.label+closeA);
			break;
        case 5:
        case 6:
			$("#left_cat").html(openA+template.catB.label+closeA+'<br>or<br>'+open1+template.cat1.label+close1);
			$("#right_cat").html(openA+template.catA.label+closeA+'<br>or<br>'+open1+template.cat2.label+close1);
            break;
    }
	if (session == 7)
	{
		$("#left_cat").html("");
		$("#right_cat").html("");
		$("#exp_instruct").html("<img src='core/spinner.gif'>");
		WriteFile();
		if(true)
		{
			resulttext = '<iframe src="'+gframe+'?embedded=true" width="500" height="500" frameborder="0" marginheight="0" marginwidth="0" onLoad="clearForm(true);">Loading...</iframe>';
			$("#experiment_frame").html(resulttext);
		}
		else 
		{
			if(template.showResult == "show")
			{
			    calculateIAT();
			}
			else
			{
			    resulttext = "<div style='text-align:center;padding:20px'>Thanks for participating!</div>";
			    $("#picture_frame").html(resulttext);
			}
		}
	}
	else
	{
		$.get("core/gInstruct"+(session+1)+".html", function(data) { $('#exp_instruct').html(data); });
	}
}
function instructionPage ( ) { switch ( session ) { case 0 : $ ( '#left_cat' ) . ready ( function ( ) { $ ( '#left_cat' ) . html ( openA + template . catA . label + closeA ) ; } ) ; $ ( '#right_cat' ) . ready ( function ( ) { $ ( '#right_cat' ) . html ( openA + template . catB . label + closeA ) ; } ) ; break ; case 1 : $ ( "#left_cat" ) . html ( open1 + template . cat1 . label + close1 ) ; $ ( "#right_cat" ) . html ( open1 + template . cat2 . label + close1 ) ; break ; case 2 : case 3 : $ ( "#left_cat" ) . html ( openA + template . catA . label + closeA + '<br>or<br>' + open1 + template . cat1 . label + close1 ) ; $ ( "#right_cat" ) . html ( openA + template . catB . label + closeA + '<br>or<br>' + open1 + template . cat2 . label + close1 ) ; break ; case 4 : $ ( "#left_cat" ) . html ( openA + template . catB . label + closeA ) ; $ ( "#right_cat" ) . html ( openA + template . catA . label + closeA ) ; break ; case 5 : case 6 : $ ( "#left_cat" ) . html ( openA + template . catB . label + closeA + '<br>or<br>' + open1 + template . cat1 . label + close1 ) ; $ ( "#right_cat" ) . html ( openA + template . catA . label + closeA + '<br>or<br>' + open1 + template . cat2 . label + close1 ) ; break ; } if ( session == 7 ) { $ ( "#left_cat" ) . html ( "" ) ; $ ( "#right_cat" ) . html ( "" ) ; $ ( "#exp_instruct" ) . html ( "<img src='core/spinner.gif'>" ) ; WriteFile ( ) ; if ( true ) { resulttext = '<iframe src="' + gframe + '?embedded=true" width="500" height="500" frameborder="0" marginheight="0" marginwidth="0" onLoad="clearForm(true);">Loading...</iframe>' ; $ ( "#experiment_frame" ) . html ( resulttext ) ; } else { if ( template . showResult == "show" ) { calculateIAT ( ) ; } else { resulttext = "<div style='text-align:center;padding:20px'>Thanks for participating!</div>" ; $ ( "#picture_frame" ) . html ( resulttext ) ; } } } else { $ . get ( "core/gInstruct" + ( session + 1 ) + ".html" , function ( data ) { $ ( '#exp_instruct' ) . html ( data ) ; } ) ; } }
insert instruction text based on stage in IAT
insert instruction text based on stage in IAT
//if('insertForm' in template)