[LON-CAPA-cvs] cvs: modules /msu localenroll.pm
raeburn
raeburn at source.lon-capa.org
Fri Aug 3 11:37:38 EDT 2012
raeburn Fri Aug 3 15:37:38 2012 EDT
Modified files:
/modules/msu localenroll.pm
Log:
- MSU now uses four characters for some department identifiers
(e.g., rcah).
Index: modules/msu/localenroll.pm
diff -u modules/msu/localenroll.pm:1.58 modules/msu/localenroll.pm:1.59
--- modules/msu/localenroll.pm:1.58 Sat Mar 10 15:37:55 2012
+++ modules/msu/localenroll.pm Fri Aug 3 15:37:38 2012
@@ -1,6 +1,6 @@
# functions to glue school database system into Lon-CAPA for
# automated enrollment
-# $Id: localenroll.pm,v 1.58 2012/03/10 15:37:55 raeburn Exp $
+# $Id: localenroll.pm,v 1.59 2012/08/03 15:37:38 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -129,7 +129,7 @@
<!DOCTYPE text>
<students>
|;
- if ($class =~ m/^([suf]s\d{2})(\w{2,3})(\d{3,4}\w?)(\d{3})$/) {
+ if ($class =~ m/^([suf]s\d{2})(\w{2,})(\d{3,4}\w?)(\d{3})$/) {
my $sem = $1;
my $subj = $2;
my $crse = $3;
@@ -191,7 +191,7 @@
sub get_sections {
my ($coursecode,$dom) = @_;
my @secs = ();
- if ($coursecode =~ m/^([suf]s\d{2})(\w{2,3})(\d{3,4}\w?)/) {
+ if ($coursecode =~ m/^([suf]s\d{2})(\w{2,4})(\d{3,4}\w?)/) {
my $term = $1;
my $subj = $2;
my $crse = $3;
@@ -237,7 +237,7 @@
$outcome = "Inclusion of enrollment could not be established for the course section $course_id because the username of the owner contains invalid characters.";
return $outcome;
}
- if ($course_id =~ m/^([suf]s)(\d{2})(\w{2,3})(\d{3,4}\w?)(\d{3})$/) {
+ if ($course_id =~ m/^([suf]s)(\d{2})(\w{2,4})(\d{3,4}\w?)(\d{3})$/) {
my $sem = $1;
my $yr = $2;
my $subj = $3;
@@ -397,7 +397,7 @@
sub validate_courseID {
my ($course_id,$dom) = @_;
my $outcome = '';
- if ($course_id =~ m/^([suf]s\d{2})(\w{2,3})(\d{3,4}\w?)(\d{3})$/) {
+ if ($course_id =~ m/^([suf]s\d{2})(\w{2,4})(\d{3,4}\w?)(\d{3})$/) {
my $term = $1;
my $subj = $2;
my $crse = $3;
@@ -440,7 +440,7 @@
ss => 'Spring',
us => 'Summer',
);
- if ($instcode =~ m/^([suf]s)(\d{2})(\w{2,3})(\d{3,4}\w?)$/) {
+ if ($instcode =~ m/^([suf]s)(\d{2})(\w{2,4})(\d{3,4}\w?)$/) {
my $sem = $1;
my $year = $2;
my $term = $sem.$year;
@@ -594,7 +594,7 @@
);
@{$$cat_order{'Semester'}} = ('ss','us','fs');
foreach my $cid (keys %{$instcodes}) {
- if ($$instcodes{$cid} =~ m/^([suf]s)(\d{2})(\w{2,3})(\d{3,4}\w?)$/) {
+ if ($$instcodes{$cid} =~ m/^([suf]s)(\d{2})(\w{2,4})(\d{3,4}\w?)$/) {
$$codes{$cid}{'Semester'} = $1;
$$codes{$cid}{'Department'} = $3;
$$codes{$cid}{'Number'} = $4;
@@ -749,7 +749,7 @@
my ($dbh,$class,$stuinfo) = @_;
my $pidcount = 0;
my $blankcount = 0;
- if ($class =~ m/^([suf]s\d{2})(\w{2,3})(\d{3,4}\w?)(\d{3})$/) {
+ if ($class =~ m/^([suf]s\d{2})(\w{2,4})(\d{3,4}\w?)(\d{3})$/) {
eval {
my $sth = $dbh->prepare("SELECT Pid,Pilot_Id FROM LONCAPA_ClassList WHERE Term_Code = '$1' AND Subj_Code = '$2' AND Crse_Code = '$3' AND Sctn_Code = '$4' ORDER BY Pid");
$sth->execute();
@@ -809,7 +809,7 @@
$person .= ':'.$dom;
}
if (defined($person) && $person ne '') {
- if ($class =~ m/^([suf]s\d{2})(\w{2,3})(\d{3,4}\w?)(\d{3})$/) {
+ if ($class =~ m/^([suf]s\d{2})(\w{2,4})(\d{3,4}\w?)(\d{3})$/) {
# Check if section exists in LONCAPA table.
if (!defined($dbh)) {
($dbh,$dbflag) = &connect_DB('RO');
@@ -845,7 +845,7 @@
%{$defaults} = (
'Year' => '\d{2}',
'Semester' => '^[sfu]s',
- 'Department' => '\w{2,3}',
+ 'Department' => '\w{2,4}',
'Number' => '\d{3,4}\w?',
);
@{$code_order} = ('Semester','Year','Department','Number');
More information about the LON-CAPA-cvs
mailing list