--- loncom/html/adm/helper/newslot.helper 2005/10/17 21:19:30 1.5 +++ loncom/html/adm/helper/newslot.helper 2005/11/18 16:26:57 1.9 @@ -32,7 +32,8 @@ if ($val=~/^\s*$/) { return 'Must specify a name'; } - if ($val=~/\s$/) { return 'Must not contain spaces'; } + if ($val=~/\s/) { return 'Must not contain spaces'; } + if ($val=~/\W/) { return 'Must contain only letters, numbers and _'; } return undef; @@ -78,30 +79,64 @@ return &{$helper->{DATA}{origslot}}('description'); - - -

Time students can start reserving:
    - - - - - return &{$helper->{DATA}{origslot}}('startreserve','anytime'); - - - - -

Maxium number of students allowed in this slot:
    - - - - - if ($val ne '' && $val=~/\D/) { return 'Must be numeric.'; } - return undef; - - - return &{$helper->{DATA}{origslot}}('maxspace'); - - + + $helper->{'VARS'}{'type'} eq 'schedulable_student' + + +

Time students can start reserving:
    + + + + + return &{$helper->{DATA}{origslot}}('startreserve','anytime'); + + + + +

Maxium number of students allowed in this slot:
    + + + + + if ($val ne '' && $val=~/\D/) { return 'Must be numeric.'; } + return undef; + + + return &{$helper->{DATA}{origslot}}('maxspace'); + + + + +

Period of time in which this slot is can only be uniquely chosen:
   Start: + + + + + my $default=&{$helper->{DATA}{origslot}}('uniqueperiod','anytime'); + if ($default eq 'anytime') { return 'anytime' }; + if (ref($default)) { return $default->[0]; } + return 'anytime'; + + +
   End:
+ + + my $default=&{$helper->{DATA}{origslot}}('uniqueperiod','anytime'); + if ($default eq 'anytime') { return 'anytime' }; + if (ref($default)) { return $default->[1]; } + return 'anytime'; + + + + + $helper->{'VARS'}{'type'} eq 'preassigned' + + delete($helper->{'VARS'}{'startreserve'}); + delete($helper->{'VARS'}{'maxspace'}); + delete($helper->{'VARS'}{'startunique'}); + delete($helper->{'VARS'}{'endunique'}); + +

Secret word proctors use to checkin users:
    @@ -117,28 +152,6 @@ -

Period of time in which this slot is can only be uniquely chosen:
   Start: - - - - - my $default=&{$helper->{DATA}{origslot}}('uniqueperiod','anytime'); - if ($default eq 'anytime') { return 'anytime' }; - if (ref($default)) { return $default->[0]; } - return 'anytime'; - - -
   End:
- - - my $default=&{$helper->{DATA}{origslot}}('uniqueperiod','anytime'); - if ($default eq 'anytime') { return 'anytime' }; - if (ref($default)) { return $default->[1]; } - return 'anytime'; - - - -

Slot is: @@ -217,7 +230,9 @@ my ($uname,$udomain)=split(/:/,$user); push(@names,"$uname\@$udomain"); } - $slot{'proctor'}=join(',',@names); + # make sure the usenrmaes are unique + my %proctors = map { ($_,1) } @names; + $slot{'proctor'}=join(',',sort(keys(%proctors))); } my $cname = $env{'course.'.$env{'request.course.id'}.'.num'}; my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; @@ -231,13 +246,18 @@ "\n".'

  • Type: '.$slot{'type'}.'
  • '; my %labels = map {($_->[0],$_->[1])} &Apache::slotrequest::csvupload_fields(); - foreach my $which ('ip','proctor','description','maxspace', - 'secret','symb') { + foreach my $which ('ip','description','maxspace','secret','symb') { if (exists($slot{$which})) { $result.="\n".'
  • '.$labels{$which}.': '. &HTML::Entities::encode($slot{$which}).'
  • '; } } + if (exists($slot{'proctor'})) { + my $proctors = $slot{'proctor'}; + $proctors =~ s/,/, /g; + $result.="\n".'
  • '.$labels{'proctor'}.': '. + &HTML::Entities::encode($proctors).'
  • '; + } if (exists($slot{'uniqueperiod'})) { $result.= "\n".'
  • '.$labels{'uniqueperiod'}.': '.