$lt{'aut'} | $lt{'type'} |
$lt{'emof'} | $lt{'part'} | $lt{'pn'} |
-$lt{'def'} | $lt{'femof'} |
-$lt{'gen'} | $lt{'foremf'} | $lt{'fr'} |
+$lt{'gen'} | $lt{'femof'} |
+$lt{'def'} | $lt{'foremf'} | $lt{'fr'} |
ENDTABLEHEADFOUR
if ($csec) {
@@ -1148,18 +1199,20 @@ ENDTABLEHEADFOUR
my $rid=$_;
my ($inmapid)=($rid=~/\.(\d+)$/);
- if (($pschp eq 'all') || ($allmaps{$pschp} eq $mapp{$rid}) ||
- ($pssymb eq $symbp{$rid})) {
+ if ((!$pssymb &&
+ (($pschp eq 'all') || ($allmaps{$pschp} eq $mapp{$rid})))
+ ||
+ ($pssymb && $pssymb eq $symbp{$rid})) {
# ------------------------------------------------------ Entry for one resource
- if ($defbgone eq '"E0E099"') {
- $defbgone='"E0E0DD"';
+ if ($defbgone eq '"#E0E099"') {
+ $defbgone='"#E0E0DD"';
} else {
- $defbgone='"E0E099"';
+ $defbgone='"#E0E099"';
}
- if ($defbgtwo eq '"FFFF99"') {
- $defbgtwo='"FFFFDD"';
+ if ($defbgtwo eq '"#FFFF99"') {
+ $defbgtwo='"#FFFFDD"';
} else {
- $defbgtwo='"FFFF99"';
+ $defbgtwo='"#FFFF99"';
}
my $thistitle='';
my %name= ();
@@ -1186,14 +1239,14 @@ ENDTABLEHEADFOUR
my $totalparms=scalar keys %name;
if ($totalparms>0) {
my $firstrow=1;
- my $title=$bighash{'title_'.$rid};
- $title=~s/\:/:/g;
+ my $title=&Apache::lonnet::gettitle($uri);
$r->print('
---|
'.
join(' / ',split(/\//,$uri)).
' '.
- "$title");
@@ -1301,8 +1354,8 @@ ENDTABLEHEADFOUR
my $showtitle=$maptitles{$maptitle}.($maptitle!~/^uploaded/?' ['.$maptitle.']':'');
$r->print(<
-Set Defaults for All Resources in $foldermap
-$showtitle
+Set Defaults for All Resources in $foldermap
+$showtitle
Specifically for
ENDMAPONE
if ($uname) {
@@ -1310,17 +1363,17 @@ ENDMAPONE
('firstname','middlename','lastname','generation', 'id'));
my $person=$name{'firstname'}.' '.$name{'middlename'}.' '
.$name{'lastname'}.' '.$name{'generation'};
- $r->print(&mt("User")." $uname \($person\) ".
+ $r->print(&mt("User")." $uname \($person\) ".
&mt('in')." \n");
} else {
- $r->print("".&mt('all').' '.&mt('users in')." \n");
+ $r->print("".&mt('all').' '.&mt('users in')." \n");
}
- if ($csec) {$r->print(&mt("Section")." $csec ".
+ if ($csec) {$r->print(&mt("Section")." $csec ".
&mt('of')." \n")};
- $r->print("$coursename ");
- $r->print("\n");
+ $r->print("$coursename ");
+ $r->print("\n");
#---------------------------------------------------------------- print table
$r->print('');
$r->print(''.&mt('Parameter Name').' | ');
@@ -1328,6 +1381,7 @@ ENDMAPONE
$r->print(''.&mt('Parameter in Effect').' | ');
foreach (sort keys %name) {
+ $r->print('');
&print_row($r,$_,\%part,\%name,$mapid,\%default,
\%type,\%display,$defbgone,$defbgtwo,
$parmlev);
@@ -1384,21 +1438,20 @@ ENDMAPONE
my $setdef=&mt("Set Defaults for All Resources in Course");
$r->print(<$setdef
-
-$coursename
+$coursename
ENDMAPONE
if ($uname) {
my %name=&Apache::lonnet::userenvironment($udom,$uname,
('firstname','middlename','lastname','generation', 'id'));
my $person=$name{'firstname'}.' '.$name{'middlename'}.' '
.$name{'lastname'}.' '.$name{'generation'};
- $r->print(" ".&mt("User")." $uname \($person\) \n");
+ $r->print(" ".&mt("User")." $uname \($person\) \n");
} else {
- $r->print("".&mt("ALL")." ".&mt("USERS")." \n");
+ $r->print(" ".&mt("ALL")." ".&mt("USERS")." \n");
}
- if ($csec) {$r->print(&mt("Section")." $csec\n")};
- $r->print("\n");
+ if ($csec) {$r->print(&mt("Section")." $csec\n")};
+ $r->print("\n");
#---------------------------------------------------------------- print table
$r->print('');
$r->print(''.&mt('Parameter Name').' | ');
@@ -1406,6 +1459,7 @@ ENDMAPONE
$r->print(''.&mt('Parameter in Effect').' | ');
foreach (sort keys %name) {
+ $r->print('');
&print_row($r,$_,\%part,\%name,$mapid,\%default,
\%type,\%display,$defbgone,$defbgtwo,$parmlev);
# $r->print(" resource.$part{$_}.$name{$_},$symbp{$mapid} | \n");
@@ -1492,13 +1546,34 @@ sub crsenv {
if ($name =~ /^default_enrollment_(start|end)_date$/) {
$value=&Apache::lonhtmlcommon::get_date_from_form($name.'_value');
}
+ # Get existing cloners
+ my @oldcloner = ();
+ if ($name eq 'cloners') {
+ my %clonenames=&Apache::lonnet::dump('environment',$dom,$crs,'cloners');
+ if ($clonenames{'cloners'} =~ /,/) {
+ @oldcloner = split/,/,$clonenames{'cloners'};
+ } else {
+ $oldcloner[0] = $clonenames{'cloners'};
+ }
+ }
#
# Let the user know we made the changes
- if ($name) {
+ if ($name && defined($value)) {
+ if ($name eq 'cloners') {
+ $value =~ s/^,//;
+ $value =~ s/,$//;
+ }
my $put_result = &Apache::lonnet::put('environment',
{$name=>$value},$dom,$crs);
if ($put_result eq 'ok') {
$setoutput.=&mt('Set').' '.$name.' '.&mt('to').' '.$value.'. ';
+ if ($name eq 'cloners') {
+ &change_clone($value,\@oldcloner);
+ }
+ # Flush the course logs so course description is immediately updated
+ if ($name eq 'description' && defined($value)) {
+ &Apache::lonnet::flushcourselogs();
+ }
} else {
$setoutput.=&mt('Unable to set').' '.$name.' '.&mt('to').
' '.$value.' '.&mt('due to').' '.$put_result.'. ';
@@ -1512,104 +1587,132 @@ sub crsenv {
# -------------------------------------------------------- Get parameters again
my %values=&Apache::lonnet::dump('environment',$dom,$crs);
+ my $SelectStyleFile=&mt('Select Style File');
+ my $SelectSpreadsheetFile=&mt('Select Spreadsheet File');
my $output='';
if (! exists($values{'con_lost'})) {
my %descriptions=
- ('url' => 'Top Level Map '.
+ ('url' => ''.&mt('Top Level Map').' '.
'".
- 'Select Map '.
- 'Modification may make assessment data '.
- 'inaccessible',
- 'description' => 'Course Description',
- 'courseid' => 'Course ID or number '.
- '(internal, optional)',
- 'grading' => 'Grading'.
- '"standard" or any other value. '.
- 'Default for new courses is "standard".',
-
- 'default_xml_style' => 'Default XML Style File '.
+ &mt('Select Map').' '.
+ &mt('Modification may make assessment data inaccessible').
+ '',
+ 'description' => ''.&mt('Course Description').'',
+ 'courseid' => ''.&mt('Course ID or number').
+ ' '.
+ '('.&mt('internal').', '.&mt('optional').')',
+ 'cloners' => ''.&mt('Users allowed to clone course').' (user:domain,user:domain) '.&mt('Users with active Course Coordinator role in the course automatically have the right to clone it, and can be omitted from list.'),
+ 'grading' => ''.&mt('Grading').' '.
+ '"standard", "external", or "spreadsheet" '.&Apache::loncommon::help_open_topic('GradingOptions'),
+ 'default_xml_style' => ''.&mt('Default XML Style File').' '.
'Select Style File ",
- 'question.email' => 'Feedback Addresses for Resource Content '.
- 'Questions (user:domain,'.
+ ",'sty')\">$SelectStyleFile ",
+ 'question.email' => ''.&mt('Feedback Addresses for Resource Content Question').
+ ' (user:domain,'.
'user:domain(section;section;...;*;...),...)',
- 'comment.email' => 'Feedback Addresses for Course Content Comments '.
+ 'comment.email' => ''.&mt('Feedback Addresses for Course Content Comments').' '.
'(user:domain,user:domain(section;section;...;*;...),...)',
- 'policy.email' => 'Feedback Addresses for Course Policy'.
+ 'policy.email' => ''.&mt('Feedback Addresses for Course Policy').''.
' (user:domain,user:domain(section;section;...;*;...),...)',
- 'hideemptyrows' => 'Hide Empty Rows in Spreadsheets '.
- '("yes" for default hiding)',
- 'pageseparators' => 'Visibly Separate Items on Pages '.
- '("yes" for visible separation, '.
- 'changes will not show until next login)',
-
- 'plc.roles.denied'=> 'Disallow live chatroom use for '.
- 'Roles "st": '.
- 'student, "ta": '.
+ 'hideemptyrows' => ''.&mt('Hide Empty Rows in Spreadsheets').' '.
+ '('.&mt('"[_1]" for default hiding','yes').')',
+ 'pageseparators' => ''.&mt('Visibly Separate Items on Pages').' '.
+ '('.&mt('"[_1]" for visible separation','yes').', '.
+ &mt('changes will not show until next login').')',
+ 'student_classlist_view' => ''.&mt('Allow students to view classlist.').''.&mt('("all":students can view all sections,"section":students can only view their own section.blank or "disabled" prevents student view.'),
+
+ 'plc.roles.denied'=> ''.&mt('Disallow live chatroom use for Roles').
+ ' "st": '.
+ &mt('student').', "ta": '.
'TA, "in": '.
- 'instructor; role,role,...) '.
+ &mt('instructor').'; '.&mt('role,role,...').') '.
Apache::loncommon::help_open_topic("Course_Disable_Discussion"),
'plc.users.denied' =>
- 'Disallow live chatroom use for Users '.
+ ''.&mt('Disallow live chatroom use for Users').' '.
'(user:domain,user:domain,...)',
- 'pch.roles.denied'=> 'Disallow Resource Discussion for '.
- 'Roles "st": '.
+ 'pch.roles.denied'=> ''.&mt('Disallow Resource Discussion for Roles').
+ ' "st": '.
'student, "ta": '.
'TA, "in": '.
'instructor; role,role,...) '.
Apache::loncommon::help_open_topic("Course_Disable_Discussion"),
'pch.users.denied' =>
- 'Disallow Resource Discussion for Users '.
+ ''.&mt('Disallow Resource Discussion for Users').' '.
'(user:domain,user:domain,...)',
'spreadsheet_default_classcalc'
- => 'Default Course Spreadsheet '.
+ => ''.&mt('Default Course Spreadsheet').' '.
'Select Spreadsheet File ",
+ ",'spreadsheet')\">$SelectSpreadsheetFile ",
'spreadsheet_default_studentcalc'
- => 'Default Student Spreadsheet '.
+ => ''.&mt('Default Student Spreadsheet').' '.
'Select Spreadsheet File ",
+ ",'spreadsheet')\">$SelectSpreadsheetFile ",
'spreadsheet_default_assesscalc'
- => 'Default Assessment Spreadsheet '.
+ => ''.&mt('Default Assessment Spreadsheet').' '.
'Select Spreadsheet File ",
+ ",'spreadsheet')\">$SelectSpreadsheetFile ",
'allow_limited_html_in_feedback'
- => 'Allow limited HTML in discussion posts '.
- '(Set value to "yes" to allow)',
+ => ''.&mt('Allow limited HTML in discussion posts').' '.
+ '('.&mt('Set value to "[_1]" to allow',"yes").')',
+ 'allow_discussion_post_editing'
+ => ''.&mt('Allow users to edit/delete their own discussion posts').' '.
+ '('.&mt('Set value to "[_1]" to allow',"yes").')',
'rndseed'
- => 'Randomization algorithm used '.
- 'Modifying this will make problems '.
- 'have different numbers and answers',
+ => ''.&mt('Randomization algorithm used').' '.
+ ''.&mt('Modifying this will make problems').' '.
+ &mt('have different numbers and answers').'',
+ 'receiptalg'
+ => ''.&mt('Receipt algorithm used').' '.
+ &mt('This controls how receipt numbers are generated.'),
+ 'suppress_tries'
+ => ''.&mt('Suppress number of tries in printing').'('.
+ &mt('yes if supress').')',
'problem_stream_switch'
- => 'Allow problems to be split over pages '.
- ' ("yes" if allowed, anything else if not)',
+ => ''.&mt('Allow problems to be split over pages').' '.
+ ' ('.&mt('"[_1]" if allowed, anything else if not','yes').')',
+ 'default_paper_size'
+ => ''.&mt('Default paper type').' '.
+ ' ('.&mt('supported types').': Letter [8 1/2x11 in], Legal [8 1/2x14 in],'.
+ ' Tabloid [11x17 in], Executive [7 1/2x10 in], A2 [420x594 mm],'.
+ ' A3 [297x420 mm], A4 [210x297 mm], A5 [148x210 mm], A6 [105x148 mm])',
'anonymous_quiz'
- => 'Anonimous quiz/exam '.
- ' (yes to avoid print students names )',
- 'default_enrollment_start_date' => 'Default beginning date '.
- 'when enrolling students',
- 'default_enrollment_end_date' => 'Default ending date '.
- 'when enrolling students',
- 'languages' => 'Languages used',
+ => ''.&mt('Anonymous quiz/exam').' '.
+ ' ('.&mt('yes').' '.&mt('to avoid print students names').' )',
+ 'default_enrollment_start_date' => ''.&mt('Default beginning date when enrolling students').'',
+ 'default_enrollment_end_date' => ''.&mt('Default ending date when enrolling students').'',
+ 'nothideprivileged' => ''.&mt('Privileged users that should not be hidden on staff listings').''.
+ ' (user:domain,user:domain,...)',
+ 'languages' => ''.&mt('Languages used').'',
'disable_receipt_display'
- => 'Disable display of problem receipts '.
- ' ("yes" to disable, anything else if not)'
+ => ''.&mt('Disable display of problem receipts').' '.
+ ' ('.&mt('"[_1]" to disable, anything else if not','yes').')',
+ 'disablesigfigs'
+ => ''.&mt('Disable checking of Significant Figures').' '.
+ ' ('.&mt('"[_1]" to disable, anything else if not','yes').')',
+ 'tthoptions'
+ => ''.&mt('Default set of options to pass to tth/m when converting tex').''
);
- my @Display_Order = ('url','description','courseid','grading',
+ my @Display_Order = ('url','description','courseid','cloners','grading',
'default_xml_style','pageseparators',
'question.email','comment.email','policy.email',
+ 'student_classlist_view',
'plc.roles.denied','plc.users.denied',
'pch.roles.denied','pch.users.denied',
'allow_limited_html_in_feedback',
+ 'allow_discussion_post_editing',
'languages',
+ 'nothideprivileged',
'rndseed',
+ 'receiptalg',
'problem_stream_switch',
+ 'suppress_tries',
+ 'default_paper_size',
'disable_receipt_display',
'spreadsheet_default_classcalc',
'spreadsheet_default_studentcalc',
@@ -1617,12 +1720,16 @@ sub crsenv {
'hideemptyrows',
'default_enrollment_start_date',
'default_enrollment_end_date',
+ 'tthoptions',
+ 'disablesigfigs'
);
foreach my $parameter (sort(keys(%values))) {
- if (! $descriptions{$parameter}) {
- $descriptions{$parameter}=$parameter;
- push(@Display_Order,$parameter);
- }
+ unless ($parameter =~ m/^internal\./) {
+ if (! $descriptions{$parameter}) {
+ $descriptions{$parameter}=$parameter;
+ push(@Display_Order,$parameter);
+ }
+ }
}
foreach my $parameter (@Display_Order) {
my $description = $descriptions{$parameter};
@@ -1659,33 +1766,24 @@ sub crsenv {
$onchange.' />'.
' | ';
}
+ my %lt=&Apache::lonlocal::texthash(
+ 'par' => 'Parameter',
+ 'val' => 'Value',
+ 'set' => 'Set',
+ 'sce' => 'Set Course Environment'
+ );
+
+ my $Parameter=&mt('Parameter');
+ my $Value=&mt('Value');
+ my $Set=&mt('Set');
+ my $browse_js=&Apache::loncommon::browser_and_searcher_javascript('parmset');
+ my $html=&Apache::lonxml::xmlbegin();
$r->print(<
+$html
+
-
LON-CAPA Course Environment
$bodytag
@@ -1693,10 +1791,10 @@ $bodytag
$setoutput
-Parameter | Value | Set? |
+$lt{'par'} | $lt{'val'} | $lt{'set'}? |
$output
-
+
@@ -1731,8 +1829,9 @@ sub overview {
'Set/Modify Course Assessment Parameters');
my $dom = $ENV{'course.'.$ENV{'request.course.id'}.'.domain'};
my $crs = $ENV{'course.'.$ENV{'request.course.id'}.'.num'};
+ my $html=&Apache::lonxml::xmlbegin();
$r->print(<
+$html
LON-CAPA Course Environment
@@ -1757,13 +1856,30 @@ ENDOVER
push (@deldata,$thiskey);
} elsif ($cmd eq 'datepointer') {
my $data=&Apache::lonhtmlcommon::get_date_from_form($ENV{$_});
- if ($olddata{$thiskey} ne $data) { $newdata{$thiskey}=$data; }
+ if (defined($data) and $olddata{$thiskey} ne $data) { $newdata{$thiskey}=$data; }
}
}
}
# Store
- &Apache::lonnet::del('resourcedata',\@deldata,$dom,$crs);
- &Apache::lonnet::put('resourcedata',\%newdata,$dom,$crs);
+ my $delentries=$#deldata+1;
+ my @newdatakeys=keys %newdata;
+ my $putentries=$#newdatakeys+1;
+ if ($delentries) {
+ if (&Apache::lonnet::del('resourcedata',\@deldata,$dom,$crs) eq 'ok') {
+ $r->print(''.&mt('Deleted [_1] parameter(s)',$delentries));
+ } else {
+ $r->print(''.
+ &mt('Error deleting parameters').'');
+ }
+ }
+ if ($putentries) {
+ if (&Apache::lonnet::put('resourcedata',\%newdata,$dom,$crs) eq 'ok') {
+ $r->print(''.&mt('Stored [_1] parameter(s)',$putentries));
+ } else {
+ $r->print(''.
+ &mt('Error storing parameters').'');
+ }
+ }
# Read and display
my %resourcedata=&Apache::lonnet::dump('resourcedata',$dom,$crs);
my $oldsection='';
@@ -1771,6 +1887,7 @@ ENDOVER
my $oldpart='';
my $pointer=0;
$tableopen=0;
+ my $foundkeys=0;
foreach my $thiskey (sort keys %resourcedata) {
if ($resourcedata{$thiskey.'.type'}) {
my ($course,$middle,$part,$name)=
@@ -1783,9 +1900,10 @@ ENDOVER
$middle=~s/\.$//;
my $realm=''.&mt('All Resources').'';
if ($middle=~/^(.+)\_\_\_\(all\)$/) {
- $realm=''.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).'';
+ $realm=''.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' ('.$1.')';
} elsif ($middle) {
- $realm=''.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).'';
+ my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle);
+ $realm=''.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' ('.$url.' in '.$map.' id: '.$id.')';
}
if ($section ne $oldsection) {
$r->print(&tableend()."\n
$section");
@@ -1808,6 +1926,7 @@ ENDOVER
$r->print(&tablestart().''.$name.
': | | ');
+ $foundkeys++;
if ($resourcedata{$thiskey.'.type'}=~/^date/) {
my $jskey='key_'.$pointer;
$pointer++;
@@ -1826,8 +1945,92 @@ ENDOVER
}
}
- $r->print(&tableend().
- ' | |