[LON-CAPA-cvs] cvs: loncom /cgi listcodes.pl

raeburn raeburn at source.lon-capa.org
Wed Jan 1 14:07:44 EST 2014


raeburn		Wed Jan  1 19:07:44 2014 EDT

  Modified files:              
    /loncom/cgi	listcodes.pl 
  Log:
  - Include the course ID as an attribute of the <course> tag when 
    rendering unique course codes in xml format. 
  
  
Index: loncom/cgi/listcodes.pl
diff -u loncom/cgi/listcodes.pl:1.1 loncom/cgi/listcodes.pl:1.2
--- loncom/cgi/listcodes.pl:1.1	Wed Jan  1 17:41:51 2014
+++ loncom/cgi/listcodes.pl	Wed Jan  1 19:07:44 2014
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 $|=1;
 # Listing of domain's courses with unique six character codes
-# $Id: listcodes.pl,v 1.1 2014/01/01 17:41:51 raeburn Exp $
+# $Id: listcodes.pl,v 1.2 2014/01/01 19:07:44 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -312,8 +312,7 @@
                 }
                 if ($format eq 'xml') {
                      print <<"END";
- <course>
-  <courseID>$cnum</courseID>
+ <course id="$cnum">
   <code>$courses{$course}{'uniquecode'}</code>
   <title>$courses{$course}{'description'}</title>
   <owner>$courses{$course}{'owner'}</owner>
@@ -370,8 +369,7 @@
     } elsif ($format eq 'xml') {
          <<"END";
 <courses>
- <course> 
-  <courseID>$cnum</courseID>
+ <course id="$cnum"> 
   <code>$code</code>
   <title>$title</title>
   <owner>$owner</owner>




More information about the LON-CAPA-cvs mailing list