Diff for /loncom/homework/grades.pm between versions 1.538 and 1.539

version 1.538, 2008/12/20 04:04:36 version 1.539, 2008/12/21 22:01:35
Line 217  sub showResourceInfo { Line 217  sub showResourceInfo {
  $partsseen{$partID}=1;   $partsseen{$partID}=1;
     }      }
     my $display_part=&get_display_part($partID,$symb);      my $display_part=&get_display_part($partID,$symb);
     $result.='<td>'.&mt('<b>Part: </b>[_1]',$display_part).' <span class="LC_internal_info">'.      $result.='<td><b>'.&mt('Part').': </b>'.$display_part.
  $resID.'</span></td>'.                  ' <span class="LC_internal_info">'.$resID.'</span></td>'.
  '<td>'.&mt('<b>Type: </b>[_1]',$responsetype).'</td></tr>';   '<td><b>'.&mt('Type').': </b>'.$responsetype.'</td></tr>';
 #    '<td>'.&mt('<b>Handgrade: </b>[_1]',$handgrade).'</td></tr>';  #    '<td>'.&mt('<b>Handgrade: </b>[_1]',$handgrade).'</td></tr>';
  }   }
     }      }
Line 779  sub listStudents { Line 779  sub listStudents {
     my $getsec    = $env{'form.section'} eq '' ? 'all' : $env{'form.section'};      my $getsec    = $env{'form.section'} eq '' ? 'all' : $env{'form.section'};
     my $getgroup  = $env{'form.group'} eq '' ? 'all' : $env{'form.group'};      my $getgroup  = $env{'form.group'} eq '' ? 'all' : $env{'form.group'};
     my $submitonly= $env{'form.submitonly'} eq '' ? 'all' : $env{'form.submitonly'};      my $submitonly= $env{'form.submitonly'} eq '' ? 'all' : $env{'form.submitonly'};
     my $viewgrade = $env{'form.showgrading'} eq 'yes' ? 'View/Grade/Regrade' : 'View';      my $viewgrade = $env{'form.showgrading'} eq 'yes' ? &mt('View/Grade/Regrade') : &mt('View');
     $env{'form.probTitle'} = $env{'form.probTitle'} eq '' ?       $env{'form.probTitle'} = $env{'form.probTitle'} eq '' ? 
  &Apache::lonnet::gettitle($symb) : $env{'form.probTitle'};   &Apache::lonnet::gettitle($symb) : $env{'form.probTitle'};
   
     my $result='<h3><span class="LC_info">&nbsp;'.      my $result='<h3><span class="LC_info">&nbsp;'.$viewgrade.
  &mt($viewgrade.' Submissions for a Student or a Group of Students')   &mt(' Submissions for a Student or a Group of Students')
  .'</span></h3>';   .'</span></h3>';
   
     my ($table,undef,$hdgrade,$partlist,$handgrade) = &showResourceInfo($symb,$env{'form.probTitle'},($env{'form.showgrading'} eq 'yes'));      my ($table,undef,$hdgrade,$partlist,$handgrade) = &showResourceInfo($symb,$env{'form.probTitle'},($env{'form.showgrading'} eq 'yes'));
   
     my %lt = ( 'multiple' =>      my %lt = ( 'multiple' =>
        "Please select a student or group of students before clicking on the Next button.",         &mt("Please select a student or group of students before clicking on the Next button."),
        'single'   =>         'single'   =>
        "Please select the student before clicking on the Next button.",         &mt("Please select the student before clicking on the Next button."),
        );         );
     %lt = &Apache::lonlocal::texthash(%lt);      %lt = &Apache::lonlocal::texthash(%lt);
     $request->print(<<LISTJAVASCRIPT);      $request->print(<<LISTJAVASCRIPT);
Line 837  LISTJAVASCRIPT Line 837  LISTJAVASCRIPT
  "\n".$table;   "\n".$table;
   
     $gradeTable .=       $gradeTable .= 
  '&nbsp;'.   '&nbsp;<b>'.&mt('View Problem Text').': </b>'.
  &mt('<b>View Problem Text: </b>[_1]',  
     '<label><input type="radio" name="vProb" value="no" checked="checked" /> '.&mt('no').' </label>'."\n".      '<label><input type="radio" name="vProb" value="no" checked="checked" /> '.&mt('no').' </label>'."\n".
     '<label><input type="radio" name="vProb" value="yes" /> '.&mt('one student').' </label>'."\n".      '<label><input type="radio" name="vProb" value="yes" /> '.&mt('one student').' </label>'."\n".
     '<label><input type="radio" name="vProb" value="all" /> '.&mt('all students').' </label>').'<br />'."\n";      '<label><input type="radio" name="vProb" value="all" /> '.&mt('all students').' </label><br />'."\n";
     $gradeTable .=       $gradeTable .= 
  '&nbsp;'.   '&nbsp;<b>'.&mt('View Answer').': </b>'.
  &mt('<b>View Answer: </b>[_1]',  
     '<label><input type="radio" name="vAns" value="no"  /> '.&mt('no').' </label>'."\n".      '<label><input type="radio" name="vAns" value="no"  /> '.&mt('no').' </label>'."\n".
     '<label><input type="radio" name="vAns" value="yes" /> '.&mt('one student').' </label>'."\n".      '<label><input type="radio" name="vAns" value="yes" /> '.&mt('one student').' </label>'."\n".
     '<label><input type="radio" name="vAns" value="all" checked="checked" /> '.&mt('all students').' </label>').'<br />'."\n";      '<label><input type="radio" name="vAns" value="all" checked="checked" /> '.&mt('all students').' </label><br />'."\n";
   
     my $submission_options;      my $submission_options;
     if ($env{'form.handgrade'} eq 'yes' && scalar(@$partlist) > 1) {      if ($env{'form.handgrade'} eq 'yes' && scalar(@$partlist) > 1) {
Line 863  LISTJAVASCRIPT Line 861  LISTJAVASCRIPT
  '<label><input type="radio" name="lastSub" value="datesub" /> '.&mt('by dates and submissions').' </label>'."\n".   '<label><input type="radio" name="lastSub" value="datesub" /> '.&mt('by dates and submissions').' </label>'."\n".
  '<label><input type="radio" name="lastSub" value="all" /> '.&mt('all details').'</label>';   '<label><input type="radio" name="lastSub" value="all" /> '.&mt('all details').'</label>';
     $gradeTable .=       $gradeTable .= 
  '&nbsp;'.   '&nbsp;<b>'.&mt('Submissions').': </b>'.$submission_options.'<br />'."\n";
  &mt('<b>Submissions: </b>[_1]',$submission_options).'<br />'."\n";  
   
     $gradeTable .=       $gradeTable .= 
         '&nbsp;'.          '&nbsp;<b>'.&mt('Grading Increments').': </b>'.
  &mt('<b>Grading Increments:</b> [_1]',  
     '<select name="increment">'.      '<select name="increment">'.
     '<option value="1">'.&mt('Whole Points').'</option>'.      '<option value="1">'.&mt('Whole Points').'</option>'.
     '<option value=".5">'.&mt('Half Points').'</option>'.      '<option value=".5">'.&mt('Half Points').'</option>'.
     '<option value=".25">'.&mt('Quarter Points').'</option>'.      '<option value=".25">'.&mt('Quarter Points').'</option>'.
     '<option value=".1">'.&mt('Tenths of a Point').'</option>'.      '<option value=".1">'.&mt('Tenths of a Point').'</option>'.
     '</select>');      '</select>';
           
     $gradeTable .=       $gradeTable .= 
         &build_section_inputs().          &build_section_inputs().
Line 893  LISTJAVASCRIPT Line 889  LISTJAVASCRIPT
  &Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,1,'javascript:reLoadList(this.form);')).'<br />';   &Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,1,'javascript:reLoadList(this.form);')).'<br />';
     }      }
   
     $gradeTable.=&mt('To '.lc($viewgrade).' a submission or a group of submissions, click on the check box(es) '.      $gradeTable.=&mt('To [_1] a submission or a group of submissions, click on the check box(es) next to the student\'s name(s). Then click on the Next button.',lc($viewgrade)).'<br />'."\n".
  'next to the student\'s name(s). Then click on the Next button.').'<br />'."\n".  
  '<input type="hidden" name="command" value="processGroup" />'."\n";   '<input type="hidden" name="command" value="processGroup" />'."\n";
   
 # checkall buttons  # checkall buttons
     $gradeTable.=&check_script('gradesub', 'stuinfo');      $gradeTable.=&check_script('gradesub', 'stuinfo');
     $gradeTable.='<input type="button" '."\n".      $gradeTable.='<input type="button" '."\n".
  'onClick="javascript:checkSelect(this.form.stuinfo);" '."\n".   'onClick="javascript:checkSelect(this.form.stuinfo);" '."\n".
  'value="'.&mt('Next-&gt;').'" /> <br />'."\n";   'value="'.&mt('Next').' &rarr;" /> <br />'."\n";
     $gradeTable.=&check_buttons();      $gradeTable.=&check_buttons();
     $gradeTable.='<label><input type="checkbox" name="checkPlag" checked="checked" />'.&mt('Check For Plagiarism').'</label>';      $gradeTable.='<label><input type="checkbox" name="checkPlag" checked="checked" />'.&mt('Check For Plagiarism').'</label>';
     my ($classlist, undef, $fullname) = &getclasslist($getsec,'1',$getgroup);      my ($classlist, undef, $fullname) = &getclasslist($getsec,'1',$getgroup);
