anchor.diff:  </div>
   <div style="text-align:right" class="col-sm-4">
   <!-- pause,end exam -->
  -<button id="paubtn" type="button" data-toggle="modal" data-target="#pauModal">Pause</button>
   <input type="hidden" name="tests" />
   <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
   <input type="submit" value="Submit" id="sbtbtn"/> 
  
positive.code: 	  var modal = $(this);
  	  modal.find('.modal-body').html(genReviewTable());
  	})
  	//Show/Hide answer.
  	$('#ansbtn').on('click', function (e) {
  		//.log("answer!" + curTest);
  
negative.code: 		}
  	});	
  	//En/Disable all text inputs.
  	function ToggleTestApperance(){
  		if(p.tests[curTest].dirty == true){
  			showTest4Edit();
  		}else{
  			showTest4View();
  		}
  	}
  	//Display tests.
  	function showTest4Edit(){
  		if(curTest > -1 && curTest < total){
  			$('#testrootpanel #qh').children().last().remove();
  			$('#testrootpanel #quescol').html('');
  			$('#testrootpanel #optcol').html('');
  			$('#testrootpanel #ansrow #anscol #answell').html('');
  			$('#testrootpanel #ansrow #anscol #answell').removeClass('hidden');
  			$('#chekmark').prop('checked',false);
  			if(p.tests[curTest].hasOwnProperty('marked')
  				&& typeof p.tests[curTest].marked != 'undefined'){
  				$('#chekmark').prop('checked',p.tests[curTest].marked);
  			}
  			var curSN = curTest + 1;
  			$('#testrootpanel #qh').append("<label>Item " + curSN + " of "+ total +"</label>");
  			if(typeof p.tests[curTest].pic != 'undefined'){
  				$('#testrootpanel #quescol').append("<div class=\"thumbnail\" id=\"qthb\"><img src=\"${pageContext.request.contextPath}/resources/pic/" + p.tests[curTest].pic+ "\"/></div>");
  				$('#testrootpanel #quescol').append("<div class=\"caption\" id=\"ques\"><h4>" + p.tests[curTest].question[0] + "</h4>");
  			}else{
  				$('#testrootpanel #quescol').append("<div class=\"thumbnail\" id=\"qthb\"><label for=\"pic_input\"><img src=\"${pageContext.request.contextPath}/resources/pic/" + p.tests[curTest].pic+ "\"/></label><input id=\"pic_input\" type=\"file\" name=\"file\"/></div>");	
  				$('#testrootpanel #quescol').append("<textarea id=\"ques\" class=\"form-control\" disabled>" 
  						+ p.tests[curTest].question[0] +"</textarea>")
  			}
  			//Options.
  			var opts = p.tests[curTest].options;
  			for(var i = 0; i < opts.length; ++i){
  				var opt = opts[i];
  				var id = "opt" + i;
  				$('#testrootpanel #optcol').append("<input id=\"" + id + "\"type=\"text\" name=\"opt\" placeholder=\"" + opt + "\"></input><br>");
  			}
  			
  			//Answer area
  			$("#ansrow #anscol #answell").append("<div class=\"row\">Answer:</div>");
  			$("#ansrow #anscol #answell").append("<div id=\"ansr\" class=\"row\">");
  			$("#ansrow #anscol #answell #ansr").append("<div id=\"ansc\" class=\"col-xs-2\">");
  			if(typeof p.tests[curTest].answers != 'undefined'){
  				$("#ansrow #anscol #answell #ansr #ansc").append("<input type=\"text\" class=\"form-control\" placeholder=\""+ p.tests[curTest].answers[0] + "\"></input>");
  			}else{
  				$("#ansrow #anscol #answell #ansr #ansc").append("<input type=\"text\" class=\"form-control\"></input>");
  			}
  			
  			
  			//Keyword
  			$("#answell").append("<div class=\"row\">Keyword:</div>");
  			$("#answell").append("<div id=\"kwds\" class=\"row\">");
  			$("#kwds").append("<div id=\"en\" class=\"col-xs-5\">");
  			$("#kwds").append("<div id=\"ch\" class=\"col-xs-5\">");
  			if(typeof p.tests[curTest].kwds != 'undefined'){
  				var kwds = p.tests[curTest].kwds;
  				for(var i = 0; i < kwds.length; ++i){
  					if(i%2 == 0){
  						$("#ansrow #anscol #answell #kwds #en").append("<textarea class=\"form-control\"> " + kwds[i] + "</textarea>");
  					}else{
  						$("#ansrow #anscol #answell #kwds #ch").append("<textarea class=\"form-control\"> " + kwds[i] + "</textarea>");						
  					}
  				}
  			}
  			$("#answell").append("<button type=\"button\" id=\"pluskwdbtn\" class=\"btn btn-info\">");
  			$('#answell').children().last()
  			.on('click',function(){
  				$("#ansrow #anscol #answell #kwds #en").append("<textarea class=\"form-control\"> </textarea>");	
  				$("#ansrow #anscol #answell #kwds #ch").append("<textarea class=\"form-control\"> </textarea>");
  			});
  			$('#answell').children().last().append("<span class=\"glyphicon glyphicon-plus\"></span>");
  			
  			//Watchword
  			$("#ansrow #anscol #answell").append("<div class=\"row\">Watchword:</div>");
  			$("#ansrow #anscol #answell").append("<div id=\"wwds\" class=\"row\">");
  			$("#ansrow #anscol #answell #wwds").append("<div id=\"en\" class=\"col-xs-5\">");
  			$("#ansrow #anscol #answell #wwds").append("<div id=\"ch\" class=\"col-xs-5\">");
  			if(typeof p.tests[curTest].watchword != 'undefined'){
  				var wwds = p.tests[curTest].watchword;
  				for(var i = 0; i < wwds.length; ++i){
  					if(i%2 != 0){
  						$("#ansrow #anscol #answell #wwds #en").append("<textarea class=\"form-control\"> " + wwds[i] + "</textarea>");
  					}else{
  						$("#ansrow #anscol #answell #wwds #ch").append("<textarea class=\"form-control\"> " + wwds[i] + "</textarea>");						
  					}
  				}
  			}
  			$("#ansrow #anscol #answell").append("<button type=\"button\"  id=\"pluswdbtn\" class=\"btn btn-info\">");
  			$("#ansrow #anscol #answell #pluswdbtn").append("<span class=\"glyphicon glyphicon-plus\"></span>");
  			$("#ansrow #anscol #answell #pluswdbtn").on('click',function(){
  				$("#ansrow #anscol #answell #wwds #en").append("<textarea class=\"form-control\"> </textarea>");	
  				$("#ansrow #anscol #answell #wwds #ch").append("<textarea class=\"form-control\"> </textarea>");							
  			});
  			
  			
  			//Tips.
  			$("#ansrow #anscol #answell").append("<div class=\"row\">Tips:</div>");
  			$("#ansrow #anscol #answell").append("<div id=\"tipsr\" class=\"row\">");
  			$("#ansrow #anscol #answell #tipsr").append("<div id=\"tipsc\" class=\"col-xs-12\">");
  			if(typeof p.tests[curTest].tips != 'undefined'){
  				$("#ansrow #anscol #answell #tipsr #tipsc").append("<textarea class=\"form-control\" >"+ p.tests[curTest].tips+"</textarea>");
  			}else{
  				$("#ansrow #anscol #answell #tipsr #tipsc").append("<textarea class=\"form-control\" ></textarea>");
  			}
  		}
  	}
  	
  	//Display tests.
  	function showTest4View(){
  		if(curTest > -1 && curTest < total){
  			$('#testrootpanel #qh').children().last().remove();
  			$('#testrootpanel #quescol').html('');
  			$('#testrootpanel #optcol').html('');
  			$('#testrootpanel #ansrow #anscol #answell').html('');
  			$('#ansrow #anscol #answell').addClass('hidden');
  			$('#chekedit').prop('checked',false);
  			if(p.tests[curTest].hasOwnProperty('marked')
  				&& typeof p.tests[curTest].marked != 'undefined'){
  				$('#chekmark').prop('checked',p.tests[curTest].marked);
  