--- loncom/homework/response.pm	2010/02/28 23:44:36	1.217
+++ loncom/homework/response.pm	2010/11/24 00:10:06	1.220
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # various response type definitons response definition
 #
-# $Id: response.pm,v 1.217 2010/02/28 23:44:36 raeburn Exp $
+# $Id: response.pm,v 1.220 2010/11/24 00:10:06 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -30,7 +30,7 @@
 
 =head1 NAME
 
-Apache::resonse.pm
+Apache::response.pm
 
 =head1 SYNOPSIS
 
@@ -280,7 +280,7 @@ sub meta_response_order {
 }
 
 sub check_for_previous {
-    my ($curresponse,$partid,$id,$last) = @_;
+    my ($curresponse,$partid,$id,$last,$type) = @_;
     my %previous;
     $previous{'used'} = 0;
     foreach my $key (sort(keys(%Apache::lonhomework::history))) {
@@ -305,7 +305,15 @@ sub check_for_previous {
 		if (! $previous{'award'} ) { $previous{'award'} = 'UNKNOWN';	}
                 if ($previous{'award'} eq 'INTERNAL_ERROR') { $previous{'used'}=0; }
 		&Apache::lonxml::debug("got a match :$previous{'award'}:$previous{'used'}:");
-	    }
+            } elsif ($type eq 'ci') {
+                if (lc($pastresponse) eq lc($curresponse)) {
+                    if ($key =~ /^(\d+):/) {
+                        push (@{$previous{'versionci'}},$1);
+                        $previous{'awardci'} = $Apache::lonhomework::history{"resource.$partid.$id.awarddetail"};
+                        $previous{'usedci'} = 1;
+                    }
+                }
+            }
 	}
     }
     &Apache::lonhomework::showhash(%previous);
@@ -402,7 +410,7 @@ sub start_customresponse {
     } elsif ($target eq 'edit') {
 	$result.=&Apache::edit::tag_start($target,$token);
 	$result.=&Apache::edit::text_arg('String to display for answer:',
-					 'answerdisplay',$token);
+					 'answerdisplay',$token,'50');
 	$result.=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
     } elsif ($target eq 'modified') {
 	my $constructtag;
@@ -512,7 +520,7 @@ sub start_mathresponse {
     } elsif ($target eq 'edit') {
 	$result.=&Apache::edit::tag_start($target,$token);
 	$result.=&Apache::edit::text_arg('String to display for answer:',
-					 'answerdisplay',$token);
+					 'answerdisplay',$token,'50');
 	$result.=&Apache::edit::select_arg('Algebra System:',
 					   'cas',
 					   ['maxima','R'],