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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 30 Nov 2004 23:28:58 -0000


albertel		Tue Nov 30 18:28:58 2004 EDT

  Modified files:              
    /loncom/homework	structuretags.pm lonsimpleproblemedit.pm 
  Log:
  - Bug #2476, #3647, cleanup to editing simple problems
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.272 loncom/homework/structuretags.pm:1.273
--- loncom/homework/structuretags.pm:1.272	Thu Nov 11 18:45:35 2004
+++ loncom/homework/structuretags.pm	Tue Nov 30 18:28:57 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.272 2004/11/11 23:45:35 albertel Exp $
+# $Id: structuretags.pm,v 1.273 2004/11/30 23:28:57 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1363,12 +1363,13 @@
 sub start_simpleeditbutton {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     my $result='';
-    if (($target eq 'web') &&
+    if (($ENV{'form.simple_edit_button'} ne 'off') &&
+	($target eq 'web') &&
         (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) {
         my $url=$ENV{'request.noversionuri'};
         $url=~s/\?.*$//;
 	$result='<table width="100%" bgcolor="#FFFFAA" border="2"><tr><td>'.
-                '<a href="'.$url.'/smpedit">'.&mt('Simple Problem Editor').'</a> - '.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.').
+                '<a href="'.$url.'/smpedit">'.&mt('Edit').'</a> - '.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.').
 &Apache::loncommon::help_open_topic('Caching').'</td></tr></table><br />';
     }
     return $result;
Index: loncom/homework/lonsimpleproblemedit.pm
diff -u loncom/homework/lonsimpleproblemedit.pm:1.11 loncom/homework/lonsimpleproblemedit.pm:1.12
--- loncom/homework/lonsimpleproblemedit.pm:1.11	Tue Nov 30 17:57:16 2004
+++ loncom/homework/lonsimpleproblemedit.pm	Tue Nov 30 18:28:57 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Simple Problem Parameter Setting "Editor"
 #
-# $Id: lonsimpleproblemedit.pm,v 1.11 2004/11/30 22:57:16 albertel Exp $
+# $Id: lonsimpleproblemedit.pm,v 1.12 2004/11/30 23:28:57 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -52,6 +52,7 @@
 sub rawrendering {
     my ($symb)=@_;
     my %data=('show_errors'=>'on',
+	      'simple_edit_button' => 'off',
 	      'devalidatecourseresdata'=>'on');
     return &Apache::loncommon::get_student_view($symb,time,time,
 						$ENV{'request.course.id'},
@@ -196,6 +197,9 @@
     $r->print(&Apache::loncommon::bodytag('Simple Problem Editor'));
     if ($symb) {
 	$r->print('<h1>'.&Apache::lonnet::gettitle($symb).'</h1>');
+	$r->print('<table width="100%" bgcolor="#FFFFAA" border="2"><tr><td>'.
+                '<a href="'.$uri.'">'.&mt('Student View').'</a> - '.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.').
+		  &Apache::loncommon::help_open_topic('Caching').'</td></tr></table>');
 	$r->print('<table border="2" bgcolor="#FFFFFF" width="100%"><tr><td>'.
                   &rawrendering($symb).
                   '</td></tr></table><br />');
@@ -212,7 +216,7 @@
         $r->print('<b>'.&mt('Question Type').
 		  ': '.&Apache::loncommon::select_form
 	                               ($qtype,'questiontype',%questiontypes).
-  '</b><br /><input type="submit" value="'.&mt('Store Changes').
+  '</b><br /><input type="submit" value="'.&mt('Save and Edit').
   '" /><p>&nbsp;</p>');
 # Question Text
         $r->print(&questiontext());
@@ -284,7 +288,7 @@
 	}
 # Store Button
 	$r->print(
-  '<input type="submit" value="'.&mt('Store Changes').'" /></form>');
+  '<input type="submit" value="'.&mt('Save and Edit').'" /></form>');
     } else {
 	$r->print(&mt('Could not identify problem.'));
     }