--- loncom/enrollment/Enrollment.pm 2009/08/19 18:43:31 1.41 +++ loncom/enrollment/Enrollment.pm 2010/08/20 21:44:59 1.43 @@ -1,5 +1,5 @@ # Automated Enrollment manager -# $Id: Enrollment.pm,v 1.41 2009/08/19 18:43:31 raeburn Exp $ +# $Id: Enrollment.pm,v 1.43 2010/08/20 21:44:59 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -92,9 +92,17 @@ sub update_LC { open(FILE,"<$$configvars{'lonTabDir'}.'/rolesplain.tab"); my @rolesplain = ; close(FILE); - foreach (@rolesplain) { - if ($_ =~ /^(st|ta|ex|ad|in|cc):([\w\s]+)$/) { - $longroles{$1} = $2; + foreach my $item (@rolesplain) { + if ($_ =~ /^(st|ta|ex|ad|in|cc|co):([\w\s]+):?([\w\s]*)/) { + if ($courseinfo{'type'} eq 'Community') { + unless($1 eq 'cc') { + $longroles{$1} = $3; + } + } else { + unless($1 eq 'co') { + $longroles{$1} = $2; + } + } } } @@ -767,14 +775,13 @@ sub parse_classlist { push @state, $tagname; if ("@state" eq "students student") { $uname = $attr->{username}; + $$studentsref{$uname}[ $$placeref{'groupID'} ] = $groupID; } }, "tagname, attr"], text_h => [sub { my ($text) = @_; - if ("@state" eq "students student groupID") { - $$studentsref{$uname}[ $$placeref{'groupID'} ] = $groupID; - } elsif ("@state" eq "students student startdate") { + if ("@state" eq "students student startdate") { my $start = $text; unless ($text eq '') { $start = &process_date($text);