version 1.581.2.1, 2010/01/06 18:43:57
|
version 1.582, 2009/12/09 17:53:55
|
Line 97 sub ssi_print_error {
|
Line 97 sub ssi_print_error {
|
# |
# |
# --- Retrieve the parts from the metadata file.--- |
# --- Retrieve the parts from the metadata file.--- |
sub getpartlist { |
sub getpartlist { |
my ($symb) = @_; |
my ($symb,$errorref) = @_; |
|
|
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
|
unless (ref($navmap)) { |
|
if (ref($errorref)) { |
|
$$errorref = 'navmap'; |
|
return; |
|
} |
|
} |
my $res = $navmap->getBySymb($symb); |
my $res = $navmap->getBySymb($symb); |
my $partlist = $res->parts(); |
my $partlist = $res->parts(); |
my $url = $res->src(); |
my $url = $res->src(); |
Line 144 sub nameUserString {
|
Line 150 sub nameUserString {
|
#--- Get the partlist and the response type for a given problem. --- |
#--- Get the partlist and the response type for a given problem. --- |
#--- Indicate if a response type is coded handgraded or not. --- |
#--- Indicate if a response type is coded handgraded or not. --- |
sub response_type { |
sub response_type { |
my ($symb) = shift; |
my ($symb,$response_error) = @_; |
|
|
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
|
unless (ref($navmap)) { |
|
if (ref($response_error)) { |
|
$$response_error = 1; |
|
} |
|
return; |
|
} |
my $res = $navmap->getBySymb($symb); |
my $res = $navmap->getBySymb($symb); |
my $partlist = $res->parts(); |
my $partlist = $res->parts(); |
my %vPart = |
my %vPart = |
Line 194 sub get_display_part {
|
Line 206 sub get_display_part {
|
#--- Show resource title |
#--- Show resource title |
#--- and parts and response type |
#--- and parts and response type |
sub showResourceInfo { |
sub showResourceInfo { |
my ($symb,$probTitle,$checkboxes) = @_; |
my ($symb,$probTitle,$checkboxes,$res_error) = @_; |
my $col=3; |
my $col=3; |
if ($checkboxes) { $col=4; } |
if ($checkboxes) { $col=4; } |
my $result = '<h3>'.&mt('Current Resource').': '.$probTitle.'</h3>'."\n"; |
my $result = '<h3>'.&mt('Current Resource').': '.$probTitle.'</h3>'."\n"; |
|
my ($partlist,$handgrade,$responseType) = &response_type($symb,$res_error); |
|
if (ref($res_error)) { |
|
if ($$res_error) { |
|
return; |
|
} |
|
} |
$result .='<table border="0">'; |
$result .='<table border="0">'; |
my ($partlist,$handgrade,$responseType) = &response_type($symb); |
|
my %resptype = (); |
my %resptype = (); |
my $hdgrade='no'; |
my $hdgrade='no'; |
my %partsseen; |
my %partsseen; |
Line 767 sub verifyreceipt {
|
Line 784 sub verifyreceipt {
|
if ($env{"course.$courseid.receiptalg"} eq 'receipt2' || |
if ($env{"course.$courseid.receiptalg"} eq 'receipt2' || |
$env{"course.$courseid.receiptalg"} eq 'receipt3') { $receiptparts=1; } |
$env{"course.$courseid.receiptalg"} eq 'receipt3') { $receiptparts=1; } |
my $parts=['0']; |
my $parts=['0']; |
if ($receiptparts) { ($parts)=&response_type($symb); } |
if ($receiptparts) { |
|
my $res_error; |
|
($parts)=&response_type($symb,\$res_error); |
|
if ($res_error) { |
|
return &navmap_errormsg(); |
|
} |
|
} |
|
|
my $header = |
my $header = |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
Line 1745 sub gradeBox {
|
Line 1768 sub gradeBox {
|
$$record{'resource.'.$partid.'.tries'}.'" />'."\n". |
$$record{'resource.'.$partid.'.tries'}.'" />'."\n". |
'<input type="hidden" name="aggtries'.$counter.'_'.$partid.'" value="'. |
'<input type="hidden" name="aggtries'.$counter.'_'.$partid.'" value="'. |
$aggtries.'" />'."\n"; |
$aggtries.'" />'."\n"; |
$result.=&handback_box($symb,$uname,$udom,$counter,$partid,$record); |
my $res_error; |
|
$result.=&handback_box($symb,$uname,$udom,$counter,$partid,$record,\$res_error); |
|
if ($res_error) { |
|
return &navmap_errormsg(); |
|
} |
return $result; |
return $result; |
} |
} |
|
|
sub handback_box { |
sub handback_box { |
my ($symb,$uname,$udom,$counter,$partid,$record) = @_; |
my ($symb,$uname,$udom,$counter,$partid,$record,$res_error) = @_; |
my ($partlist,$handgrade,$responseType) = &response_type($symb); |
my ($partlist,$handgrade,$responseType) = &response_type($symb,$res_error); |
my (@respids); |
my (@respids); |
my @part_response_id = &flatten_responseType($responseType); |
my @part_response_id = &flatten_responseType($responseType); |
foreach my $part_response_id (@part_response_id) { |
foreach my $part_response_id (@part_response_id) { |
Line 2046 KEYWORDS
|
Line 2073 KEYWORDS
|
} |
} |
|
|
my %record = &Apache::lonnet::restore($symb,$env{'request.course.id'},$udom,$uname); |
my %record = &Apache::lonnet::restore($symb,$env{'request.course.id'},$udom,$uname); |
my ($partlist,$handgrade,$responseType) = &response_type($symb); |
my $res_error; |
|
my ($partlist,$handgrade,$responseType) = &response_type($symb,\$res_error); |
|
if ($res_error) { |
|
$request->print(&navmap_errormsg()); |
|
return; |
|
} |
|
|
# Display student info |
# Display student info |
$request->print(($counter == 0 ? '' : '<br />')); |
$request->print(($counter == 0 ? '' : '<br />')); |
Line 2597 sub processHandGrade {
|
Line 2629 sub processHandGrade {
|
} |
} |
$ctr = 0; |
$ctr = 0; |
@parsedlist = reverse @parsedlist if ($button eq 'Previous'); |
@parsedlist = reverse @parsedlist if ($button eq 'Previous'); |
my ($partlist) = &response_type($symb); |
my $res_error; |
|
my ($partlist) = &response_type($symb,\$res_error); |
|
if ($res_error) { |
|
$request->print(&navmap_errormsg()); |
|
return; |
|
} |
foreach my $student (@parsedlist) { |
foreach my $student (@parsedlist) { |
my $submitonly=$env{'form.submitonly'}; |
my $submitonly=$env{'form.submitonly'}; |
my ($uname,$udom) = split(/:/,$student); |
my ($uname,$udom) = split(/:/,$student); |
Line 2795 sub check_and_remove_from_queue {
|
Line 2832 sub check_and_remove_from_queue {
|
sub handback_files { |
sub handback_files { |
my ($request,$symb,$stuname,$domain,$newflg,$new_part,$newrecord) = @_; |
my ($request,$symb,$stuname,$domain,$newflg,$new_part,$newrecord) = @_; |
my $portfolio_root = '/userfiles/portfolio'; |
my $portfolio_root = '/userfiles/portfolio'; |
my ($partlist,$handgrade,$responseType) = &response_type($symb); |
my $res_error; |
|
my ($partlist,$handgrade,$responseType) = &response_type($symb,\$res_error); |
|
if ($res_error) { |
|
$request->print('<br />'.&navmap_errormsg().'<br />'); |
|
return; |
|
} |
my @part_response_id = &flatten_responseType($responseType); |
my @part_response_id = &flatten_responseType($responseType); |
foreach my $part_response_id (@part_response_id) { |
foreach my $part_response_id (@part_response_id) { |
my ($part_id,$resp_id) = @{ $part_response_id }; |
my ($part_id,$resp_id) = @{ $part_response_id }; |
Line 3254 sub viewgrades {
|
Line 3295 sub viewgrades {
|
$result.= '<h3>'.$common_header.'</h3>'.&Apache::loncommon::start_data_table(); |
$result.= '<h3>'.$common_header.'</h3>'.&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 |
my ($partlist,$handgrade,$responseType) = &response_type($symb); |
my $res_error; |
|
my ($partlist,$handgrade,$responseType) = &response_type($symb,\$res_error); |
|
if ($res_error) { |
|
return &navmap_errormsg(); |
|
} |
my %weight = (); |
my %weight = (); |
my $ctsparts = 0; |
my $ctsparts = 0; |
my %seen = (); |
my %seen = (); |
Line 3314 sub viewgrades {
|
Line 3359 sub viewgrades {
|
&Apache::loncommon::start_data_table_header_row(). |
&Apache::loncommon::start_data_table_header_row(). |
'<th>'.&mt('No.').'</th>'. |
'<th>'.&mt('No.').'</th>'. |
'<th>'.&nameUserString('header')."</th>\n"; |
'<th>'.&nameUserString('header')."</th>\n"; |
my (@parts) = sort(&getpartlist($symb)); |
my $partserror; |
|
my (@parts) = sort(&getpartlist($symb,\$partserror)); |
|
if ($partserror) { |
|
return &navmap_errormsg(); |
|
} |
my (undef,undef,$url)=&Apache::lonnet::decode_symb($symb); |
my (undef,undef,$url)=&Apache::lonnet::decode_symb($symb); |
my @partids = (); |
my @partids = (); |
foreach my $part (@parts) { |
foreach my $part (@parts) { |
Line 3473 sub editgrades {
|
Line 3522 sub editgrades {
|
my %columns = (); |
my %columns = (); |
my ($i,$ctr,$count,$rec_update) = (0,0,0,0); |
my ($i,$ctr,$count,$rec_update) = (0,0,0,0); |
|
|
my (@parts) = sort(&getpartlist($symb)); |
my $partserror; |
|
my (@parts) = sort(&getpartlist($symb,\$partserror)); |
|
if ($partserror) { |
|
return &navmap_errormsg(); |
|
} |
my $header; |
my $header; |
while ($ctr < $env{'form.totalparts'}) { |
while ($ctr < $env{'form.totalparts'}) { |
my $partid = $env{'form.partid_'.$ctr}; |
my $partid = $env{'form.partid_'.$ctr}; |
Line 3805 ENDPICK
|
Line 3858 ENDPICK
|
} |
} |
|
|
sub csvupload_fields { |
sub csvupload_fields { |
my ($symb) = @_; |
my ($symb,$errorref) = @_; |
my (@parts) = &getpartlist($symb); |
my (@parts) = &getpartlist($symb,$errorref); |
|
if (ref($errorref)) { |
|
if ($$errorref) { |
|
return; |
|
} |
|
} |
|
|
my @fields=(['ID','Student/Employee ID'], |
my @fields=(['ID','Student/Employee ID'], |
['username','Student Username'], |
['username','Student Username'], |
['domain','Student Domain']); |
['domain','Student Domain']); |
Line 3906 sub csvuploadmap {
|
Line 3965 sub csvuploadmap {
|
&csvuploadmap_header($request,$symb,$datatoken,$#records+1); |
&csvuploadmap_header($request,$symb,$datatoken,$#records+1); |
my ($i,$keyfields); |
my ($i,$keyfields); |
if (@records) { |
if (@records) { |
my @fields=&csvupload_fields($symb); |
my $fieldserror; |
|
my @fields=&csvupload_fields($symb,\$fieldserror); |
|
if ($fieldserror) { |
|
$request->print(&navmap_errormsg()); |
|
return; |
|
} |
if ($env{'form.upfile_associate'} eq 'reverse') { |
if ($env{'form.upfile_associate'} eq 'reverse') { |
&Apache::loncommon::csv_print_samples($request,\@records); |
&Apache::loncommon::csv_print_samples($request,\@records); |
$i=&Apache::loncommon::csv_print_select_table($request,\@records, |
$i=&Apache::loncommon::csv_print_select_table($request,\@records, |
Line 4143 LISTJAVASCRIPT
|
Line 4206 LISTJAVASCRIPT
|
&mt('Manual Grading by Page or Sequence').'</span></h3>'; |
&mt('Manual Grading by Page or Sequence').'</span></h3>'; |
|
|
$result.='<form action="/adm/grades" method="post" name="displayPage">'."\n"; |
$result.='<form action="/adm/grades" method="post" name="displayPage">'."\n"; |
my ($titles,$symbx) = &getSymbMap(); |
my $map_error; |
|
my ($titles,$symbx) = &getSymbMap($map_error); |
|
if ($map_error) { |
|
$request->print(&navmap_errormsg()); |
|
return; |
|
} |
my ($curpage) =&Apache::lonnet::decode_symb($symb); |
my ($curpage) =&Apache::lonnet::decode_symb($symb); |
# my ($curpage,$mapId) =&Apache::lonnet::decode_symb($symb); |
# my ($curpage,$mapId) =&Apache::lonnet::decode_symb($symb); |
# my $type=($curpage =~ /\.(page|sequence)/); |
# my $type=($curpage =~ /\.(page|sequence)/); |
Line 4238 LISTJAVASCRIPT
|
Line 4306 LISTJAVASCRIPT
|
} |
} |
|
|
sub getSymbMap { |
sub getSymbMap { |
|
my ($map_error) = @_; |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
|
unless (ref($navmap)) { |
|
if (ref($map_error)) { |
|
$$map_error = 'navmap'; |
|
} |
|
return; |
|
} |
my %symbx = (); |
my %symbx = (); |
my @titles = (); |
my @titles = (); |
my $minder = 0; |
my $minder = 0; |
Line 4298 sub displayPage {
|
Line 4372 sub displayPage {
|
$request->print($result); |
$request->print($result); |
|
|
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
|
unless (ref($navmap)) { |
|
$request->print(&navmap_errormsg()); |
|
$request->print(&show_grading_menu_form($symb)); |
|
return; |
|
} |
my ($mapUrl, $id, $resUrl)=&Apache::lonnet::decode_symb($env{'form.page'}); |
my ($mapUrl, $id, $resUrl)=&Apache::lonnet::decode_symb($env{'form.page'}); |
my $map = $navmap->getResourceByUrl($resUrl); # add to navmaps |
my $map = $navmap->getResourceByUrl($resUrl); # add to navmaps |
if (!$map) { |
if (!$map) { |
Line 4552 sub updateGradeByPage {
|
Line 4631 sub updateGradeByPage {
|
|
|
$request->print($result); |
$request->print($result); |
|
|
|
|
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
|
unless (ref($navmap)) { |
|
$request->print(&navmap_errormsg()); |
|
return; |
|
} |
my ($mapUrl, $id, $resUrl) = &Apache::lonnet::decode_symb( $env{'form.page'}); |
my ($mapUrl, $id, $resUrl) = &Apache::lonnet::decode_symb( $env{'form.page'}); |
my $map = $navmap->getResourceByUrl($resUrl); # add to navmaps |
my $map = $navmap->getResourceByUrl($resUrl); # add to navmaps |
if (!$map) { |
if (!$map) { |
Line 4775 sub defaultFormData {
|
Line 4859 sub defaultFormData {
|
Return html dropdown of possible sequences to grade |
Return html dropdown of possible sequences to grade |
|
|
Arguments: |
Arguments: |
$symb - $symb of the current resource |
$symb - $symb of the current resource |
|
$map_error - ref to scalar which will container error if |
|
$navmap object is unavailable in &getSymbMap(). |
|
|
=cut |
=cut |
|
|
sub getSequenceDropDown { |
sub getSequenceDropDown { |
my ($symb)=@_; |
my ($symb,$map_error)=@_; |
my $result='<select name="selectpage">'."\n"; |
my $result='<select name="selectpage">'."\n"; |
my ($titles,$symbx) = &getSymbMap(); |
my ($titles,$symbx) = &getSymbMap($map_error); |
|
if (ref($map_error)) { |
|
return if ($$map_error); |
|
} |
my ($curpage)=&Apache::lonnet::decode_symb($symb); |
my ($curpage)=&Apache::lonnet::decode_symb($symb); |
my $ctr=0; |
my $ctr=0; |
foreach (@$titles) { |
foreach (@$titles) { |
Line 5048 sub scantron_selectphase {
|
Line 5137 sub scantron_selectphase {
|
my ($r,$file2grade) = @_; |
my ($r,$file2grade) = @_; |
my ($symb)=&get_symb($r); |
my ($symb)=&get_symb($r); |
if (!$symb) {return '';} |
if (!$symb) {return '';} |
my $sequence_selector=&getSequenceDropDown($symb); |
my $map_error; |
|
my $sequence_selector=&getSequenceDropDown($symb,\$map_error); |
|
if ($map_error) { |
|
$r->print('<br />'.&navmap_errormsg().'<br />'); |
|
return; |
|
} |
my $default_form_data=&defaultFormData($symb); |
my $default_form_data=&defaultFormData($symb); |
my $grading_menu_button=&show_grading_menu_form($symb); |
my $grading_menu_button=&show_grading_menu_form($symb); |
my $file_selector=&scantron_uploads($file2grade); |
my $file_selector=&scantron_uploads($file2grade); |
Line 6222 sub scantron_validate_file {
|
Line 6316 sub scantron_validate_file {
|
$r->print('<p>'.&mt('Gathering necessary information.').'</p>');$r->rflush(); |
$r->print('<p>'.&mt('Gathering necessary information.').'</p>');$r->rflush(); |
#get the student pick code ready |
#get the student pick code ready |
$r->print(&Apache::loncommon::studentbrowser_javascript()); |
$r->print(&Apache::loncommon::studentbrowser_javascript()); |
my $max_bubble=&scantron_get_maxbubble(); |
my $nav_error; |
|
my $max_bubble=&scantron_get_maxbubble(\$nav_error); |
|
if ($nav_error) { |
|
$r->print(&navmap_errormsg()); |
|
return ''; |
|
} |
my $result=&scantron_form_start($max_bubble).$default_form_data; |
my $result=&scantron_form_start($max_bubble).$default_form_data; |
$r->print($result); |
$r->print($result); |
|
|
Line 6634 sub scantron_validate_sequence {
|
Line 6733 sub scantron_validate_sequence {
|
my ($r,$currentphase) = @_; |
my ($r,$currentphase) = @_; |
|
|
my $navmap=Apache::lonnavmaps::navmap->new(); |
my $navmap=Apache::lonnavmaps::navmap->new(); |
|
unless (ref($navmap)) { |
|
$r->print(&navmap_errormsg()); |
|
return (1,$currentphase); |
|
} |
my (undef,undef,$sequence)= |
my (undef,undef,$sequence)= |
&Apache::lonnet::decode_symb($env{'form.selectpage'}); |
&Apache::lonnet::decode_symb($env{'form.selectpage'}); |
|
|
Line 6665 sub scantron_validate_ID {
|
Line 6768 sub scantron_validate_ID {
|
#get scantron line setup |
#get scantron line setup |
my %scantron_config=&get_scantron_config($env{'form.scantron_format'}); |
my %scantron_config=&get_scantron_config($env{'form.scantron_format'}); |
my ($scanlines,$scan_data)=&scantron_getfile(); |
my ($scanlines,$scan_data)=&scantron_getfile(); |
|
|
&scantron_get_maxbubble(); # parse needs the bubble_lines.. array. |
my $nav_error; |
|
&scantron_get_maxbubble(\$nav_error); # parse needs the bubble_lines.. array. |
|
if ($nav_error) { |
|
$r->print(&navmap_errormsg()); |
|
return(1,$currentphase); |
|
} |
|
|
my %found=('ids'=>{},'usernames'=>{}); |
my %found=('ids'=>{},'usernames'=>{}); |
for (my $i=0;$i<=$scanlines->{'count'};$i++) { |
for (my $i=0;$i<=$scanlines->{'count'};$i++) { |
Line 7219 sub scantron_validate_CODE {
|
Line 7327 sub scantron_validate_CODE {
|
|
|
my %allcodes=&get_codes(); |
my %allcodes=&get_codes(); |
|
|
&scantron_get_maxbubble(); # parse needs the lines per response array. |
my $nav_error; |
|
&scantron_get_maxbubble(\$nav_error); # parse needs the lines per response array. |
|
if ($nav_error) { |
|
$r->print(&navmap_errormsg()); |
|
return(1,$currentphase); |
|
} |
|
|
my ($scanlines,$scan_data)=&scantron_getfile(); |
my ($scanlines,$scan_data)=&scantron_getfile(); |
for (my $i=0;$i<=$scanlines->{'count'};$i++) { |
for (my $i=0;$i<=$scanlines->{'count'};$i++) { |
Line 7291 sub scantron_validate_doublebubble {
|
Line 7404 sub scantron_validate_doublebubble {
|
|
|
|
|
sub scantron_get_maxbubble { |
sub scantron_get_maxbubble { |
|
my ($nav_error) = @_; |
if (defined($env{'form.scantron_maxbubble'}) && |
if (defined($env{'form.scantron_maxbubble'}) && |
$env{'form.scantron_maxbubble'}) { |
$env{'form.scantron_maxbubble'}) { |
&restore_bubble_lines(); |
&restore_bubble_lines(); |
Line 7301 sub scantron_get_maxbubble {
|
Line 7415 sub scantron_get_maxbubble {
|
&Apache::lonnet::decode_symb($env{'form.selectpage'}); |
&Apache::lonnet::decode_symb($env{'form.selectpage'}); |
|
|
my $navmap=Apache::lonnavmaps::navmap->new(); |
my $navmap=Apache::lonnavmaps::navmap->new(); |
|
unless (ref($navmap)) { |
|
if (ref($nav_error)) { |
|
$$nav_error = 1; |
|
} |
|
} |
my $map=$navmap->getResourceByUrl($sequence); |
my $map=$navmap->getResourceByUrl($sequence); |
my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0); |
my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0); |
|
|
Line 7390 sub scantron_validate_missingbubbles {
|
Line 7509 sub scantron_validate_missingbubbles {
|
#get scantron line setup |
#get scantron line setup |
my %scantron_config=&get_scantron_config($env{'form.scantron_format'}); |
my %scantron_config=&get_scantron_config($env{'form.scantron_format'}); |
my ($scanlines,$scan_data)=&scantron_getfile(); |
my ($scanlines,$scan_data)=&scantron_getfile(); |
my $max_bubble=&scantron_get_maxbubble(); |
my $nav_error; |
|
my $max_bubble=&scantron_get_maxbubble(\$nav_error); |
|
if ($nav_error) { |
|
return(1,$currentphase); |
|
} |
if (!$max_bubble) { $max_bubble=2**31; } |
if (!$max_bubble) { $max_bubble=2**31; } |
for (my $i=0;$i<=$scanlines->{'count'};$i++) { |
for (my $i=0;$i<=$scanlines->{'count'};$i++) { |
my $line=&scantron_get_line($scanlines,$scan_data,$i); |
my $line=&scantron_get_line($scanlines,$scan_data,$i); |
Line 7450 sub scantron_process_students {
|
Line 7573 sub scantron_process_students {
|
my $classlist=&Apache::loncoursedata::get_classlist(); |
my $classlist=&Apache::loncoursedata::get_classlist(); |
my %idmap=&username_to_idmap($classlist); |
my %idmap=&username_to_idmap($classlist); |
my $navmap=Apache::lonnavmaps::navmap->new(); |
my $navmap=Apache::lonnavmaps::navmap->new(); |
|
unless (ref($navmap)) { |
|
$r->print(&navmap_errormsg()); |
|
return ''; |
|
} |
my $map=$navmap->getResourceByUrl($sequence); |
my $map=$navmap->getResourceByUrl($sequence); |
my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0); |
my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0); |
my (%grader_partids_by_symb,%grader_randomlists_by_symb); |
my (%grader_partids_by_symb,%grader_randomlists_by_symb); |
Line 7492 SCANTRONFORM
|
Line 7619 SCANTRONFORM
|
my $i=-1; |
my $i=-1; |
my $started; |
my $started; |
|
|
|
my $nav_error; |
|
&scantron_get_maxbubble(\$nav_error); # Need the bubble lines array to parse. |
|
if ($nav_error) { |
|
$r->print(&navmap_errormsg()); |
|
return ''; |
|
} |
|
|
&scantron_get_maxbubble(); # Need the bubble lines array to parse. |
&scantron_get_maxbubble(); # Need the bubble lines array to parse. |
|
|
|
|
# If an ssi failed in scantron_get_maxbubble, put an error message out to |
# If an ssi failed in scantron_get_maxbubble, put an error message out to |
# the user and return. |
# the user and return. |
|
|
Line 7976 sub checkscantron_results {
|
Line 8111 sub checkscantron_results {
|
my $classlist=&Apache::loncoursedata::get_classlist(); |
my $classlist=&Apache::loncoursedata::get_classlist(); |
my %idmap=&Apache::grades::username_to_idmap($classlist); |
my %idmap=&Apache::grades::username_to_idmap($classlist); |
my $navmap=Apache::lonnavmaps::navmap->new(); |
my $navmap=Apache::lonnavmaps::navmap->new(); |
|
unless (ref($navmap)) { |
|
$r->print(&navmap_errormsg()); |
|
return ''; |
|
} |
my $map=$navmap->getResourceByUrl($sequence); |
my $map=$navmap->getResourceByUrl($sequence); |
my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0); |
my @resources=$navmap->retrieveResources($map,\&scantron_filter,1,0); |
my (%grader_partids_by_symb,%grader_randomlists_by_symb); |
my (%grader_partids_by_symb,%grader_randomlists_by_symb); |
Line 7994 sub checkscantron_results {
|
Line 8133 sub checkscantron_results {
|
'Progress of Bubblesheet Data/Submission Records Comparison',$count, |
'Progress of Bubblesheet Data/Submission Records Comparison',$count, |
'inline',undef,'checkscantron'); |
'inline',undef,'checkscantron'); |
my ($username,$domain,$started); |
my ($username,$domain,$started); |
|
my $nav_error; |
&scantron_get_maxbubble(); # Need the bubble lines array to parse. |
&scantron_get_maxbubble(\$nav_error); # Need the bubble lines array to parse. |
|
if ($nav_error) { |
|
$r->print(&navmap_errormsg()); |
|
return ''; |
|
} |
|
|
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state, |
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state, |
'Processing first student'); |
'Processing first student'); |
Line 8989 sub assign_clicker_grades {
|
Line 9132 sub assign_clicker_grades {
|
my ($symb)=&get_symb($r); |
my ($symb)=&get_symb($r); |
if (!$symb) {return '';} |
if (!$symb) {return '';} |
# See which part we are saving to |
# See which part we are saving to |
my ($partlist,$handgrade,$responseType) = &response_type($symb); |
my $res_error; |
|
my ($partlist,$handgrade,$responseType) = &response_type($symb,\$res_error); |
|
if ($res_error) { |
|
return &navmap_errormsg(); |
|
} |
# FIXME: This should probably look for the first handgradeable part |
# FIXME: This should probably look for the first handgradeable part |
my $part=$$partlist[0]; |
my $part=$$partlist[0]; |
# Start screen output |
# Start screen output |
Line 9093 ENDHEADER
|
Line 9240 ENDHEADER
|
return $result.&show_grading_menu_form($symb); |
return $result.&show_grading_menu_form($symb); |
} |
} |
|
|
|
sub navmap_errormsg { |
|
return '<div class="LC_error">'. |
|
&mt('An error occurred retrieving information about resources in the course.').'<br />'. |
|
&mt('It is recommended that you [_1]re-initialize the course[_2] and then return to this grading page..','<a href="/adm/roles?selectrole=1&newrole='.$env{'request.role'}.'">','</a>'). |
|
'</div>'; |
|
} |
|
|
sub handler { |
sub handler { |
my $request=$_[0]; |
my $request=$_[0]; |
&reset_caches(); |
&reset_caches(); |
Line 9116 sub handler {
|
Line 9270 sub handler {
|
my $brcrum = [{href=>"/adm/grades",text=>"Grading"}]; |
my $brcrum = [{href=>"/adm/grades",text=>"Grading"}]; |
$request->print(&Apache::loncommon::start_page('Grading',undef, |
$request->print(&Apache::loncommon::start_page('Grading',undef, |
{'bread_crumbs' => $brcrum})); |
{'bread_crumbs' => $brcrum})); |
if (&Apache::loncommon::needs_gci_custom()) { |
|
$request->print('<h3>'.&mt('Grading screens are unavailable for GCI Concept Tests').'</h3>'.&Apache::loncommon::end_page()); |
|
&reset_caches(); |
|
return ''; |
|
} |
|
if ($symb eq '' && $command eq '') { |
if ($symb eq '' && $command eq '') { |
if ($env{'user.adv'}) { |
if ($env{'user.adv'}) { |
if (($env{'form.codeone'}) && ($env{'form.codetwo'}) && |
if (($env{'form.codeone'}) && ($env{'form.codetwo'}) && |
Line 9323 ssi_with_retries()
|
Line 9472 ssi_with_retries()
|
|
|
=item scantron_get_maxbubble() : |
=item scantron_get_maxbubble() : |
|
|
|
Arguments: |
|
$nav_error - Reference to scalar which is a flag to indicate a |
|
failure to retrieve a navmap object. |
|
if $nav_error is set to 1 by scantron_get_maxbubble(), the |
|
calling routine should trap the error condition and display the warning |
|
found in &navmap_errormsg(). |
|
|
Returns the maximum number of bubble lines that are expected to |
Returns the maximum number of bubble lines that are expected to |
occur. Does this by walking the selected sequence rendering the |
occur. Does this by walking the selected sequence rendering the |
resource and then checking &Apache::lonxml::get_problem_counter() |
resource and then checking &Apache::lonxml::get_problem_counter() |
Line 9388 ssi_with_retries()
|
Line 9544 ssi_with_retries()
|
Validates all scanlines in the selected file to not have any |
Validates all scanlines in the selected file to not have any |
invalid or underspecified student/employee IDs |
invalid or underspecified student/employee IDs |
|
|
|
=item navmap_errormsg() : |
|
|
|
Returns HTML mark-up inside a <div></div> with a link to re-initialize the course. |
|
Should be called whenever the request to instantiate a navmap object fails. |
|
|
=back |
=back |
|
|
=cut |
=cut |