');
@@ -1984,11 +2021,13 @@ sub crsenv {
my $r=shift;
my $setoutput='';
- my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs(undef,
- 'Edit Course Environment');
+ my $breadcrumbs =
+ &Apache::lonhtmlcommon::breadcrumbs('Edit Course Environment');
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my (%crsinfo,$chome);
+
#
# Go through list of changes
foreach (keys %env) {
@@ -2008,7 +2047,7 @@ sub crsenv {
('environment',
{'top level map backup '.$bkuptime => $tmp[1] },
$dom,$crs).
- ' ';
+ ' ';
}
#
# Deal with modified default spreadsheets
@@ -2036,6 +2075,29 @@ sub crsenv {
if ($name =~ /^default_enrollment_(start|end)_date$/) {
$value=&Apache::lonhtmlcommon::get_date_from_form($name.'_value');
}
+ #
+ # Deal with the emails
+ if ($name =~ /\.email$/) {
+ foreach my $specifier (split(',',$value)) {
+ my ($user,$sections_or_groups)=
+ ($specifier=~/^([^\(]+)\(([^\)]+)\)/);
+ if (!$sections_or_groups) {
+ $user = $specifier;
+ }
+ my ($name,$domain) = split(':',$user);
+ if (!defined($user) || !defined($domain)) {
+ $setoutput.= ' '.
+ &mt("Invalid email address specified, address must be of the form username:domain what was specified was ([_1])",$user).
+ '';
+ undef($value);
+ } elsif (&Apache::lonnet::homeserver($user,$domain) eq 'no_host') {
+ $setoutput.= ' '.
+ &mt("Invalid email address specified, user [_1] is unknown.",$name).
+ '';
+ undef($value);
+ }
+ }
+ }
# Get existing cloners
my @oldcloner = ();
if ($name eq 'cloners') {
@@ -2049,46 +2111,96 @@ sub crsenv {
#
# Let the user know we made the changes
if ($name && defined($value)) {
- my $failed_cloners;
+ my %failed_cloners;
if ($name eq 'cloners') {
$value =~ s/\s//g;
$value =~ s/^,//;
$value =~ s/,$//;
# check requested clones are valid users.
- $failed_cloners = &check_cloners(\$value,\@oldcloner);
+ %failed_cloners = &check_cloners(\$value,\@oldcloner);
}
my $put_result = &Apache::lonnet::put('environment',
{$name=>$value},$dom,$crs);
if ($put_result eq 'ok') {
- $setoutput.=&mt('Set').' '.$name.' '.&mt('to').' '.$value.'. ';
+ $setoutput.=&mt('Set').' '.$name.' '.&mt('to').' ';
+ if ($name =~ /^default_enrollment_(start|end)_date$/) {
+ $setoutput .= &Apache::lonlocal::locallocaltime($value);
+ } else {
+ $setoutput .= $value;
+ }
+ $setoutput .= '. ';
if ($name eq 'cloners') {
&change_clone($value,\@oldcloner);
}
- # Flush the course logs so course description is immediately updated
+ # Update environment and nohist_courseids.db
+ if ($name eq 'description' || $name eq 'cloners') {
+ if ($chome eq '') {
+ %crsinfo =
+ &Apache::lonnet::courseiddump($dom,'.',1,'.','.',
+ $crs,undef,undef,'Course');
+ $chome = &Apache::lonnet::homeserver($crs,$dom);
+ }
+ }
if ($name eq 'description' && defined($value)) {
- &Apache::lonnet::flushcourselogs();
+ &Apache::lonnet::appenv('course.'.$env{'request.course.id'}.'.description' => $value);
+ if (ref($crsinfo{$env{'request.course.id'}}) eq 'HASH') {
+ $crsinfo{$env{'request.course.id'}}{'description'} = $value;
+ my $putresult =
+ &Apache::lonnet::courseidput($dom,\%crsinfo,
+ $chome,'notime');
+ }
+ }
+ if ($name eq 'cloners') {
+ if (ref($crsinfo{$env{'request.course.id'}}) eq 'HASH') {
+ $crsinfo{$env{'request.course.id'}}{'cloners'} = $value;
+ my $putresult =
+ &Apache::lonnet::courseidput($dom,\%crsinfo,
+ $chome,'notime');
+ }
}
} else {
$setoutput.=&mt('Unable to set').' '.$name.' '.&mt('to').
' '.$value.' '.&mt('due to').' '.$put_result.'. ';
}
- if (($name eq 'cloners') && ($failed_cloners)) {
- $setoutput.= &mt('Unable to include').' - '.$failed_cloners.', '.
- &mt('reason').' - '.&mt('LON-CAPA user(s) do(es) not exist').
- '. '.&mt('Please ').
- ' '.
- &mt('add the user(s)').', '.
- &mt('and then return to the ').
- ''.
- &mt('Course Parameters page').' '.
- &mt('to add the new user(s) to the list of possible cloners').
- '. ';
+ if (($name eq 'cloners') && (keys(%failed_cloners) > 0)) {
+ $setoutput.= &mt('Unable to include').': ';
+ my @fails;
+ my $num = 0;
+ if (defined($failed_cloners{'format'})) {
+ $fails[$num] .= ''.$failed_cloners{'format'}.
+ ', '.&mt('reason').' - '.
+ &mt('Invalid format');
+ $num ++;
+ }
+ if (defined($failed_cloners{'domain'})) {
+ $fails[$num] .= ''.$failed_cloners{'domain'}.
+ ', '.&mt('reason').' - '.
+ &mt('Domain does not exist');
+ $num ++;
+ }
+ if (defined($failed_cloners{'newuser'})) {
+ $fails[$num] .= ''.$failed_cloners{'newuser'}. ', '.&mt('reason').' - '.
+ &mt('LON-CAPA user(s) do(es) not exist.').
+ '. '.&mt('Please ').
+ ' '.
+ &mt('add the user(s)').', '.
+ &mt('and then return to the ').
+ ''.
+ &mt('Course Parameters page').' '.
+ &mt('to add the new user(s) to the list of possible cloners');
+ }
+ $setoutput .= join('; ',@fails).'. ';
}
}
}
+
+ my $start_table =&Apache::loncommon::start_data_table();
+ my $start_header_row=&Apache::loncommon::start_data_table_header_row();
+ my $end_header_row =&Apache::loncommon::end_data_table_header_row();
# ------------------------- Re-init course environment entries for this session
- &Apache::lonnet::coursedescription($env{'request.course.id'});
+ &Apache::lonnet::coursedescription($env{'request.course.id'},
+ {'freshen_cache' => 1});
# -------------------------------------------------------- Get parameters again
@@ -2101,36 +2213,47 @@ sub crsenv {
('url' => ''.&mt('Top Level Map').' '.
'".
- &mt('Select Map').' '.
+ &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.'),
+ 'cloners' => ''.&mt('Users allowed to clone course').' (user:domain,user:domain,*:domain) '.&mt('Users with active Course Coordinator role in course are permitted to clone and need not be included.
+Use *:domain to allow course to be cloned by anyone in the specified domain.
+Use * to allow unrestricted cloning in all domains.'),
'grading' => ''.&mt('Grading').' '.
'"standard", "external", or "spreadsheet" '.&Apache::loncommon::help_open_topic('GradingOptions'),
+ 'task_grading' => ''.&mt('Bridge Task Grading').' '.
+ &mt('Instructors and TAs in sections, when grading bridge tasks, should be allowed to grade other sections, "[_1]" they are allowed (this is the default), "[_2]" no, they can only grade their own section','any','section'),
'default_xml_style' => ''.&mt('Default XML Style File').' '.
'$SelectStyleFile ",
+ ",'sty')\">$SelectStyleFile ",
'question.email' => ''.&mt('Feedback Addresses for Resource Content Question').
' (user:domain,'.
'user:domain(section;section;...;*;...),...)',
+ 'question.email.text' => ''.&mt('Custom Text for Resource Content Question Option in Feedback').
+ '',
'comment.email' => ''.&mt('Feedback Addresses for Course Content Comments').' '.
'(user:domain,user:domain(section;section;...;*;...),...)',
+ 'comment.email.text' => ''.&mt('Custom Text for Course Content Option in Feedback').
+ '',
'policy.email' => ''.&mt('Feedback Addresses for Course Policy').''.
' (user:domain,user:domain(section;section;...;*;...),...)',
+ 'policy.email.text' => ''.&mt('Custom Text for Course Policy Option in Feedback').
+ '',
'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.'),
-
+ '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.)'),
+ 'student_classlist_portfiles' => ''.&mt('Include link to accessible portfolio files').' '.&mt('"[_1]" for link to each a listing of each student\'s files.','yes'),
+ 'student_classlist_opt_in' => ''.&mt("Student's agreement needed for listing in student-viewable roster").' '.&mt('"[_1]" to require students to opt-in to listing in the roster (on the roster page).','yes'),
'plc.roles.denied'=> ''.&mt('Disallow live chatroom use for Roles').
- ' "st": '.
+ ' ("st": '.
&mt('student').', "ta": '.
'TA, "in": '.
&mt('instructor').'; '.&mt('role,role,...').') '.
@@ -2140,7 +2263,7 @@ sub crsenv {
'(user:domain,user:domain,...)',
'pch.roles.denied'=> ''.&mt('Disallow Resource Discussion for Roles').
- ' "st": '.
+ ' ("st": '.
'student, "ta": '.
'TA, "in": '.
'instructor; role,role,...) '.
@@ -2174,8 +2297,8 @@ sub crsenv {
'('.&mt('or set value to "[_1]" to allow all roles',"yes").')',
'rndseed'
=> ''.&mt('Randomization algorithm used').' '.
- ''.&mt('Modifying this will make problems').' '.
- &mt('have different numbers and answers').'',
+ ''.&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.'),
@@ -2190,9 +2313,8 @@ sub crsenv {
' ('.&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'
- => ''.&mt('Anonymous quiz/exam').' '.
- ' ('.&mt('yes').' '.&mt('to avoid print students names').' )',
+ 'print_header_format'
+ => &mtn(' Print header format; substitutions : %n student name %c course id %a assignment note, numbers after the % limit the field size.').'',
'default_enrollment_start_date' => ''.&mt('Default beginning date for student access.').'',
'default_enrollment_end_date' => ''.&mt('Default ending date for student access.').'',
'nothideprivileged' => ''.&mt('Privileged users that should not be hidden on staff listings').''.
@@ -2201,6 +2323,8 @@ sub crsenv {
'disable_receipt_display'
=> ''.&mt('Disable display of problem receipts').' '.
' ('.&mt('"[_1]" to disable, anything else if not','yes').')',
+ 'task_messages'
+ => ''.&mt('Send message to student when clicking Done on Tasks').' ('.&mt('[_1] to send a message only to student, [_2] to send message to student and add record to user information page for instructors. Leave blank to disable.','only_student','student_and_user_notes_screen').')',
'disablesigfigs'
=> ''.&mt('Disable checking of Significant Figures').' '.
' ('.&mt('"[_1]" to disable, anything else if not','yes').')',
@@ -2210,13 +2334,19 @@ sub crsenv {
'externalsyllabus'
=> ''.&mt('URL of Syllabus (not using internal handler)').'',
'tthoptions'
- => ''.&mt('Default set of options to pass to tth/m when converting tex').''
+ => ''.&mt('Default set of options to pass to tth/m when converting tex').'',
+
+ 'texengine'
+ => ''.&mt('Force all students in the course to use a specific math rendering engine.').' '.&mt('(Valid options are [_1].)','"tth", "jsMath", "mimetex"').'',
+
);
my @Display_Order = ('url','description','courseid','cloners','grading',
'externalsyllabus',
'default_xml_style','pageseparators',
- 'question.email','comment.email','policy.email',
+ 'question.email','question.email.text','comment.email','comment.email.text','policy.email','policy.email.text',
'student_classlist_view',
+ 'student_classlist_opt_in',
+ 'student_classlist_portfiles',
'plc.roles.denied','plc.users.denied',
'pch.roles.denied','pch.users.denied',
'allow_limited_html_in_feedback',
@@ -2228,6 +2358,7 @@ sub crsenv {
'problem_stream_switch',
'suppress_tries',
'default_paper_size',
+ 'print_header_format',
'disable_receipt_display',
'spreadsheet_default_classcalc',
'spreadsheet_default_studentcalc',
@@ -2236,8 +2367,10 @@ sub crsenv {
'default_enrollment_start_date',
'default_enrollment_end_date',
'tthoptions',
+ 'texengine',
'disablesigfigs',
- 'disableexampointprint'
+ 'disableexampointprint',
+ 'task_messages','task_grading',
);
foreach my $parameter (sort(keys(%values))) {
unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./)) {
@@ -2247,13 +2380,15 @@ sub crsenv {
}
}
}
+
foreach my $parameter (@Display_Order) {
my $description = $descriptions{$parameter};
# onchange is javascript to automatically check the 'Set' button.
my $onchange = 'onFocus="javascript:window.document.forms'.
"['envform'].elements['".$parameter."_setparmval']".
'.checked=true;"';
- $output .= '