version 1.616, 2012/05/28 10:31:17
|
version 1.618, 2012/06/07 10:27:26
|
Line 102 sub printable_sequence {
|
Line 102 sub printable_sequence {
|
|
|
if ($res->is_sequence()) { |
if ($res->is_sequence()) { |
my $symb = $res->symb(); |
my $symb = $res->symb(); |
&Apache::lonnet::logthis("Symb: $symb"); |
|
my $navmap = $res->{NAV_MAP}; |
my $navmap = $res->{NAV_MAP}; |
|
|
# Find the first resource in the map: |
# Find the first resource in the map: |
Line 111 sub printable_sequence {
|
Line 110 sub printable_sequence {
|
my $first = $iterator->next(); |
my $first = $iterator->next(); |
|
|
while (1) { |
while (1) { |
if ($first == $iterator->END_ITERATOR) { |
if ($first == $iterator->END_ITERATOR) { last; } |
&Apache::lonnet::logthis("End of iterator"); |
|
last; } |
|
if (ref($first)) { |
|
&Apache::lonnet::logthis("Looking at: " . $first->symb()); |
|
} else { |
|
&Apache::lonnet::logthis("Got: $first"); |
|
} |
|
if (ref($first) && ! $first->is_sequence()) {last; } |
if (ref($first) && ! $first->is_sequence()) {last; } |
$first = $iterator->next(); |
$first = $iterator->next(); |
} |
} |
Line 127 sub printable_sequence {
|
Line 119 sub printable_sequence {
|
# Might be an empty map: |
# Might be an empty map: |
|
|
if (!ref($first)) { |
if (!ref($first)) { |
&Apache::lonnet::logthis("printable_sequence: empty"); |
|
return 0; |
return 0; |
} |
} |
my $partsref = $first->parts(); |
my $partsref = $first->parts(); |
my @parts = @$partsref; |
my @parts = @$partsref; |
&Apache::lonnet::logthis("Dates for " . $first->symb()); |
|
my ($open, $close) = $navmap->map_printdates($first, $parts[0]); |
my ($open, $close) = $navmap->map_printdates($first, $parts[0]); |
&Apache::lonnet::logthis("Opens $open, closes $close"); |
|
&Apache::lonnet::logthis(ctime($open)); |
|
&Apache::lonnet::logthis(ctime($close)); |
|
return &printable($open, $close); |
return &printable($open, $close); |
} |
} |
return 0; |
return 0; |
Line 1246 sub is_code_valid {
|
Line 1233 sub is_code_valid {
|
} |
} |
|
|
} |
} |
|
# |
|
# Compare two students by section (Used to sort by section). |
|
# |
|
# Implicit inputs, |
|
# $a - The first one |
|
# $b - The second one. |
|
# |
|
# Returns: |
|
# a-section cmp b-section |
|
# |
|
sub compare_sections { |
|
my ($u1, $d1, $s1, $n1, $stat1) = split(/:/, $a); |
|
my ($u2, $d2, $s2, $n2, $stat2) = split(/:/, $b); |
|
|
|
return $s1 cmp $s2; |
|
} |
|
|
# Compare two students by name. The students are in the form |
# Compare two students by name. The students are in the form |
# returned by the helper: |
# returned by the helper: |
Line 3116 ENDPART
|
Line 3119 ENDPART
|
if (($helper->{'VARS'}->{'student_sort'} eq 1) && |
if (($helper->{'VARS'}->{'student_sort'} eq 1) && |
($helper->{'VARS'}->{'SPLIT_PDFS'} ne "sections")) { |
($helper->{'VARS'}->{'SPLIT_PDFS'} ne "sections")) { |
@students = sort compare_names @students; |
@students = sort compare_names @students; |
|
} else { |
|
@students = sort compare_sections @students; |
} |
} |
&adjust_number_to_print($helper); |
&adjust_number_to_print($helper); |
|
|