version 1.259.2.1, 2009/09/23 03:15:18
|
version 1.261, 2010/02/28 23:27:36
|
Line 573 sub valid_award {
|
Line 573 sub valid_award {
|
'BAD_FORMULA', 'INTERNAL_ERROR', 'SIG_FAIL', 'INCORRECT', |
'BAD_FORMULA', 'INTERNAL_ERROR', 'SIG_FAIL', 'INCORRECT', |
'MISORDERED_RANK', 'INVALID_FILETYPE', |
'MISORDERED_RANK', 'INVALID_FILETYPE', |
'EXCESS_FILESIZE', 'DRAFT', |
'EXCESS_FILESIZE', 'DRAFT', |
'SUBMITTED', 'ASSIGNED_SCORE', |
'SUBMITTED', 'SUBMITTED_CREDIT', |
'APPROX_ANS', 'EXACT_ANS','COMMA_FAIL') { |
'ANONYMOUS', 'ANONYMOUS_CREDIT', |
|
'ASSIGNED_SCORE', 'APPROX_ANS', |
|
'EXACT_ANS','COMMA_FAIL') { |
if ($award eq $possibleaward) { return 1; } |
if ($award eq $possibleaward) { return 1; } |
} |
} |
return 0; |
return 0; |
Line 588 sub valid_award {
|
Line 590 sub valid_award {
|
'UNIT_NOTNEEDED', 'WANTED_NUMERIC', 'BAD_FORMULA', 'INTERNAL_ERROR', |
'UNIT_NOTNEEDED', 'WANTED_NUMERIC', 'BAD_FORMULA', 'INTERNAL_ERROR', |
'COMMA_FAIL', 'SIG_FAIL', 'INCORRECT', 'MISORDERED_RANK', |
'COMMA_FAIL', 'SIG_FAIL', 'INCORRECT', 'MISORDERED_RANK', |
'INVALID_FILETYPE', 'EXCESS_FILESIZE', 'DRAFT', 'SUBMITTED', |
'INVALID_FILETYPE', 'EXCESS_FILESIZE', 'DRAFT', 'SUBMITTED', |
|
'SUBMITTED_CREDIT', 'ANONYMOUS', 'ANONYMOUS_CREDIT', |
'ASSIGNED_SCORE', 'APPROX_ANS', 'EXACT_ANS'); |
'ASSIGNED_SCORE', 'APPROX_ANS', 'EXACT_ANS'); |
my $i=0; |
my $i=0; |
my %fwd_awards = map { ($_,$i++) } @awards; |
my %fwd_awards = map { ($_,$i++) } @awards; |
Line 611 sub hide_award {
|
Line 614 sub hide_award {
|
return 1; |
return 1; |
} |
} |
if ($award =~ |
if ($award =~ |
/^(?:EXACT_ANS|APPROX_ANS|SUBMITTED|ASSIGNED_SCORE|INCORRECT)/) { |
/^(?:EXACT_ANS|APPROX_ANS|SUBMITTED|SUBMITTED_CREDIT|ANONYMOUS|ANONYMOUS_CREDIT|ASSIGNED_SCORE|INCORRECT)/) { |
return 1; |
return 1; |
} |
} |
return 0; |
return 0; |
Line 869 sub decideoutput {
|
Line 872 sub decideoutput {
|
$css_class=$possible_class{'charged_try'}; |
$css_class=$possible_class{'charged_try'}; |
$button=1; |
$button=1; |
} elsif ($award eq 'SUBMITTED') { |
} elsif ($award eq 'SUBMITTED') { |
if ($env{'request.uri'} eq '/res/gci/gci/internal/submission.problem') { |
$message = &mt("Your submission has been recorded."); |
if ($target eq 'web') { |
|
$message .= '<br />'.&mt('Thank you for making a submission to the Geosciences Concept Inventory via the GCI Web Center.'); |
|
} |
|
} |
|
$css_class=$possible_class{'no_grade'}; |
$css_class=$possible_class{'no_grade'}; |
$button=1; |
$button=1; |
|
} elsif ($award eq 'SUBMITTED_CREDIT') { |
|
$message = &mt("Your submission has been recorded, and credit awarded."); |
|
$css_class=$possible_class{'correct'}; |
|
$button=1; |
|
} elsif ($award eq 'ANONYMOUS') { |
|
$message = &mt("Your anonymous submission has been recorded."); |
|
$css_class=$possible_class{'no_grade'}; |
|
$button=1; |
|
} elsif ($award eq 'ANONYMOUS_CREDIT') { |
|
$message = &mt("Your anonymous submission has been recorded, and credit awarded."); |
|
$css_class=$possible_class{'correct'}; |
} elsif ($award eq 'DRAFT') { |
} elsif ($award eq 'DRAFT') { |
$message = &mt("Copy saved but not submitted."); |
$message = &mt("Copy saved but not submitted."); |
$css_class=$possible_class{'not_charged_try'}; |
$css_class=$possible_class{'not_charged_try'}; |
Line 926 sub decideoutput {
|
Line 936 sub decideoutput {
|
if (&Apache::lonhomework::hide_problem_status() |
if (&Apache::lonhomework::hide_problem_status() |
&& $Apache::inputtags::status[-1] ne 'SHOW_ANSWER' |
&& $Apache::inputtags::status[-1] ne 'SHOW_ANSWER' |
&& &hide_award($award)) { |
&& &hide_award($award)) { |
if ($env{'request.uri'} eq '/res/gci/gci/internal/submission.problem') { |
$message = &mt("Answer Submitted: Your final submission will be graded after the due date."); |
if ($target eq 'web') { |
$css_class=$possible_class{'no_grade'}; |
$message = &mt("Your submission has been recorded.").'<br />'. |
$button=1; |
&mt('Thank you for making a submission to the Geosciences Concept Inventory via the GCI Web Center.'); |
|
} |
|
} else { |
|
$message = &mt("Answer Submitted: Your final submission will be graded after the due date."); |
|
} |
|
$css_class=$possible_class{'no_grade'}; |
|
$button=1; |
|
} |
} |
if ($Apache::inputtags::status[-1] eq 'SHOW_ANSWER' && |
if ($Apache::inputtags::status[-1] eq 'SHOW_ANSWER' && |
!$added_computer_text && $target ne 'tex') { |
!$added_computer_text && $target ne 'tex') { |
Line 1046 sub setgradedata {
|
Line 1049 sub setgradedata {
|
$Apache::lonhomework::results{"resource.$id.solved"} = |
$Apache::lonhomework::results{"resource.$id.solved"} = |
$solvemsg; |
$solvemsg; |
$Apache::lonhomework::results{"resource.$id.awarded"} = '1'; |
$Apache::lonhomework::results{"resource.$id.awarded"} = '1'; |
|
} elsif ( $award eq 'SUBMITTED_CREDIT' ) { |
|
$Apache::lonhomework::results{"resource.$id.tries"} = |
|
$Apache::lonhomework::history{"resource.$id.tries"} + 1; |
|
$Apache::lonhomework::results{"resource.$id.solved"} = |
|
'credit_attempted'; |
|
$Apache::lonhomework::results{"resource.$id.awarded"} = '1'; |
|
} elsif ( $award eq 'ANONYMOUS_CREDIT' ) { |
|
$Apache::lonhomework::results{"resource.$id.tries"} = |
|
$Apache::lonhomework::history{"resource.$id.tries"} + 1; |
|
$Apache::lonhomework::results{"resource.$id.solved"} = |
|
'credit_attempted'; |
|
$Apache::lonhomework::results{"resource.$id.awarded"} = '1'; |
} elsif ( $award eq 'INCORRECT' ) { |
} elsif ( $award eq 'INCORRECT' ) { |
$Apache::lonhomework::results{"resource.$id.tries"} = |
$Apache::lonhomework::results{"resource.$id.tries"} = |
$Apache::lonhomework::history{"resource.$id.tries"} + 1; |
$Apache::lonhomework::history{"resource.$id.tries"} + 1; |
Line 1060 sub setgradedata {
|
Line 1075 sub setgradedata {
|
$Apache::lonhomework::history{"resource.$id.tries"} + 1; |
$Apache::lonhomework::history{"resource.$id.tries"} + 1; |
$Apache::lonhomework::results{"resource.$id.solved"} = |
$Apache::lonhomework::results{"resource.$id.solved"} = |
'ungraded_attempted'; |
'ungraded_attempted'; |
|
} elsif ( $award eq 'ANONYMOUS' ) { |
|
$Apache::lonhomework::results{"resource.$id.tries"} = |
|
$Apache::lonhomework::history{"resource.$id.tries"} + 1; |
|
$Apache::lonhomework::results{"resource.$id.solved"} = |
|
'ungraded_attempted'; |
} elsif ( $award eq 'DRAFT' ) { |
} elsif ( $award eq 'DRAFT' ) { |
$Apache::lonhomework::results{"resource.$id.solved"} = ''; |
$Apache::lonhomework::results{"resource.$id.solved"} = ''; |
} elsif ( $award eq 'NO_RESPONSE' ) { |
} elsif ( $award eq 'NO_RESPONSE' ) { |
Line 1119 sub setgradedata {
|
Line 1139 sub setgradedata {
|
if ($award eq 'SUBMITTED') { |
if ($award eq 'SUBMITTED') { |
&Apache::response::add_to_gradingqueue(); |
&Apache::response::add_to_gradingqueue(); |
} |
} |
|
if (($Apache::lonhomework::type eq 'anonsurvey') || |
|
($Apache::lonhomework::type eq 'anonsurveycred')) { |
|
$Apache::lonhomework::results{"resource.$id.type"} = $Apache::lonhomework::type; |
|
} |
} |
} |
|
|
sub find_which_previous { |
sub find_which_previous { |
Line 1233 sub get_grade_messages {
|
Line 1257 sub get_grade_messages {
|
if ( $maxtries eq 'con_lost' ) { $maxtries = '0'; } |
if ( $maxtries eq 'con_lost' ) { $maxtries = '0'; } |
my $tries_text=&mt('Tries'); |
my $tries_text=&mt('Tries'); |
if ( $Apache::lonhomework::type eq 'survey' || |
if ( $Apache::lonhomework::type eq 'survey' || |
|
$Apache::lonhomework::type eq 'surveycred' || |
|
$Apache::lonhomework::type eq 'anonsurvey' || |
|
$Apache::lonhomework::type eq 'anonsurveycred' || |
$Apache::lonhomework::parsing_a_task) { |
$Apache::lonhomework::parsing_a_task) { |
$tries_text=&mt('Submissions'); |
$tries_text=&mt('Submissions'); |
} |
} |
Line 1248 sub get_grade_messages {
|
Line 1275 sub get_grade_messages {
|
$trystr = '\vskip 0 mm '; |
$trystr = '\vskip 0 mm '; |
} |
} |
} else { |
} else { |
$trystr = '<td><span class="LC_nobreak">'; |
$trystr = '<td><span class="LC_nobreak">'.$tries_text." $tries"; |
my %parmhash=&Apache::lonnet::coursedescription($env{'request.course.id'}); |
if ($Apache::lonhomework::parsing_a_task) { |
if ($parmhash{'suppress_tries'} ne 'yes') { |
} elsif($env{'request.state'} ne 'construct') { |
$trystr .= "$tries_text $tries"; |
$trystr.="/$maxtries"; |
if ($Apache::lonhomework::parsing_a_task) { |
} else { |
} elsif($env{'request.state'} ne 'construct') { |
if (defined($Apache::inputtags::params{'maxtries'})) { |
$trystr.="/$maxtries"; |
$trystr.="/".$Apache::inputtags::params{'maxtries'}; |
} else { |
} |
if (defined($Apache::inputtags::params{'maxtries'})) { |
} |
$trystr.="/".$Apache::inputtags::params{'maxtries'}; |
$trystr.="</span></td>"; |
} |
|
} |
|
} |
|
$trystr.="</span></td>"; |
|
} |
} |
} |
} |
|
|
Line 1302 sub gradestatus {
|
Line 1325 sub gradestatus {
|
undef($previousmsg); |
undef($previousmsg); |
} |
} |
if ( $showbutton ) { |
if ( $showbutton ) { |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
my $submit_text = &mt('Submit Answer'); |
|
if ($env{'request.uri'} eq '/res/gci/gci/internal/submission.problem') { |
|
$submit_text = &mt('Submit Questions'); |
|
} |
|
$button = |
$button = |
'<input |
'<input onmouseup="javascript:setSubmittedPart(\''.$id.'\')" |
onmouseup="javascript:setSubmittedPart(\''.$id.'\')" |
type="submit" name="submit_'.$id.'" |
onsubmit="javascript:setSubmittedPart(\''.$id.'\')" |
value="'.&mt('Submit Answer').'" />'; |
type="submit" name="submit_'.$id.'" |
|
value="'.$submit_text.'" />'; |
|
} |
} |
} |
} |
|
|
Line 1420 sub previous_tries {
|
Line 1437 sub previous_tries {
|
$prefix =~ tr{.}{_}; |
$prefix =~ tr{.}{_}; |
my $function_name = "LONCAPA_previous_tries_".$prefix. |
my $function_name = "LONCAPA_previous_tries_".$prefix. |
$Apache::lonxml::curdepth.'_'.$env{'form.counter'}; |
$Apache::lonxml::curdepth.'_'.$env{'form.counter'}; |
my $triestext = &mt('Previous Tries'); |
|
if ($env{'request.uri'} eq '/res/gci/gci/internal/submission.problem') { |
|
$triestext = &mt('Submission History'); |
|
} |
|
my $result ="<script type=\"text/javascript\"> |
my $result ="<script type=\"text/javascript\"> |
// <![CDATA[ |
// <![CDATA[ |
function $function_name() {newWindow=open('','new_W','width=500,height=500,scrollbars=1,resizable=yes');newWindow.$windowopen;newWindow.document.writeln('$start_page $output $end_page');newWindow.document.close();newWindow.focus()} |
function $function_name() {newWindow=open('','new_W','width=500,height=500,scrollbars=1,resizable=yes');newWindow.$windowopen;newWindow.document.writeln('$start_page $output $end_page');newWindow.document.close();newWindow.focus()} |
// ]]> |
// ]]> |
</script><a href=\"javascript:$function_name();void(0);\">".$triestext."</a><br />"; |
</script><a href=\"javascript:$function_name();void(0);\">".&mt("Previous Tries")."</a><br />"; |
#use Data::Dumper; |
#use Data::Dumper; |
#&Apache::lonnet::logthis(&Dumper(\%Apache::inputtags::submission_display)); |
#&Apache::lonnet::logthis(&Dumper(\%Apache::inputtags::submission_display)); |
return $result; |
return $result; |