version 1.7, 2005/11/02 22:07:52
|
version 1.10, 2005/11/18 16:51:13
|
Line 7
|
Line 7
|
if (exists($env{'form.name'}) || |
if (exists($env{'form.name'}) || |
$env{'form.name'} =~ /\S/) { |
$env{'form.name'} =~ /\S/) { |
$helper->{'VARS'}{'name'}=$env{'form.name'}; |
$helper->{'VARS'}{'name'}=$env{'form.name'}; |
|
$helper->{VARS}{'origname'}=$env{'form.name'}; |
|
$helper->{DATA}{copy} = 1; |
} |
} |
} |
} |
$helper->{DATA}{origslot} = sub { |
$helper->{DATA}{origslot} = sub { |
Line 17
|
Line 19
|
} |
} |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $name=$helper->{'VARS'}{'name'}; |
my $name=$helper->{VARS}{'origname'}; |
my %slot=&Apache::lonnet::get('slots', [$name], $cdom, $cnum); |
my %slot=&Apache::lonnet::get('slots', [$name], $cdom, $cnum); |
if (!ref($slot{$name})) { return $default; } |
if (!ref($slot{$name})) { return $default; } |
if (!exists($slot{$name}{$which})) { return $default; } |
if (!exists($slot{$name}{$which})) { return $default; } |
Line 27
|
Line 29
|
<message nextstate="OPTIONAL"> |
<message nextstate="OPTIONAL"> |
<message_text> |
<message_text> |
Name: <br /> |
Name: <br /> |
</message_text> |
</message_text> |
</message> |
</message> |
<string variable="name" size="30"> |
<string variable="name" size="30"> |
<validator> |
<validator> |
if ($val=~/^\s*$/) { return 'Must specify a name'; } |
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; |
return undef; |
</validator> |
</validator> |
<defaultvalue> |
<defaultvalue> |
return $helper->{'VARS'}{'name'}; |
return $helper->{'VARS'}{'name'}; |
</defaultvalue> |
</defaultvalue> |
</string> |
</string> |
|
<condition> |
|
<clause>$helper->{DATA}{copy}</clause> |
|
<message nextstate="OPTIONAL"> |
|
<message_text> |
|
<p>Changing the Name will create a new slot with the new name, and not rename the existing slot.</p> |
|
</message_text> |
|
</message> |
|
</condition> |
<message> |
<message> |
<message_text><br />Start time:<br /> </message_text> |
<message_text><br />Start time:<br /> </message_text> |
</message> |
</message> |
Line 229
|
Line 240
|
my ($uname,$udomain)=split(/:/,$user); |
my ($uname,$udomain)=split(/:/,$user); |
push(@names,"$uname\@$udomain"); |
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 $cname = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |