--- loncom/homework/grades.pm 2014/01/30 19:11:05 1.717 +++ loncom/homework/grades.pm 2014/02/04 18:53:44 1.718 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.717 2014/01/30 19:11:05 bisitz Exp $ +# $Id: grades.pm,v 1.718 2014/02/04 18:53:44 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1432,6 +1432,15 @@ INNERJS txtc => 'Text Color', font => 'Font Size', fnst => 'Font Style', + col1 => 'red', + col2 => 'green', + col3 => 'blue', + siz1 => 'normal', + siz2 => '+1', + siz3 => '+2', + sty1 => 'normal', + sty2 => 'italic', + sty3 => 'bold', ); $request->print(&Apache::lonhtmlcommon::scripttag(<<SUBJAVASCRIPT)); @@ -1595,25 +1604,34 @@ INNERJS var redsel = ""; var grnsel = ""; var blusel = ""; - if (kwclr=="red") {var redsel="checked"}; - if (kwclr=="green") {var grnsel="checked"}; - if (kwclr=="blue") {var blusel="checked"}; + var txtcol1 = "$lt{'col1'}"; + var txtcol2 = "$lt{'col2'}"; + var txtcol3 = "$lt{'col3'}"; + var txtsiz1 = "$lt{'siz1'}"; + var txtsiz2 = "$lt{'siz2'}"; + var txtsiz3 = "$lt{'siz3'}"; + var txtsty1 = "$lt{'sty1'}"; + var txtsty2 = "$lt{'sty2'}"; + var txtsty3 = "$lt{'sty3'}"; + if (kwclr=="red") {var redsel="checked='checked'"}; + if (kwclr=="green") {var grnsel="checked='checked'"}; + if (kwclr=="blue") {var blusel="checked='checked'"}; var sznsel = ""; var sz1sel = ""; var sz2sel = ""; - if (kwsize=="0") {var sznsel="checked"}; - if (kwsize=="+1") {var sz1sel="checked"}; - if (kwsize=="+2") {var sz2sel="checked"}; + if (kwsize=="0") {var sznsel="checked='checked'"}; + if (kwsize=="+1") {var sz1sel="checked='checked'"}; + if (kwsize=="+2") {var sz2sel="checked='checked'"}; var synsel = ""; var syisel = ""; var sybsel = ""; - if (kwstyle=="") {var synsel="checked"}; - if (kwstyle=="<i>") {var syisel="checked"}; - if (kwstyle=="<b>") {var sybsel="checked"}; + if (kwstyle=="") {var synsel="checked='checked'"}; + if (kwstyle=="<i>") {var syisel="checked='checked'"}; + if (kwstyle=="<b>") {var sybsel="checked='checked'"}; highlightCentral(); - highlightbody('red','red',redsel,'0','normal',sznsel,'','normal',synsel); - highlightbody('green','green',grnsel,'+1','+1',sz1sel,'<i>','italic',syisel); - highlightbody('blue','blue',blusel,'+2','+2',sz2sel,'<b>','bold',sybsel); + highlightbody('red',txtcol1,redsel,'0',txtsiz1,sznsel,'',txtsty1,synsel); + highlightbody('green',txtcol2,grnsel,'+1',txtsiz2,sz1sel,'<i>',txtsty2,syisel); + highlightbody('blue',txtcol3,blusel,'+2',txtsiz3,sz2sel,'<b>',txtsty3,sybsel); highlightend(); return; } @@ -1631,31 +1649,29 @@ INNERJS hDoc.$docopen; hDoc.write('$start_page_highlight_central'); hDoc.write("<form action=\\"inactive\\" name=\\"hlCenter\\">"); - hDoc.write("<h3><span class=\\"LC_info\\"> $lt{'kehi'}<\\/span><\\/h3><br /><br />"); + hDoc.write("<h1>$lt{'kehi'}<\\/h1>"); - hDoc.write('<table border="0" width="100%"><tr><td bgcolor="#777777">'); - hDoc.write('<table border="0" width="100%"><tr bgcolor="#DDFFFF">'); - hDoc.write("<td><b>$lt{'txtc'}<\\/b><\\/td><td><b>$lt{'font'}<\\/b><\\/td><td><b>$lt{'fnst'}<\\/td><\\/tr>"); + hDoc.write('<table border="0" width="100%"><tr style="background-color:#A1D676">'); + hDoc.write("<th>$lt{'txtc'}<\\/th><th>$lt{'font'}<\\/th><th>$lt{'fnst'}<\\/th><\\/tr>"); } function highlightbody(clrval,clrtxt,clrsel,szval,sztxt,szsel,syval,sytxt,sysel) { var hDoc = hwdWin.document; - hDoc.write("<tr bgcolor=\\"#ffffdd\\">"); + hDoc.write("<tr>"); hDoc.write("<td align=\\"left\\">"); - hDoc.write("<input name=\\"kwdclr\\" type=\\"radio\\" value=\\""+clrval+"\\" "+clrsel+"> "+clrtxt+"<\\/td>"); + hDoc.write("<input name=\\"kwdclr\\" type=\\"radio\\" value=\\""+clrval+"\\" "+clrsel+" \\/> "+clrtxt+"<\\/td>"); hDoc.write("<td align=\\"left\\">"); - hDoc.write("<input name=\\"kwdsize\\" type=\\"radio\\" value=\\""+szval+"\\" "+szsel+"> "+sztxt+"<\\/td>"); + hDoc.write("<input name=\\"kwdsize\\" type=\\"radio\\" value=\\""+szval+"\\" "+szsel+" \\/> "+sztxt+"<\\/td>"); hDoc.write("<td align=\\"left\\">"); - hDoc.write("<input name=\\"kwdstyle\\" type=\\"radio\\" value=\\""+syval+"\\" "+sysel+"> "+sytxt+"<\\/td>"); + hDoc.write("<input name=\\"kwdstyle\\" type=\\"radio\\" value=\\""+syval+"\\" "+sysel+" \\/> "+sytxt+"<\\/td>"); hDoc.write("<\\/tr>"); } function highlightend() { var hDoc = hwdWin.document; - hDoc.write("<\\/table>"); - hDoc.write("<\\/td><\\/tr><\\/table> "); - hDoc.write("<input type=\\"button\\" value=\\"$lt{'save'}\\" onclick=\\"javascript:updateChoice(1)\\"> "); - hDoc.write("<input type=\\"button\\" value=\\"$lt{'canc'}\\" onclick=\\"self.close()\\"><br /><br />"); + hDoc.write("<\\/table><br \\/>"); + hDoc.write("<input type=\\"button\\" value=\\"$lt{'save'}\\" onclick=\\"javascript:updateChoice(1)\\" \\/> "); + hDoc.write("<input type=\\"button\\" value=\\"$lt{'canc'}\\" onclick=\\"self.close()\\" \\/><br /><br />"); hDoc.write("<\\/form>"); hDoc.write('$end_page_highlight_central'); hDoc.close(); @@ -2045,6 +2061,7 @@ sub submission { if (1) { my %lt = &Apache::lonlocal::texthash( + keyh => 'Keyword Highlighting', keyw => 'Keyword Options', list => 'List', past => 'Paste Selection to List', @@ -2053,13 +2070,18 @@ sub submission { # # Print out the keyword options line # - $request->print(<<KEYWORDS); -<br /><b>$lt{'keyw'}:</b> -<a href="javascript:keywords(document.SCORE);" target="_self">$lt{'list'}</a> -<a href="#" onmousedown="javascript:getSel(); return false" - class="page">$lt{'past'}</a> -<a href="javascript:kwhighlight();" target="_self">$lt{'high'}</a><br /><br /> -KEYWORDS + $request->print( + '<div class="LC_columnSection">' + .'<fieldset><legend>'.$lt{'keyh'}.'</legend>' + .&Apache::lonhtmlcommon::funclist_from_array( + ['<a href="javascript:keywords(document.SCORE);" target="_self">'.$lt{'list'}.'</a>', + '<a href="#" onmousedown="javascript:getSel(); return false" + class="page">'.$lt{'past'}.'</a>', + '<a href="javascript:kwhighlight();" target="_self">'.$lt{'high'}.'</a>'], + {legend => $lt{'keyw'}}) + .'</fieldset></div>' + ); + # # Load the other essays for similarity check #