--- loncom/interface/lonhelper.pm 2006/03/02 23:56:55 1.131 +++ loncom/interface/lonhelper.pm 2006/03/06 23:32:31 1.132 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # .helper XML handler to implement the LON-CAPA helper # -# $Id: lonhelper.pm,v 1.131 2006/03/02 23:56:55 foxr Exp $ +# $Id: lonhelper.pm,v 1.132 2006/03/06 23:32:31 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2306,6 +2306,13 @@ sub render { } } } + function checkexpired() { + for (i=0; i{'coursepersonnel'}) { @@ -2479,12 +2487,20 @@ SECTIONSELECT # username, fullname, section, type for (@keys) { - # Filter out inactive students if we've set "activeonly" - if (!$self->{'activeonly'} || $classlist->{$_}->[$status] eq + + # We split the active students into the choices array and + # inactive ones into expired_students so that we can put them in 2 separate + # tables. + + if ( $classlist->{$_}->[$status] eq 'Active') { push @$choices, [$_, $classlist->{$_}->[$fullname], $classlist->{$_}->[$section], $classlist->{$_}->[$status], 'Student']; + } else { + push @$expired_students, [$_, $classlist->{$_}->[$fullname], + $classlist->{$_}->[$section], + $classlist->{$_}->[$status], 'Student']; } } @@ -2499,6 +2515,9 @@ SECTIONSELECT "".&mt('Username').":".&mt('Domain').""; my $checked = 0; + # + # Give the active students and staff: + # for my $choice (@$choices) { $result .= "[0],'<>&"') . "\n"; } - $result .= "\n\n"; + # If activeonly is not set then we can also give the expired students: + # + if (!$self->{'activeonly'} && ((scalar @$expired_students) > 0)) { + $result .= "

Inactive students:

\n"; + $result .= < + + + + + +INACTIVEBUTTONS + $result .= "\n"; + + for my $choice (@$expired_students) { + $result .= "\n\n\n\n"; + } + $result .= "
[0]; + if (exists($defaultUsers{$user})) { + $result .= " checked='checked' "; + $checked = 1; + } + } elsif (!$self->{'multichoice'} && !$checked) { + $result .= " checked='checked' "; + $checked = 1; + } + $result .= + " value='" . HTML::Entities::encode($choice->[0] . ':' + .$choice->[2] . ':' + .$choice->[1] . ':' + .$choice->[3], "<>&\"'") + . "' />" + . HTML::Entities::encode($choice->[1],'<>&"') + . "" + . HTML::Entities::encode($choice->[2],'<>&"') + . "" + . HTML::Entities::encode($choice->[3],'<>&"') + . "" + . HTML::Entities::encode($choice->[4],'<>&"') + . "" + . HTML::Entities::encode($choice->[0],'<>&"') + . "
\n"; + + } + + return $result; }