--- loncom/homework/grades.pm	2015/03/17 12:22:20	1.734
+++ loncom/homework/grades.pm	2015/03/18 12:53:24	1.735
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.734 2015/03/17 12:22:20 raeburn Exp $
+# $Id: grades.pm,v 1.735 2015/03/18 12:53:24 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4806,7 +4806,7 @@ sub displaySubByDates {
 
     my $interaction;
     my $no_increment = 1;
-    my %lastrndseed;
+    my (%lastrndseed,%lasttype);
     for ($version=1;$version<=$$record{'version'};$version++) {
 	my $timestamp = 
 	    &Apache::lonlocal::locallocaltime($$record{$version.':timestamp'});
@@ -4865,11 +4865,13 @@ sub displaySubByDates {
 			    $displaySub[0].=&mt('Trial: [_1]',
 					    $$record{"$where.$partid.tries"});
                             if (($rndseed ne '') && ($lastrndseed{$partid} ne '')) {
-                                if ($rndseed ne $lastrndseed{$partid}) {
+                                if (($rndseed ne $lastrndseed{$partid}) &&
+                                    (($type eq 'randomizetry') || ($lasttype{$partid} eq 'randomizetry'))) {
                                     $newvariation = '&nbsp;('.&mt('New variation this try').')';
                                 }
                             }
                             $lastrndseed{$partid} = $rndseed;
+                            $lasttype{$partid} = $type;
 		        }
 		        my $responseType=($isTask ? 'Task'
                                               : $responseType->{$partid}->{$responseId});