Subject: [LON-CAPA-dev] Heads up for 1.1.2

From: Guy Albertelli II <[email-masked]>
Date: Mon, 8 Mar 2004 15:25:18 -0500 (EST)

Hi All,

First pass at a 1.1.2 email below, I expect the full release to be
ready Wednesday.

Anyhoo:

New Version 1.1.2 Released

More bugfixes, I'd suggest installing this if you have the chance or
one of the bugs below has hit you.

Changes:
- added French translation
- added some machines
- support multi-domained machines with authors
- postinstall checks ownership of databases
- scantron grading works when problem is CLOSED or is already
   graded and is receivng a different grade
- scantron grading works for <matchresponse> and <rankresponse>
- <matchresponse> prints when table is placed 'left or 'right'
- <optionresponse> and <numericalrespone> better about generating bubbles
  from scantron mode
- print single <part>ed problem for exams better about showing weights
- uploaded scores display better about cases where it would do
   5.9999999999, also hides the 'The correct answer is' and 'Tries' strings
   more properly
- can now 'Reply' to messages in Bulletin Boards
- sending message to students from uploaded file works now
- printing uses the specifed paper width values correctly
- printing works for users with _lots_ of roles
- printing works for images in CSTR space
- SPRS could hide data in unlikely cases
- removed unused parameter 'problemstyle'
- publishing problems with tag like strings inside of a <script> could
  cause bad metadata to be generated
- fixed case where lond could lock up in a &wait()

To install this update:

1) You will need to be running Redhat 7.X (preferably 7.3) or Fedora
   for this release to work

   If you are running Fedora please see this page for instructions
   http://install.loncapa.org/fedora_install.html

   If you are running Redhat 7.X instructions for updating follow.

2) if you haven't already download and install the 3.9 systemperl rpm

If you are running RedHat 7.X get
http://install.loncapa.org/resources/LON-CAPA-systemperl-3.9-rh7.i386.rpm

Install it by doing:
rpm -e `rpm -q -a | grep systemperl`
rpm --install --force --nodeps LON-CAPA-systemperl-3.9-rh7.i386.rpm

Verify it is installed by doing:

$ rpm -q LON-CAPA-systemperl

RedHat 7.X will show
LON-CAPA-systemperl-3.9-rh7

3) Download the new LON-CAPA tarball from
wget http://install.lon-capa.org/versions/loncapa-1.1.2.tar.gz

and untar it

tar xzvf loncapa-1.1.2.tar.gz

4) Run the UPDATE script as root
cd loncapa-1.1.2
su
./UPDATE

5) restart the system services
/etc/rc.d/init.d/loncontrol stop
/etc/rc.d/init.d/loncontrol start
/etc/rc.d/init.d/httpd stop
/etc/rc.d/init.d/httpd start

----NOTES
1) Many questions are answered at http://help.lon-capa.org
2) Defect reports, and enhancement requests can be entered at
   http://bugs.lon-capa.org
3) Mailing lists can be joined and left at http://mail.lon-capa.org

-- 
[email-masked]  LON-CAPA Developer  0-7-4-7-

---

From: "H. K. Ng" <[email-masked]>
Date: Fri, 12 Mar 2004 13:39:58 -0500

Hi,

I am finally in the process of implementing the automatic enrollment. I am 
able to connect to the data base using a standalone script and download the 
data and using that to populate the courses. However, when I incorporate it 
into lon-capa, I get this message

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.

Question1: Where do I look for what happened? I checked the usual logs http 
and lonnet.
Question2+: What should go into the fields <autharg> and <authtype>? How do 
they differ? We use local authentication via LDAP.

Thanks,
hk

---

From: Guy Albertelli II <[email-masked]>
Date: Fri, 12 Mar 2004 13:47:56 -0500 (EST)

Hi Hon-Kie

> Question1: Where do I look for what happened? I checked the usual logs http 

/home/httpd/perl/logs/autoenroll.log

> they differ? We use local authentication via LDAP.

<authtype> is then localauth
<autharg> is whatever you type into the 'argument' box if anything
when creating a user normally.
(I.E. is says on the enrollment screen
 Local Authentication with argument [_________]
             whatever you put here --^
It might be nothing. And from taking a look at you localauth.pm file
it looks like it is nothing.)

---

From: "H. K. Ng" <[email-masked]>
Date: Fri, 12 Mar 2004 14:01:35 -0500

Hi Guy,

>/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??

   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/>";

Does the section number has to be in three digits?

Thanks,
-hk

---

From: "H. K. Ng" <[email-masked]>
Date: Fri, 12 Mar 2004 14:34:42 -0500

Hi Guy,

Look in the wrong place for the origin of the error message in 
lonpopulate.pm. It works now. It was a simple string comparison that I missed.

Thanks,
hk

---

From: "Stuart Peter Raeburn" <[email-masked]>
Date: Fri, 12 Mar 2004 15:34:14 -0500

Hon-Kie, 

The message: 

"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." 

