[LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm /publisher lonconstruct.pm lonpubdir.pm /xml lonxml.pm

www lon-capa-cvs@mail.lon-capa.org
Mon, 16 Jun 2003 21:32:43 -0000


www		Mon Jun 16 17:32:43 2003 EDT

  Modified files:              
    /loncom/homework	lonhomework.pm 
    /loncom/publisher	lonconstruct.pm lonpubdir.pm 
    /loncom/xml	lonxml.pm 
  Log:
  Bug #430 - way to directly go into (XML) edit mode if problem/page is
  broken.
  
  
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.134 loncom/homework/lonhomework.pm:1.135
--- loncom/homework/lonhomework.pm:1.134	Fri Jun 13 16:50:57 2003
+++ loncom/homework/lonhomework.pm	Mon Jun 16 17:32:43 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.134 2003/06/13 20:50:57 albertel Exp $
+# $Id: lonhomework.pm,v 1.135 2003/06/16 21:32:43 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -677,6 +677,8 @@
   }
   if ($ENV{'request.state'} eq "construct") {
     if ( -e $file ) {
+      &Apache::loncommon::get_unprocessed_cgi
+                          ($ENV{'QUERY_STRING'},['problemmode']);
       if (!(defined $ENV{'form.problemmode'})) {
 	#first visit to problem in construction space
 	#&view_or_edit_menu($request);
Index: loncom/publisher/lonconstruct.pm
diff -u loncom/publisher/lonconstruct.pm:1.12 loncom/publisher/lonconstruct.pm:1.13
--- loncom/publisher/lonconstruct.pm:1.12	Sun Jun 15 14:02:57 2003
+++ loncom/publisher/lonconstruct.pm	Mon Jun 16 17:32:43 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Construction Space Page Wrapper for Construction
 #
-# $Id: lonconstruct.pm,v 1.12 2003/06/15 18:02:57 www Exp $
+# $Id: lonconstruct.pm,v 1.13 2003/06/16 21:32:43 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -105,6 +105,16 @@
    &Debug($r, "Lower frame URL afer ~ subst: ".$lowerframe);
    $lowerframe= &HTML::Entities::encode($lowerframe);
    &Debug($r, "LOwer frame URL after quote subst: ".$lowerframe);
+
+#
+# Are we forcing edit mode?
+#
+
+   &Apache::loncommon::get_unprocessed_cgi
+        ($ENV{'QUERY_STRING'},['forceedit']);
+   if ($ENV{'form.forceedit'}) {
+       $lowerframe.='?editmode=Edit&problemmode=EditXML';
+   }
 
    $r->print(<<ENDPAGE);
 <html>
Index: loncom/publisher/lonpubdir.pm
diff -u loncom/publisher/lonpubdir.pm:1.32 loncom/publisher/lonpubdir.pm:1.33
--- loncom/publisher/lonpubdir.pm:1.32	Sun Jun 15 14:02:57 2003
+++ loncom/publisher/lonpubdir.pm	Mon Jun 16 17:32:43 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Construction Space Directory Lister
 #
-# $Id: lonpubdir.pm,v 1.32 2003/06/15 18:02:57 www Exp $
+# $Id: lonpubdir.pm,v 1.33 2003/06/16 21:32:43 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -310,13 +310,17 @@
 	$status.='<br><a href="/adm/retrieve?filename=/~'.$uname.
 	    $thisdisfn.'/'.$filename.'" target=cat>Retrieve</a>';
     }
+    my $editlink='';
+    if ($filename=~/\.(xml|html|htm|xhtml|xhtm|problem|exam|quiz|assess|survey|form|library)$/) {
+	$editlink=' (<a href="'.$linkdir.'/'.$filename.'?forceedit=1" target="_top">Edit</a>)';
+    }
     $r->print('<tr bgcolor="'.$bgcolor.'">'.
 	      '<td><a target="_parent" href="/adm/publish?filename=/~'.
 	      $uname.$thisdisfn.'/'.$filename.'">'.'Publish</a>'.
 	      '</td>'.
 	      '<td>'.
 	      '<a href="'.$linkdir.'/'.$filename.'" target="_top">'.
-               $filename.'</a>'.
+               $filename.'</a>'.$editlink.
 	      '</td>'.
 	      '<td>'.$title.'</td>'.
 	      '<td>'.$status.'</td>'.
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.263 loncom/xml/lonxml.pm:1.264
--- loncom/xml/lonxml.pm:1.263	Thu Jun 12 16:28:14 2003
+++ loncom/xml/lonxml.pm	Mon Jun 16 17:32:43 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.263 2003/06/12 20:28:14 albertel Exp $
+# $Id: lonxml.pm,v 1.264 2003/06/16 21:32:43 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1249,6 +1249,10 @@
 	    if ($ENV{'form.attemptclean'}) {
 		$filecontents=&htmlclean($filecontents,1);
 	    }
+#
+# we are in construction space, see if edit mode forced
+            &Apache::loncommon::get_unprocessed_cgi
+                          ($ENV{'QUERY_STRING'},['editmode']);
 	}
 	if (!$ENV{'form.editmode'} || $ENV{'form.viewmode'}) {
 	    $result = &Apache::lonxml::xmlparse($request,$target,$filecontents,