version 1.302.2.7, 2006/09/22 21:16:14
|
version 1.303, 2006/01/17 23:09:50
|
Line 1577 sub submission {
|
Line 1577 sub submission {
|
} |
} |
my $overRideScore = $env{'form.overRideScore'} eq '' ? 'no' : $env{'form.overRideScore'}; |
my $overRideScore = $env{'form.overRideScore'} eq '' ? 'no' : $env{'form.overRideScore'}; |
|
|
$request->print('<form action="/adm/grades" method="post" name="SCORE">'."\n". |
$request->print('<form action="/adm/grades" method="post" name="SCORE" enctype="multipart/form-data">'."\n". |
'<input type="hidden" name="command" value="handgrade" />'."\n". |
'<input type="hidden" name="command" value="handgrade" />'."\n". |
'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n". |
'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n". |
'<input type="hidden" name="Status" value="'.$env{'form.Status'}.'" />'."\n". |
'<input type="hidden" name="Status" value="'.$env{'form.Status'}.'" />'."\n". |
Line 1807 KEYWORDS
|
Line 1807 KEYWORDS
|
} |
} |
if (@files) { |
if (@files) { |
$lastsubonly.='<br /><font color="red" size="1">Like all files provided by users, this file may contain virusses</font><br />'; |
$lastsubonly.='<br /><font color="red" size="1">Like all files provided by users, this file may contain virusses</font><br />'; |
|
my $file_counter = 0; |
foreach my $file (@files) { |
foreach my $file (@files) { |
|
$file_counter ++; |
&Apache::lonnet::allowuploaded('/adm/grades',$file); |
&Apache::lonnet::allowuploaded('/adm/grades',$file); |
$lastsubonly.='<br /><a href="'.$file.'" target="lonGRDs"><img src="'.&Apache::loncommon::icon($file).'" border=0"> '.$file.'</a>'; |
$lastsubonly.='<br /><a href="'.$file.'" target="lonGRDs"><img src="'.&Apache::loncommon::icon($file).'" border=0"> '.$file.'</a>'; |
|
$lastsubonly.='Return commented document to student. <input type="file" name="returndoc'.$file_counter.'" />'."\n"; |
|
$lastsubonly.='<input type="hidden" name="returndocorig'.$file_counter.'" value="'.$file.'" />'; |
|
|
} |
} |
$lastsubonly.='<br />'; |
$lastsubonly.='<br />'; |
} |
} |
Line 2040 sub processHandGrade {
|
Line 2045 sub processHandGrade {
|
} |
} |
} |
} |
} |
} |
|
if ($env{'form.returndoc1'}) { |
|
# if multiple files are uploaded names will be 'returndoc2', 'returndoc3' |
|
my $file_counter = 1; |
|
while ($env{'form.returndoc'.$file_counter}) { |
|
$request->print("<font color=\"red\">Will upload document</font>".$env{'form.returndocorig'.$file_counter}); |
|
$file_counter ++; |
|
} |
|
} |
$ctr++; |
$ctr++; |
} |
} |
} |
} |
Line 2248 sub saveHandGrade {
|
Line 2261 sub saveHandGrade {
|
|
|
my $solvedstatus = $record{'resource.'.$new_part.'.solved'}; |
my $solvedstatus = $record{'resource.'.$new_part.'.solved'}; |
if ($aggtries > 0) { |
if ($aggtries > 0) { |
&decrement_aggs($symb,$new_part,\%aggregate,$aggtries,$totaltries,$solvedstatus); |
&decrement($symb,$new_part,\%aggregate,$aggtries,$totaltries,$solvedstatus); |
$aggregateflag = 1; |
$aggregateflag = 1; |
} |
} |
} elsif ($dropMenu eq '') { |
} elsif ($dropMenu eq '') { |
Line 2397 sub version_portfiles {
|
Line 2410 sub version_portfiles {
|
&Apache::lonnet::logthis("should be unmarking and remarking $key",@portfiles); |
&Apache::lonnet::logthis("should be unmarking and remarking $key",@portfiles); |
foreach my $file (@portfiles) { |
foreach my $file (@portfiles) { |
&Apache::lonnet::unmark_as_readonly($domain,$stuname,[$symb,$env{'request.course.id'}],$file); |
&Apache::lonnet::unmark_as_readonly($domain,$stuname,[$symb,$env{'request.course.id'}],$file); |
my ($directory,$answer_file) =($file =~ /^(.*?)([^\/]*)$/); |
my ($directory,$answer_file) =($file =~ /^(.*?)([^\/]*$)/); |
my $version = 0; |
my $version = 0; |
my ($answer_name,$answer_ver,$answer_ext) = |
my @answer_file_parts = split(/\./, $answer_file); |
&file_name_version_ext($answer_file); |
|
my @dir_list = &Apache::lonnet::dirlist($directory,$domain,$stuname,$portfolio_root); |
my @dir_list = &Apache::lonnet::dirlist($directory,$domain,$stuname,$portfolio_root); |
|
my @file_names; |
|
my @file_name_parts; |
foreach my $row (@dir_list) { |
foreach my $row (@dir_list) { |
my ($file) = split(/\&/,$row,2); |
@file_names = split(/\&/,$row,2); |
my ($file_name,$file_version,$file_ext) = |
@file_name_parts = split(/\./, $file_names[0]); |
&file_name_version_ext($file); |
# ($file_name_parts[scalar @file_name_parts] eq $answer_file_parts[scalar @answer_file_parts]) |
if (($file_name eq $answer_name) && |
if (($file_name_parts[0] eq $answer_file_parts[0]) && |
($file_ext eq $answer_ext)) { |
($file_name_parts[-1] eq $answer_file_parts[-1])) { |
# gets here if filename and extension match, regardless of version |
# gets here if filename and extension match, regardless of version |
if ($file_version ne '') { |
if (scalar @file_name_parts == 3) { # a versioned file is found |
# a versioned file is found so save it for later |
# so save it for later |
if ($file_version > $version) { |
if ($file_name_parts[1] > $version) {$version = $file_name_parts[1]}; |
$version = $file_version; |
|
} |
|
} |
} |
} |
} |
} |
} |
Line 2422 sub version_portfiles {
|
Line 2434 sub version_portfiles {
|
if($env{'form.copy'} eq '-1') { |
if($env{'form.copy'} eq '-1') { |
&Apache::lonnet::logthis('problem getting file '.$directory.$answer_file); |
&Apache::lonnet::logthis('problem getting file '.$directory.$answer_file); |
} else { |
} else { |
my $new_answer = $answer_name.'.'.$version.'.'.$answer_ext; |
my $copy_result = &Apache::lonnet::finishuserfileupload($stuname,$domain,'copy', |
my $copy_result = &Apache::lonnet::finishuserfileupload( |
'/portfolio'.$directory.$answer_file_parts[0].'.'.$version.'.'.$answer_file_parts[-1]); |
$stuname,$domain,'copy', |
push(@v_portfiles, $directory.$answer_file_parts[0].'.'.$version.'.'.$answer_file_parts[-1]); |
'/portfolio'.$directory.$new_answer); |
|
push(@v_portfiles, $directory.$new_answer); |
|
&Apache::lonnet::mark_as_readonly($domain,$stuname, |
&Apache::lonnet::mark_as_readonly($domain,$stuname, |
['/portfolio'.$directory.$new_answer], |
['/portfolio'.$directory.$answer_file_parts[0].'.'.$version.'.'.$answer_file_parts[-1]], |
[$symb,$env{'request.course.id'},'graded']); |
[$symb,$env{'request.course.id'},'graded']); |
} |
} |
} |
} |
Line 2439 sub version_portfiles {
|
Line 2449 sub version_portfiles {
|
|
|
} |
} |
|
|
sub file_name_version_ext { |
|
my ($file)=@_; |
|
my @file_parts = split(/\./, $file); |
|
my ($name,$version,$ext); |
|
if (@file_parts > 1) { |
|
$ext=pop(@file_parts); |
|
if (@file_parts > 1 && $file_parts[-1] =~ /^\d+$/) { |
|
$version=pop(@file_parts); |
|
} |
|
$name=join('.',@file_parts); |
|
} else { |
|
$name=join('.',@file_parts); |
|
} |
|
return($name,$version,$ext); |
|
} |
|
|
|
#-------------------------------------------------------------------------------------- |
#-------------------------------------------------------------------------------------- |
# |
# |
#-------------------------- Next few routines handles grading by section or whole class |
#-------------------------- Next few routines handles grading by section or whole class |
Line 3291 sub csvuploadmap {
|
Line 3285 sub csvuploadmap {
|
unshift(@fields,['none','']); |
unshift(@fields,['none','']); |
$i=&Apache::loncommon::csv_samples_select_table($request,\@records, |
$i=&Apache::loncommon::csv_samples_select_table($request,\@records, |
\@fields); |
\@fields); |
foreach my $rec (@records) { |
my %sone=&Apache::loncommon::record_sep($records[0]); |
my %temp = &Apache::loncommon::record_sep($rec); |
$keyfields=join(',',sort(keys(%sone))); |
if (%temp) { |
|
$keyfields=join(',',sort(keys(%temp))); |
|
last; |
|
} |
|
} |
|
} |
} |
} |
} |
&csvuploadmap_footer($request,$i,$keyfields); |
&csvuploadmap_footer($request,$i,$keyfields); |
Line 3459 sub csvuploadassign {
|
Line 3448 sub csvuploadassign {
|
} |
} |
$request->print("<br />Stored $countdone students\n"); |
$request->print("<br />Stored $countdone students\n"); |
if (@skipped) { |
if (@skipped) { |
$request->print('<p><font size="+1"><b>Skipped Students</b></font></p>'); |
$request->print('<p<font size="+1"><b>Skipped Students</b></font></p>'); |
foreach my $student (@skipped) { $request->print("$student<br />\n"); } |
foreach my $student (@skipped) { $request->print("$student<br />\n"); } |
} |
} |
if (@notallowed) { |
if (@notallowed) { |
Line 3679 sub displayPage {
|
Line 3668 sub displayPage {
|
if($curRes == $iterator->BEGIN_MAP) { $depth++; } |
if($curRes == $iterator->BEGIN_MAP) { $depth++; } |
if($curRes == $iterator->END_MAP) { $depth--; } |
if($curRes == $iterator->END_MAP) { $depth--; } |
|
|
if (ref($curRes) && $curRes->is_problem()) { |
if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) { |
my $parts = $curRes->parts(); |
my $parts = $curRes->parts(); |
my $title = $curRes->compTitle(); |
my $title = $curRes->compTitle(); |
my $symbx = $curRes->symb(); |
my $symbx = $curRes->symb(); |
Line 3876 sub updateGradeByPage {
|
Line 3865 sub updateGradeByPage {
|
if($curRes == $iterator->BEGIN_MAP) { $depth++; } |
if($curRes == $iterator->BEGIN_MAP) { $depth++; } |
if($curRes == $iterator->END_MAP) { $depth--; } |
if($curRes == $iterator->END_MAP) { $depth--; } |
|
|
if (ref($curRes) && $curRes->is_problem()) { |
if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) { |
my $parts = $curRes->parts(); |
my $parts = $curRes->parts(); |
my $title = $curRes->compTitle(); |
my $title = $curRes->compTitle(); |
my $symbx = $curRes->symb(); |
my $symbx = $curRes->symb(); |
Line 4063 sub scantron_CODElist {
|
Line 4052 sub scantron_CODElist {
|
sub scantron_CODEunique { |
sub scantron_CODEunique { |
my $result='<nobr> |
my $result='<nobr> |
<label><input type="radio" name="scantron_CODEunique" |
<label><input type="radio" name="scantron_CODEunique" |
value="yes" checked="checked" /> Yes </label> |
value="Yes" checked="on" /> Yes </label> |
</nobr> |
</nobr> |
<nobr> |
<nobr> |
<label><input type="radio" name="scantron_CODEunique" |
<label><input type="radio" name="scantron_CODEunique" |
value="no" /> No </label> |
value="No" /> No </label> |
</nobr>'; |
</nobr>'; |
return $result; |
return $result; |
} |
} |
Line 4517 sub reset_skipping_status {
|
Line 4506 sub reset_skipping_status {
|
&scantron_putfile(undef,$scan_data); |
&scantron_putfile(undef,$scan_data); |
} |
} |
|
|
sub start_skipping { |
sub allow_skipping { |
my ($scan_data,$i)=@_; |
my ($scan_data,$i)=@_; |
my %remembered=split(':',&scan_data($scan_data,'remember_skipping')); |
my %remembered=split(':',&scan_data($scan_data,'remember_skipping')); |
if ($env{'form.scantron_options_redo'} =~ /^redo_/) { |
delete($remembered{$i}); |
$remembered{$i}=2; |
|
} else { |
|
$remembered{$i}=1; |
|
} |
|
&scan_data($scan_data,'remember_skipping',join(':',%remembered)); |
&scan_data($scan_data,'remember_skipping',join(':',%remembered)); |
} |
} |
|
|
sub should_be_skipped { |
sub should_be_skipped { |
my ($scanlines,$scan_data,$i)=@_; |
my ($scan_data,$i)=@_; |
if ($env{'form.scantron_options_redo'} !~ /^redo_/) { |
if ($env{'form.scantron_options_redo'} !~ /^redo_/) { |
# not redoing old skips |
# not redoing old skips |
if ($scanlines->{'skipped'}[$i]) { return 1; } |
|
return 0; |
return 0; |
} |
} |
my %remembered=split(':',&scan_data($scan_data,'remember_skipping')); |
my %remembered=split(':',&scan_data($scan_data,'remember_skipping')); |
|
if (exists($remembered{$i})) { return 0; } |
if (exists($remembered{$i}) && $remembered{$i} != 2 ) { |
|
return 0; |
|
} |
|
return 1; |
return 1; |
} |
} |
|
|
Line 4551 sub remember_current_skipped {
|
Line 4532 sub remember_current_skipped {
|
$to_remember{$i}=1; |
$to_remember{$i}=1; |
} |
} |
} |
} |
|
&Apache::lonnet::logthis('remembering '.join(':',%to_remember)); |
&scan_data($scan_data,'remember_skipping',join(':',%to_remember)); |
&scan_data($scan_data,'remember_skipping',join(':',%to_remember)); |
&scantron_putfile(undef,$scan_data); |
&scantron_putfile(undef,$scan_data); |
} |
} |
Line 4656 sub scantron_validate_file {
|
Line 4637 sub scantron_validate_file {
|
} |
} |
if ($env{'form.scantron_options_redo'} eq 'redo_skipped') { |
if ($env{'form.scantron_options_redo'} eq 'redo_skipped') { |
&remember_current_skipped(); |
&remember_current_skipped(); |
|
&scantron_remove_file('skipped'); |
$env{'form.scantron_options_redo'}='redo_skipped_ready'; |
$env{'form.scantron_options_redo'}='redo_skipped_ready'; |
} |
} |
|
|
Line 4818 sub scantron_putfile {
|
Line 4800 sub scantron_putfile {
|
|
|
sub scantron_get_line { |
sub scantron_get_line { |
my ($scanlines,$scan_data,$i)=@_; |
my ($scanlines,$scan_data,$i)=@_; |
if (&should_be_skipped($scanlines,$scan_data,$i)) { return undef; } |
if (&should_be_skipped($scan_data,$i)) { return undef; } |
#if ($scanlines->{'skipped'}[$i]) { return undef; } |
if ($scanlines->{'skipped'}[$i]) { return undef; } |
if ($scanlines->{'corrected'}[$i]) {return $scanlines->{'corrected'}[$i];} |
if ($scanlines->{'corrected'}[$i]) {return $scanlines->{'corrected'}[$i];} |
return $scanlines->{'orig'}[$i]; |
return $scanlines->{'orig'}[$i]; |
} |
} |
Line 4839 sub scantron_put_line {
|
Line 4821 sub scantron_put_line {
|
my ($scanlines,$scan_data,$i,$newline,$skip)=@_; |
my ($scanlines,$scan_data,$i,$newline,$skip)=@_; |
if ($skip) { |
if ($skip) { |
$scanlines->{'skipped'}[$i]=$newline; |
$scanlines->{'skipped'}[$i]=$newline; |
&start_skipping($scan_data,$i); |
&allow_skipping($scan_data,$i); |
return; |
return; |
} |
} |
$scanlines->{'corrected'}[$i]=$newline; |
$scanlines->{'corrected'}[$i]=$newline; |
} |
} |
|
|
sub scantron_clear_skip { |
|
my ($scanlines,$scan_data,$i)=@_; |
|
if (exists($scanlines->{'skipped'}[$i])) { |
|
undef($scanlines->{'skipped'}[$i]); |
|
return 1; |
|
} |
|
return 0; |
|
} |
|
|
|
sub scantron_validate_ID { |
sub scantron_validate_ID { |
my ($r,$currentphase) = @_; |
my ($r,$currentphase) = @_; |
|
|
Line 5297 SCANTRONFORM
|
Line 5270 SCANTRONFORM
|
($uname,$udom)=split(/:/,$uname); |
($uname,$udom)=split(/:/,$uname); |
&Apache::lonnet::delenv('form.counter'); |
&Apache::lonnet::delenv('form.counter'); |
&Apache::lonnet::appenv(%$scan_record); |
&Apache::lonnet::appenv(%$scan_record); |
|
|
if (&scantron_clear_skip($scanlines,$scan_data,$i)) { |
|
&scantron_putfile($scanlines,$scan_data); |
|
} |
|
|
|
my $i=0; |
my $i=0; |
foreach my $resource (@resources) { |
foreach my $resource (@resources) { |