indicates that a total of zero registered students was retrieved from the 
temporary xml files created for all course sections of the LON-CAPA class 
for which you were using Automated Enrollment Manager -> "Update Roster Now" 
. 

/home/httpd/perl/logs/autoenroll.log is where you will find all data that 
are logged when you run /home/httpd/perl/Autoenroll.log (i.e., as a process 
called from the command line, e.g., via an entry in /etc/cron.d/loncapa). 
However, in this case, as you called the enrollment update via the web 
interface (using "Update Roster Now"), all log information is directed to 
your web browser, so /home/httpd/perl/logs/autoenroll.log will not contain 
any pertinent information. 

When using the web-based Automated Enrollment Manager, httpd entries will 
only be added to the /etc/httpd/logs/error_log file if there is problem 
executing the /home/httpd/lib/perl/Apache/lonpopulate script.  In this case 
the script ran normally without generating an Apache error. 

To determine what happened, I recommend proceeding as follows: 

1. Check that the automated enrollment settings are correct for the course.
To do so log-in as Domain Coordinator, and click the MCRS button.  Then 
select the course from the select box and view the automated enrollment 
settings.  Make sure that you have entries for at least the following: 

Default authentication parameter
Default authentication method
Official course code
Course section number(:groupID) 

[You might also need "Username of course owner (@fsu)" depending on whether 
you are enforcing a check for a valid course owner]. 

The format of the course section number entry should be: 001:1,002:2 etc.
For a single section number (with no corresponding groupID) you would see 
001:  for this parameter. 

As domain coordinator you can define the format of the official course code 
and the section number. However you need to make sure that your choice is 
interpreted correctly by the routine you create in 
localenroll::fetchenrollment(), 

i.e., if you chose official course code as spr2004physics, and section 1:
make sure that your localenroll::fetchenrollment() routine can retrieve 
class list data for the course section: spr2004physics1 

2. To check that the temporary xml files are being correctly written in 
/home/httpd/perl/tmp you may want to temporarily comment out line 519 of 
/home/httpd/lib/perl/LONCAPA/Enrollment.pm 

i.e. comment out:
       unlink $xmlfile; 

This line is used to remove the temporary classlist files (with names such 
as: fsu_43551dedcd43febmsul1_spr2004physics1_classlist.xml) after 
processing.  By commenting it out you will be able to see whether 
appropriate records are being retrieved by localenroll::fetchenrollment() 

Note: the parameters <autharg></autharg> and <authtype></authtype> can be 
left blank in each student record in your class roster xml file(s), if the 
default parameters defined for the course ("Default authentication 
parameter" and "Default authentication method" (see above) have been set.  
The default authentication method should be localauth in your case, and the 
default is whatever you use in the authentication argument field in the 
standard enrollment screen (it may be empty). 

Default automated enrollment parameters can be set either when you create 
the course as DC using CCRS, or when you modify the course using MCRS. 

Stuart 

Stuart Raeburn
MSU LON-CAPA support/development 

Guy Albertelli II writes: 

> _______________________________________________
> LON-CAPA-dev mailing list
> [email-masked]
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-dev 
>

---

From: "Stuart Peter Raeburn" <[email-masked]>
Date: Fri, 12 Mar 2004 15:55:55 -0500

Hon-Kie, 

> following lines. It looks like it was not able to put the info into 

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. 

> The automated enrollment settings for this course have been left 

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) = 
&LONCAPA::Enrollment::update_LC($dom,$crs,$updateadds,$updatedrops,$autostar 
t,$autoend,$authtype,$autharg,\@allcourses,\%LC_code,\$logmsg,\$newusermsg," 
updatenow");
         } 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);

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 

Stuart Raeburn

---

From: "Stuart Peter Raeburn" <[email-masked]>
Date: Fri, 12 Mar 2004 16:11:07 -0500

Hon-Kie, 

Good to hear that everything is working correctly now. Here is a brief note 
of something you should be aware of: 

1.  If you want course coordinators to be able to use Automated Enrollment 
Manager when logged into your access servers you will need to replace 
localenroll.pm on your access servers with your custom version (with run set 
to 1).  However if you do that make sure that you also comment out the 
command to run /home/httpd/perl/Autoenroll.pl in /etc/cron.d/loncapa on all 
the access servers, otherwise at 1.30 am every day, Autoenroll.pl will be 
executed on your library server, and also on all your access servers.  When 
run as a cron job, you only want a single copy of Autoenroll to be running 
(on your library server). 

If you leave localenroll.pm unchanged on the access servers (i.e., as the 
standard shipped version with run set to 0), then course coordinators will 
need to be logged into the library server to see the link in the Enrollment 
screen to the Automated Enrollment Manager web interface. 

This will change with LON-CAPA 1.2, as calls to functions in localenroll.pm 
will be mediated via lonc/lond such that access servers will call the 
version of localenroll.pm on the home library server associated with a 
course. Once 1.2 is released, localenroll.pm will no longer be needed on 
access servers to allow the Automated Enrollment Manager web interface to be 
used by Course Coordinators logged in to those servers. 

Stuart

---

