--- loncom/homework/chemresponse.pm 2014/08/20 18:02:08 1.94 +++ loncom/homework/chemresponse.pm 2015/03/07 23:04:08 1.95 @@ -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 chem_standard_order { 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') {