--- loncom/homework/structuretags.pm 2003/06/19 20:04:16 1.187 +++ loncom/homework/structuretags.pm 2003/06/30 20:21:43 1.191 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.187 2003/06/19 20:04:16 albertel Exp $ +# $Id: structuretags.pm,v 1.191 2003/06/30 20:21:43 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -149,11 +149,8 @@ sub setup_rndseed { } if ($ENV{'form.resetdata'} eq 'New Problem Variation' || $ENV{'form.newrandomization'} eq 'New Randomization') { - $rndseed=time; - if ($rndseed eq $ENV{'form.rndseed'}) { - srand($rndseed); - $rndseed=int(rand(1000000000)); - } + srand(time); + $rndseed=int(rand(2100000000)); $ENV{'form.rndseed'}=$rndseed; delete($ENV{'form.resetdata'}); delete($ENV{'form.newrandomization'}); @@ -408,9 +405,9 @@ sub start_problem { "$name\n$body_tag_start\n"; } } elsif ($target eq 'tex') { - my $startminipage = ''; - if ($ENV{'form.problem_split'} ne 'yes') { - $startminipage = '\begin{minipage}{\textwidth}'; + my $startminipage = ' SSS '.$ENV{'form.problem_split'}.' FFF '; + if (not $ENV{'form.problem_split'}=~/yes/) { + $startminipage .= '\begin{minipage}{\textwidth}'; } my $name= &Apache::lonxml::get_param('name',$parstack,$safeeval); if ($name eq '') { @@ -507,7 +504,8 @@ sub end_problem { } } elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER' || $status eq 'UNCHECKEDOUT' ) { - if ($target ne 'tex') { + if ($target ne 'tex' && + $ENV{'form.answer_output_mode'} ne 'tex') { $result.="\n"; } } @@ -515,7 +513,7 @@ sub end_problem { $result.=&Apache::lonxml::xmlend(); } elsif ($target eq 'tex') { my $endminipage = ''; - if ($ENV{'form.problem_split'} ne 'yes') { + if (not $ENV{'form.problem_split'}=~/yes/) { $endminipage = '\end{minipage}'; } $result .= '\keephidden{ENDOFPROBLEM}\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}'; @@ -1040,15 +1038,7 @@ sub end_startouttext { &Apache::edit::insertlist($target,$token). &Apache::edit::end_row(). &Apache::edit::start_spanning_row()."\n" - .'
'. - &Apache::loncommon::help_open_topic("Greek_Symbols", - 'Greek Symbols', - undef,undef,600) - .''. - &Apache::loncommon::help_open_topic("Other_Symbols", - 'Other Symbols', - undef,undef,600) - .'
'. + . &Apache::loncommon::helpLatexCheatsheet () . &Apache::edit::editfield($token->[1],$text,"",80,4); } if ($target eq 'modified') {