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

www www@source.lon-capa.org
Tue, 06 Apr 2010 14:56:37 -0000


This is a MIME encoded message

--www1270565797
Content-Type: text/plain

www		Tue Apr  6 14:56:37 2010 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  Cleaning up form.probTitle that was (or failed to be) moved all over the place
  
  
--www1270565797
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20100406145637.txt"

Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.604 loncom/homework/grades.pm:1.605
--- loncom/homework/grades.pm:1.604	Thu Apr  1 00:58:43 2010
+++ loncom/homework/grades.pm	Tue Apr  6 14:56:37 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.604 2010/04/01 00:58:43 raeburn Exp $
+# $Id: grades.pm,v 1.605 2010/04/06 14:56:37 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -637,7 +637,6 @@
     $jscript.= '<form action="/adm/grades" method="post" name="onestudent">'."\n".
 	'<input type="hidden" name="symb"    value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n".
 	'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n".
-	'<input type="hidden" name="probTitle" value="'.$env{'form.probTitle'}.'" />'."\n".
 	'<input type="hidden" name="Status"  value="'.$stu_status.'" />'."\n".
 	'<input type="hidden" name="command" value="submission" />'."\n".
 	'<input type="hidden" name="student" value="" />'."\n".
@@ -732,7 +731,7 @@
    my $request = shift;
    &commonJSfunctions($request);
    my ($symb)   = &get_symb($request);
-   return '<form name="gradingMenu"><input type="submit" value="'.&mt('Verify Receipt No.').'" />'.
+   return '<form name="gradingMenu"><input type="submit" value="'.&mt('Verify Receipt Number.').'" />'.
         &Apache::lonnet::recprefix($env{'request.course.id'}).
         '-<input type="text" name="receipt" size="4" />'.
         '<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n".
@@ -752,10 +751,8 @@
 
     my $title.=
 	'<h3><span class="LC_info">'.
-	&mt('Verifying Receipt No. [_1]',$receipt).
-	'</span></h3>'."\n".
-	'<h4>'.&mt('<b>Resource: </b>[_1]',$env{'form.probTitle'}).
-	'</h4>'."\n";
+	&mt('Verifying Receipt Number [_1]',$receipt).
+	'</span></h3>'."\n";
 
     my ($string,$contents,$matches) = ('','',0);
     my (undef,undef,$fullname) = &getclasslist('all','0');
@@ -842,8 +839,6 @@
     my $getgroup  = $env{'form.group'} eq '' ? 'all' : $env{'form.group'};
     my $submitonly= $env{'form.submitonly'} eq '' ? 'all' : $env{'form.submitonly'};
     my $viewgrade = $env{'form.showgrading'} eq 'yes' ? 'View/Grade/Regrade' : 'View';
-    $env{'form.probTitle'} = $env{'form.probTitle'} eq '' ? 
-	&Apache::lonnet::gettitle($symb) : $env{'form.probTitle'};
 
     my $result='<h3><span class="LC_info">&nbsp;'
 	.&mt("$viewgrade Submissions for a Student or a Group of Students")
@@ -948,7 +943,6 @@
 	'<input type="hidden" name="handgrade"   value="'.$env{'form.handgrade'}.'" /><br />'."\n".
 	'<input type="hidden" name="showgrading" value="'.$env{'form.showgrading'}.'" /><br />'."\n".
 	'<input type="hidden" name="saveState"   value="'.$env{'form.saveState'}.'" />'."\n".
-	'<input type="hidden" name="probTitle"   value="'.$env{'form.probTitle'}.'" />'."\n".
 	'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n".
 	'<input type="hidden" name="saveStatusOld" value="'.$saveStatus.'" />'."\n";
 
@@ -1918,7 +1912,8 @@
     $udom = ($udom eq '' ? $env{'user.domain'} : $udom); #has form.userdom changed for a student?
     my $usec = &Apache::lonnet::getsection($udom,$uname,$env{'request.course.id'});
     $env{'form.fullname'} = &Apache::loncommon::plainname($uname,$udom,'lastname') if $env{'form.fullname'} eq '';
