--- loncom/homework/inputtags.pm 2015/03/17 12:22:20 1.332 +++ loncom/homework/inputtags.pm 2015/03/18 12:53:24 1.333 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.332 2015/03/17 12:22:20 raeburn Exp $ +# $Id: inputtags.pm,v 1.333 2015/03/18 12:53:24 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1739,15 +1739,15 @@ sub previous_tries { my $count; my %count_lookup; - my $lastrndseed; + my ($lastrndseed,$lasttype); my $numstamps = 0; foreach my $i (1..$Apache::lonhomework::history{'version'}) { my $prefix = $i.":resource.$id"; - my $is_anon; + my $is_anon; + my $curr_type = $Apache::lonhomework::history{"$prefix.type"}; if (defined($env{'form.grade_symb'})) { - if (($Apache::lonhomework::history{"$prefix.type"} eq 'anonsurvey') || - ($Apache::lonhomework::history{"$prefix.type"} eq 'anonsurveycred')) { + if (($curr_type eq 'anonsurvey') || ($curr_type eq 'anonsurveycred')) { $is_anon = 1; } } @@ -1787,7 +1787,8 @@ sub previous_tries { } my $trystr = "(".&mt('Try [_1]',$Apache::lonhomework::history{"$prefix.tries"}).")"; if (($curr_rndseed ne '') && ($lastrndseed ne '')) { - if ($curr_rndseed ne $lastrndseed) { + if (($curr_rndseed ne $lastrndseed) && + (($curr_type eq 'randomizetry') || ($lasttype eq 'randomizetry'))) { $trystr .= '
'.&mt('New problem variation this try.').''; } } @@ -1828,6 +1829,7 @@ sub previous_tries { } $output.=&Apache::loncommon::end_data_table_row()."\n"; $lastrndseed = $curr_rndseed; + $lasttype = $curr_type; } return if ($output eq ''); my $headers = ''.