--- loncom/homework/inputtags.pm 2004/04/27 07:09:45 1.139 +++ loncom/homework/inputtags.pm 2004/05/20 23:11:12 1.142 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.139 2004/04/27 07:09:45 albertel Exp $ +# $Id: inputtags.pm,v 1.142 2004/05/20 23:11:12 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -425,7 +425,7 @@ sub decideoutput { if ($target ne 'tex') {$message.=&Apache::loncommon::help_open_topic('Physical_Units');} $bgcolor=$possiblecolors{'not_charged_try'}; $button=1; - } elsif ($awrad eq 'UNIT_FAIL' || $award eq 'UNIT_IRRECONCIBLE') { + } elsif ($award eq 'UNIT_FAIL' || $award eq 'UNIT_IRRECONCIBLE') { $message = &mt('Incompatible units. No conversion found between "[_1]" and the required units.',''.$awardmsg.''); if ($target ne 'tex') {$message.=&Apache::loncommon::help_open_topic('Physical_Units');} $bgcolor=$possiblecolors{'not_charged_try'}; @@ -482,9 +482,26 @@ sub removealldata { } } +sub hidealldata { + my ($id)=@_; + foreach my $key (keys(%Apache::lonhomework::results)) { + if (($key =~ /^resource\.\Q$id\E\./) && ($key !~ /\.collaborators$/)) { + &Apache::lonxml::debug("Hidding $key"); + my $newkey=$key; + $newkey=~s/^(resource\.\Q$id\E\.[^\.]+\.)(.*)$/${1}hidden${2}/; + $Apache::lonhomework::results{$newkey}= + $Apache::lonhomework::results{$key}; + delete($Apache::lonhomework::results{$key}); + } + } +} + sub setgradedata { my ($award,$msg,$id,$previously_used) = @_; # if the student already has it correct, don't modify the status + if ($Apache::lonhomework::scantronmode && defined($ENV{'form.CODE'})) { + $Apache::lonhomework::results{"resource.CODE"}=$ENV{'form.CODE'}; + } if (!$Apache::lonhomework::scantronmode && $Apache::inputtags::status['-1'] ne 'CAN_ANSWER' && $Apache::inputtags::status['-1'] ne 'CANNOT_ANSWER') {