--- loncom/html/adm/help/tex/Institutional_Integration_Course_Codes.tex 2008/07/28 23:14:54 1.1 +++ loncom/html/adm/help/tex/Institutional_Integration_Course_Codes.tex 2013/12/04 18:04:10 1.6 @@ -1,16 +1,14 @@ \label{Institutional_Integration_Course_Codes} Courses in a domain can be self-cataloging if assigned an institutional -code. For this to work, two routines need to be customized in localenroll.pm +code. For this to work two routines need to be customized in localenroll.pm - \emph{instcode\_format()} and \emph{instcode\_defaults()}. The first of these is used to split institutional course codes into their constituent -parts, and to populate some perl data structures with these data. -LON-CAPA will use these perl structures to generate linked select boxes -which can be used when searching the {}``official'' course catalog. -The second routine is used when constructing a regular expression for -retrieval of courses based on search criteria specified by the user via the -linked select boxes. The search criteria are combined with defaults for any -components not explicitly selected (the defaults are fragments of a generic -institutional code) to create the regular expression used in the course search. +parts, and populate some perl data structures with these data, which +LON-CAPA can use to generate linked select boxes which users can use +to create filters to apply when searching the {}``official'' course +catalog. The second routine constructs a regular expression used when +searching for courses based on the filter chosen by the user, which +will contain fragments of an institutional code. \textbf{\large instcode\_format} @@ -20,19 +18,24 @@ Six arguments are required: \item domain (\$dom) \item reference to hash of institutional course IDs (\$instcodes) \item reference to hash of codes (\$codes) -\item reference to array of titles (\$codetitles), e.g., @\{\$codetitles\} +\item reference to array of titles (\$codetitles), +\begin{quote} +e.g., @\{\$codetitles\} +\begin{quote} = (\char`\"{}year\char`\"{},\char`\"{}semester\char`\"{},\char`\"{}department\char`\"{},\char`\"{}number\char`\"{}) +\end{quote} +\end{quote} \item reference to hash of abbreviations used in categories, (\$cat\_titles) e.g., \begin{quote} \%\{\$\$cat\_titles\{'Semester'\}\} = ( \begin{quote} -fs => 'Fall', +fs =$>$ 'Fall', -ss => 'Spring', +ss =$>$ 'Spring', -us => 'Summer'); +us =$>$ 'Summer'); \end{quote} \end{quote} \item reference to hash of arrays specifying sort order used in category @@ -40,14 +43,14 @@ titles (\$cat\_order), e.g., @\{\$\$cat\ \end{enumerate} The routine returns 'ok' if no errors occurred. -At MSU, {}``fs03nop590'' is an example of an institutional course +At MSU, {}``fs13nop590'' is an example of an institutional course code; including the following entry in the instcodes hash passed in -by reference - \$\$instcodes\{'43551dedcd43febmsul1'\} = 'fs03nop590' +by reference - \$\$instcodes\{'43551dedcd43febmsul1'\} = 'fs13nop590' would cause the \$codes perl data structure to be populated. -fs03nop590 would be split as follows: +fs13nop590 would be split as follows: -\$\$codes\{'year'\} = '2003' +\$\$codes\{\{'year'\} = '2013' \$\$codes\{'semester'\} = 'Fall' @@ -79,7 +82,7 @@ The routine used at MSU is as follows: \texttt{foreach my \$cid (keys \%\{\$instcodes\}) \{} \begin{quotation} -\texttt{if (\$\$instcodes\{\$cid\} =\~{} m/^({[}suf]s)(\textbackslash{}d\{2\})(\textbackslash{}w\{2,3\})(\textbackslash{}d\{3,4\}\textbackslash{}w?)\$/) +\texttt{if (\$\$instcodes\{\$cid\} =\~{} m/\^{}({[}suf]s)(\textbackslash{}d\{2\})(\textbackslash{}w\{2,3\})(\textbackslash{}d\{3,4\}\textbackslash{}w?)\$/) \{} \begin{quotation} \texttt{\$\$codes\{\$cid\}\{'Semester'\} = \$1;} @@ -92,7 +95,7 @@ The routine used at MSU is as follows: \texttt{my \$numyear = \$year;} -\texttt{\$numyear =\~{} s/^0//;} +\texttt{\$numyear =\~{} s/\^{}0//;} \texttt{\$\$codes\{\$cid\}\{'Year'\} = \$year;} @@ -129,7 +132,7 @@ in institutional code. (\$code\_order) \end{enumerate} The routine returns 'ok' if no errors occurred. -At MSU , the regaular expression fragments used mirror those included +At MSU, the regular expression fragments used mirror those included in the regular expression used in instcode\_format() to split an institutional course code into its component parts. @@ -142,7 +145,7 @@ course code into its component parts. \begin{quotation} \texttt{'Year' => '\textbackslash{}d\{2\}',} -\texttt{'Semester' => '^{[}sfu]s',} +\texttt{'Semester' => '\^{}{[}sfu]s',} \texttt{'Department' => '\textbackslash{}w\{2,3\}',}