[LON-CAPA-admin] Course Catalog
Stuart Peter Raeburn
raeburn at msu.edu
Wed Jan 31 13:01:50 EST 2007
Stefan,
At present the course catalog link on the log-in page will list courses in
the domain to which the machine belongs, which have institutional codes
assigned to them. (If a logged-in user types the URL:
[machine]/adm/coursecatalog, the catalog will be for the current role's
domain, or the user's domain - if the user has no role selected).
The ability to assign institutional codes was originally introduced in 2004
to support auto-enrollment for courses in domains with access to
institutional classlist datafeeds. Institutional codes can be assigned when
a Domain Coordinator creates a new course via CCRS, and they can be modified
for an existing course by a Domain Coordinator using MCRS.
If /home/httpd/lib/perl/localenroll.pm has been customized appropriately,
the course catalog will display an initial page which provides select boxes
for the user to narrow the search, e.g., (at MSU): Year, Semester,
Department, Number and a "Display courses" button - see
http://s10.lite.msu.edu/adm/coursecatalog
There are two subroutines in localenroll.pm which require customization -
instcode_format() and instcode_defaults(). In the absence of customization,
there will be not be an initial page with categories and a "display courses"
button; instead the course catalog will simply display a list of all courses
which have institutional codes, sorted by title (sort order can be changed
by clicking the column headings).
The comments included in the stub localenroll.pm file including in the
LON-CAPA distribution provide information about how to customize the two
routines. I can also send you the complete code for these routines as
implemented at MSU (for excerpts see below).
Stuart Raeburn
MSU LON-CAPA group
P.S. If you are planning to customize localenroll.pm (on the library server
for your domain):
In short....
instcode_format() takes a reference to a hash of institutional courseIDs
(where key is LON-CAPA courseID, e.g., 43551dedcd43febmsul, and value is
institutional code, e.g., fs03nop590), and divides the institutional code
into fragments - at MSU: year, semester, department and number. The
fragments are then accumulated for each of the categories.
instcode_defaults() specifies the default regular expression fragments to be
used to filter the display of courses based on the selections a user makes.
For example ....
At MSU codes are similar to fs03nop590 where fs is semester (fs is Fall), 03
is year, nop is department and 590 is course number.
instcode_format() at MSU includes:
foreach my $cid (keys %{$instcodes}) {
if ($$instcodes{$cid} =~ m/^([suf]s)(\d{2})(\w{2,3})(\d{3,4}\w?)$/) {
$$codes{$cid}{'Semester'} = $1;
$$codes{$cid}{'Department'} = $3;
$$codes{$cid}{'Number'} = $4;
my $year = $2;
my $numyear = $year;
$numyear =~ s/^0//;
$$codes{$cid}{'Year'} = $year;
unless (defined($$cat_titles{'Year'}{$year})) {
$$cat_titles{'Year'}{$year} = 2000 + $numyear;
}
}
}
The select boxes shown on the intial page of course catalog are:
Year, Semester, Department, Nunmber
If a user selected 2003 and Fall from the select boxes, the regular
expression used in filtering the course listing would be:
fs03\w{2,3}\d{3,4}\w?
instcode_defaults() at MSU includes:
%{$defaults} = (
'Year' => '\d{2}',
'Semester' => '^[sfu]s',
'Department' => '\w{2,3}',
'Number' => '\d{3,4}\w?',
);
@{$code_order} = ('Semester','Year','Department','Number');
Let me know if you would like more information on customizing
instcode_format() and instcode_defaults(). Before doing so you will need
decide on a scheme for institutional codes. If you also plan to use
auto-enrollment this may be influenced by the requirement to be able to
access classlist datafeeds.
Stefan Bisitz writes:
> Hi,
>
> Which courses are listed in the "Course Catalog" (link from LON-CAPA
> login page)? How can I control, which courses are listed? On our server,
> I only find there three (very) old courses, which shouldn't be listed there.
>
> -> [machine]/adm/coursecatalog
>
> Thanks,
> Stefan
>
> _______________________________________________
> LON-CAPA-admin mailing list
> LON-CAPA-admin at mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-admin
>
More information about the LON-CAPA-admin
mailing list