--- loncom/interface/courseprefs.pm 2014/06/13 02:03:41 1.49.2.15
+++ loncom/interface/courseprefs.pm 2015/03/11 00:28:28 1.49.2.17
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set configuration settings for a course
#
-# $Id: courseprefs.pm,v 1.49.2.15 2014/06/13 02:03:41 raeburn Exp $
+# $Id: courseprefs.pm,v 1.49.2.17 2015/03/11 00:28:28 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -463,13 +463,15 @@ sub handler {
help => 'Course_Prefs_Display',
ordered => ['default_xml_style','pageseparators',
'disable_receipt_display','texengine',
- 'tthoptions'],
+ 'tthoptions','uselcmath','usejsme'],
itemtext => {
default_xml_style => 'Default XML style file',
pageseparators => 'Visibly Separate Items on Pages',
disable_receipt_display => 'Disable display of problem receipts',
texengine => 'Force use of a specific math rendering engine',
tthoptions => 'Default set of options to pass to tth/m when converting TeX',
+ uselcmath => 'Student formula entry uses inline preview, not DragMath pop-up',
+ usejsme => 'Molecule editor uses JSME (HTML5) in place of JME (Java)',
},
},
'grading' =>
@@ -1405,7 +1407,7 @@ sub store_changes {
$displayval = &Apache::lonlocal::locallocaltime($displayval);
} elsif ($key eq 'categories') {
$displayval = $env{'form.categories_display'};
- } elsif ($key eq 'canuse_pdfforms') {
+ } elsif (($key eq 'canuse_pdfforms') || ($key eq 'usejsme') || ($key eq 'uselcmath')) {
if ($changes->{$item}{$key} eq '1') {
$displayval = &mt('Yes');
} elsif ($changes->{$item}{$key} eq '0') {
@@ -2625,9 +2627,9 @@ sub display_loncaparev_constraints {
}
foreach my $map (keys(%allmaps)) {
my $mapres = $navmap->getResourceByUrl($map);
- my $mapsymb = $mapres->symb();
- $toshow{$mapsymb} = 1;
if (ref($mapres)) {
+ my $mapsymb = $mapres->symb();
+ $toshow{$mapsymb} = 1;
my $pcslist = $mapres->map_hierarchy();
if ($pcslist ne '') {
foreach my $pc (split(/,/,$pcslist)) {
@@ -3698,6 +3700,14 @@ sub print_appearance {
input => 'textbox',
size => 40,
},
+ 'uselcmath' => {
+ text => ''.&mt($itemtext->{'uselcmath'}).'',
+ input => 'radio',
+ },
+ 'usejsme' => {
+ text => ''.&mt($itemtext->{'usejsme'}).'',
+ input => 'radio',
+ },
);
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'appearance');
}
@@ -3959,20 +3969,30 @@ sub item_table_row_end {
}
sub yesno_radio {
- my ($item,$settings) = @_;
+ my ($item,$settings,$unsetdefault,$valueyes,$valueno) = @_;
my $itemon = ' ';
my $itemoff = ' checked="checked" ';
+ if (($valueyes eq '') && ($valueno eq '')) {
+ $valueyes = 'yes';
+ $valueno = '';
+ }
if (ref($settings) eq 'HASH') {
- if ($settings->{$item} eq 'yes') {
+ if ($settings->{$item} eq $valueyes) {
$itemon = $itemoff;
$itemoff = ' ';
}
+ unless (exists($settings->{$item})) {
+ if ($unsetdefault eq $valueyes) {
+ $itemon = $itemoff;
+ $itemoff = ' ';
+ }
+ }
}
return ' '.
+ $itemon.' value="'.$valueyes.'" />'.&mt('Yes').' '.
'';
+ $itemoff.' value="'.$valueno.'" />'.&mt('No').'';
}
sub select_from_options {
@@ -4057,7 +4077,16 @@ sub make_item_rows {
&Apache::lonhtmlcommon::date_setter('display',$item,
$settings->{$item});
} elsif ($items->{$item}{input} eq 'radio') {
- $datatable .= &yesno_radio($item,$settings);
+ my ($unsetdefault,$valueyes,$valueno);
+ if (($item eq 'usejsme') || ($item eq 'uselcmath')) {
+ my %domdefs = &Apache::lonnet::get_domain_defaults($cdom);
+ unless ($domdefs{$item} eq '0') {
+ $unsetdefault = 1;
+ }
+ $valueyes = "1";
+ $valueno = "0";
+ }
+ $datatable .= &yesno_radio($item,$settings,$unsetdefault,$valueyes,$valueno);
} elsif ($items->{$item}{input} eq 'selectbox') {
my $curr = $settings->{$item};
$datatable .=
@@ -4133,7 +4162,8 @@ sub nothidepriv_row {
' '.
- ''.
+ ''.
'';
}
$datatable .= '';