--- loncom/interface/courseprefs.pm 2010/02/12 00:39:51 1.8.2.6
+++ loncom/interface/courseprefs.pm 2010/01/08 00:04:04 1.19
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set configuration settings for a course
#
-# $Id: courseprefs.pm,v 1.8.2.6 2010/02/12 00:39:51 raeburn Exp $
+# $Id: courseprefs.pm,v 1.19 2010/01/08 00:04:04 faziophi Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -115,15 +115,15 @@ sub handler {
%lt = (
conf => 'Course Configuration',
edit => 'Edit Course Configuration',
- gens => 'General course settings',
- idnu => 'Course ID or number',
- desc => 'Course Description',
+ gens => 'General Settings',
+ idnu => 'ID/Number',
+ desc => 'Title',
catg => 'Categorize course',
excc => 'Exclude from course catalog',
clon => 'Users allowed to clone course',
rept => 'Replacement titles for standard course roles',
- time => 'Timezone in which the course takes place',
- date => 'Locale used for course calendar',
+ time => 'Timezone',
+ date => 'Calendar Locale',
coco => 'Course Content',
copo => 'Course Policy',
priv => 'Domain Coordinators in course',
@@ -161,36 +161,32 @@ sub handler {
'courseinfo' =>
{ text => $lt{'gens'},
help => 'Course_Environment',
- header => [{col1 => 'Setting',
- col2 => 'Value'}],
ordered => ['description','courseid','categories',
- 'hidefromcat','cloners','externalsyllabus',
- 'url','rolenames'],
+ 'hidefromcat','externalsyllabus',
+ 'cloners','url','rolenames'],
itemtext => {
description => $lt{'desc'},
courseid => $lt{'idnu'},
categories => $lt{'catg'},
hidefromcat => $lt{'excc'},
cloners => $lt{'clon'},
- externalsyllabus => 'URL of Syllabus',
+ externalsyllabus => 'External Syllabus URL',
url => 'Top Level Map',
rolenames => $lt{'rept'},
},
},
'localization' =>
- { text => 'Language/TimeZone/Locale',
+ { text => 'Language & Time Localization',
help => 'Course_Environment',
- header => [{col1 => 'Setting',
- col2 => 'Value',}],
ordered => ['languages','timezone','datelocale'],
itemtext => {
- languages => 'Languages used',
+ languages => 'Language(s)',
timezone => $lt{'time'},
datelocale => $lt{'date'},
},
},
'feedback' =>
- { text => 'Feedback messages',
+ { text => 'Feedback Messages',
help => 'Course_Environment',
header => [{col1 => 'Questions about:',
col2 => 'Recipients'},
@@ -206,19 +202,17 @@ sub handler {
'discussion' =>
{ text => 'Discussion and Chat',
help => 'Course_Environment',
- header => [{col1 => 'Setting',
- col2 => 'Value',}],
ordered => ['plc.roles.denied','plc.users.denied',
'pch.roles.denied','pch.users.denied',
'allow_limited_html_in_feedback',
'allow_discussion_post_editing'],
itemtext => {
- 'plc.roles.denied' => 'No Resource Discussion',
- 'plc.users.denied' => 'No Resource Discussion',
- 'pch.roles.denied' => 'No Chat room use',
- 'pch.users.denied' => 'No Chat room use',
- allow_limited_html_in_feedback => 'Allow limited HTML in discussion posts',
- allow_discussion_post_editing => 'Users can edit/delete own discussion posts',
+ 'plc.roles.denied' => 'Disable resource discussion',
+ 'plc.users.denied' => 'Disable resource discussion',
+ 'pch.roles.denied' => 'Disable chat room',
+ 'pch.users.denied' => 'Disable chat room',
+ allow_limited_html_in_feedback => 'HTML in discussion',
+ allow_discussion_post_editing => 'Allow users to edit/delete own discussion posts',
},
},
'classlists' =>
@@ -244,57 +238,50 @@ sub handler {
},
},
'appearance' =>
- { text => 'Display of resources ',
+ { text => 'Display of Resources ',
help => 'Course_Environment',
- header => [{col1 => 'Setting',
- col2 => 'Value'}],
ordered => ['default_xml_style','pageseparators',
'disable_receipt_display','texengine',
'tthoptions'],
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',
+ default_xml_style => 'Default XML style file',
+ pageseparators => 'Separate items on composite pages',
+ disable_receipt_display => 'Disable problem receipts display',
+ texengine => 'Force specific math rendering engine',
tthoptions => 'Default set of options to pass to tth/m when converting TeX',
},
},
'grading' =>
{ text => 'Grading',
help => 'Course_Environment',
- header => [{col1 => 'Setting',
- col2 => 'Value',}],
ordered => ['grading','rndseed',
'receiptalg','disablesigfigs'],
itemtext => {
- grading => 'Grading',
- rndseed => 'Randomization algorithm used',
- receiptalg => 'Receipt algorithm used',
- disablesigfigs => 'Disable checking of Significant Figures',
+ grading => 'Grading Type',
+ rndseed => 'Randomization algorithm',
+ receiptalg => 'Receipt algorithm',
+ disablesigfigs => 'Disable significant figure checks',
},
},
'printouts' =>
- { text => 'Printout generation',
+ { text => 'Printouts',
help => 'Course_Environment',
- header => [{col1 => 'Setting',
- 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' =>
{ text => 'Spreadsheets',
help => 'Course_Environment',
- header => [{col1 => 'Setting',
- col2 => 'Value'}],
ordered => ['spreadsheet_default_classcalc',
'spreadsheet_default_studentcalc',
'spreadsheet_default_assesscalc','hideemptyrows'],
@@ -308,8 +295,6 @@ sub handler {
'bridgetasks' =>
{ text => 'Bridge tasks',
help => 'Course_Environment',
- header => [{col1 => 'Setting',
- col2 => 'Value'}],
ordered => ['task_messages','task_grading',
'suppress_embed_prompt'],
itemtext => {
@@ -365,21 +350,20 @@ 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 .= '
-
-
-
-
+ ';
+ if (exists $item->{'header'}->[0]->{'col1'} ||
+ exists $item->{'header'}->[0]->{'col2'}) {
+ $output .= '
+
'.&mt($item->{'header'}->[0]->{'col1'}).' |
'.&mt($item->{'header'}->[0]->{'col2'}).' |
- ';
+ ';
+ }
$rowtotal ++;
if ($action eq 'feedback') {
$output .= &print_feedback('top',$cdom,$settings,$ordered,$itemtext,\$rowtotal);
@@ -388,10 +372,6 @@ sub print_config_box {
}
$output .= '
-
-
-
-
'.&mt($item->{'header'}->[1]->{'col1'}).' | ';
@@ -402,25 +382,27 @@ sub print_config_box {
$output .= &print_classlists('middle',$cdom,$settings,$itemtext,\$rowtotal,$crstype).
'
- |
-
-
-
-
-
- '.&mt($item->{'header'}->[2]->{'col1'}).' |
- '.&mt($item->{'header'}->[2]->{'col2'}).' |
- ';
+ ';
+ if (exists $item->{'header'}->[0]->{'col1'} ||
+ exists $item->{'header'}->[0]->{'col2'}) {
+ $output .= '
+
+ '.&mt($item->{'header'}->[0]->{'col1'}).' |
+ '.&mt($item->{'header'}->[0]->{'col2'}).' |
+ ';
+ }
}
} else {
$output .= '
-
-
-
-
+ ';
+ if (exists $item->{'header'}->[0]->{'col1'} ||
+ exists $item->{'header'}->[0]->{'col2'}) {
+ $output .= '
+
'.&mt($item->{'header'}->[0]->{'col1'}).' |
'.&mt($item->{'header'}->[0]->{'col2'}).' |
- ';
+ ';
+ }
}
$rowtotal ++;
if ($action eq 'courseinfo') {
@@ -448,9 +430,7 @@ sub print_config_box {
}
$output .= '
-
-
- ';
+';
return ($output,$rowtotal);
}
@@ -985,13 +965,19 @@ sub store_changes {
if (defined($yesno{$key})) {
$displayval = &mt('No');
if ($changes->{$item}{$key} eq 'yes') {
- $displayval = &mt('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,10 +1023,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);
+ } else {
+ foreach my $key (@delkeys) {
+ &Apache::lonnet::delenv('course.'.$cdom.'_'.$cnum.'.'.$key);
+ }
}
}
if (@need_env_update) {
@@ -1323,6 +1309,7 @@ sub print_courseinfo {
'',
input => 'textbox',
size => '40',
+ advanced => 1
},
'description' => {
text => ''.&mt($itemtext->{'description'}).'',
@@ -1340,12 +1327,14 @@ sub print_courseinfo {
&mt('Coordinators included automatically'),
input => 'textbox',
size => '40',
+ advanced => 1
},
'rolenames' => {
text => ''.&mt($itemtext->{'rolenames'}).' '.
'('.$replace.')',
input => 'textbox',
size => '20',
+ advanced => 1
},
'externalsyllabus' => {
text => ''.&mt($itemtext->{'externalsyllabus'}).' ('.
@@ -1374,7 +1363,11 @@ sub print_courseinfo {
next if (!$can_categorize);
}
$count ++;
- $datatable .= &item_table_row_start($items{$item}{text},$count);
+ if (exists $items{$item}{advanced} && $items{$item}{advanced} == 1) {
+ $datatable .= &item_table_row_start($items{$item}{text},$count,"advanced");
+ } else {
+ $datatable .= &item_table_row_start($items{$item}{text},$count);
+ }
if ($items{$item}{input} eq 'radio') {
$datatable .= &yesno_radio($item,$settings);
} elsif ($item eq 'cloners') {
@@ -1642,16 +1635,16 @@ sub print_localization {
}
my %items = (
languages => {
- text => &mt($itemtext->{'languages'}).' '.
- &mt("(will override user's preference)"),
+ text => ''.&mt($itemtext->{'languages'}).' '.
+ &mt("(overrides individual user preference)"),
input => 'selectbox',
},
timezone => {
- text => &mt($itemtext->{'timezone'}),
+ text => ''.&mt($itemtext->{'timezone'}).'',
input => 'selectbox',
},
datelocale => {
- text => &mt($itemtext->{'datelocale'}),
+ text => ''.&mt($itemtext->{'datelocale'}).'',
input => 'selectbox',
},
);
@@ -1760,11 +1753,11 @@ sub print_feedback {
my %sections = &Apache::loncommon::get_sections($cdom,$cnum);
my @sections = sort( { $a <=> $b } keys(%sections));
my %lt = &Apache::lonlocal::texthash (
- currone => 'Current recipient:',
- currmult => 'Current recipients:',
- add => 'Additional recipient:',
- del => 'Delete?',
- sec => 'Sections:',
+ currone => 'Current recipient:',
+ curmult => 'Current recipients:',
+ add => 'Additional recipient:',
+ del => 'Delete?',
+ sec => 'Sections:',
);
foreach my $item (@{$ordered}) {
@@ -1825,7 +1818,7 @@ sub user_table {
if ($num) {
$output .= ''.
'';
- if ($num == 1) {
+ if ($num > 1) {
$output .= $lt->{'currone'};
} else {
$output .= $lt->{'currmult'};
@@ -1945,11 +1938,11 @@ sub print_discussion {
my %sections = &Apache::loncommon::get_sections($cdom,$cnum);
my @sections = sort( { $a <=> $b } keys(%sections));
my %lt = &Apache::lonlocal::texthash (
- currone => 'Disallowed:',
- currmult => 'Disallowed:',
- add => 'Disallow more:',
- del => 'Delete?',
- sec => 'Sections:',
+ currone => 'Disallowed:',
+ curmult => 'Disallowed:',
+ add => 'Disallow more:',
+ del => 'Delete?',
+ sec => 'Sections:',
);
foreach my $item (@{$ordered}) {
@@ -2233,7 +2226,7 @@ sub print_grading {
},
'rndseed' => {
text => ''.&mt($itemtext->{'rndseed'}).''.
- ''.' '.
+ ''.' '.
&mt('Modifying this will make problems have different numbers and answers!').
'',
input => 'selectbox',
@@ -2305,6 +2298,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);
}
@@ -2435,15 +2438,13 @@ sub get_other_items {
}
sub item_table_row_start {
- my ($text,$count) = @_;
+ my ($text,$count,$add_class) = @_;
my $output;
- if ($count%2) {
- $output .= '';
- } else {
- $output .= ' ';
- }
+ my $css_class = ($count % 2) ? 'LC_odd_row' : 'LC_even_row';
+ $css_class = (join(' ',$css_class,$add_class)) unless ($add_class eq '');
+ $output .= ' '."\n";;
$output .= ''.$text.
- ' | ';
+ ' | ';
return $output;
}
| | | | |