--- loncom/homework/chemresponse.pm 2008/09/05 16:09:39 1.79
+++ loncom/homework/chemresponse.pm 2008/09/21 20:09:06 1.81
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# chemical equation style response
#
-# $Id: chemresponse.pm,v 1.79 2008/09/05 16:09:39 riegler Exp $
+# $Id: chemresponse.pm,v 1.81 2008/09/21 20:09:06 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -342,7 +342,6 @@ sub end_organicresponse {
}
}
if (($target eq 'web' ) && ($Apache::lonhomework::type ne 'exam') && ($Apache::inputtags::status['-1'] eq 'CAN_ANSWER')){
-# hierher
my $options=&Apache::lonxml::get_param('options',$parstack,
$safeeval);
my $shown_text;
@@ -455,6 +454,8 @@ sub edit_reaction_button {
my $field_es=&escape($field);
my $reaction_es=&escape($reaction);
my $docopen=&Apache::lonhtmlcommon::javascript_docopen();
+ my $iconpath=$Apache::lonnet::perlvar{'lonIconsURL'};
+ my $display=&mt('Edit Answer');
my $start_page =
&Apache::loncommon::start_page('LON-CAPA Reaction Editor',undef,
{'frameset' => 1,
@@ -476,7 +477,7 @@ sub edit_reaction_button {
}
// -->
-
+
EDITREACTION
return $result;
}
@@ -490,12 +491,6 @@ sub start_reactionresponse {
} elsif ($target eq 'web') {
my $partid = $Apache::inputtags::part;
my $id = $Apache::inputtags::response['-1'];
- my $reaction=$Apache::lonhomework::history{"resource.$partid.$id.submission"};
- if ($reaction eq '') { $reaction=&Apache::lonxml::get_param('initial',$parstack,$safeeval); }
- my $status=$Apache::inputtags::status['-1'];
- if ($status eq 'CAN_ANSWER') {
- $result.=&edit_reaction_button($id,"HWVAL_$id",$reaction);
- }
if ( &Apache::response::show_answer() ) {
my $ans=&Apache::lonxml::get_param('answer',$parstack,$safeeval);
if (!$Apache::lonxml::default_homework_loaded) {
@@ -510,12 +505,9 @@ sub start_reactionresponse {
$safeeval);
$result .=''.
&Apache::edit::text_arg('Answer:','answer',$token,40);
- $result .=&edit_reaction_button($id,&Apache::edit::html_element_name('answer'),$answer).'';
my $initial=&Apache::lonxml::get_param('initial',$parstack,$safeeval);
$result.=''.
&Apache::edit::text_arg('Initial Reaction:','initial',$token,40);
- $result .=&edit_reaction_button($id,&Apache::edit::html_element_name('initial'),$initial).'';
-
$result .=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
} elsif ($target eq 'modified') {
my $constructtag=&Apache::edit::get_new_args($token,$parstack,
@@ -589,6 +581,12 @@ sub end_reactionresponse {
&Apache::lonhomework::set_bubble_lines();
}
}
+ my $status=$Apache::inputtags::status['-1'];
+ if (($target eq 'web') && ($Apache::lonhomework::type ne 'exam') && ($status eq 'CAN_ANSWER')) {
+ my $reaction=$Apache::lonhomework::history{"resource.$partid.$id.submission"};
+ if ($reaction eq '') { $reaction=&Apache::lonxml::get_param('initial',$parstack,$safeeval); }
+ $result.=&edit_reaction_button($id,"HWVAL_$id",$reaction);
+ }
&Apache::response::end_response();
return $result;
}