-    my $symb = &get_symb($request); 
+    my $symb = &get_symb($request);
+    my $probtitle=&Apache::lonnet::gettitle($symb); 
     if ($symb eq '') { $request->print("Unable to handle ambiguous references:."); return ''; }
 
     if (!&canview($usec)) {
@@ -1942,13 +1937,10 @@
     if ($counter == 0) {
 	&sub_page_js($request);
 	&sub_page_kw_js($request) if ($env{'form.handgrade'} eq 'yes');
-	$env{'form.probTitle'} = $env{'form.probTitle'} eq '' ? 
-	    &Apache::lonnet::gettitle($symb) : $env{'form.probTitle'};
 	if ($env{'form.handgrade'} eq 'yes' && &files_exist($request, $symb)) {
 	    &download_all_link($request, $symb);
 	}
-	$request->print('<h3>&nbsp;<span class="LC_info">'.&mt('Submission Record').'</span></h3>'."\n".
-			'<h4>&nbsp;'.&mt('<b>Resource: </b> [_1]',$env{'form.probTitle'}).'</h4>'."\n");
+	$request->print('<h3>&nbsp;<span class="LC_info">'.&mt('Submission Record').'</span></h3>');
 
 	# option to display problem, only once else it cause problems 
         # with the form later since the problem has a form.
@@ -1979,7 +1971,7 @@
 	    $env{'form.kwsize'}   = $keyhash{$loginuser.'_kwsize'} ne '' ? $keyhash{$loginuser.'_kwsize'} : '0';
 	    $env{'form.kwstyle'}  = $keyhash{$loginuser.'_kwstyle'} ne '' ? $keyhash{$loginuser.'_kwstyle'} : '';
 	    $env{'form.msgsub'}   = $keyhash{$symb.'_subject'} ne '' ? 
-		$keyhash{$symb.'_subject'} : $env{'form.probTitle'};
+		$keyhash{$symb.'_subject'} : $probtitle;
 	    $env{'form.savemsgN'} = $keyhash{$symb.'_savemsgN'} ne '' ? $keyhash{$symb.'_savemsgN'} : '0';
 	}
 	my $overRideScore = $env{'form.overRideScore'} eq '' ? 'no' : $env{'form.overRideScore'};
@@ -1989,7 +1981,6 @@
 			'<input type="hidden" name="saveState"  value="'.$env{'form.saveState'}.'" />'."\n".
 			'<input type="hidden" name="Status"     value="'.$stu_status.'" />'."\n".
 			'<input type="hidden" name="overRideScore" value="'.$overRideScore.'" />'."\n".
-			'<input type="hidden" name="probTitle"  value="'.$env{'form.probTitle'}.'" />'."\n".
 			'<input type="hidden" name="refresh"    value="off" />'."\n".
 			'<input type="hidden" name="studentNo"  value="" />'."\n".
 			'<input type="hidden" name="gradeOpt"   value="" />'."\n".
@@ -2537,7 +2528,7 @@
 		if ($env{'form.withgrades'.$ctr}) {
 		    $message.="\n\nPoint".($pts > 1 ? 's':'').' awarded = '.$pts.' out of '.$wgt;
 		    $messagetail = " for <a href=\"".
-		                   $feedurl."?symb=$showsymb\">$env{'form.probTitle'}</a>";
+		                   $feedurl."?symb=$showsymb\">$restitle</a>";
 		}
 		$msgstatus = 
                     &Apache::lonmsg::user_normal_msg($uname,$udom,$subject,
@@ -2565,7 +2556,7 @@
 						      $udom);
 			    if ($env{'form.withgrades'.$ctr}) {
 				$messagetail = " for <a href=\"".
-                                    $baseurl."?symb=$showsymb\">$env{'form.probTitle'}</a>";
+                                    $baseurl."?symb=$showsymb\">$restitle</a>";
 			    }
 			    $msgstatus = 
 				&Apache::lonmsg::user_normal_msg($collaborator,$udom,$subject,$message.$messagetail,undef,$baseurl,undef,undef,undef,$showsymb,$restitle);
@@ -2665,6 +2656,7 @@
 		 }
 		 return $a cmp $b;
 	     } (keys(%$fullname))) {
+# FIXME: this is fishy, looks like the button label
 	if ($nextflg == 1 && $button =~ /Next$/) {
 	    push(@parsedlist,$item);
 	}
@@ -2675,6 +2667,7 @@
 	}
     }
     $ctr = 0;
