--- loncom/homework/lonhomework.pm 2003/06/16 21:32:43 1.135 +++ loncom/homework/lonhomework.pm 2003/09/15 18:43:53 1.141 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.135 2003/06/16 21:32:43 www Exp $ +# $Id: lonhomework.pm,v 1.141 2003/09/15 18:43:53 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -50,7 +50,7 @@ use Apache::essayresponse(); use Apache::externalresponse(); use Apache::rankresponse(); use Apache::matchresponse(); -#use Apache::chemresponse(); +use Apache::chemresponse(); use Apache::Constants qw(:common); use HTML::Entities(); use Apache::loncommon(); @@ -69,10 +69,14 @@ sub get_target { } elsif ( defined($ENV{'form.grade_target'} ) && ($Apache::lonhomework::viewgrades eq 'F' )) { return ($ENV{'form.grade_target'}); + } elsif (defined($ENV{'form.grade_target'} ) + && ($ENV{'form.grade_target'} eq 'answer')) { + return ($ENV{'form.grade_target'}); } if ( defined($ENV{'form.submitted'}) && - ( !defined($ENV{'form.resetdata'}))) { + ( !defined($ENV{'form.resetdata'})) && + ( !defined($ENV{'form.newrandomization'}))) { return ('grade', 'web'); } else { return ('web'); @@ -91,7 +95,8 @@ sub get_target { if ( $ENV{'form.problemmode'} eq 'View' || $ENV{'form.problemmode'} eq 'Discard Edits and View') { if ( defined($ENV{'form.submitted'}) && - (!defined($ENV{'form.resetdata'})) ) { + (!defined($ENV{'form.resetdata'})) && + (!defined($ENV{'form.newrandomization'}))) { return ('grade', 'web','answer'); } else { return ('web','answer'); @@ -469,15 +474,8 @@ sub editxmlmode { &renderpage($request,$file); } else { my ($rows,$cols) = &Apache::edit::textarea_sizes(\$problem); - my $xml_help = '
'. - &Apache::loncommon::help_open_topic("Problem_Editor_XML_Index",'Problem Editing Help') - .' | '. - &Apache::loncommon::help_open_topic("Greek_Symbols",'Greek Symbols', - undef,undef,600) - .' | '. - &Apache::loncommon::help_open_topic("Other_Symbols",'Other Symbols', - undef,undef,600) - .' |