--- loncom/homework/structuretags.pm 2003/05/14 16:49:13 1.173
+++ 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.173 2003/05/14 16:49:13 albertel 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:
-
+
+
+
Show All Foils
';
my $numtoanalyze=$ENV{'form.numtoanalyze'};
- if (!$numtoanalyze) { $numtoanalyze=100; }
- $result.= '
+ if (!$numtoanalyze) { $numtoanalyze=20; }
+ $result.= ' 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';
@@ -493,7 +505,7 @@ sub end_problem {
if ($target eq 'web') {
$result.=&Apache::lonxml::xmlend();
} elsif ($target eq 'tex') {
- $result .= '\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}';
+ $result .= '\keephidden{ENDOFPROBLEM}\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}';
if (not $ENV{'request.symb'} =~ m/\.page_/) {
$result .= '\end{minipage}\end{document} ';
} else {
@@ -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=