Line 1021  LISTJAVASCRIPT Line 1016  LISTJAVASCRIPT
     $gradeTable.=&Apache::loncommon::end_data_table()."\n".      $gradeTable.=&Apache::loncommon::end_data_table()."\n".
  '<input type="button" '.   '<input type="button" '.
  'onClick="javascript:checkSelect(this.form.stuinfo);" '.   'onClick="javascript:checkSelect(this.form.stuinfo);" '.
  'value="'.&mt('Next-&gt;').'" /></form>'."\n";   'value="'.&mt('Next').' &rarr;" /></form>'."\n";
     if ($ctr == 0) {      if ($ctr == 0) {
  my $num_students=(scalar(keys(%$fullname)));   my $num_students=(scalar(keys(%$fullname)));
  if ($num_students eq 0) {   if ($num_students eq 0) {
Line 1117  sub processGroup { Line 1112  sub processGroup {
 #--- Javascript to handle the submission page functionality ---  #--- Javascript to handle the submission page functionality ---
 sub sub_page_js {  sub sub_page_js {
     my $request = shift;      my $request = shift;
       my $alertmsg = &mt('A number equal or greater than 0 is expected. Entered value = ');
     $request->print(<<SUBJAVASCRIPT);      $request->print(<<SUBJAVASCRIPT);
 <script type="text/javascript" language="javascript">  <script type="text/javascript" language="javascript">
     function updateRadio(formname,id,weight) {      function updateRadio(formname,id,weight) {
Line 1127  sub sub_page_js { Line 1123  sub sub_page_js {
  gradeBox.value = pts;   gradeBox.value = pts;
  var resetbox = false;   var resetbox = false;
  if (isNaN(pts) || pts < 0) {   if (isNaN(pts) || pts < 0) {
     alert("A number equal or greater than 0 is expected. Entered value = "+pts);      alert("$alertmsg"+pts);
     for (var i=0; i<radioButton.length; i++) {      for (var i=0; i<radioButton.length; i++) {
  if (radioButton[i].checked) {   if (radioButton[i].checked) {
     gradeBox.value = i;      gradeBox.value = i;
Line 1372  INNERJS Line 1368  INNERJS
   
     my $docopen=&Apache::lonhtmlcommon::javascript_docopen();      my $docopen=&Apache::lonhtmlcommon::javascript_docopen();
     $docopen=~s/^document\.//;      $docopen=~s/^document\.//;
       my $alertmsg = &mt('Please select a word or group of words from document and then click this link.');
     $request->print(<<SUBJAVASCRIPT);      $request->print(<<SUBJAVASCRIPT);
 <script type="text/javascript" language="javascript">  <script type="text/javascript" language="javascript">
   
Line 1404  INNERJS Line 1401  INNERJS
     else return;      else return;
     var cleantxt = txt.replace(new RegExp('([\\f\\n\\r\\t\\v ])+', 'g')," ");      var cleantxt = txt.replace(new RegExp('([\\f\\n\\r\\t\\v ])+', 'g')," ");
     if (cleantxt=="") {      if (cleantxt=="") {
  alert("Please select a word or group of words from document and then click this link.");   alert("$alertmsg");
  return;   return;
     }      }
     var nret = prompt("Add selection to keyword list? Edit if desired.",cleantxt);      var nret = prompt("Add selection to keyword list? Edit if desired.",cleantxt);
Line 2056  KEYWORDS Line 2053  KEYWORDS
     $lastsubonly.="\n".'<div class="LC_grade_submission_part"><b>Part:</b> '.      $lastsubonly.="\n".'<div class="LC_grade_submission_part"><b>Part:</b> '.
  $display_part.' <span class="LC_internal_info">( ID '.$respid.   $display_part.' <span class="LC_internal_info">( ID '.$respid.
  ' )</span>&nbsp; &nbsp;'.   ' )</span>&nbsp; &nbsp;'.
  '<span class="LC_warning">'.&mt('Nothing submitted - no attempts').'</span><br /><br /></div>';   '<span class="LC_warning">'.&mt('Nothing submitted - no attempts.').'</span><br /><br /></div>';
     next;      next;
  }   }
  foreach my $submission (@$string) {   foreach my $submission (@$string) {
Line 2334  sub get_last_submission { Line 2331  sub get_last_submission {
     }      }
     if (!@string) {      if (!@string) {
  $string[0] =   $string[0] =
     '<span class="LC_warning">Nothing submitted - no attempts.</span>';      '<span class="LC_warning">'.&mt('Nothing submitted - no attempts.').'</span>';
     }      }
     return (\@string,\$timestamp);      return (\@string,\$timestamp);
 }  }
Line 2980  sub file_name_version_ext { Line 2977  sub file_name_version_ext {
 sub viewgrades_js {  sub viewgrades_js {
     my ($request) = shift;      my ($request) = shift;
   
       my $alertmsg = &mt('A number equal or greater than 0 is expected. Entered value = ');
     $request->print(<<VIEWJAVASCRIPT);      $request->print(<<VIEWJAVASCRIPT);
 <script type="text/javascript" language="javascript">  <script type="text/javascript" language="javascript">
    function writePoint(partid,weight,point) {     function writePoint(partid,weight,point) {
Line 2988  sub viewgrades_js { Line 2986  sub viewgrades_js {
  if (point == "textval") {   if (point == "textval") {
     point = document.classgrade["TEXTVAL_"+partid].value;      point = document.classgrade["TEXTVAL_"+partid].value;
     if (isNaN(point) || parseFloat(point) < 0) {      if (isNaN(point) || parseFloat(point) < 0) {
  alert("A number equal or greater than 0 is expected. Entered value = "+parseFloat(point));   alert("$alertmsg"+parseFloat(point));
  var resetbox = false;   var resetbox = false;
  for (var i=0; i<radioButton.length; i++) {   for (var i=0; i<radioButton.length; i++) {
     if (radioButton[i].checked) {      if (radioButton[i].checked) {
Line 3086  sub viewgrades_js { Line 3084  sub viewgrades_js {
  var weight = document.classgrade["weight_"+partid].value;   var weight = document.classgrade["weight_"+partid].value;
   
  if (isNaN(point) || parseFloat(point) < 0) {   if (isNaN(point) || parseFloat(point) < 0) {
     alert("A number equal or greater than 0 is expected. Entered value = "+parseFloat(point));      alert("$alertmsg"+parseFloat(point));
     textbox.value = "";      textbox.value = "";
     return;      return;
  }   }
Line 3178  sub viewgrades { Line 3176  sub viewgrades {
     my $sectionClass;      my $sectionClass;
     my $section_display = join (", ",&Apache::loncommon::get_env_multiple('form.section'));      my $section_display = join (", ",&Apache::loncommon::get_env_multiple('form.section'));
     if ($env{'form.section'} eq 'all') {      if ($env{'form.section'} eq 'all') {
  $sectionClass='Class';   $sectionClass=&mt('Class');
     } elsif ($env{'form.section'} eq 'none') {      } elsif ($env{'form.section'} eq 'none') {
  $sectionClass='Students in no Section';   $sectionClass=&mt('Students in no Section');
     } else {      } else {
  $sectionClass='Students in Section(s) [_1]';   $sectionClass=&mt('Students in Section(s) [_1]');
     }      }
     $result.=      $result.=
  '<h3>'.   '<h3>'.
  &mt("Assign Common Grade To $sectionClass",$section_display).'</h3>';   &mt("Assign Common Grade to [_1]",$sectionClass,$section_display).'</h3>';
     $result.= &Apache::loncommon::start_data_table();      $result.= &Apache::loncommon::start_data_table();
     #radio buttons/text box for assigning points for a section or class.      #radio buttons/text box for assigning points for a section or class.
     #handles different parts of a problem      #handles different parts of a problem
Line 3218  sub viewgrades { Line 3216  sub viewgrades {
  my $line = '<input type="text" name="TEXTVAL_'.   my $line = '<input type="text" name="TEXTVAL_'.
     $partid.'" size="4" '.'onChange="javascript:writePoint(\''.      $partid.'" size="4" '.'onChange="javascript:writePoint(\''.
  $partid.'\','.$weight{$partid}.',\'textval\')" /> /'.   $partid.'\','.$weight{$partid}.',\'textval\')" /> /'.
     $weight{$partid}.' (problem weight)</td>'."\n";      $weight{$partid}.' '.&mt('(problem weight)').'</td>'."\n";
  $line.= '<td><select name="SELVAL_'.$partid.'"'.   $line.= '<td><b>'.&mt('Grade Status').':</b><select name="SELVAL_'.$partid.'"'.
     'onChange="javascript:writeRadText(\''.$partid.'\','.      'onChange="javascript:writeRadText(\''.$partid.'\','.
  $weight{$partid}.')"> '.   $weight{$partid}.')"> '.
     '<option selected="selected"> </option>'.      '<option selected="selected"> </option>'.
Line 3232  sub viewgrades { Line 3230  sub viewgrades {
  $line.='<input type="hidden" name="weight_'.   $line.='<input type="hidden" name="weight_'.
     $partid.'" value="'.$weight{$partid}.'" />'."\n";      $partid.'" value="'.$weight{$partid}.'" />'."\n";
   
       #&mt('<td><b>Part:</b></td><td>[_1]</td><td><b>Points:</b></td><td>[_2]</td><td>or</td><td>[_3]</td>',$display_part,$radio,$line).
  $result.=   $result.=
     &Apache::loncommon::start_data_table_row()."\n".      &Apache::loncommon::start_data_table_row()."\n".
     &mt('<td><b>Part:</b></td><td>[_1]</td><td><b>Points:</b></td><td>[_2]</td><td>or</td><td>[_3]</td>',$display_part,$radio,$line).      '<td><b>'.&mt('Part').':</b></td><td>'.$display_part.'</td><td><b>'.&mt('Points').':</b></td><td>'.$radio.'</td><td>'.&mt('or').'</td><td>'.$line.'</td>'.
     &Apache::loncommon::end_data_table_row()."\n";      &Apache::loncommon::end_data_table_row()."\n";
  $ctsparts++;   $ctsparts++;
     }      }
Line 3245  sub viewgrades { Line 3244  sub viewgrades {
   
     #table listing all the students in a section/class      #table listing all the students in a section/class
     #header of table      #header of table
     $result.= '<h3>'.&mt('Assign Grade to Specific Students in '.$sectionClass,      $result.= '<h3>'.&mt('Assign Grade to Specific Students in ').$sectionClass,
  $section_display).'</h3>';   $section_display.'</h3>';
     $result.= &Apache::loncommon::start_data_table().      $result.= &Apache::loncommon::start_data_table().
  &Apache::loncommon::start_data_table_header_row().   &Apache::loncommon::start_data_table_header_row().
  '<th>'.&mt('No.').'</th>'.   '<th>'.&mt('No.').'</th>'.
Line 3256  sub viewgrades { Line 3255  sub viewgrades {
     my @partids = ();      my @partids = ();
     foreach my $part (@parts) {      foreach my $part (@parts) {
  my $display=&Apache::lonnet::metadata($url,$part.'.display');   my $display=&Apache::lonnet::metadata($url,$part.'.display');
  $display =~ s|^Number of Attempts|Tries<br />|; # makes the column narrower          my $narrowtext = &mt('Tries');
    $display =~ s|^Number of Attempts|$narrowtext <br />|; # makes the column narrower
  if  (!$display) { $display = &Apache::lonnet::metadata($url,$part.'.name'); }   if  (!$display) { $display = &Apache::lonnet::metadata($url,$part.'.name'); }
  my ($partid) = &split_part_type($part);   my ($partid) = &split_part_type($part);
         push(@partids,$partid);          push(@partids,$partid);
Line 3428  sub editgrades { Line 3428  sub editgrades {
     if ($type eq 'awarded' || $type eq 'solved') { next; }      if ($type eq 'awarded' || $type eq 'solved') { next; }
     my $display=&Apache::lonnet::metadata($url,$stores.'.display');      my $display=&Apache::lonnet::metadata($url,$stores.'.display');
     $display =~ s/\[Part: (\w)+\]//;      $display =~ s/\[Part: (\w)+\]//;
     $display =~ s/Number of Attempts/Tries/;              my $narrowtext = &mt('Tries');
     $header .= '<th align="center">'.&mt('Old '.$display).'</th>'.      $display =~ s/Number of Attempts/$narrowtext/;
  '<th align="center">'.&mt('New '.$display).'</th>';      $header .= '<th align="center">'.&mt('Old').' '.$display.'</th>'.
    '<th align="center">'.&mt('New').' '.$display.'</th>';
     $columns{$partid}+=2;      $columns{$partid}+=2;
  }   }
     }      }
Line 3772  ENDPICK Line 3773  ENDPICK
 }  }
   
 sub checkforfile_js {  sub checkforfile_js {
       my $alertmsg = &mt('Please use the browse button to select a file from your local directory.');
     my $result =<<CSVFORMJS;      my $result =<<CSVFORMJS;
 <script type="text/javascript" language="javascript">  <script type="text/javascript" language="javascript">
     function checkUpload(formname) {      function checkUpload(formname) {
  if (formname.upfile.value == "") {   if (formname.upfile.value == "") {
     alert("Please use the browse button to select a file from your local directory.");      alert("$alertmsg");
     return false;      return false;
  }   }
  formname.submit();   formname.submit();
Line 4050  sub csvuploadassign { Line 4052  sub csvuploadassign {
 sub pickStudentPage {  sub pickStudentPage {
     my ($request) = shift;      my ($request) = shift;
   
       my $alertmsg = &mt('Please select the student you wish to grade.');
     $request->print(<<LISTJAVASCRIPT);      $request->print(<<LISTJAVASCRIPT);
 <script type="text/javascript" language="javascript">  <script type="text/javascript" language="javascript">
   
 function checkPickOne(formname) {  function checkPickOne(formname) {
     if (radioSelection(formname.student) == null) {      if (radioSelection(formname.student) == null) {
  alert("Please select the student you wish to grade.");   alert("$alertmsg");
  return;   return;
     }      }
     ptr = pullDownSelection(formname.selectpage);      ptr = pullDownSelection(formname.selectpage);
Line 4090  LISTJAVASCRIPT Line 4093  LISTJAVASCRIPT
  $ctr++;   $ctr++;
     }      }
     $select.= '</select>';      $select.= '</select>';
     $result.=&mt('&nbsp;<b>Problems from:</b> [_1]',$select)."<br />\n";      $result.='&nbsp;<b>'.&mt('Problems from').':</b> '.$select."<br />\n";
   
     $ctr=0;      $ctr=0;
     foreach (@$titles) {      foreach (@$titles) {
Line 4105  LISTJAVASCRIPT Line 4108  LISTJAVASCRIPT
     my $options =      my $options =
  '<label><input type="radio" name="vProb" value="no" checked="checked" /> '.&mt('no').' </label>'."\n".   '<label><input type="radio" name="vProb" value="no" checked="checked" /> '.&mt('no').' </label>'."\n".
  '<label><input type="radio" name="vProb" value="yes" /> '.&mt('yes').' </label>'."<br />\n";   '<label><input type="radio" name="vProb" value="yes" /> '.&mt('yes').' </label>'."<br />\n";
     $result.='&nbsp;'.&mt('<b>View Problems Text: </b> [_1]',$options);      $result.='&nbsp;<b>'.&mt('View Problem Text').': </b>'.$options;
   
     $options =      $options =
  '<label><input type="radio" name="lastSub" value="none" /> '.&mt('none').' </label>'."\n".   '<label><input type="radio" name="lastSub" value="none" /> '.&mt('none').' </label>'."\n".
  '<label><input type="radio" name="lastSub" value="datesub" checked="checked" /> '.&mt('by dates and submissions').'</label>'."\n".   '<label><input type="radio" name="lastSub" value="datesub" checked="checked" /> '.&mt('by dates and submissions').'</label>'."\n".
  '<label><input type="radio" name="lastSub" value="all" /> '.&mt('all details').' </label>'."\n";   '<label><input type="radio" name="lastSub" value="all" /> '.&mt('all details').' </label>'."\n";
     $result.='&nbsp;'.&mt('<b>Submission Details: </b>[_1]',$options);      $result.='&nbsp;<b>'.&mt('Submissions').': </b>'.$options;
           
     $result.=&build_section_inputs();      $result.=&build_section_inputs();
     my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status'));      my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status'));
Line 4120  LISTJAVASCRIPT Line 4123  LISTJAVASCRIPT
  '<input type="hidden" name="symb"    value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n".   '<input type="hidden" name="symb"    value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n".
  '<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."<br />\n";   '<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."<br />\n";
   
     $result.='&nbsp;'.&mt('<b>Use CODE: [_1] </b>',      $result.='&nbsp;<b>'.&mt('Use CODE').': </b> <input type="text" name="CODE" value="" /> <br />'."\n";
   '<input type="text" name="CODE" value="" />').  
       '<br />'."\n";  
   
     $result.='&nbsp;<input type="button" '.      $result.='&nbsp;<input type="button" '.
  'onClick="javascript:checkPickOne(this.form);" value="'.&mt('Next-&gt;').'" /><br />'."\n";   'onClick="javascript:checkPickOne(this.form);" value="'.&mt('Next').' &rarr;" /><br />'."\n";
   
     $request->print($result);      $request->print($result);
   
Line 4164  LISTJAVASCRIPT Line 4165  LISTJAVASCRIPT
     }      }
     $studentTable.=&Apache::loncommon::end_data_table()."\n";      $studentTable.=&Apache::loncommon::end_data_table()."\n";
     $studentTable.='<input type="button" '.      $studentTable.='<input type="button" '.
  'onClick="javascript:checkPickOne(this.form);" value="'.&mt('Next-&gt;').'" /></form>'."\n";   'onClick="javascript:checkPickOne(this.form);" value="'.&mt('Next').' &rarr;" /></form>'."\n";
   
     $studentTable.=&show_grading_menu_form($symb);      $studentTable.=&show_grading_menu_form($symb);
     $request->print($studentTable);      $request->print($studentTable);
Line 4301  sub displayPage { Line 4302  sub displayPage {
 #    $request->print('match='.$1."<br />\n");  #    $request->print('match='.$1."<br />\n");
 # }  # }
 # $companswer =~ s|<table border=\"1\">|<table border=\"0\">|g;  # $companswer =~ s|<table border=\"1\">|<table border=\"0\">|g;
  $studentTable.='&nbsp;<b>'.$title.'</b>&nbsp;<br />&nbsp;'.&mt('<b>Correct answer:</b><br />[_1]',$companswer);   $studentTable.='&nbsp;<b>'.$title.'</b>&nbsp;<br />&nbsp;<b>'.&mt('Correct answer').':</b><br />'.$companswer;
     }      }
   
     my %record = &Apache::lonnet::restore($symbx,$env{'request.course.id'},$udom,$uname);      my %record = &Apache::lonnet::restore($symbx,$env{'request.course.id'},$udom,$uname);
Line 4371  sub displaySubByDates { Line 4372  sub displaySubByDates {
     my %orders;      my %orders;
     $mark{'correct_by_student'} = $checkIcon;      $mark{'correct_by_student'} = $checkIcon;
     if (!exists($$record{'1:timestamp'})) {      if (!exists($$record{'1:timestamp'})) {
  return '<br />&nbsp;<span class="LC_warning">'.&mt('Nothing submitted - no attempts').'</span><br />';   return '<br />&nbsp;<span class="LC_warning">'.&mt('Nothing submitted - no attempts.').'</span><br />';
     }      }
   
     my $interaction;      my $interaction;
Line 6189  sub scantron_validate_file { Line 6190  sub scantron_validate_file {
     }      }
     if ($stop) {      if ($stop) {
  if ($validate_phases[$currentphase] eq 'sequence') {   if ($validate_phases[$currentphase] eq 'sequence') {
     $r->print('<input type="submit" name="submit" value="'.&mt('Ignore -&gt;').' " />');      $r->print('<input type="submit" name="submit" value="'.&mt('Ignore').' &rarr; " />');
     $r->print(' '.&mt('this error').' <br />');      $r->print(' '.&mt('this error').' <br />');
   
     $r->print(" <p>".&mt("Or click the 'Grading Menu' button to start over.")."</p>");      $r->print(" <p>".&mt("Or click the 'Grading Menu' button to start over.")."</p>");
  } else {   } else {
             if ($validate_phases[$currentphase] eq 'doublebubble' || $validate_phases[$currentphase] eq 'missingbubbles') {              if ($validate_phases[$currentphase] eq 'doublebubble' || $validate_phases[$currentphase] eq 'missingbubbles') {
         $r->print('<input type="button" name="submitbutton" value="'.&mt('Continue -&gt;').'" onclick="javascript:verify_bubble_radio(this.form)" />');          $r->print('<input type="button" name="submitbutton" value="'.&mt('Continue').' &rarr;" onclick="javascript:verify_bubble_radio(this.form)" />');
             } else {              } else {
                 $r->print('<input type="submit" name="submit" value="'.&mt('Continue -&gt;').'" />');                  $r->print('<input type="submit" name="submit" value="'.&mt('Continue').' &rarr;" />');
             }              }
     $r->print(' '.&mt('using corrected info').' <br />');      $r->print(' '.&mt('using corrected info').' <br />');
     $r->print("<input type='submit' value='".&mt("Skip")."' name='scantron_skip_record' />");      $r->print("<input type='submit' value='".&mt("Skip")."' name='scantron_skip_record' />");
Line 7550  sub scantron_upload_scantron_data { Line 7551  sub scantron_upload_scantron_data {
 <script type="text/javascript" language="javascript">  <script type="text/javascript" language="javascript">
     function checkUpload(formname) {      function checkUpload(formname) {
  if (formname.upfile.value == "") {   if (formname.upfile.value == "") {
     alert("Please use the browse button to select a file from your local directory.");      alert("'.&mt('Please use the browse button to select a file from your local directory.').'");
     return false;      return false;
  }   }
  formname.submit();   formname.submit();
Line 8055  sub grading_menu { Line 8056  sub grading_menu {
     $Str .= Apache::lonhtmlcommon::generate_menu(@menu);      $Str .= Apache::lonhtmlcommon::generate_menu(@menu);
     #$menudata->{'jscript'}      #$menudata->{'jscript'}
     $Str .='<hr /><input type="button" value="'.&mt('Verify Receipt').'" '.      $Str .='<hr /><input type="button" value="'.&mt('Verify Receipt').'" '.
         ''.  
         ' onClick="javascript:checkChoice(document.forms.gradingMenu,\'5\',\'verify\')" '.          ' onClick="javascript:checkChoice(document.forms.gradingMenu,\'5\',\'verify\')" '.
         ' /> '.          ' /> '.
         &Apache::lonnet::recprefix($env{'request.course.id'}).          &Apache::lonnet::recprefix($env{'request.course.id'}).
         '-<input type="text" name="receipt" size="4" onChange="javascript:checkReceiptNo(this.form,\'OK\')" />';          '-<input type="text" name="receipt" size="4" onChange="javascript:checkReceiptNo(this.form,\'OK\')" />';
   
     $Str .="</form>\n";      $Str .="</form>\n";
       my $receiptalert = &mt("Please enter a receipt number given by a student in the receipt box.");
     $request->print(<<GRADINGMENUJS);      $request->print(<<GRADINGMENUJS);
 <script type="text/javascript" language="javascript">  <script type="text/javascript" language="javascript">
     function checkChoice(formname,val,cmdx) {      function checkChoice(formname,val,cmdx) {
Line 8089  sub grading_menu { Line 8090  sub grading_menu {
  if (nospace == "OK" && isNaN(receiptNo)) {checkOpt = true;}   if (nospace == "OK" && isNaN(receiptNo)) {checkOpt = true;}
  if (nospace == "notOK" && (isNaN(receiptNo) || receiptNo == "")) {checkOpt = true;}   if (nospace == "notOK" && (isNaN(receiptNo) || receiptNo == "")) {checkOpt = true;}
  if (checkOpt) {   if (checkOpt) {
     alert("Please enter a receipt number given by a student in the receipt box.");      alert("$receiptalert");
     formname.receipt.value = "";      formname.receipt.value = "";
     formname.receipt.focus();      formname.receipt.focus();
     return false;      return false;
Line 8110  sub submit_options { Line 8111  sub submit_options {
     if (!$symb) {return '';}      if (!$symb) {return '';}
     my $probTitle = &Apache::lonnet::gettitle($symb);      my $probTitle = &Apache::lonnet::gettitle($symb);
   
       my $receiptalert = &mt("Please enter a receipt number given by a student in the receipt box."); 
     $request->print(<<GRADINGMENUJS);      $request->print(<<GRADINGMENUJS);
 <script type="text/javascript" language="javascript">  <script type="text/javascript" language="javascript">
     function checkChoice(formname,val,cmdx) {      function checkChoice(formname,val,cmdx) {
Line 8137  sub submit_options { Line 8139  sub submit_options {
  if (nospace == "OK" && isNaN(receiptNo)) {checkOpt = true;}   if (nospace == "OK" && isNaN(receiptNo)) {checkOpt = true;}
  if (nospace == "notOK" && (isNaN(receiptNo) || receiptNo == "")) {checkOpt = true;}   if (nospace == "notOK" && (isNaN(receiptNo) || receiptNo == "")) {checkOpt = true;}
  if (checkOpt) {   if (checkOpt) {
     alert("Please enter a receipt number given by a student in the receipt box.");      alert("$receiptalert");
     formname.receipt.value = "";      formname.receipt.value = "";
     formname.receipt.focus();      formname.receipt.focus();
     return false;      return false;
Line 8240  GRADINGMENUJS Line 8242  GRADINGMENUJS
               </label>                </label>
             </div>              </div>
             <div>              <div>
       <input type="button" onClick="javascript:checkChoice(this.form,\'2\');" value="'.&mt('Next-&gt;').'" />        <input type="button" onClick="javascript:checkChoice(this.form,\'2\');" value="'.&mt('Next').' &rarr;" />
             </div>              </div>
           </div>            </div>
   
Line 8257  GRADINGMENUJS Line 8259  GRADINGMENUJS
               </label>                </label>
             </div>              </div>
             <div>              <div>
       <input type="button" onClick="javascript:checkChoice(this.form,\'2\');" value="'.&mt('Next-&gt;').'" />        <input type="button" onClick="javascript:checkChoice(this.form,\'2\');" value="'.&mt('Next').' &rarr;" />
             </div>              </div>
         </div>          </div>
   </form>';    </form>';

Removed from v.1.538  
changed lines
  Added in v.1.539


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>