--- loncom/interface/courseprefs.pm 2009/11/23 21:45:18 1.12
+++ loncom/interface/courseprefs.pm 2010/01/07 18:21:25 1.16
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set configuration settings for a course
#
-# $Id: courseprefs.pm,v 1.12 2009/11/23 21:45:18 raeburn Exp $
+# $Id: courseprefs.pm,v 1.16 2010/01/07 18:21:25 faziophi Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -101,7 +101,7 @@ sub handler {
date => 'Locale used for community calendar',
coco => 'Community Content',
copo => 'Community Policy',
- priv => 'Domain Coodinators in community',
+ priv => 'Domain Coordinators in community',
defd => 'Default dates for member access',
stuv => 'Member-viewable membership list options',
stul => 'Member agreement needed to be listed',
@@ -126,7 +126,7 @@ sub handler {
date => 'Locale used for course calendar',
coco => 'Course Content',
copo => 'Course Policy',
- priv => 'Domain Coodinators in course',
+ priv => 'Domain Coordinators in course',
defd => 'Default dates for student access',
stuv => 'Student-viewable classlist options',
stul => 'Student agreement needed to be listed',
@@ -281,13 +281,14 @@ sub handler {
col2 => 'Value',}],
ordered => ['problem_stream_switch','suppress_tries',
'default_paper_size','print_header_format',
- 'disableexampointprint'],
+ 'disableexampointprint','canuse_pdfforms'],
itemtext => {
problem_stream_switch => 'Allow problems to be split over pages',
suppress_tries => 'Suppress number of tries in printing',
default_paper_size => 'Default paper type',
print_header_format => 'Print header format',
disableexampointprint => 'Disable automatically printing point values on exams',
+ canuse_pdfforms => 'Users can print problems as PDF forms and upload later for grading',
},
},
'spreadsheet' =>
@@ -365,16 +366,11 @@ sub print_config_box {
my $itemtext = $item->{'itemtext'};
my $rowtotal = 0;
my $output =
- '
-
- '.
- &mt($item->{text}).' '.
- &Apache::loncommon::help_open_topic($item->{'help'}).' | '."\n".
- '
';
+ '
+ '.
+ &Apache::loncommon::help_open_topic($item->{'help'}).'';
if (($action eq 'feedback') || ($action eq 'classlists')) {
$output .= '
-
-
'.&mt($item->{'header'}->[0]->{'col1'}).' |
@@ -388,10 +384,6 @@ sub print_config_box {
}
$output .= '
- |
-
-
-
'.&mt($item->{'header'}->[1]->{'col1'}).' | ';
@@ -402,10 +394,6 @@ sub print_config_box {
$output .= &print_classlists('middle',$cdom,$settings,$itemtext,\$rowtotal,$crstype).
'
- |
-
-
-
'.&mt($item->{'header'}->[2]->{'col1'}).' |
@@ -414,8 +402,6 @@ sub print_config_box {
}
} else {
$output .= '
-
-
'.&mt($item->{'header'}->[0]->{'col1'}).' |
@@ -448,9 +434,7 @@ sub print_config_box {
}
$output .= '
- |
-
- ';
+';
return ($output,$rowtotal);
}
@@ -983,15 +967,21 @@ sub store_changes {
$displayname = &mt($text);
}
if (defined($yesno{$key})) {
- $displayval = 'no';
+ $displayval = &mt('No');
if ($changes->{$item}{$key} eq 'yes') {
- $displayval = 'yes';
+ $displayval = &mt('Yes');
}
} elsif (($key =~ /^default_enrollment_(start|end)_date$/) && ($displayval)) {
$displayval = &Apache::lonlocal::locallocaltime($displayval);
} elsif ($key eq 'categories') {
$displayval = $env{'form.categories_display'};
- }
+ } elsif ($key eq 'canuse_pdfforms') {
+ if ($changes->{$item}{$key} eq '1') {
+ $displayval = &mt('Yes');
+ } elsif ($changes->{$item}{$key} eq '0') {
+ $displayval = &mt('No');
+ }
+ }
if ($changes->{$item}{$key} eq '') {
push(@delkeys,$key);
$output .= ''.&mt('Deleted setting for [_1]',
@@ -1037,6 +1027,10 @@ sub store_changes {
$output .= &mt('An error occurred when removing course settings which are no longer in use.');
}
$output .= '';
+ } else {
+ foreach my $key (@delkeys) {
+ &Apache::lonnet::delenv('course.'.$cdom.'_'.$cnum.'.'.$key);
+ }
}
}
if (@need_env_update) {
@@ -1298,7 +1292,7 @@ sub print_courseinfo {
}
}
if (!defined($categoriesform)) {
- $categoriesform = &mt('No categories defined for this domain');
+ $categoriesform = &mt('No categories defined in this domain.');
}
my ($can_toggle_cat,$can_categorize) = &can_modify_catsettings($cdom,$crstype);
@@ -2301,6 +2295,16 @@ sub print_printouts {
text => ''.&mt($itemtext->{'disableexampointprint'}).'',
input => 'radio',
},
+ canuse_pdfforms => {
+ text => ''.&mt($itemtext->{'canuse_pdfforms'}).'',
+ input => 'selectbox',
+ options => {
+ 1 => &mt('Yes'),
+ 0 => &mt('No'),
+ },
+ order => ['1','0'],
+ nullval => 'None specified - use domain default',
+ }
);
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype);
}
|