version 1.70, 2006/08/01 14:04:59
|
version 1.74, 2007/10/08 09:22:50
|
Line 327 sub end_organicresponse {
|
Line 327 sub end_organicresponse {
|
} |
} |
$result.=&Apache::response::answer_footer('organicresponse'); |
$result.=&Apache::response::answer_footer('organicresponse'); |
} |
} |
|
if ($target eq 'web') { |
|
&Apache::response::setup_prior_tries_hash(\&format_prior_answer_organic, |
|
['molecule']) |
|
} |
|
|
if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || |
if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || |
$target eq 'tex' || $target eq 'analyze') { |
$target eq 'tex' || $target eq 'analyze') { |
&Apache::lonxml::increment_counter(&Apache::response::repetition()); |
&Apache::lonxml::increment_counter(&Apache::response::repetition(), $partid); |
|
if ($target eq 'analyze') { |
|
&Apache::lonhomework::set_bubble_lines(); |
|
} |
} |
} |
&Apache::response::end_response(); |
&Apache::response::end_response(); |
return $result; |
return $result; |
} |
} |
|
|
|
sub format_prior_answer_organic { |
|
my ($mode,$answer,$other_data) = @_; |
|
my $result=&mt('Smile representation: "[_1]"','<tt>'.$answer.'</tt>'); |
|
my $jme=$other_data->[0]; |
|
$result.=&jme_img($jme,$answer,400); |
|
return $result; |
|
} |
|
|
sub start_organicstructure { |
sub start_organicstructure { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
my $result; |
my $result; |
Line 467 sub start_reactionresponse {
|
Line 482 sub start_reactionresponse {
|
&Apache::lonxml::default_homework_load($safeeval); |
&Apache::lonxml::default_homework_load($safeeval); |
} |
} |
@Apache::scripttag::parser_env = @_; |
@Apache::scripttag::parser_env = @_; |
$Apache::inputtags::answertxt{$id}=&Apache::run::run("return &chemparse(q\0$ans\0);",$safeeval); |
$Apache::inputtags::answertxt{$id}=[&Apache::run::run("return &chemparse(q\0$ans\0);",$safeeval)]; |
} |
} |
} elsif ($target eq "edit") { |
} elsif ($target eq "edit") { |
$result .=&Apache::edit::tag_start($target,$token); |
$result .=&Apache::edit::tag_start($target,$token); |
Line 542 sub end_reactionresponse {
|
Line 557 sub end_reactionresponse {
|
} |
} |
$result.=&Apache::response::answer_footer('reactionresponse'); |
$result.=&Apache::response::answer_footer('reactionresponse'); |
} |
} |
|
if ($target eq 'web') { |
|
&Apache::response::setup_prior_tries_hash(\&format_prior_response_reaction); |
|
} |
|
|
if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || |
if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || |
$target eq 'tex' || $target eq 'analyze') { |
$target eq 'tex' || $target eq 'analyze') { |
&Apache::lonxml::increment_counter(&Apache::response::repetition()); |
&Apache::lonxml::increment_counter(&Apache::response::repetition(), $partid); |
} |
} |
&Apache::response::end_response(); |
&Apache::response::end_response(); |
return $result; |
return $result; |
} |
} |
|
|
|
sub format_prior_response_reaction { |
|
my ($mode,$answer) =@_; |
|
return '<span class="LC_prior_reaction">'. |
|
&HTML::Entities::encode($answer,'"<>&').'</span>'; |
|
} |
|
|
sub start_chem { |
sub start_chem { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_; |
my $result = ''; |
my $result = ''; |