[LON-CAPA-dev] Re: automatic enrollment

Stuart Peter Raeburn lon-capa-dev@mail.lon-capa.org
Fri, 12 Mar 2004 15:55:55 -0500


H. K. Ng writes: 

> Hi Guy, 
>> > Question1: Where do I look for what happened? I checked the usual logs 
>> http
>> > and lonnet. 
>> /home/httpd/perl/logs/autoenroll.log
> I guess it never went to the point of writing into the log. The log file 
> does not exists. The message came from lonpopulate.pm and after the 
> following lines. It looks like it was not able to put the info into 
> environment??

The autoenroll.log file is only written to (and created, if necessary) when 
LONCAPA::Enrollment::update_LC() is called by Autoenroll.pl, i.e., when you 
run enrollment as an automated process from the command line (or cron).  By 
contrast, when you update enrollment in a single course via the "Update 
Roster Now" web interface, output is sent to the browser, instead of being 
written to the autoenroll.log file. 

>   my $reply = &Apache::lonnet::put('environment',\%cenv,$dom,$crs);
>   if ($reply !~ /^ok$/) {
>       $response = "There was a problem processing your requested changes. 
> The automated enrollment settings for this course have been left 
> unchanged.<br/>"; 

This is not the origin of the message. The line reponsible for generating 
the message you reported was line 1769 of lonpopulate.pm 

         if ($reply{$crs} > 0) {
             ($changecount,$response) = 
         } else {
             $response = "There was a problem retrieving institutional class 
list data for the course sections and crosslisted courses which contribute 
enrollment to this course. No updates have been carried out, and the
roster remains unchanged.";

This message was triggered because the number of registered students 
reported by localenroll::fetch_enrollment() for the course you were updating 
was zero. 

The message you identified above
>   my $reply = &Apache::lonnet::put('environment',\%cenv,$dom,$crs);
>   if ($reply !~ /^ok$/) {

about failing to write to the environment is generated when storage of 
automated enrollment settings such as first and last auto-enrollment dates 
fails.  The "Update Roster Now" routine would not generate this type of 
message because it does not attempt to store anything in a course's 
environment.db file. 


Stuart Raeburn
MSU LON-CAPA support/development