--- loncom/homework/structuretags.pm 2012/02/01 18:51:52 1.465.2.14.2.1 +++ loncom/homework/structuretags.pm 2010/06/05 19:36:57 1.469 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.465.2.14.2.1 2012/02/01 18:51:52 raeburn Exp $ +# $Id: structuretags.pm,v 1.469 2010/06/05 19:36:57 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -128,17 +128,8 @@ sub homework_js { &setmode_javascript(). <<'JS'; JS } @@ -162,55 +153,10 @@ JS sub setmode_javascript { return <<"ENDSCRIPT"; -ENDSCRIPT -} - -sub file_delchk_js { - my $delfilewarn = &mt('You have indicated you wish to remove some files previously included in your submission.').'\\n'. - &mt('Continue submission with these files removed?'); - return <<"ENDSCRIPT"; - ENDSCRIPT } @@ -231,17 +177,12 @@ sub page_start { $parstack,$parser,$safeeval); } - $extra_head .= &homework_js(). - &Apache::lonhtmlcommon::dragmath_js("EditMathPopup"); - if (&Apache::lonhtmlcommon::htmlareabrowser()) { - my %textarea_args = ( - dragmath => 'math', - ); - $extra_head .= &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args); - } - my $is_task = ($env{'request.uri'} =~ /\.task$/); - if ($is_task) { - $extra_head .= &file_delchk_js(); + $extra_head .= &homework_js(); + + if ($env{'environment.wysiwygeditor'} eq 'on') { + $extra_head .= &Apache::lonhtmlcommon::dragmath_js("FCKEditMathPopup"); + } else { + $extra_head .= &Apache::lonhtmlcommon::dragmath_js("EditMathPopup"); } my %body_args; @@ -268,9 +209,6 @@ sub page_start { } elsif (!defined($found{'body'}) && $env{'request.state'} eq 'construct') { if ($target eq 'web' || $target eq 'edit') { - if ($env{'environment.remote'} ne 'off') { - $body_args{'only_body'} = 1; - } # Breadcrumbs for Construction Space &Apache::lonhtmlcommon::clear_breadcrumbs(); &Apache::lonhtmlcommon::add_breadcrumb({ @@ -304,8 +242,7 @@ sub page_start { # $body_args{'no_title'} = 1; $body_args{'force_register'} = 1; $body_args{'add_entries'} = \%add_entries; - if ($env{'environment.remote'} eq 'off' - && $env{'request.state'} eq 'construct') { + if ( $env{'request.state'} eq 'construct') { $body_args{'only_body'} = 1; } } @@ -339,9 +276,6 @@ sub page_start { if ($target eq 'edit') { $form_tag_start.=&Apache::edit::form_change_detection(); } - if ($is_task) { - $form_tag_start .= ' onsubmit="return file_deletion_check(this);"'; - } $form_tag_start.='>'."\n"; my $symb=&Apache::lonnet::symbread(); @@ -383,15 +317,9 @@ sub get_resource_name { } sub setup_rndseed { - my ($safeeval,$target)=@_; + my ($safeeval)=@_; + my $rndseed; my ($symb)=&Apache::lonnet::whichuser(); - my ($questiontype,$set_safespace,$rndseed); - if ($target eq 'analyze') { - $questiontype = $env{'form.grade_questiontype'}; - } - unless (defined($questiontype)) { - $questiontype = $Apache::lonhomework::type; - } if ($env{'request.state'} eq "construct" || $symb eq '' || $Apache::lonhomework::type eq 'practice' @@ -406,14 +334,6 @@ sub setup_rndseed { } $env{'form.rndseed'}=$rndseed; } - if (($env{'request.state'} eq "construct") && - ($Apache::lonhomework::type eq 'randomizetry')) { - my $tries = $Apache::lonhomework::history{"resource.$Apache::inputtags::part.tries"}; - if ($tries) { - $rndseed += $tries; - } - $env{'form.'.$Apache::inputtags::part.'.rndseed'}=$rndseed; - } if ( ($env{'form.resetdata'} eq &mt('New Problem Variation') && $env{'form.submitted'} eq 'yes') || $env{'form.newrandomization'} eq &mt('New Randomization')) { @@ -429,42 +349,10 @@ sub setup_rndseed { if ($Apache::lonhomework::history{'resource.CODE'}) { $rndseed=&Apache::lonnet::rndseed(); } - $set_safespace = 1; - } elsif ($questiontype eq 'randomizetry') { - if ($target eq 'analyze') { - if (defined($env{'form.grade_rndseed'})) { - $rndseed = $env{'form.grade_rndseed'}; - } - } - unless (($target eq 'analyze') && (defined($rndseed))) { - $rndseed=&Apache::lonnet::rndseed(); - my $curr_try = $Apache::lonhomework::history{"resource.$Apache::inputtags::part.tries"}; - if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') { - $curr_try ++; - } - if ($rndseed =~/^(\d+)[,:](\d+)$/) { - $rndseed = $1; - } - if ($curr_try) { - my $reqtries = &Apache::lonnet::EXT("resource.$Apache::inputtags::part.randomizeontries"); - if (($reqtries =~ /^\d+$/) && ($reqtries > 1)) { - my $inc = int(($curr_try-1)/$reqtries); - $rndseed += $inc; - } else { - $rndseed += $curr_try; - } - } - } - $set_safespace = 1; - } - if ($set_safespace) { - if ($safeeval) { - &Apache::lonxml::debug("Setting rndseed to $rndseed"); - &Apache::run::run('$external::randomseed="'.$rndseed.'";',$safeeval); - } - } - unless (($env{'request.state'} eq "construct") || ($symb eq '')) { - $env{'form.'.$Apache::inputtags::part.'.rndseed'}=$rndseed; + if ($safeeval) { + &Apache::lonxml::debug("Setting rndseed to $rndseed"); + &Apache::run::run('$external::randomseed="'.$rndseed.'";',$safeeval); + } } return $rndseed; } @@ -476,48 +364,27 @@ sub remember_problem_state { '; } -sub problem_edit_action_button { - my ($name,$action,$accesskey,$text,$flag)=@_; - my $actionscript="setmode(this.form,'$action')"; - return "\n"; -} - sub problem_edit_buttons { - my ($mode)=@_; -# Buttons that do not save - my $result='
'. - &problem_edit_action_button('subdiscview','discard','d','Discard Edits and View',1); - if ($mode eq 'editxml') { - $result.=&problem_edit_action_button('subedit','edit','e','Edit',1); - $result.=&problem_edit_action_button('subundo','undoxml','u','Undo',1); - $result.=&Apache::lonhtmlcommon::dragmath_button("LC_editxmltext",1); - } else { - $result.=&problem_edit_action_button('subeditxml','editxml','x','EditXML',1); - $result.=&problem_edit_action_button('subundo','undo','u','Undo',1); - } - $result.="\n
"; -# Buttons that save - $result.='
'; - if ($mode eq 'editxml') { - $result.=&problem_edit_action_button('subsaveedit','saveeditxml','s','Save and EditXML'); - $result.=&problem_edit_action_button('subsaveview','saveviewxml','v','Save and View'); - } else { - $result.=&problem_edit_action_button('subsaveedit','saveedit','s','Save and Edit'); - $result.=&problem_edit_action_button('subsaveview','saveview','v','Save and View'); - } - $result.="\n
\n"; - return $result; + return ' +
+ + + +
+
+ + +
'; } sub problem_edit_header { - return ''. - &remember_problem_state('edit').' + return ''. + &Apache::structuretags::remember_problem_state().'
'.&mt('Problem Editing').&Apache::loncommon::help_open_menu('Problem Editing','Problem_Editor_XML_Index',5,'Authoring').'
'. -''. &problem_edit_buttons().'
'.&Apache::lonxml::message_location().' @@ -534,6 +401,8 @@ sub problem_edit_footer {
'. + + &Apache::lonhtmlcommon::htmlareaselectactive(&Apache::lonhtmlcommon::get_htmlareafields()). "\n\n".&Apache::loncommon::end_page(); } @@ -603,7 +472,6 @@ sub problem_web_to_edit_header { ".&option('anonsurvey' ,'problemtype').&mt("Anonymous Survey Question")." ".&option('anonsurveycred' ,'problemtype').&mt("Anonymous Survey Question (with credit)")." ".&option('practice' ,'problemtype').&mt("Practice Problem")." - ".&option('randomizetry' ,'problemtype').&mt("New Randomization Each Try")." $show_all @@ -761,7 +629,9 @@ sub finalize_storage { $result=&Apache::lonnet::cstore(\%Apache::lonhomework::results, $symb,$courseid,$domain,$name); &Apache::lonxml::debug('Store return message:'.$result); - &store_aggregates($symb,$courseid); + if ($env{'request.role'} =~/^st/) { + &store_aggregates($symb,$courseid); + } } } else { &Apache::lonxml::debug('Nothing to store'); @@ -781,7 +651,7 @@ item store_aggregates() sub store_aggregates { my ($symb,$courseid) = @_; - my (%aggregate,%anoncounter,%randtrycounter); + my %aggregate; my @parts; my $cdomain = $env{'course.'.$env{'request.course.id'}.'.domain'}; my $cname = $env{'course.'.$env{'request.course.id'}.'.num'}; @@ -791,60 +661,28 @@ sub store_aggregates { } } foreach my $part (@parts) { - if ($env{'request.role'} =~/^st/) { - if ($Apache::lonhomework::results{'resource.'.$part.'.award'} - eq 'APPROX_ANS' || - $Apache::lonhomework::results{'resource.'.$part.'.award'} - eq 'EXACT_ANS') { - $aggregate{$symb."\0".$part."\0correct"} = 1; - } - if ($Apache::lonhomework::results{'resource.'.$part.'.tries'} == 1) { - $aggregate{$symb."\0".$part."\0users"} = 1; - } else { - my (undef,$last_reset) = &Apache::grades::get_last_resets($symb,$env{'request.course.id'},[$part]); - if ($last_reset) { - if (&Apache::grades::get_num_tries(\%Apache::lonhomework::history,$last_reset,$part) == 0) { - $aggregate{$symb."\0".$part."\0users"} = 1; - } - } - } - $aggregate{$symb."\0".$part."\0attempts"} = 1; + if ($Apache::lonhomework::results{'resource.'.$part.'.award'} + eq 'APPROX_ANS' || + $Apache::lonhomework::results{'resource.'.$part.'.award'} + eq 'EXACT_ANS') { + $aggregate{$symb."\0".$part."\0correct"} = 1; } - if (($Apache::lonhomework::results{'resource.'.$part.'.type'} eq 'anonsurvey') || - ($Apache::lonhomework::results{'resource.'.$part.'.type'} eq 'anonsurveycred') || - ($Apache::lonhomework::results{'resource.'.$part.'.type'} eq 'randomizetry')) { - if ($Apache::lonhomework::results{'resource.'.$part.'.type'} eq 'randomizetry') { - $randtrycounter{$symb."\0".$part} = 1; - } else { - $anoncounter{$symb."\0".$part} = 1; - } - my $needsrelease = $Apache::lonnet::needsrelease{'parameter:type:'.$Apache::lonhomework::results{'resource.'.$part.'.type'}}; - if ($needsrelease) { - my $curr_required = $env{'course.'.$env{'request.course.id'}.'.internal.releaserequired'}; - if ($curr_required eq '') { - &Apache::lonnet::update_released_required($needsrelease); - } else { - my ($currmajor,$currminor) = split(/\./,$curr_required); - my ($needsmajor,$needsminor) = split(/\./,$needsrelease); - if (($currmajor < $needsmajor) || ($currmajor == $needsmajor && $currminor < $needsminor)) { - &Apache::lonnet::update_released_required($needsrelease); - } + if ($Apache::lonhomework::results{'resource.'.$part.'.tries'} == 1) { + $aggregate{$symb."\0".$part."\0users"} = 1; + } else { + my (undef,$last_reset) = &Apache::grades::get_last_resets($symb,$env{'request.course.id'},[$part]); + if ($last_reset) { + if (&Apache::grades::get_num_tries(\%Apache::lonhomework::history,$last_reset,$part) == 0) { + $aggregate{$symb."\0".$part."\0users"} = 1; } } } + $aggregate{$symb."\0".$part."\0attempts"} = 1; } if (keys (%aggregate) > 0) { &Apache::lonnet::cinc('nohist_resourcetracker',\%aggregate, $cdomain,$cname); } - if (keys(%anoncounter) > 0) { - &Apache::lonnet::cput('nohist_anonsurveys',\%anoncounter, - $cdomain,$cname); - } - if (keys(%randtrycounter) > 0) { - &Apache::lonnet::cput('nohist_randomizetry',\%randtrycounter, - $cdomain,$cname); - } } sub checkout_msg { @@ -925,7 +763,6 @@ sub init_problem_globals { &Apache::lonhomework::reset_show_problem_status(); $Apache::lonhomework::ignore_response_errors=1; } - @Apache::functionplotresponse::callscripts=(); @Apache::inputtags::responselist = (); @Apache::inputtags::importlist = (); @Apache::inputtags::previous=(); @@ -945,9 +782,6 @@ sub reset_problem_globals { undef(%Apache::lonhomework::history); undef(%Apache::lonhomework::results); undef($Apache::inputtags::part); - if ($type eq 'Task') { - undef($Apache::inputtags::slot_name); - } #don't undef this, lonhomework.pm takes care of this, we use this to #detect if we try to do 2 problems in one file # undef($Apache::lonhomework::parsing_a_problem); @@ -956,7 +790,6 @@ sub reset_problem_globals { undef($Apache::lonhomework::type); undef($Apache::lonhomework::scantronmode); undef($Apache::lonhomework::ignore_response_errors); - undef(@Apache::functionplotresponse::callscripts); &Apache::lonhomework::reset_show_problem_status(); } @@ -1057,33 +890,16 @@ sub start_problem { if ($target eq 'tex' and $env{'request.symb'} =~ m/\.page_/) {$result='';} - if ($target eq 'analyze') { my $rndseed=&setup_rndseed($safeeval,$target); } + if ($target eq 'analyze') { my $rndseed=&setup_rndseed($safeeval); } if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex') { - #handle exam checkout - if ($Apache::lonhomework::type eq 'exam') { - my $token= - $Apache::lonhomework::history{"resource.0.outtoken"}; - if (($env{'form.doescheckout'}) && (!$token)) { - $token=&Apache::lonxml::maketoken(); - $Apache::lonhomework::history{"resource.0.outtoken"}= - $token; - } - $result.=&Apache::lonxml::printtokenheader($target,$token); - } if ($env{'form.markaccess'}) { my @interval=&Apache::lonnet::EXT("resource.0.interval"); &Apache::lonnet::set_first_access($interval[1]); } - - ($status,$accessmsg,my $slot_name,my $slot) = - &Apache::lonhomework::check_slot_access('0','problem'); - push (@Apache::inputtags::status,$status); - #handle rand seed in construction space - my $rndseed=&setup_rndseed($safeeval,$target); + my $rndseed=&setup_rndseed($safeeval); my ($symb)=&Apache::lonnet::whichuser(); - if ($env{'request.state'} ne "construct" && ($symb eq '' || $Apache::lonhomework::type eq 'practice')) { $form_tag_start.=''."\n"; } - foreach my $field ('questiontype','rndseed') { - if ($env{"form.grade_$field"} ne '') { - $result .= ''."\n"; - } - } - } } elsif ($target eq 'tex') { $result .= 'INSERTTEXFRONTMATTERHERE'; @@ -1308,7 +1115,7 @@ sub end_problem { } else { $frontmatter.= $begin_doc.$toc_line; if ($Apache::lonhomework::type eq 'exam' and $allow_print_points==1) { - $frontmatter .= '\fbox{\textit{'.&mt('[quant,_1,pt,pt]',$weight ).'}}'; + $frontmatter .= '\fbox{\textit{'.$weight.' pt}}'; } } } else { @@ -1318,7 +1125,7 @@ sub end_problem { if (not $env{'request.symb'} =~ m/\.page_/) { $frontmatter .= $begin_doc.$toc_line; if (($Apache::lonhomework::type eq 'exam') and ($allow_print_points==1)) { - $frontmatter .= '\fbox{\textit{'.&mt('[quant,_1,pt,pt]',$weight ).'}}'; + $frontmatter .= '\fbox{\textit{'.$weight.' pt}}'; } } else { $frontmatter .= '\vskip 1mm \\\\\\\\'.$startminipage; @@ -1342,7 +1149,7 @@ sub end_problem { } } elsif ( ($target eq 'web' || $target eq 'tex') && $Apache::inputtags::part eq '0' && - $status ne 'UNCHECKEDOUT' && $status ne 'NOT_YET_VIEWED') { + $status ne 'UNCHECKEDOUT' && $status ne 'NOT_YET_VIEWED') { # if part is zero, no s existed, so we need show the current # grading status my $gradestatus = &Apache::inputtags::gradestatus($Apache::inputtags::part,$target); @@ -1352,9 +1159,10 @@ sub end_problem { (($target eq 'web') && ($env{'request.state'} ne 'construct')) || ($target eq 'answer') || ($target eq 'tex') ) { - if (($target ne 'tex') && - ($env{'form.answer_output_mode'} ne 'tex')) { + if ($target ne 'tex' && + $env{'form.answer_output_mode'} ne 'tex') { $result.=""; + $result.= &Apache::lonhtmlcommon::htmlareaselectactive(&Apache::lonhtmlcommon::get_htmlareafields()); } if ($target eq 'web') { $result.= &Apache::loncommon::end_page({'discussion' => 1}); @@ -1375,9 +1183,6 @@ sub end_problem { } } } - if ($target eq 'web') { - $result.=&Apache::functionplotresponse::init_script(); - } if ($target eq 'grade') { &Apache::lonhomework::showhash(%Apache::lonhomework::results); &finalize_storage(); @@ -1435,7 +1240,7 @@ sub start_library { ($result,$form_tag_start)= &page_start($target,$token,$tagstack,$parstack,$parser,$safeeval, $name); - my $rndseed=&setup_rndseed($safeeval,$target); + my $rndseed=&setup_rndseed($safeeval); $result.=" \n $form_tag_start". ''; $result.=&problem_web_to_edit_header($rndseed); @@ -1879,6 +1684,7 @@ sub ordered_show_check { return $in_order_show; } + sub start_startpartmarker { my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; my $result=''; @@ -1887,7 +1693,7 @@ sub start_startpartmarker { $result.=&mt('Marker for the start of a part. Place end marker below to wrap in-between tags into a new part.').''; $result.=&Apache::edit::end_table(); - } + } return $result; } @@ -1917,6 +1723,10 @@ sub end_endpartmarker { return @result; } + + + + sub start_part { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; if (!$Apache::lonxml::metamode) { @@ -2002,30 +1812,11 @@ sub start_part { $allow_print_points=0; } if (($Apache::lonhomework::type eq 'exam') && ($allow_print_points)) { - $result .= '\vskip 10mm\fbox{\textit{'.&mt('[quant,_1,pt,pt]',$weight ).'}}'; + $result .= '\vskip 10mm\fbox{\textit{'.$weight.' pt}}'; } } elsif ($target eq 'web') { - if ($status eq 'CAN_ANSWER') { - my $problemstatus = &get_problem_status($Apache::inputtags::part); - my $probrandomize = &Apache::lonnet::EXT("resource.$Apache::inputtags::partlist[0].type"); - my $probrandtries = &Apache::lonnet::EXT("resource.$Apache::inputtags::partlist[0].randomizeontries"); - my $num = scalar(@Apache::inputtags::partlist)-1; - if ($probrandomize eq 'randomizetry') { - if (&Apache::lonnet::EXT("resource.$Apache::inputtags::part.type") ne 'randomizetry') { - $result .= &randomizetry_part_header($problemstatus,'none',$num); - } else { - my $reqtries = &Apache::lonnet::EXT("resource.$Apache::inputtags::part.randomizeontries"); - if ($probrandtries ne $reqtries) { - $result .= &randomizetry_part_header($problemstatus,$reqtries,$num); - } - } - } elsif (&Apache::lonnet::EXT("resource.$Apache::inputtags::part.type") eq 'randomizetry') { - my $reqtries = &Apache::lonnet::EXT("resource.$Apache::inputtags::part.randomizeontries"); - $result .= &randomizetry_part_header($problemstatus,$reqtries,$num); - } - } - $result.=''; + $result.=''; } } } @@ -2196,8 +1987,7 @@ sub start_problemtype { ['anonsurvey','Anonymous Survey'], ['anonsurveycred','Anonymous Survey (with credit)'], ['problem','Homework Problem'], - ['practice','Practice Problem'], - ['randomizetry','New Randomization Each Try'] ] + ['practice','Practice Problem'] ] ,$token); $result .=&Apache::edit::end_row().&Apache::edit::start_spanning_row(); } elsif ($target eq 'modified') { @@ -2236,15 +2026,17 @@ sub end_startouttext { $result.=&Apache::edit::start_table($token)."".&mt('Text Block')."" .''.&mt('Delete?').' ' .&Apache::edit::deletelist($target,$token) - .'' - .'' - .&Apache::lonhtmlcommon::dragmath_button($areaid,1) - .'' - .'' - .&Apache::edit::insertlist($target,$token) - .'' - .'' . - &Apache::loncommon::helpLatexCheatsheet(). + .''; + unless ($env{'environment.wysiwygeditor'} eq 'on') { + $result .= '' + .&Apache::lonhtmlcommon::dragmath_button($areaid,1) + .'' + .'' + .&Apache::edit::insertlist($target,$token) + .''; + } + $result.='' . + &Apache::loncommon::helpLatexCheatsheet(). &Apache::edit::end_row(). &Apache::edit::start_spanning_row()."\n". &Apache::edit::editfield($token->[1],$text,"",80,8,1); @@ -2312,12 +2104,11 @@ sub start_simpleeditbutton { # .&mt('Note: it can take up to 10 minutes for changes to take effect for all users.') # .&Apache::loncommon::help_open_topic('Caching') # .'

'; - $result.=&Apache::loncommon::head_subbox( - &Apache::lonhtmlcommon::start_funclist() + $result.=&Apache::lonhtmlcommon::start_funclist() .&Apache::lonhtmlcommon::add_item_funclist( '
' .&mt('Edit').'') - .&Apache::lonhtmlcommon::end_funclist()); + .&Apache::lonhtmlcommon::end_funclist(); } return $result; @@ -2333,63 +2124,6 @@ sub practice_problem_header { ''; } -sub randomizetry_problem_header { - my ($problemstatus,$reqtries) = @_; - my ($header,$text); - if ($reqtries > 1) { - $header = &mt('New Problem Variation After Every [quant,_1,Try,Tries]',$reqtries); - if (($problemstatus eq 'no') || - ($problemstatus eq 'no_feedback_ever')) { - $text = &mt('A new variation will be generated after every [quant,_1,try,tries], until the tries limit is reached.',$reqtries); - } else { - $text = &mt('A new variation will be generated after every [quant,_1,try,tries], until correct or tries limit is reached.',$reqtries); - } - } else { - $header = &mt('New Problem Variation Each Try'); - if (($problemstatus eq 'no') || - ($problemstatus eq 'no_feedback_ever')) { - $text = &mt('A new variation will be generated after each try until the tries limit is reached.'); - - } else { - $text = &mt('A new variation will be generated after each try until correct or tries limit is reached.'); - } - } - return '

'.$header.'

'. - ''.$text.'
'; -} - -sub randomizetry_part_header { - my ($problemstatus,$reqtries,$num) = @_; - my ($header,$text); - if ($reqtries eq 'none') { - $header = &mt('No Question Variation'); - $text = &mt('For this question there will no new variation after a try.'); - } elsif ($reqtries > 1) { - $header = &mt('New Question Variation After Every [quant,_1,Try,Tries]',$reqtries); - if (($problemstatus eq 'no') || - ($problemstatus eq 'no_feedback_ever')) { - $text = &mt('For this question a new variation will be generated after every [quant,_1,try,tries], until the tries limit is reached.',$reqtries); - } else { - $text = &mt('For this question a new variation will be generated after every [quant,_1,try,tries], until correct or tries limit is reached.',$reqtries); - } - } else { - $header = &mt('New Question Variation For Each Try'); - if (($problemstatus eq 'no') || - ($problemstatus eq 'no_feedback_ever')) { - $text = &mt('For this question a new variation will be generated after each try until the tries limit is reached.'); - } else { - $text = &mt('For this question a new variation will be generated after each try until correct or tries limit is reached.'); - } - } - my $output; - if ($num > 1) { - $output .= '
'; - } - $output .= '

'.$header.'

'. - ''.$text.'

'; - return $output; -} - 1; __END__