version 1.507, 2008/02/04 23:30:05
|
version 1.509, 2008/02/06 00:39:11
|
Line 3960 sub csvuploadassign {
|
Line 3960 sub csvuploadassign {
|
$grades{$store_key}=$entries{$fields{$dest}}; |
$grades{$store_key}=$entries{$fields{$dest}}; |
} |
} |
} |
} |
if (! %grades) { push(@skipped,"$username:$domain no data to save"); } |
if (! %grades) { |
$grades{"resource.regrader"}="$env{'user.name'}:$env{'user.domain'}"; |
push(@skipped,&mt("[_1]: no data to save","$username:$domain")); |
my $result=&Apache::lonnet::cstore(\%grades,$symb, |
} else { |
|
$grades{"resource.regrader"}="$env{'user.name'}:$env{'user.domain'}"; |
|
my $result=&Apache::lonnet::cstore(\%grades,$symb, |
$env{'request.course.id'}, |
$env{'request.course.id'}, |
$domain,$username); |
$domain,$username); |
if ($result eq 'ok') { |
if ($result eq 'ok') { |
$request->print('.'); |
$request->print('.'); |
} else { |
} else { |
$request->print("<p> |
$request->print("<p><span class=\"LC_error\">". |
<span class=\"LC_error\"> |
&mt("Failed to save data for student [_1]. Message when trying to save was: [_2]", |
Failed to save student $username:$domain. |
"$username:$domain",$result)."</span></p>"); |
Message when trying to save was ($result) |
} |
</span> |
$request->rflush(); |
</p>" ); |
$countdone++; |
} |
} |
$request->rflush(); |
|
$countdone++; |
|
} |
} |
$request->print("<br />Saved $countdone students\n"); |
$request->print('<br /><span class="LC_info">'.&mt("Saved [_1] students",$countdone)."</span>\n"); |
if (@skipped) { |
if (@skipped) { |
$request->print('<p><h4><b>Skipped Students</b></h4></p>'); |
$request->print('<p><span class="LC_warning">'.&mt('Skipped Students').'</span></p>'); |
foreach my $student (@skipped) { $request->print("$student<br />\n"); } |
foreach my $student (@skipped) { $request->print("$student<br />\n"); } |
} |
} |
if (@notallowed) { |
if (@notallowed) { |
$request->print('<p><span class="LC_error">Students Not Allowed to Modify</span></p>'); |
$request->print('<p><span class="LC_error">'.&mt('Students Not Allowed to Modify').'</span></p>'); |
foreach my $student (@notallowed) { $request->print("$student<br />\n"); } |
foreach my $student (@notallowed) { $request->print("$student<br />\n"); } |
} |
} |
$request->print("<br />\n"); |
$request->print("<br />\n"); |
Line 4681 my %bubble_lines_per_response; # no.
|
Line 4681 my %bubble_lines_per_response; # no.
|
|
|
my %first_bubble_line; # First bubble line no. for each bubble. |
my %first_bubble_line; # First bubble line no. for each bubble. |
|
|
my %subdivided_bubble_lines; # no. bubble lines for optionresponse |
my %subdivided_bubble_lines; # no. bubble lines for optionresponse, |
# or matchresponse where an individual |
# matchresponse or rankresponse, where |
# response can have multiple lines |
# an individual response can have multiple |
|
# lines |
|
|
my %responsetype_per_response; # responsetype for each response |
my %responsetype_per_response; # responsetype for each response |
|
|
Line 6792 for multi and missing bubble cases).
|
Line 6793 for multi and missing bubble cases).
|
Numbered from 0 (but question numbers are from |
Numbered from 0 (but question numbers are from |
1. |
1. |
%first_bubble_line - Starting bubble line for each question. |
%first_bubble_line - Starting bubble line for each question. |
%subdivided_bubble_lines - optionresponse and matchresponse type |
%subdivided_bubble_lines - optionresponse, matchresponse and rankresponse |
problems render as separate sub-questions, |
type problems render as separate sub-questions, |
in exam mode. This hash contains a |
in exam mode. This hash contains a |
comma-separated list of the lines per |
comma-separated list of the lines per |
sub-question. |
sub-question. |
Line 7113 sub scantron_validate_doublebubble {
|
Line 7114 sub scantron_validate_doublebubble {
|
which are the total number of bubble, lines, the number of bubble |
which are the total number of bubble, lines, the number of bubble |
lines for response n and number of the first bubble line for response n, |
lines for response n and number of the first bubble line for response n, |
and a comma separated list of numbers of bubble lines for sub-questions |
and a comma separated list of numbers of bubble lines for sub-questions |
(for optionresponse items only), for response n. |
(for optionresponse, matchresponse, and rankresponse items), for response n. |
|
|
=cut |
=cut |
|
|
Line 7186 sub scantron_get_maxbubble {
|
Line 7187 sub scantron_get_maxbubble {
|
|
|
# TODO - make this a persistent hash not an array. |
# TODO - make this a persistent hash not an array. |
|
|
# optionresponse and matchresponse type items render as |
# optionresponse, matchresponse and rankresponse type items |
# separate sub-questions in exam mode. |
# render as separate sub-questions in exam mode. |
if (($analysis{$part_id.'.type'} eq 'optionresponse') || |
if (($analysis{$part_id.'.type'} eq 'optionresponse') || |
($analysis{$part_id.'.type'} eq 'matchresponse')) { |
($analysis{$part_id.'.type'} eq 'matchresponse') || |
|
($analysis{$part_id.'.type'} eq 'rankresponse')) { |
my ($numbub,$numshown); |
my ($numbub,$numshown); |
if ($analysis{$part_id.'.type'} eq 'optionresponse') { |
if ($analysis{$part_id.'.type'} eq 'optionresponse') { |
if (ref($analysis{$part_id.'.options'}) eq 'ARRAY') { |
if (ref($analysis{$part_id.'.options'}) eq 'ARRAY') { |
Line 7199 sub scantron_get_maxbubble {
|
Line 7201 sub scantron_get_maxbubble {
|
if (ref($analysis{$part_id.'.items'}) eq 'ARRAY') { |
if (ref($analysis{$part_id.'.items'}) eq 'ARRAY') { |
$numbub = scalar(@{$analysis{$part_id.'.items'}}); |
$numbub = scalar(@{$analysis{$part_id.'.items'}}); |
} |
} |
|
} elsif ($analysis{$part_id.'.type'} eq 'rankresponse') { |
|
if (ref($analysis{$part_id.'.foils'}) eq 'ARRAY') { |
|
$numbub = scalar(@{$analysis{$part_id.'.foils'}}); |
|
} |
} |
} |
if (ref($analysis{$part_id.'.shown'}) eq 'ARRAY') { |
if (ref($analysis{$part_id.'.shown'}) eq 'ARRAY') { |
$numshown = scalar(@{$analysis{$part_id.'.shown'}}); |
$numshown = scalar(@{$analysis{$part_id.'.shown'}}); |