[LON-CAPA-admin] autoenroll.log

Lucas, Mark lucasm at ohio.edu
Mon Jan 7 10:50:02 EST 2013


Paul,

It's rather crude, but here is a quick script that will show the hash found in 
environment.db. The course title will need to be unescaped.

Mark

#!/usr/bin/perl
#
#  Look at environment file for a course
#
use strict;
use GDBM_File;

my $lonusers = "/home/httpd/lonUsers/ohiou/";
my $course = "10675782825415boucapa2";
my $first = substr($course,0,1);
my $second = substr($course,1,1);
my $third = substr($course,2,1);
my $filename = $lonusers."/".$first."/".$second."/".$third."/".$course."/environment.db";

tie(my %id_hash,'GDBM_File',$filename,
                            &GDBM_WRCREAT(),0640);

foreach my $key (keys %id_hash) {
   print "$key:  $id_hash{$key}\n";
}
untie(%id_hash);


On Jan 7, 2013, at 10:25 AM, Neubauer, Paul wrote:

> Hi Mark,
> 
> The Perl script you describe is essentially what I see as the most straightforward way to deal with the "noisy" log and creating something like this is exactly what I had in mind. 
> 
> I look in /home/httpd/lonUsers/bsu/1/Q/7/1Q746312661a84458bsul1 and find a number of .db files, e.g., bsu_1Q746312661a84458bsul1.db, which, according to "file bsu_1Q746312661a84458bsul1.db" looks like "GNU dbm 1.x or ndbm database, little endian", i.e., it is a binary file that is probably a GNU dbm file. I haven't used GNU dbm files before, but I'm looking up some docs to see what I can do to see what's in them.
> 
> Thanks,
> Paul
> 
> 
> -----Original Message-----
> From: lon-capa-admin-bounces at mail.lon-capa.org [mailto:lon-capa-admin-bounces at mail.lon-capa.org] On Behalf Of Lucas, Mark
> Sent: Monday, January 07, 2013 8:55 AM
> To: list about administration and system updating
> Subject: Re: [LON-CAPA-admin] autoenroll.log
> 
> Paul,
> 
> If you're looking at doing this outside of LON-CAPA proper, the following might be useful.
> 
> A course has a directory under lonUsers. You can go to (I'm not logged in right now so this is
> approximate)   /home/httpd/lonUsers/bsu/1/Q/7/1Q746312661a84458bsul1   and look for
> a .db file that contains the course name. You could create a perl script that runs through the autoenrollment log filters out the lines of historical courses, translates the course ID for the current courses, and then hands out the rest of the information.
> 
> As always, the caveat is to be careful when poking around in lonUsers and other system places by 'hand'.
> 
> Hope this helps!
> Mark
> 
> 
> On Jan 7, 2013, at 8:37 AM, Neubauer, Paul wrote:
> 
>> Hi Stefan,
>> 
>> Thanks. I suppose if worse comes to worst, I can slog through 
>> searching for each of our historical courses individually through the 
>> web interface and make a list of what they correspond to, but I'm 
>> really hoping for something that I can get in a batch and eventually 
>> automate. I'm afraid I know next to nothing about the structure of the 
>> lon-capa database or how the course ids are stored, but there has to 
>> be a way to extract the data. I had forgotten that I could search by 
>> course id, and I will do that if necessary, but I really hope it turns 
>> out not to be. :-)
>> 
>> Thanks,
>> Paul
>> 
>> 
>> -----Original Message-----
>> From: lon-capa-admin-bounces at mail.lon-capa.org 
>> [mailto:lon-capa-admin-bounces at mail.lon-capa.org] On Behalf Of Stefan 
>> Bisitz
>> Sent: Monday, January 07, 2013 8:24 AM
>> To: lon-capa-admin at mail.lon-capa.org
>> Subject: Re: [LON-CAPA-admin] autoenroll.log
>> 
>> Hi Paul,
>> 
>> 1Q746312661a84458bsul1 and other identifiers like that is the LON-CAPA Course ID. This value is created when the course is created and never ever changes. The course title (e.g., "ASTR100 Fall 2003"), even though unlikely, could be changed.
>> 
>> As Domain Coordinator, go to Main Menu >> View or modify a course or community. Copy the course id to " LON-CAPA course ID:" and click "Search" to retrieve the current title and more related data.
>> 
>> This is of course not useful for batch retrieval but offers a quick way to check the data.
>> 
>> As we don't use Autoenrollment here, others might have more or better ideas.
>> 
>> Stefan Bisitz
>> 
>> 
>> Am 07.01.2013 14:07, schrieb Neubauer, Paul:
>>> Hi all,
>>> 
>>> Thanks to a lot of good help from Stewart, we have autoenrollment working and shibboleth is providing authentication.
>>> 
>>> Now I'm trying to make better use of the log so that I have a reasonable chance of catching errors or other problems.
>>> 
>>> Unfortunately, /home/httpd/perl/logs/autoenroll.log arrives every morning with hundreds of lines, most of which are of the form:
>>> Auto-enrollment not currently enabled for 1Q746312661a84458bsul1
>>> 
>>> It appears that the autoenroll process logs the fact that every course we have ever had on LON-CAPA is not currently being autoenrolled. Course 1Q746312661a84458bsul1 may be ASTR100 Fall 2003, but I can't tell what it is from the log.
>>> 
>>> And then there are messages like:
>>> No institutional classlist data could be retrieved for
>>> 1W7361372b42a500dbsul1
>>> 
>>> I have no idea what class 1W7361372b42a500dbsul1 is.  I know it is not one of the current ones, so I am guessing that it is one from a past term that somehow got marked for autoenrollment even though we were not doing autoenrollment before this immediately past semester.
>>> 
>>> So my most urgent question is: is there a way to retrieve course information based on the "affiliate" id? It doesn't have to be something within LON-CAPA proper, in fact, I'd prefer something that could generate a plain text file. If anyone has a clue for me on constructing a MySQL query against the database so that I can extract that information, I could use that.  Basically, I'd like to filter out the past courses from autoenroll.log so I can see what is happening to the current courses without all the noise from irrelevant courses. I can do that in many different ways, I'm sure, but it strikes me that simply generating a list of what all the courses in the database are/have been (particularly by "affiliate" id, which is all the course identification that is in the log) would give me a relatively straightforward start on such a filter so I can say:
>>> 
>>> I don't need 1Q746312661a84458bsul1
>>> I DO need 2U380410d38cf5008bsul1
>>> I don't need 2b739135e6f2a50e9bsul1
>>> ...
>>> etc.
>>> 
>>> Any thoughts or ideas would be welcome.
>>> 
>>> Thanks,
>>> Paul
>>> 
>>> _______________________________________________
>>> LON-CAPA-admin mailing list
>>> LON-CAPA-admin at mail.lon-capa.org
>>> http://mail.lon-capa.org/mailman/listinfo/lon-capa-admin
>>> 
>> _______________________________________________
>> LON-CAPA-admin mailing list
>> LON-CAPA-admin at mail.lon-capa.org
>> http://mail.lon-capa.org/mailman/listinfo/lon-capa-admin
>> 
>> 
>> _______________________________________________
>> LON-CAPA-admin mailing list
>> LON-CAPA-admin at mail.lon-capa.org
>> http://mail.lon-capa.org/mailman/listinfo/lon-capa-admin
> 
> -- 
> Mark Lucas 								email: lucasm at ohiou.edu
> 252D Clippinger Lab						phone: (740)597-2984
> Department of Physics and Astronomy		fax: (740)593-0433
> Ohio University
> Athens, OH 45701
> 
> _______________________________________________
> LON-CAPA-admin mailing list
> LON-CAPA-admin at mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-admin
> 
> 
> _______________________________________________
> LON-CAPA-admin mailing list
> LON-CAPA-admin at mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-admin

-- 
Mark Lucas 								email: lucasm at ohiou.edu
252D Clippinger Lab						phone: (740)597-2984
Department of Physics and Astronomy		fax: (740)593-0433
Ohio University
Athens, OH 45701




More information about the LON-CAPA-admin mailing list