[LON-CAPA-cvs] cvs: loncom /homework grades.pm

ng lon-capa-cvs@mail.lon-capa.org
Fri, 11 Apr 2003 17:57:37 -0000


ng		Fri Apr 11 13:57:37 2003 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  Fix bug 1312 - ' in a name for essay grading
  
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.83 loncom/homework/grades.pm:1.84
--- loncom/homework/grades.pm:1.83	Fri Apr  4 18:35:17 2003
+++ loncom/homework/grades.pm	Fri Apr 11 13:57:37 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.83 2003/04/04 23:35:17 albertel Exp $
+# $Id: grades.pm,v 1.84 2003/04/11 17:57:37 ng Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -717,7 +717,7 @@
 	height = 600;
 	scrollbar = "yes";
     }
-//    if (window.pWin) window.pWin.close();
+//    if (window.pWin) {window.pWin.close(); window.pWin=null}
     pWin = window.open('', 'MessageCenter', 'toolbar=no,location=no,scrollbars='+scrollbar+',screenx=70,screeny=75,width=600,height='+height);
     pWin.focus();
     pDoc = pWin.document;
@@ -752,11 +752,7 @@
     pDoc.write("     includemsg = 1;");
     pDoc.write("  }");
     pDoc.write("  imgformname = eval(\\"opener.document.SCORE.mailicon\\"+usrctr);");
-    pDoc.write("  if (includemsg) {");
-    pDoc.write("     imgformname.src = \\"$iconpath/mailto.gif\\";");
-    pDoc.write("  } else {");
-    pDoc.write("     imgformname.src = \\"$iconpath/mailbkgrd.gif\\";");
-    pDoc.write("  }");
+    pDoc.write("  imgformname.src = \\"$iconpath/\\"+((includemsg) ? \\"mailto.gif\\" : \\"mailbkgrd.gif\\");");
     pDoc.write("  var includemsg = eval(\\"opener.document.SCORE.includemsg\\"+usrctr);");
     pDoc.write("  includemsg.value = msgchk;");
 
@@ -1250,6 +1246,7 @@
 	my $lastone = pop @col_fullnames;
 	$msgfor .= ', '.(join ', ',@col_fullnames).' and '.$lastone.'.';
     }
+    $msgfor =~ s/\'/\\'/g;
     $result.='<tr><td bgcolor="#ffffff">'."\n".
 	'&nbsp;<a href="javascript:msgCenter(document.SCORE,'.$counter.
 	',\''.$msgfor.'\')"; TARGET=_self>'.