+# FIXME: this is fishy, looks like the button label
     @parsedlist = reverse @parsedlist if ($button eq 'Previous');
     my $res_error;
     my ($partlist) = &response_type($symb,\$res_error);
@@ -3310,7 +3303,6 @@
     &Apache::lonnet::clear_EXT_cache_status();
 
     my $result='<h3><span class="LC_info">'.&mt('Manual Grading').'</span></h3>';
-    $result.='<h4>'.&mt('<b>Current Resource: </b>[_1]',$env{'form.probTitle'}).'</h4>'."\n";
 
     #view individual student submission form - called using Javascript viewOneStudent
     $result.=&jscriptNform($symb);
@@ -3323,7 +3315,6 @@
 	&build_section_inputs().
 	'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n".
 	'<input type="hidden" name="Status" value="'.$env{'stu_status'}.'" />'."\n".
-	'<input type="hidden" name="probTitle" value="'.$env{'form.probTitle'}.'" />'."\n";
 
     my ($common_header,$specific_header);
     if ($env{'form.section'} eq 'all') {
@@ -3546,7 +3537,6 @@
     my $symb=&get_symb($request);
     my $section_display = join (", ",&Apache::loncommon::get_env_multiple('form.section'));
     my $title='<h2>'.&mt('Current Grade Status').'</h2>';
-    $title.='<h4>'.&mt('<b>Current Resource: </b>[_1]',$env{'form.probTitle'}).'</h4>'."\n";
     $title.='<h4>'.&mt('<b>Section: </b>[_1]',$section_display).'</h4>'."\n";
 
     my $result= &Apache::loncommon::start_data_table().
@@ -3868,7 +3858,6 @@
 	$javascript=&csvupload_javascript_forward_associate();
     }
 
-#    my ($result) = &showResourceInfo($symb,$env{'form.probTitle'});
     my $result='';
     my $checked=(($env{'form.noFirstLine'})?' checked="checked"':'');
     my $ignore=&mt('Ignore First Line');
@@ -3893,7 +3882,6 @@
                                        value="$env{'form.upfile_associate'}" />
 <input type="hidden" name="symb"       value="$symb" />
 <input type="hidden" name="saveState"  value="$env{'form.saveState'}" />
-<input type="hidden" name="probTitle"  value="$env{'form.probTitle'}" />
 <input type="hidden" name="command"    value="csvuploadoptions" />
 <hr />
 ENDPICK
@@ -3959,9 +3947,6 @@
     my ($symb)=&get_symb($request);
     if (!$symb) {return '';}
     my $result=&checkforfile_js();
-    $env{'form.probTitle'} = &Apache::lonnet::gettitle($symb);
-#    my ($table) = &showResourceInfo($symb,$env{'form.probTitle'});
-#    $result.=$table;
     $result.='<br /><table width="100%" border="0"><tr><td bgcolor="#777777">'."\n";
     $result.='<table width="100%" border="0"><tr bgcolor="#e6ffff"><td>'."\n";
     $result.='&nbsp;<b>'.&mt('Specify a file containing the class scores for current resource.').
@@ -3975,7 +3960,6 @@
 <form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload">
 <input type="hidden" name="symb" value="$symb" />
 <input type="hidden" name="command" value="csvuploadmap" />
-<input type="hidden" name="probTitle" value="$env{'form.probTitle'}" />
 <input type="hidden" name="saveState"  value="$env{'form.saveState'}" />
 $upfile_select
 <br /><input type="button" onclick="javascript:checkUpload(this.form);" value="$upload" />
@@ -4901,8 +4885,7 @@
 sub defaultFormData {
     my ($symb)=@_;
     return '<input type="hidden" name="symb"    value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n".
-     '<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n".
-     '<input type="hidden" name="probTitle" value="'.$env{'form.probTitle'}.'" />'."\n";
+     '<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />';
 }
 
 
