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

raeburn raeburn at source.lon-capa.org
Sat Aug 29 12:39:00 EDT 2020


raeburn		Sat Aug 29 16:39:00 2020 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - Keyword highlighting.
    Convert object to string to permit use of replace().
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.771 loncom/homework/grades.pm:1.772
--- loncom/homework/grades.pm:1.771	Wed Aug 26 18:13:40 2020
+++ loncom/homework/grades.pm	Sat Aug 29 16:39:00 2020
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.771 2020/08/26 18:13:40 raeburn Exp $
+# $Id: grades.pm,v 1.772 2020/08/29 16:39:00 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1589,6 +1589,9 @@
     if (document.getSelection) txt = document.getSelection();
     else if (document.selection) txt = document.selection.createRange().text;
     else return;
+    if (typeof(txt) != 'string') {
+        txt = String(txt);
+    }
     var cleantxt = txt.replace(new RegExp('([\\f\\n\\r\\t\\v ])+', 'g')," ");
     if (cleantxt=="") {
 	alert("$js_lt{'plse'}");




More information about the LON-CAPA-cvs mailing list