From: "H. K. Ng" <[email-masked]>
Date: Wed, 17 Mar 2004 07:36:59 -0500

Hi,

So far tests on the cron job auto enrollment runs as expected. However, 
there is one item on the autoenroll.log that doesn't seem to go away. The 
class was setup with authentication as localauth, and in the <authtype> I 
put "localauth", yet the message appears below. (I have tried "loc", and 
blank and they all produce the same message.)

Authentication mismatch for xxxxxx - localauth: in system, localauth based 
on information in classlist or default for this course.

Thanks,
hk

---

From: Guy Albertelli II <[email-masked]>
Date: Wed, 17 Mar 2004 16:52:03 -0500 (EST)

Hi Hon-Kie,

> on information in classlist or default for this course.

Autoenroll.pl has a bug.

Stuart,

Enrollment.pm  line 247 does

                    if ($auth =~ m/^krb/) {
                        $auth .= ":".$authparam;
                    }

It should do:

                    $auth.=':'.$authparm;

---

From: "Stuart Peter Raeburn" <[email-masked]>
Date: Wed, 17 Mar 2004 18:49:18 -0500

Hon-Kie, 

Thank you for your e-mail. 

The message you are seeing
"Authentication mismatch for xxxxxx - localauth: in system, localauth based 
on information in classlist or default for this course." is being generated 
because line 348 in /home/httpd/lib/perl/LONCAPA/Enrollment.pm needs 
modification. 

if ($currentauth=~/^krb(4|5):/) {
   $currentauth=~/^krb(4|5):(.*)/;
   $krbdefdom=$1;
}
if ($currentauth=~/^krb(4|5):/ ||      <--- line 348
   $currentauth=~/^unix:/ ||
   $currentauth=~/^internal:/ ||
   $currentauth=~/^localauth:/) {

} else {
   $$logmsg .= "Invalid authentication method $currentauth for 
$uname.".$linefeed;
} 

should be REPLACED with: 

if ($currentauth=~/^krb(4|5):/) {
   $currentauth=~/^krb(4|5):(.*)/;
   $krbdefdom=$1;
}
elsif ($currentauth=~ /^(unix|internal|localauth):/   <-- line 348
   $currentauth = $1;
} else {
   $$logmsg .= "Invalid authentication method $currentauth for 
$uname.".$linefeed;
} 

************************ 

Five other changes are also required in Enrollment.pm that affect LON-CAPA 
domains that are employing either internal authentication or local 
authentication. 

line 266:
if ($authtype eq "int") {
CHANGE TO
if ($auth eq "internal") { 

line 275:
} elsif ($authtype eq "local") {
CHANGE TO
} elsif ($auth eq "localauth") { 

line 277:
} elsif ($authtype =~ m/^krb/) {
CHANGE TO
} elsif ($auth =~ m/^krb/) { 

Add a new line (273) after line 272
} else {
   $create_passwd = 1;   <--- line 272
   $authchk = 'ok';      <--- NEW LINE 

line 542
   my @letts = 
"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s", 
"t","u","v","w","x","y","z";
CHANGE TO
   my @letts = 
("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s" 
,"t","u","v","w","x","y","z"); 

These changes will be committed to CVS in a few minutes once final testing 
is complete.  It would be my hope that the updated version of 
LONCAPA::Enrollment.pm could be included in maintenance release 1.1.3. 

Stuart 

Stuart Raeburn

P. S.
Guy, 

Thank you for your note about line 247 (below).  However, the suggested 
switch for this particular line will not address the issue reported by 
Hon-Kie, as its cause lies elsewhere (line 348).

Line 247:
Replace
if ($auth =~ m/^krb/) {
   $auth .= ":".$authparam;  <--- line 247
} 

with 

if ($auth =~ m/^krb/) {
   $auth.=':'.$authparam;   <---  line 247
} 

As you suggest, it is probably better to use single quotes here rather than 
double quotes as we are not interpolating anything, but this code will work 
fine with either type of quote.

---

From: "H. K. Ng" <[email-masked]>
Date: Thu, 18 Mar 2004 07:54:56 -0500

Hi Stuart,

Thanks for the bug fix. One other minor comment. I get messages such

No institutional classlist data could be retrieved for 117397529e63e1bfsul1

However, the courses were never set up for auto enrollment. So the messages 
are "confusing". My suggestion is either to not show any message for 
courses not set up for auto enrollment or to say "Course xxx not configured 
for automatic classlist retrieval" - something to that effect.

Thanks,
-hk

---

From: "Stuart Peter Raeburn" <[email-masked]>
Date: Thu, 18 Mar 2004 14:44:00 -0500

Hon-Kie, 

Autoenroll.pl has now been modified so that different messages are logged 
depending on the reason why no enrollments were retrieved for a particular 
class. 

Stuart 

H. K. Ng writes: 

> However, the courses were never set up for auto enrollment. So the 
> messages are "confusing". My suggestion is either to not show any message 
> for courses not set up for auto enrollment or to say "Course xxx not 
> configured for automatic classlist retrieval" - something to that effect. 
> 
> Thanks,
> -hk 
> 
>