version 1.208, 2008/11/25 13:16:17
|
version 1.212, 2009/03/13 00:34:20
|
Line 239 sub meta_stores_write {
|
Line 239 sub meta_stores_write {
|
"></stores>\n"; |
"></stores>\n"; |
} |
} |
|
|
sub mandatory_part_meta { |
|
=pod |
=pod |
|
|
=item meta_part_order |
=item mandatory_part_meta() |
|
|
Autogenerate metadata for mandatory |
Autogenerate metadata for mandatory |
input (from RAT or lonparmset) and |
input (from RAT or lonparmset) and |
output (to lonspreadsheet) |
output (to lonspreadsheet) |
of each part |
of each part |
# |
|
return |
|
&meta_parameter_write('opendate','date_start','', |
|
'Opening Date'). |
|
&meta_parameter_write('duedate','date_end','', |
|
'Due Date'). |
|
&meta_parameter_write('answerdate','date_start','', |
|
'Show Answer Date'). |
|
&meta_parameter_write('weight','int_zeropos','', |
|
'Available Points'). |
|
&meta_parameter_write('maxtries','int_pos','', |
|
'Maximum Number of Tries'). |
|
&meta_package_write('part'). |
|
&meta_stores_write('solved','string', |
|
'Problem Status'). |
|
&meta_stores_write('tries','int_zeropos', |
|
'Number of Attempts'). |
|
&meta_stores_write('awarded','float', |
|
'Partial Credit Factor'); |
|
|
|
Note: responseid-specific data 'submission' and 'awarddetail' |
Note: responseid-specific data 'submission' and 'awarddetail' |
not available to spreadsheet -> skip here |
not available to spreadsheet -> skip here |
|
|
=cut |
=cut |
|
|
|
|
|
sub mandatory_part_meta { |
|
return &meta_package_write('part'). |
|
&meta_stores_write('solved','string','Problem Status'). |
|
&meta_stores_write('tries','int_zeropos','Number of Attempts'). |
|
&meta_stores_write('awarded','float','Partial Credit Factor'); |
} |
} |
|
|
sub meta_part_order { |
sub meta_part_order { |
Line 297 sub check_for_previous {
|
Line 283 sub check_for_previous {
|
my %previous; |
my %previous; |
$previous{'used'} = 0; |
$previous{'used'} = 0; |
foreach my $key (sort(keys(%Apache::lonhomework::history))) { |
foreach my $key (sort(keys(%Apache::lonhomework::history))) { |
if ($key =~ /resource\.$partid\.$id\.submission$/) { |
if ($key =~ /resource\.\Q$partid\E\.\Q$id\E\.submission$/) { |
if ( $last && $key =~ /^(\d+):/ ) { |
if ( $last && $key =~ /^(\d+):/ ) { |
next if ($1 >= $last); |
next if ($1 >= $last); |
} |
} |
Line 316 sub check_for_previous {
|
Line 302 sub check_for_previous {
|
$previous{'last'}='1'; |
$previous{'last'}='1'; |
} |
} |
if (! $previous{'award'} ) { $previous{'award'} = 'UNKNOWN'; } |
if (! $previous{'award'} ) { $previous{'award'} = 'UNKNOWN'; } |
|
if ($previous{'award'} eq 'INTERNAL_ERROR') { $previous{'used'}=0; } |
&Apache::lonxml::debug("got a match :$previous{'award'}:$previous{'used'}:"); |
&Apache::lonxml::debug("got a match :$previous{'award'}:$previous{'used'}:"); |
} |
} |
} |
} |
Line 915 sub showallfoils {
|
Line 902 sub showallfoils {
|
|
|
=pod |
=pod |
|
|
=item &getresponse($offset,$resulttype); |
=item &getresponse(); |
|
|
Retreives the current submitted response, helps out in the case of |
Retreives the current submitted response, helps out in the case of |
scantron mode. |
scantron mode. |
Line 961 sub getresponse {
|
Line 948 sub getresponse {
|
my $id = $Apache::inputtags::response[-1]; |
my $id = $Apache::inputtags::response[-1]; |
|
|
my $line; |
my $line; |
|
my $startline = $env{'form.scantron_questnum_start.'.$part.'.'.$id}; |
|
if (!$startline) { |
|
$startline = $Apache::lonxml::counter; |
|
} |
for ($line = 0; $line < $lines; $line++) { |
for ($line = 0; $line < $lines; $line++) { |
my $theline = $Apache::lonxml::counter+$offset-1+$line; |
my $theline = $startline+$offset-1+$line; |
$response = $env{"scantron.$theline.answer"}; |
$response = $env{"scantron.$theline.answer"}; |
if ((defined($response)) && ($response ne "") && ($response ne " ")) { |
if ((defined($response)) && ($response ne "") && ($response ne " ")) { |
last; |
last; |
} |
} |
|
|
} |
} |
|
|
# save bubbled letter for later |
# save bubbled letter for later |
Line 1019 sub repetition {
|
Line 1010 sub repetition {
|
|
|
=pod |
=pod |
|
|
=item &scored_response($part_id,$response_id); |
=item &scored_response(); |
|
|
Sets the results hash elements |
Sets the results hash elements |
|
|
Line 1289 sub check_status {
|
Line 1280 sub check_status {
|
|
|
=pod |
=pod |
|
|
=item setup_prior_tries_hash($func,$data) |
=item setup_prior_tries_hash() |
|
|
Foreach each past .submission $func is called with 3 arguments |
Foreach each past .submission $func is called with 3 arguments |
- the mode to set things up for (currently always 'grade') |
- the mode to set things up for (currently always 'grade') |
Line 1334 __END__
|
Line 1325 __END__
|
|
|
=pod |
=pod |
|
|
=back |
|
|
|
=cut |
|
|
|
|
=cut |