');
my $thismarker=$which;
$thismarker=~s/^parameter\_//;
@@ -1075,12 +1076,20 @@ sub print_td {
my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display)=@_;
$r->print('
");
@@ -1790,6 +1805,39 @@ sub assessparms {
my @values=split(/\&\&\&/,$env{'form.pres_value'});
my @types=split(/\&\&\&/,$env{'form.pres_type'});
for (my $i=0;$i<=$#markers;$i++) {
+ if ($markers[$i] =~ /^[\d.]+\&0_availablestudent\&(1|2|3)$/) {
+ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my (@ok_slots,@fail_slots,@del_slots);
+ my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom);
+ my ($level,@all) =
+ &parmval_by_symb('0.availablestudent',$pssymb,'',$uname,$udom,
+ $csec,$cgroup,$courseopt);
+ foreach my $slot_name (split(/:/,$values[$i])) {
+ next if ($slot_name eq '');
+ if (&update_slots($slot_name,$cdom,$cnum,$pssymb,$uname,$udom) eq 'ok') {
+ push(@ok_slots,$slot_name);
+
+ } else {
+ push(@fail_slots,$slot_name);
+ }
+ }
+ if (@ok_slots) {
+ $values[$i] = join(':',@ok_slots);
+ } else {
+ $values[$i] = '';
+ }
+ if ($all[$level] ne '') {
+ my @existing = split(/:/,$all[$level]);
+ foreach my $slot_name (@existing) {
+ if (!grep(/^\Q$slot_name\E$/,split(/:/,$values[$i]))) {
+ if (&delete_slots($slot_name,$cdom,$cnum,$uname,$udom,$pssymb) eq 'ok') {
+ push(@del_slots,$slot_name);
+ }
+ }
+ }
+ }
+ }
$message.=&storeparm(split(/\&/,$markers[$i]),
$values[$i],
$types[$i],
@@ -1969,7 +2017,16 @@ ENDTABLEHEADFOUR
if (grep $_ eq $tempkeyp, @catmarker) {
$part{$_}=&Apache::lonnet::metadata($uri,$_.'.part');
$name{$_}=&Apache::lonnet::metadata($uri,$_.'.name');
- $display{$_}=&Apache::lonnet::metadata($uri,$_.'.display');
+ my $parmdis=&Apache::lonnet::metadata($uri,$_.'.display');
+ if ($allparms{$name{$_}} ne '') {
+ my $identifier;
+ if ($parmdis =~ /(\s*\[Part.*)$/) {
+ $identifier = $1;
+ }
+ $display{$_} = $allparms{$name{$_}}.$identifier;
+ } else {
+ $display{$_} = $parmdis;
+ }
unless ($display{$_}) { $display{$_}=''; }
$display{$_}.=' ('.$name{$_}.')';
$default{$_}=&Apache::lonnet::metadata($uri,$_);
@@ -2076,7 +2133,16 @@ ENDTABLEHEADFOUR
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) {
$part{$tempkeyp}="0";
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name');
- $display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');
+ my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');
+ if ($allparms{$name{$tempkeyp}} ne '') {
+ my $identifier;
+ if ($parmdis =~ /(\s*\[Part.*)$/) {
+ $identifier = $1;
+ }
+ $display{$tempkeyp} = $allparms{$name{$tempkeyp}}.$identifier;
+ } else {
+ $display{$tempkeyp} = $parmdis;
+ }
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; }
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')';
$display{$tempkeyp} =~ s/_\w+_/_0_/;
@@ -2169,7 +2235,16 @@ ENDTABLEHEADFOUR
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) {
$part{$tempkeyp}="0";
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name');
- $display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');
+ my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');
+ if ($allparms{$name{$tempkeyp}} ne '') {
+ my $identifier;
+ if ($parmdis =~ /(\s*\[Part.*)$/) {
+ $identifier = $1;
+ }
+ $display{$tempkeyp} = $allparms{$name{$tempkeyp}}.$identifier;
+ } else {
+ $display{$tempkeyp} = $parmdis;
+ }
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; }
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')';
$display{$tempkeyp} =~ s/_\w+_/_0_/;
@@ -2234,6 +2309,7 @@ sub crsenv {
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
my (%crsinfo,$chome);
+ my $crstype = &Apache::loncommon::course_type();
#
# Go through list of changes
@@ -2244,6 +2320,23 @@ sub crsenv {
if ($name eq 'newp') {
$name = $env{'form.newp_name'};
}
+ if ($name =~ /^rolenames_([^_]+)$/) {
+ $name = $1.'.plaintext';
+ my $standardtitle =
+ &Apache::lonnet::plaintext($1,$crstype,$env{'request.course.id'},1);
+ my %adv_roles =
+ &Apache::lonnet::get_course_adv_roles($env{'request.course.id'},1);
+ if ($value ne '') {
+ foreach my $role (keys(%adv_roles)) {
+ if ($role =~ m{^cr/$match_domain/$match_name/\Q$value\E$}) {
+ $setoutput.= ''.
+ &mt('Requested replacement title for [_1] role is already used as the name of a custom role ([_2]).',$standardtitle,$value).
+ ' ';
+ undef($value);
+ }
+ }
+ }
+ }
if ($name eq 'url') {
$value=~s/^\/res\///;
my $bkuptime=time;
@@ -2294,12 +2387,12 @@ sub crsenv {
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).
+ &mt("Invalid e-mail 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).
+ &mt("Invalid e-mail address specified, user [_1] is unknown.",$name).
'';
undef($value);
}
@@ -2466,12 +2559,12 @@ sub crsenv {
.'('.&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').' '
+ 'plc.roles.denied'=> ''.&mt('Disallow chat room use for Roles').' '
.'('.&mt('[_1]: student, [_2]: TA, [_3]: instructor','"st"','"ta"','"in"').') '
.'("'.&mt('role,role,...').'") '
.Apache::loncommon::help_open_topic("Course_Disable_Discussion"),
'plc.users.denied' =>
- ''.&mt('Disallow live chatroom use for Users').' '.
+ ''.&mt('Disallow chat room use for Users').' '.
'("'.&mt('user:domain,user:domain,...').'")',
'pch.roles.denied'=> ''.&mt('Disallow Resource Discussion for Roles').' '
@@ -2546,7 +2639,7 @@ 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.').' '
@@ -2565,6 +2658,9 @@ sub crsenv {
&mt('Display Categories').'',
'datelocale'
=> ''.&mt('Locale used for course calendar').'',
+ 'rolenames'
+ => ''.&mt('Replacement titles for standard course roles').' '.
+ '('.&mt('To replace the standard title for a course role, enter the title you wish to use, otherwise leave blank.').')',
);
my @Display_Order = ('url','description','courseid','cloners');
(my $can_toggle_cat,$can_categorize) = &can_modify_catsettings($dom);
@@ -2589,6 +2685,7 @@ sub crsenv {
'languages',
'timezone',
'datelocale',
+ 'rolenames',
'nothideprivileged',
'rndseed',
'receiptalg',
@@ -2612,7 +2709,8 @@ sub crsenv {
foreach my $parameter (sort(keys(%values))) {
unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./) ||
($parameter =~ m/^selfenroll_/) || ($parameter =~ /_selfenroll$/)
- || ($parameter eq 'type')) {
+ || ($parameter eq 'type') ||
+ ($parameter =~ m/^(cc|in|ta|ep|ad|st)\.plaintext$/)) {
if (! $descriptions{$parameter}) {
$descriptions{$parameter}=$parameter;
push(@Display_Order,$parameter);
@@ -2652,7 +2750,27 @@ sub crsenv {
$output .= '