--- loncom/homework/structuretags.pm 2003/05/14 18:02:56 1.174 +++ loncom/homework/structuretags.pm 2003/05/23 16:26:28 1.177 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.174 2003/05/14 18:02:56 sakharuk Exp $ +# $Id: structuretags.pm,v 1.177 2003/05/23 16:26:28 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -146,8 +146,13 @@ sub setup_rndseed { $ENV{'form.rndseed'}=$rndseed; } } - if ($ENV{'form.resetdata'} eq 'New Problem Variation') { + 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)); + } $ENV{'form.rndseed'}=$rndseed; } &Apache::lonxml::debug("Setting rndseed to $rndseed"); @@ -177,19 +182,24 @@ sub problem_web_to_edit_header { my $result.=' - Random Seed: - + + + for
'; + $numtoanalyze.'" size="5" /> versions of this problem.'. + &Apache::loncommon::help_open_topic("Analyze_Problem", + '',undef,undef,300). + '
'; return $result; } @@ -264,7 +274,9 @@ sub start_problem { } #initialize globals $Apache::inputtags::part='0'; + @Apache::inputtags::partlist=('0'); @Apache::inputtags::responselist = (); + @Apache::inputtags::importlist = (); @Apache::inputtags::previous=(); @Apache::inputtags::previous_version=(); $Apache::structuretags::printanswer='No'; @@ -519,6 +531,9 @@ sub end_problem { $result = &problem_edit_footer(); } + if ($ENV{'request.state'} eq 'construct' && $target eq 'web') { + &Apache::inputtags::check_for_duplicate_ids(); + } undef(%Apache::lonhomework::history); undef(%Apache::lonhomework::results); undef($Apache::inputtags::part); @@ -844,7 +859,8 @@ sub start_part { my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); if ($id eq '') { $id = $Apache::lonxml::curdepth; } $Apache::inputtags::part=$id; - @Apache::inputtags::responselist = (); + push(@Apache::inputtags::partlist,$id); + @Apache::inputtags::response=(); @Apache::inputtags::previous=(); @Apache::inputtags::previous_version=(); $Apache::lonhomework::problemstatus=