[LON-CAPA-cvs] cvs: loncom /interface lonfeedback.pm

raeburn raeburn@source.lon-capa.org
Thu, 21 Jan 2010 23:13:50 -0000


raeburn		Thu Jan 21 23:13:50 2010 EDT

  Modified files:              
    /loncom/interface	lonfeedback.pm 
  Log:
  - Valid XML in imsmanifest.xml for discussion posts included in IMS exports of courses.  
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.283 loncom/interface/lonfeedback.pm:1.284
--- loncom/interface/lonfeedback.pm:1.283	Tue Dec 22 06:14:35 2009
+++ loncom/interface/lonfeedback.pm	Thu Jan 21 23:13:50 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.283 2009/12/22 06:14:35 faziophi Exp $
+# $Id: lonfeedback.pm,v 1.284 2010/01/21 23:13:50 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -403,8 +403,7 @@
             my $manifestfilename = $tempexport.$manifest;
             if ($manifestfile = Apache::File->new('>'.$manifestfilename)) {
                 $manifestok=1;
-                print $manifestfile qq|
-<?xml version="1.0" encoding="UTF-8"?>
+                print $manifestfile qq|<?xml version="1.0" encoding="UTF-8"?>
 <manifest xmlns="http://www.imsglobal.org/xsd/imscp_v1p1" xmlns:imsmd="http://www.imsglobal.org/xsd/imsmd_v1p2" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 identifier="MANIFEST-$ressymb" xsi:schemaLocation="http://www.imsglobal.org/xsd/imscp_v1p1 
@@ -530,11 +529,11 @@
                         print $manifestfile "\n". 
       '<item identifier="ITEM-'.$ressymb.'-'.$alldiscussion{$post}.'" isvisible="'.
         $imsitems{$alldiscussion{$post}}{'isvisible'}.'" identifieref="RES-'.$ressymb.'-'.$alldiscussion{$post}.'">'.
-        '<title>'.$imsitems{$alldiscussion{$post}}{'title'}.'</title>';
+        '<title>'.$imsitems{$alldiscussion{$post}}{'title'}.'</title></item>';
                         $imsresources .= "\n".
     '<resource identifier="RES-'.$ressymb.'-'.$alldiscussion{$post}.'" type="webcontent" href="'.$postfilename.'">'."\n".
       '<file href="'.$postfilename.'">'."\n".
-      $imsfiles{$alldiscussion{$post}}{$imsitems{$alldiscussion{$post}}{'currversion'}}."\n".
+      $imsfiles{$alldiscussion{$post}}{$imsitems{$alldiscussion{$post}}{'currversion'}}.'</file>'."\n".
     '</resource>';
                     }
                     my $postingfile;
@@ -1411,7 +1410,7 @@
                 foreach my $key (sort(keys(%currattach))) {
                     if ($$allattachments{$key}{'filename'} =~ m-^/uploaded/([^/]+/[^/]+)(/feedback)?(/?\d*)/([^/]+)$-) {
                         my $fname = $1.$3.'/'.$4;
-                        $$imsfiles{$idx}{$i} .= '<file href="'.$fname.'">'."\n";
+                        $$imsfiles{$idx}{$i} .= '<file href="'.$fname.'" />'."\n";
                         $$attachtxt{$i}.= '<a href="'.$fname.'">'.$4.'</a><br />';
                     }
                 }