[LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm structuretags.pm

albertel lon-capa-cvs-allow@mail.lon-capa.org
Wed, 31 Oct 2007 17:40:02 -0000


albertel		Wed Oct 31 13:40:02 2007 EDT

  Modified files:              
    /loncom/homework	lonhomework.pm structuretags.pm 
  Log:
  - fixup location of error messages
  
  
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.280 loncom/homework/lonhomework.pm:1.281
--- loncom/homework/lonhomework.pm:1.280	Tue Oct 30 21:37:52 2007
+++ loncom/homework/lonhomework.pm	Wed Oct 31 13:40:00 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.280 2007/10/31 01:37:52 albertel Exp $
+# $Id: lonhomework.pm,v 1.281 2007/10/31 17:40:00 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -149,7 +149,7 @@
 	    } elsif ( $env{'form.problemmode'} eq &mt('Edit') ||
 		      $env{'form.problemmode'} eq 'Edit') {
 		if ( $env{'form.submitted'} eq 'edit' ) {
-		    if ( $env{'form.submit'} eq &mt('Submit Changes and View') ) {
+		    if ( $env{'form.submit'} eq &mt('Save and View') ) {
 			return ('modified','web','answer');
 		    } else {
 			return ('modified','no_output_web','edit');
@@ -909,7 +909,7 @@
 	if (!$error) { $problem=&Apache::lonnet::getfile($file); }
     }
     &Apache::lonhomework::showhashsubset(\%env,'^form');
-    if ( $env{'form.submit'} eq &mt('Submit Changes and View') ) {
+    if ( $env{'form.submit'} eq &mt('Save and View') ) {
 	&Apache::lonhomework::showhashsubset(\%env,'^form');
 	$env{'form.problemmode'}='View';
 	&renderpage($request,$file);
@@ -939,8 +939,7 @@
 
 	$result.=$start_page.
 	    &renderpage($request,$file,['no_output_web'],1).
-	    &Apache::lonxml::message_location().'
-            <form '.&Apache::edit::form_change_detection().' name="lonhomework" method="POST" action="'.
+            '<form '.&Apache::edit::form_change_detection().' name="lonhomework" method="POST" action="'.
 	    &HTML::Entities::encode($env{'request.uri'},'<>&"').'">'.
 	    &Apache::structuretags::remember_problem_state().'
             <div class="LC_edit_problem_editxml_header">
@@ -961,6 +960,7 @@
                 <input type="submit" name="submit" accesskey="v" value="'.&mt('Save and View').'" />
               </div>
               <hr class="LC_edit_problem_divide" />
+	      '.&Apache::lonxml::message_location().'
             </div>
             '  . '
             <textarea '.&Apache::edit::element_change_detection().
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.408 loncom/homework/structuretags.pm:1.409
--- loncom/homework/structuretags.pm:1.408	Tue Oct 30 21:37:52 2007
+++ loncom/homework/structuretags.pm	Wed Oct 31 13:40:01 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.408 2007/10/31 01:37:52 albertel Exp $
+# $Id: structuretags.pm,v 1.409 2007/10/31 17:40:01 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -199,7 +199,7 @@
 	}
     }
 
-    if (!defined($found{'body'})) {
+    if (!defined($found{'body'}) && $env{'request.state'} ne 'construct') {
 	$page_start .= &Apache::lonxml::message_location();
     }
     
@@ -317,6 +317,7 @@
        <input type="submit" name="submit" accesskey="v" value="'.&mt('Save and View').'" />
   </div>
 <hr class="LC_edit_problem_divide" />
+'.&Apache::lonxml::message_location().'
 </div>
 '.
        '<table border="0" width="100%"><tr><td bgcolor="#DDDDDD">';
@@ -460,9 +461,9 @@
     $result.='<input type="hidden" name="problemmode" value="'.&mt('View').'" />';
     $result .= '<input type="submit" name="problemmode" accesskey="e" value="'.&mt('Edit').'" />';
     $result .= '<input type="submit" name="problemmode" accesskey="x" value="'.&mt('EditXML').'" />';
-
     $result.='
    </div>
+   '.&Apache::lonxml::message_location().'
 </div>';
     return $result;
 }