version 1.8, 2002/08/21 17:18:08
|
version 1.9, 2002/08/30 15:35:08
|
Line 85 sub MapOptions {
|
Line 85 sub MapOptions {
|
return $Str; |
return $Str; |
} |
} |
|
|
|
sub ProblemOptions { |
|
my ($data, $page, $map, $formName)=@_; |
|
my $Str = ''; |
|
$Str .= '<select name="'; |
|
$Str .= (($page)?$page:'').'ProblemSelect"'; |
|
if($formName) { |
|
$Str .= ' onchange="document.'.$formName.'.submit()"'; |
|
} |
|
$Str .= '>'."\n"; |
|
|
|
my $selected = 0; |
|
foreach my $sequence (split(':',$data->{'orderedSequences'})) { |
|
if($data->{$sequence.':title'} eq $map || $map eq 'All Maps') { |
|
foreach my $problem (split(':', $data->{$sequence.':problems'})) { |
|
$Str .= '<option'; |
|
if($data->{$page.'ProblemSelect'} eq |
|
$data->{$problem.':title'}) { |
|
$Str .= ' selected'; |
|
$selected = 1; |
|
} |
|
$Str .= '>'.$data->{$problem.':title'}.'</option>'."\n"; |
|
} |
|
} |
|
} |
|
$Str .= '<option'; |
|
if(!$selected) { |
|
$Str .= ' selected'; |
|
} |
|
$Str .= '>All Problems</option>'."\n"; |
|
|
|
$Str .= '</select>'."\n"; |
|
|
|
return $Str; |
|
} |
|
|
|
sub PartOptions { |
|
my ($data, $page, $parts, $formName)=@_; |
|
my $Str = ''; |
|
|
|
if(!defined($parts)) { |
|
return ''; |
|
} |
|
|
|
$Str .= '<select name="'; |
|
$Str .= (($page)?$page:'').'PartSelect"'; |
|
if($formName) { |
|
$Str .= ' onchange="document.'.$formName.'.submit()"'; |
|
} |
|
$Str .= '>'."\n"; |
|
|
|
my $selected = 0; |
|
foreach my $part (@$parts) { |
|
$Str .= '<option'; |
|
if($data->{$page.'PartSelect'} eq $part) { |
|
$Str .= ' selected'; |
|
$selected = 1; |
|
} |
|
$Str .= '>'.$part.'</option>'."\n"; |
|
} |
|
$Str .= '<option'; |
|
if(!$selected) { |
|
$Str .= ' selected'; |
|
} |
|
$Str .= '>All Parts</option>'."\n"; |
|
|
|
$Str .= '</select>'."\n"; |
|
|
|
return $Str; |
|
} |
|
|
sub StudentOptions { |
sub StudentOptions { |
my ($cache, $students, $selectedName, $page, $formName)=@_; |
my ($cache, $students, $selectedName, $page, $formName)=@_; |
|
|