Diff for /loncom/homework/grades.pm between versions 1.74 and 1.75

version 1.74, 2003/03/23 07:22:58 version 1.75, 2003/03/23 08:10:30
Line 2036  sub upcsvScores_form { Line 2036  sub upcsvScores_form {
     }      }
     </script>      </script>
 CSVFORMJS  CSVFORMJS
     $ENV{'form.probTitle'} = &Apache::lonnet::metadata($url,'title');      $ENV{'form.probTitle'} = &Apache::lonnet::gettitle($symb);
     $result.='<table width=100% border=0><tr><td bgcolor=#777777>'."\n";      $result.='<table width=100% border=0><tr><td bgcolor=#777777>'."\n";
     $result.='<table width=100% border=0><tr bgcolor="#e6ffff"><td>'."\n";      $result.='<table width=100% border=0><tr bgcolor="#e6ffff"><td>'."\n";
     $result.='&nbsp;<b>Specify a file containing the class scores for problem - '.$ENV{'form.probTitle'}.      $result.='&nbsp;<b>Specify a file containing the class scores for problem - '.$ENV{'form.probTitle'}.
Line 2768  sub updateGradeByPage { Line 2768  sub updateGradeByPage {
 #  #
 #-------------------------------------------------------------------  #-------------------------------------------------------------------
   
   #--------------------Scantron Grading-----------------------------------
   #
   #------ start of section for handling grading by page/sequence ---------
   
   sub getSequenceDropDown {
       my ($request,$symb)=@_;
       my $result='<select name="selectpage">'."\n";
       my ($titles,$symbx) = &getSymbMap($request);
       my ($curpage,$type,$mapId) = ($symb =~ /(.*?\.(page|sequence))___(\d+)___/); 
       my $ctr=0;
       foreach (@$titles) {
    my ($minder,$showtitle) = ($_ =~ /(\d+)\.(.*)/);
    $result.='<option value="'.$$symbx{$_}.'" '.
       ($$symbx{$_} =~ /$curpage$/ ? 'selected="on"' : '').
       '>'.$showtitle.'</option>'."\n";
    $ctr++;
       }
       $result.= '</select>';
       return $result;
   }
   
   sub scantron_selectphase {
       my ($r) = @_;
       my ($symb,$url)=&get_symb_and_url($r);
       if (!$symb) {return '';}
       my $sequence_selector=&getSequenceDropDown($r,$symb);
       my $result;
       $result.= <<SCANTRONFORM;
   <form method="post" enctype="multipart/form-data" action="/adm/grades" name="scantronupload">
     <input type="hidden" name="symb" value="$symb" />
     <input type="hidden" name="url" value="$url" />
     <input type="hidden" name="command" value="scantron_configphase" />
     <table width="100%" border="0">
       <tr>
         <td bgcolor="#777777">
           <table width="100%" border="0">
             <tr bgcolor="#e6ffff">
               <td>
                 &nbsp;<b>Specify file location and which Folder/Sequence to grade</b>
               </td>
             </tr>
             <tr bgcolor="#ffffe6">
               <td>
                  Sequence to grade: $sequence_selector
       </td>
             </tr>
             <tr bgcolor="#ffffe6">
               <td>
    <!-- FIXME I need to present a list of files from a specfic directory that has been configured, or any existing delay queues -->
    Filename of scoring office file:
    <select name="selectfile">
       <option value="filname1">filename1</option>
       <option value="filname2">filename2</option>
    </select>
       </td>
             </tr>
           </table>
         </td>
       </tr>
     </table>
     <input type="submit" value="Submit" />
   </form>
   SCANTRONFORM
   
       return $result;
   }
   
   sub scantron_configphase {
       my ($r) = @_;
       my $sequence=$ENV{'form.selectpage'};
       my $result;
       $result.="got page $sequence";
       $Apache::lonxml::debug=1;
       &Apache::lonhomework::showhash(%ENV);
       $Apache::lonxml::debug=0;
       #FIXME Needs to present some lines from the file and allow the instructor to specify which columns represent what data, possibly have some nice defaults setup, probably should do a pass through all problems for a student to get an idea of how many questions there are, and homw many lines we'll have,
       return $result;
   }
   
   sub scantron_process_students {
       #FIXME
       #   loop through students, {
       #      Check if studnet info valid, if not add line to delay queue
       #      foreach question 'submit' the students answer to the server
       #             through grade target {
       #         generate data to pass back that includes grade recevied
       #      }
       #   }
       #   loop through delay queue {
       #      print out each delayed student with interface to select how
       #          to repair student provided info
       #       Expected errors include
       #           1 bad/no stuid/username
       #           2 invalid bubblings
       #   }
       # if delay queue exists 2 submits one to process delayed students one
       #     to ignore delayed students, possibly saving the delay queue for later
   
   }
   #-------- end of section for handling grading scantron forms -------
   #
   #-------------------------------------------------------------------
   
   
 #-------------------------- Menu interface -------------------------  #-------------------------- Menu interface -------------------------
 #  #
 #--- Show a Grading Menu button - Calls the next routine ---  #--- Show a Grading Menu button - Calls the next routine ---
Line 2796  sub gradingmenu { Line 2900  sub gradingmenu {
  var cmd = formname.command;   var cmd = formname.command;
  formname.lastCmd.value = radioSelection(formname.command);   formname.lastCmd.value = radioSelection(formname.command);
  formname.lastSec.value = pullDownSelection(formname.section);   formname.lastSec.value = pullDownSelection(formname.section);
  if (cmd[0].checked || cmd[1].checked || cmd[2].checked) {   if (cmd[0].checked || cmd[1].checked || cmd[2].checked || cmd[4].checked) {
     formname.submit();      formname.submit();
  }   }
   
Line 2809  sub gradingmenu { Line 2913  sub gradingmenu {
     newWin.focus();      newWin.focus();
  }   }
   
  if (cmd[4].checked) {   if (cmd[5].checked) {
     if (!checkReceiptNo(formname,'notOK')) { return false;}      if (!checkReceiptNo(formname,'notOK')) { return false;}
     formname.submit();      formname.submit();
  }   }
Line 2851  sub gradingmenu { Line 2955  sub gradingmenu {
 </script>  </script>
 GRADINGMENUJS  GRADINGMENUJS
   
     my $probTitle = &Apache::lonnet::metadata($ENV{'form.url'},'title');      my $probTitle = &Apache::lonnet::gettitle($ENV{'form.url'});
     my $result='<h3>&nbsp;<font color="#339933">Manual Grading/View Submission</font></h3>'.      my $result='<h3>&nbsp;<font color="#339933">Manual Grading/View Submission</font></h3>'.
  '<table border="0">'.   '<table border="0">'.
  '<tr><td colspan=3><font size=+1><b>Problem: </b>'.$probTitle.'</font></td></tr>';   '<tr><td colspan=3><font size=+1><b>Problem: </b>'.$probTitle.'</font></td></tr>';
Line 2910  GRADINGMENUJS Line 3014  GRADINGMENUJS
  ($lastCmd eq 'csvupload' ? 'checked' : '').'> '.   ($lastCmd eq 'csvupload' ? 'checked' : '').'> '.
  'Upload scores from file</td></tr>'."\n";   'Upload scores from file</td></tr>'."\n";
   
       $result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="2">'.
    '<input type="radio" name="command" value="scantron_selectphase" /> '.
           'Grade scantron forms</td></tr>'."\n";
   
     if ((&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) && ($symb)) {      if ((&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) && ($symb)) {
  $result.='<tr bgcolor="#ffffe6"valign="top"><td>'.   $result.='<tr bgcolor="#ffffe6"valign="top"><td>'.
     '<input type="radio" name="command" value="verify" onSelect="javascript:this.form.receipt.focus()" '.      '<input type="radio" name="command" value="verify" onSelect="javascript:this.form.receipt.focus()" '.
Line 3030  sub handler { Line 3138  sub handler {
  }   }
  $request->print(&csvuploadmap($request));   $request->print(&csvuploadmap($request));
     }      }
    } elsif ($command eq 'scantron_selectphase') {
       $request->print(&scantron_selectphase($request));
    } elsif ($command eq 'scantron_configphase') {
       $request->print(&scantron_configphase($request));
  } else {   } else {
     $request->print("Unknown action: $command:");      $request->print("Unknown action: $command:");
  }   }

Removed from v.1.74  
changed lines
  Added in v.1.75


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