version 1.141, 2006/05/08 22:01:11
|
version 1.143, 2006/05/09 18:15:39
|
Line 3162 sub start_section {
|
Line 3162 sub start_section {
|
|
|
my $section = Apache::loncoursedata::CL_SECTION(); |
my $section = Apache::loncoursedata::CL_SECTION(); |
my $classlist = Apache::loncoursedata::get_classlist(); |
my $classlist = Apache::loncoursedata::get_classlist(); |
foreach (keys %$classlist) { |
foreach my $user (keys(%$classlist)) { |
my $sectionName = $classlist->{$_}->[$section]; |
my $section_name = $classlist->{$user}[$section]; |
if (!$sectionName) { |
if (!$section_name) { |
$choices{"No section assigned"} = ""; |
$choices{"No section assigned"} = ""; |
} else { |
} else { |
$choices{$sectionName} = $sectionName; |
$choices{$section_name} = $section_name; |
} |
} |
} |
} |
|
|
for my $sectionName (sort(keys(%choices))) { |
if (exists($choices{"No section assigned"})) { |
push @{$paramHash->{CHOICES}}, [$sectionName, $sectionName]; |
push(@{$paramHash->{CHOICES}}, |
|
['No section assigned','No section assigned']); |
|
delete($choices{"No section assigned"}); |
|
} |
|
for my $section_name (sort {lc($a) cmp lc($b) } (keys(%choices))) { |
|
push @{$paramHash->{CHOICES}}, [$section_name, $section_name]; |
} |
} |
return if ($token->[2]{'onlysections'}); |
return if ($token->[2]{'onlysections'}); |
|
|
# add in groups to the end of the list |
# add in groups to the end of the list |
my %curr_groups; |
my %curr_groups = &Apache::loncommon::coursegroups(); |
if (&Apache::loncommon::coursegroups(\%curr_groups)) { |
foreach my $group_name (sort(keys(%curr_groups))) { |
foreach my $group_name (sort(keys(%curr_groups))) { |
push(@{$paramHash->{CHOICES}}, [$group_name, $group_name]); |
push(@{$paramHash->{CHOICES}}, [$group_name, $group_name]); |
|
} |
|
} |
} |
} |
} |
|
|
Line 3243 sub start_group {
|
Line 3246 sub start_group {
|
# Populate the CHOICES element |
# Populate the CHOICES element |
my %choices; |
my %choices; |
|
|
my %curr_groups; |
my %curr_groups = &Apache::loncommon::coursegroups(); |
if (&Apache::loncommon::coursegroups(\%curr_groups)) { |
foreach my $group_name (sort {lc($a) cmp lc($b)} (keys(%curr_groups))) { |
foreach my $group_name (sort(keys(%curr_groups))) { |
push(@{$paramHash->{CHOICES}}, [$group_name, $group_name]); |
push(@{$paramHash->{CHOICES}}, [$group_name, $group_name]); |
|
} |
|
} |
} |
} |
} |
|
|