version 1.302, 2005/12/15 17:53:20
|
version 1.302.2.5, 2006/03/03 21:52:01
|
Line 2248 sub saveHandGrade {
|
Line 2248 sub saveHandGrade {
|
|
|
my $solvedstatus = $record{'resource.'.$new_part.'.solved'}; |
my $solvedstatus = $record{'resource.'.$new_part.'.solved'}; |
if ($aggtries > 0) { |
if ($aggtries > 0) { |
&decrement($symb,$new_part,\%aggregate,$aggtries,$totaltries,$solvedstatus); |
&decrement_aggs($symb,$new_part,\%aggregate,$aggtries,$totaltries,$solvedstatus); |
$aggregateflag = 1; |
$aggregateflag = 1; |
} |
} |
} elsif ($dropMenu eq '') { |
} elsif ($dropMenu eq '') { |
Line 2397 sub version_portfiles {
|
Line 2397 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_file_parts = split(/\./, $answer_file); |
my ($answer_name,$answer_ver,$answer_ext) = |
|
&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) { |
@file_names = split(/\&/,$row,2); |
my ($file) = split(/\&/,$row,2); |
@file_name_parts = split(/\./, $file_names[0]); |
my ($file_name,$file_version,$file_ext) = |
# ($file_name_parts[scalar @file_name_parts] eq $answer_file_parts[scalar @answer_file_parts]) |
&file_name_version_ext($file); |
if (($file_name_parts[0] eq $answer_file_parts[0]) && |
if (($file_name eq $answer_name) && |
($file_name_parts[-1] eq $answer_file_parts[-1])) { |
($file_ext eq $answer_ext)) { |
# gets here if filename and extension match, regardless of version |
# gets here if filename and extension match, regardless of version |
if (scalar @file_name_parts == 3) { # a versioned file is found |
if ($file_version ne '') { |
# so save it for later |
# a versioned file is found so save it for later |
if ($file_name_parts[1] > $version) {$version = $file_name_parts[1]}; |
if ($file_version > $version) { |
|
$version = $file_version; |
|
} |
} |
} |
} |
} |
} |
} |
Line 2421 sub version_portfiles {
|
Line 2422 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 $copy_result = &Apache::lonnet::finishuserfileupload($stuname,$domain,'copy', |
my $new_answer = $answer_name.'.'.$version.'.'.$answer_ext; |
'/portfolio'.$directory.$answer_file_parts[0].'.'.$version.'.'.$answer_file_parts[-1]); |
my $copy_result = &Apache::lonnet::finishuserfileupload( |
push(@v_portfiles, $directory.$answer_file_parts[0].'.'.$version.'.'.$answer_file_parts[-1]); |
$stuname,$domain,'copy', |
|
'/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.$answer_file_parts[0].'.'.$version.'.'.$answer_file_parts[-1]], |
['/portfolio'.$directory.$new_answer], |
[$symb,$env{'request.course.id'},'graded']); |
[$symb,$env{'request.course.id'},'graded']); |
} |
} |
} |
} |
Line 2436 sub version_portfiles {
|
Line 2439 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 3272 sub csvuploadmap {
|
Line 3291 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); |
my %sone=&Apache::loncommon::record_sep($records[0]); |
foreach my $rec (@records) { |
$keyfields=join(',',sort(keys(%sone))); |
my %temp = &Apache::loncommon::record_sep($rec); |
|
if (%temp) { |
|
$keyfields=join(',',sort(keys(%temp))); |
|
last; |
|
} |
|
} |
} |
} |
} |
} |
&csvuploadmap_footer($request,$i,$keyfields); |
&csvuploadmap_footer($request,$i,$keyfields); |
Line 3435 sub csvuploadassign {
|
Line 3459 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 4039 sub scantron_CODElist {
|
Line 4063 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="on" /> Yes </label> |
value="yes" checked="checked" /> 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; |
} |
} |