--- loncom/homework/structuretags.pm 2007/10/16 23:20:25 1.404 +++ loncom/homework/structuretags.pm 2007/10/30 00:09:30 1.406 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.404 2007/10/16 23:20:25 albertel Exp $ +# $Id: structuretags.pm,v 1.406 2007/10/30 00:09:30 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -332,35 +332,44 @@ sub option { sub problem_web_to_edit_header { my ($rndseed)=@_; - my $result.=''; + my $result .= '
'; + + $result.='
'; + $result.=''; $result .= ''; - $result .= ' - - - - -
'; + + if (!$Apache::lonhomework::parsing_a_task) { + $result .= + '
'. + &mt('Problem Testing'). + &Apache::loncommon::help_open_topic('Problem_Editor_Testing_Area'). + '
'; + } else { + $result .= + '
'. + &mt('Task Testing'). + '
'; + } + my $show_all_foils_text = ($Apache::lonhomework::parsing_a_task) ? &mt(' Show All Instances') : &mt(' Show All Foils'); - if (defined($env{'form.showallfoils'})) { $result.='checked="on"'; } - $result.= ' />'.$show_all_foils_text.''. - &Apache::loncommon::help_open_topic('Problem_Editor_Testing_Area','Testing Problems'). - '
'; - $result.=&mt('Apply style file: ').' -&').'" /> - '.&mt('Select').' - -
'; + my $show_all= ''; + + + $result .= '
'; if (!$Apache::lonhomework::parsing_a_task) { $result.=" - -Problem Status: +
+ +".&mt("Problem Status:")." - - -Problem Type: + + +".&mt("Problem Type:")." - - -Feedback Mode: + +$show_all +
+
+ +".&mt("Feedback Mode:")." - - -
"; - my $numtoanalyze=$env{'form.numtoanalyze'}; - if (!$numtoanalyze) { $numtoanalyze=20; } - $result.= ' for - '.&mt('versions of this problem'). - '.'.&Apache::loncommon::help_open_topic("Analyze_Problem", - '',undef,undef,300). - '
'; + +"; + } elsif ($Apache::lonhomework::parsing_a_task) { $result.=" - -Problem Status: +
+ +".&mt("Problem Status:")." - - -
"; + +$show_all +"; + } + + $result.=' + + '.&mt('Apply style file: ').' + &').'" /> + '.&mt('Select').' + +
+ + + +
+
+
+ + + '; + + if (!$Apache::lonhomework::parsing_a_task) { + my $numtoanalyze=$env{'form.numtoanalyze'}; + if (!$numtoanalyze) { $numtoanalyze=20; } + $result .= &mt('[_1] for [_2] versions of this problem.', + '', + ''). + &Apache::loncommon::help_open_topic("Analyze_Problem", + '',undef,undef,300); } + + $result.=' +
+
+
'; return $result; } @@ -576,19 +616,19 @@ sub init_problem_globals { if ($type eq 'problem') { $Apache::inputtags::part='0'; @Apache::inputtags::partlist=('0'); - $Apache::lonhomework::problemstatus=&get_problem_status('0'); + &Apache::lonhomework::set_show_problem_status(&get_problem_status('0')); $Apache::lonhomework::ignore_response_errors=0; } elsif ($type eq 'library') { $Apache::inputtags::part=''; @Apache::inputtags::partlist=(); - $Apache::lonhomework::problemstatus=''; + &Apache::lonhomework::reset_show_problem_status(); $Apache::lonhomework::ignore_response_errors=1; } elsif ($type eq 'Task') { $Apache::inputtags::part='0'; @Apache::inputtags::partlist=('0'); - $Apache::lonhomework::problemstatus=''; + &Apache::lonhomework::reset_show_problem_status(); $Apache::lonhomework::ignore_response_errors=1; } @Apache::inputtags::responselist = (); @@ -617,8 +657,8 @@ sub reset_problem_globals { undef($Apache::lonhomework::default_type); undef($Apache::lonhomework::type); undef($Apache::lonhomework::scantronmode); - undef($Apache::lonhomework::problemstatus); undef($Apache::lonhomework::ignore_response_errors); + &Apache::lonhomework::reset_show_problem_status(); } sub set_problem_state { @@ -1488,7 +1528,7 @@ sub start_part { @Apache::inputtags::response=(); @Apache::inputtags::previous=(); @Apache::inputtags::previous_version=(); - $Apache::lonhomework::problemstatus=&get_problem_status($id); + &Apache::lonhomework::set_show_problem_status(&get_problem_status($id)); &Apache::response::reset_params(); my $hidden=&Apache::loncommon::check_if_partid_hidden($Apache::inputtags::part);