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

raeburn raeburn at source.lon-capa.org
Sat Mar 7 18:04:09 EST 2015


raeburn		Sat Mar  7 23:04:09 2015 EDT

  Modified files:              
    /loncom/homework	chemresponse.pm 
  Log:
  - Bug 4729
    - Course/Community defaults includes a domain configuration to specify use
      of the JSME molecular editor (can be overridden in Course Settings --
      "Display of Resources" -- by CC).    
  
  
Index: loncom/homework/chemresponse.pm
diff -u loncom/homework/chemresponse.pm:1.94 loncom/homework/chemresponse.pm:1.95
--- loncom/homework/chemresponse.pm:1.94	Wed Aug 20 18:02:08 2014
+++ loncom/homework/chemresponse.pm	Sat Mar  7 23:04:08 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # chemical equation style response
 #
-# $Id: chemresponse.pm,v 1.94 2014/08/20 18:02:08 raeburn Exp $
+# $Id: chemresponse.pm,v 1.95 2015/03/07 23:04:08 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -69,6 +69,34 @@
 sub separate_jme_window {
     my ($smile_input,$jme_input,$molecule,$options,$shown_text)=@_;
     my $usejsme = 1;
+    if (($env{'request.course.id'}) && ($env{'request.state'} ne 'construct')) {
+        if (exists($env{'course.'.$env{'request.course.id'}.'.usejsme'})) {
+            if ($env{'course.'.$env{'request.course.id'}.'.usejsme'} eq '0') {
+                $usejsme = 0;
+            }
+        } else {
+            my %domdefs = &Apache::lonnet::get_domain_defaults($env{'course.'.$env{'request.course.id'}.'.domain'});
+            if ($domdefs{'usejsme'} eq '0') {
+                $usejsme = 0;
+            }
+        }
+    } else {
+        my %domdefs = &Apache::lonnet::get_domain_defaults($env{'course.'.$env{'request.course.id'}.'.domain'});
+        if ($domdefs{'usejsme'} eq '0') {
+            $usejsme = 0;
+        }
+    }
+    if ($usejsme) {
+        if ($env{'browser.type'} eq 'mozilla') {
+            if ($env{'browser.version'} < 4) {
+                $usejsme = 0;
+            }
+        }
+    } else {
+        if ($env{'browser.mobile'}) {
+            $usejsme = 1;
+        }
+    }
     my $linkstyle = 'display:none';
     my $creditstyle = 'display:inline';
     if ($env{'browser.type'} eq 'explorer') {




More information about the LON-CAPA-cvs mailing list