@@ -8481,10 +8464,8 @@
     my ($request) = @_;
     my ($symb)=&get_symb($request);
     if (!$symb) {return '';}
-    my $probTitle = &Apache::lonnet::gettitle($symb);
 
     my %fields = ('symb'=>&Apache::lonenc::check_encrypt($symb),
-                  'probTitle'=>$probTitle,
                   'command'=>'individual',
                   'gradingMenu'=>1,
                   'showgrading'=>"yes");
@@ -8575,7 +8556,6 @@
     $Str .= '<form method="post" action="" name="gradingMenu">';
     $Str .= '<input type="hidden" name="command" value="" />'.
     	'<input type="hidden" name="symb"        value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n".
-	'<input type="hidden" name="probTitle"   value="'.$probTitle.'" />'."\n".
 	'<input type="hidden" name="gradingMenu" value="1" />'."\n".
 	'<input type="hidden" name="showgrading" value="yes" />'."\n";
 
@@ -8650,14 +8630,12 @@
     my ($request) = @_;
     my ($symb)=&get_symb($request);
     if (!$symb) {return '';}
-    my $probTitle = &Apache::lonnet::gettitle($symb);
 
     &commonJSfunctions($request);
     my $result;
 
     $result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n".
 	'<input type="hidden" name="symb"        value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n".
-	'<input type="hidden" name="probTitle"   value="'.$probTitle.'" />'."\n".
 	'<input type="hidden" name="gradingMenu" value="1" />'."\n".
 	'<input type="hidden" name="showgrading" value="yes" />'."\n";
 
@@ -8808,7 +8786,6 @@
     my ($symb)=&get_symb($r);
     if (!$symb) {return '';}
     my $result=&checkforfile_js();
-    $env{'form.probTitle'} = &Apache::lonnet::gettitle($symb);
     $result.='<br /><table width="100%" border="0"><tr><td bgcolor="#777777">'."\n";
     $result.='<table width="100%" border="0"><tr bgcolor="#e6ffff"><td>'."\n";
     $result.='&nbsp;<b>'.&mt('Specify a file containing the clicker information for this resource.').
@@ -8886,7 +8863,6 @@
 <form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload">
 <input type="hidden" name="symb" value="$symb" />
 <input type="hidden" name="command" value="processclickerfile" />
-<input type="hidden" name="probTitle" value="$env{'form.probTitle'}" />
 <input type="hidden" name="saveState"  value="$env{'form.saveState'}" />
 <input type="file" name="upfile" size="50" />
 <br /><label>$type: $selectform</label>
@@ -8918,7 +8894,6 @@
     &Apache::loncommon::store_course_settings('grades_clicker',
                                               \%Saveable_Parameters);
     my $result='';
-#    my ($result) = &showResourceInfo($symb,$env{'form.probTitle'});
     if (($env{'form.gradingmechanism'} eq 'specific') && ($env{'form.specificid'}!~/\w/)) {
 	$result.='<span class="LC_error">'.&mt('You need to specify a clicker ID for the correct answer').'</span>';
 	return $result.&show_grading_menu_form($symb);
@@ -8995,7 +8970,6 @@
 <form method="post" action="/adm/grades" name="clickeranalysis">
 <input type="hidden" name="symb" value="$symb" />
 <input type="hidden" name="command" value="assignclickergrades" />
-<input type="hidden" name="probTitle" value="$env{'form.probTitle'}" />
 <input type="hidden" name="saveState"  value="$env{'form.saveState'}" />
 <input type="hidden" name="gradingmechanism" value="$env{'form.gradingmechanism'}" />
 <input type="hidden" name="pcorrect" value="$env{'form.pcorrect'}" />
@@ -9158,7 +9132,6 @@
     my $part=$$partlist[0];
 # Start screen output
     my $result='';
-#    my ($result) = &showResourceInfo($symb,$env{'form.probTitle'});
 
     my $heading=&mt('Assigning grades based on clicker file');
     $result.=(<<ENDHEADER);

--www1270565797--