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

raeburn raeburn at source.lon-capa.org
Sat Mar 7 18:05:57 EST 2015


raeburn		Sat Mar  7 23:05:57 2015 EDT

  Modified files:              
    /loncom/homework	response.pm 
  Log:
  - Previewing math expressions by a student (mathresponse and formularesponse).
    - Course/Community defaults includes a domain configuration to specify use
      of the LON-CAPA Math previewer (can be overridden in Course Settings --
      "Display of Resources" -- by CC).
  
  
Index: loncom/homework/response.pm
diff -u loncom/homework/response.pm:1.241 loncom/homework/response.pm:1.242
--- loncom/homework/response.pm:1.241	Mon Feb 23 19:46:19 2015
+++ loncom/homework/response.pm	Sat Mar  7 23:05:57 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # various response type definitons response definition
 #
-# $Id: response.pm,v 1.241 2015/02/23 19:46:19 raeburn Exp $
+# $Id: response.pm,v 1.242 2015/03/07 23:05:57 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -595,17 +595,36 @@
             $eqneditor = 'dragmath';
         }
     } elsif ($env{'browser.type'} eq 'mozilla') {
-        if ($env{'browser.version'} < 3) {
+        if ($env{'browser.version'} < 4) {
             $eqneditor = 'dragmath';
         } else {
             if ($env{'browser.info'} =~ /^firefox\-([\d\.]+)/) {
                 my $firefox = $1;
-                if ($firefox < 3) {
+                if ($firefox < 4) {
                     $eqneditor = 'dragmath';
                 }
             }
         }
     }
+    if ($eqneditor eq 'lcmath') {
+        if (($env{'request.course.id'}) && ($env{'request.state'} ne 'construct')) {
+            if (exists($env{'course.'.$env{'request.course.id'}.'.uselcmath'})) {
+                if ($env{'course.'.$env{'request.course.id'}.'.uselcmath'} eq '0') {
+                    $eqneditor = 'dragmath';
+                }
+            } else {
+                my %domdefs = &Apache::lonnet::get_domain_defaults($env{'course.'.$env{'request.course.id'}.'.domain'});
+                if ($domdefs{'uselcmath'} eq '0') {
+                    $eqneditor = 'dragmath';
+                }
+            }
+        } else {
+            my %domdefs = &Apache::lonnet::get_domain_defaults($env{'course.'.$env{'request.course.id'}.'.domain'});
+            if ($domdefs{'uselcmath'} eq '0') {
+                $eqneditor = 'dragmath';
+            }
+        }
+    }
     if ($eqneditor eq 'dragmath') {
         # DragMath applet
         my $button=&mt('Edit Answer');




More information about the LON-CAPA-cvs mailing list