[LON-CAPA-cvs] cvs: loncom /enrollment localenroll.pm
raeburn
lon-capa-cvs@mail.lon-capa.org
Sat, 03 Jul 2004 18:37:20 -0000
raeburn Sat Jul 3 14:37:20 2004 EDT
Modified files:
/loncom/enrollment localenroll.pm
Log:
Add stub for instcode_format to retrieve institutional code format information.
Index: loncom/enrollment/localenroll.pm
diff -u loncom/enrollment/localenroll.pm:1.9 loncom/enrollment/localenroll.pm:1.10
--- loncom/enrollment/localenroll.pm:1.9 Thu Jun 17 14:31:25 2004
+++ loncom/enrollment/localenroll.pm Sat Jul 3 14:37:20 2004
@@ -1,6 +1,6 @@
# functions to glue school database system into Lon-CAPA for
# automated enrollment
-# $Id: localenroll.pm,v 1.9 2004/06/17 18:31:25 raeburn Exp $
+# $Id: localenroll.pm,v 1.10 2004/07/03 18:37:20 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -174,7 +174,7 @@
# interface will allow the course coordinator to enter section numbers
# in text boxes.
#
-################################
+###############################
sub get_sections {
my ($coursecode,$dom) = @_;
@@ -278,4 +278,46 @@
return ($authparam,$create_passwd,$authchk);
}
+###############################
+# sub instcode_format
+#
+# Split coursecodes into constituent parts.
+# e.g., INSTITUTIONALCODE = fs03nop590, LON-CAPA COURSEID: 43551dedcd43febmsul1
+# (MSU's course naming scheme - fs03 = Fall semester 2003, nop =
+# department name, 590 = course number)
+#
+# Incoming data:
+# $dom (domain)
+# $$courseIDs{'43551dedcd43febmsul1'} = 'Title of course' (hash of courseIDs)
+#
+# fs03nop590 would be split as follows
+# @{$codetitles} = ("year","semester","department","number")
+# $$codes{{'year'} = '2003'
+# $$codes{'semester'} = 'Fall'
+# $$codes{'department'} = 'nop'
+# $$codes{'number'} = '590'
+#
+# requires five arguments:
+# domain ($dom)
+# reference to hash of institutional course IDs ($instcodes)
+# reference to hash of codes ($codes)
+# reference to array of titles ($codetitles)
+# reference to hash of abbreviations used in categories
+# reference to hash of arrays specifying sort order used in category titles
+#
+# e.g., %{$$cat_titles{'Semester'}} = (
+# fs => 'Fall',
+# ss => 'Spring',
+# us => 'Summer');
+#
+# e.g., @{$$cat_order{'Semester'}} = ('ss','us','fs');
+# returns 1 parameter: 'ok' if no processing errors.
+###############################
+
+sub instcode_format () {
+ my ($dom,$instcodes,$codes,$codetitles,$cat_titles,$cat_order) = @_;
+ my $outcome = 'ok';
+ return $outcome;
+}
+
1;