[LON-CAPA-cvs] cvs: loncom /homework imageresponse.pm matchresponse.pm optionresponse.pm radiobuttonresponse.pm rankresponse.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 27 Oct 2003 20:04:34 -0000


albertel		Mon Oct 27 15:04:34 2003 EDT

  Modified files:              
    /loncom/homework	imageresponse.pm matchresponse.pm 
                    	optionresponse.pm radiobuttonresponse.pm 
                    	rankresponse.pm 
  Log:
  - took a look at all of the analyze outputs and corrected the buglets
  
  
Index: loncom/homework/imageresponse.pm
diff -u loncom/homework/imageresponse.pm:1.37 loncom/homework/imageresponse.pm:1.38
--- loncom/homework/imageresponse.pm:1.37	Mon Oct 27 14:27:09 2003
+++ loncom/homework/imageresponse.pm	Mon Oct 27 15:04:34 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # image click response style
 #
-# $Id: imageresponse.pm,v 1.37 2003/10/27 19:27:09 albertel Exp $
+# $Id: imageresponse.pm,v 1.38 2003/10/27 20:04:34 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -175,7 +175,8 @@
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result='';
     my @whichopt;
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'tex') {
+    if ($target eq 'web' || $target eq 'grade' || $target eq 'tex' ||
+	$target eq 'analyze') {
 	my ($count,$max) = &getfoilcounts($parstack,$safeeval);
 	if ($count>$max) { $count=$max }
 	&Apache::lonxml::debug("Count is $count from $max");
@@ -443,7 +444,8 @@
 sub start_rectangle {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result='';
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'tex') { 
+    if ($target eq 'web' || $target eq 'grade' || $target eq 'tex' ||
+	$target eq 'analyze') { 
 	&Apache::lonxml::startredirection; 
     } elsif ($target eq 'edit') {
 	my $coords=&Apache::lonxml::get_all_text('/rectangle',$parser);
@@ -479,7 +481,8 @@
 sub end_rectangle {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result;
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'tex') {
+    if ($target eq 'web' || $target eq 'grade' || $target eq 'tex' ||
+	$target eq 'analyze') {
 	my $name = $Apache::imageresponse::curname;
 	my $area = &Apache::lonxml::endredirection;
 	&Apache::lonxml::debug("out is $area for $name");
Index: loncom/homework/matchresponse.pm
diff -u loncom/homework/matchresponse.pm:1.28 loncom/homework/matchresponse.pm:1.29
--- loncom/homework/matchresponse.pm:1.28	Mon Oct 27 14:27:09 2003
+++ loncom/homework/matchresponse.pm	Mon Oct 27 15:04:34 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Full matching style response
 #
-# $Id: matchresponse.pm,v 1.28 2003/10/27 19:27:09 albertel Exp $
+# $Id: matchresponse.pm,v 1.29 2003/10/27 20:04:34 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -251,7 +251,7 @@
 	} elsif ( $target eq 'analyze') {
 	    my @shown=&whichfoils($max,$randomize);
 	    &Apache::response::analyze_store_foilgroup(\@shown,
-						       ['text','value']);
+						 ['text','value','location']);
 	    #FIXME need to store options in some way
 	}
 	&Apache::lonxml::increment_counter(&getfoilcounts($max));
@@ -259,6 +259,14 @@
 	$result=&Apache::edit::end_table();
     }
     return $result;
+}
+
+sub whichfoils {
+    my ($max,$randomize)=@_;
+    return &Apache::response::whichorder(&getfoilcounts($max),
+					 $randomize,
+					 &Apache::response::showallfoils(),
+					 \%Apache::response::foilgroup);
 }
 
 sub displayanswers {
Index: loncom/homework/optionresponse.pm
diff -u loncom/homework/optionresponse.pm:1.93 loncom/homework/optionresponse.pm:1.94
--- loncom/homework/optionresponse.pm:1.93	Mon Oct 27 14:27:09 2003
+++ loncom/homework/optionresponse.pm	Mon Oct 27 15:04:34 2003
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # option list style responses
 #
-# $Id: optionresponse.pm,v 1.93 2003/10/27 19:27:09 albertel Exp $
+# $Id: optionresponse.pm,v 1.94 2003/10/27 20:04:34 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -149,7 +149,8 @@
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   
   my $result;
-  if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || $target eq 'tex' || $target eq 'analyze') {
+  if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' ||
+      $target eq 'tex' || $target eq 'analyze') {
     my $tex_option_switch=&Apache::lonxml::get_param('texoptions',$parstack,$safeeval);
     my $name;
     my @opt;
@@ -165,7 +166,8 @@
       $result.=&displayanswers($max,$randomize,@opt);
     } elsif ( $target eq 'analyze') {
 	my @shown = &whichfoils($max,$randomize);
-	&Apache::response::analyze_store_foilgroup(\@shown,['text','value']);
+	&Apache::response::analyze_store_foilgroup(\@shown,
+						  ['text','value','location']);
 	my $part_id="$Apache::inputtags::part.$Apache::inputtags::response[-1]";
 	push (@{ $Apache::lonhomework::analyze{"$part_id.options"} },@opt);
     } elsif ( $target eq 'grade') {
Index: loncom/homework/radiobuttonresponse.pm
diff -u loncom/homework/radiobuttonresponse.pm:1.78 loncom/homework/radiobuttonresponse.pm:1.79
--- loncom/homework/radiobuttonresponse.pm:1.78	Mon Oct 27 14:27:09 2003
+++ loncom/homework/radiobuttonresponse.pm	Mon Oct 27 15:04:34 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # mutliple choice style responses
 #
-# $Id: radiobuttonresponse.pm,v 1.78 2003/10/27 19:27:09 albertel Exp $
+# $Id: radiobuttonresponse.pm,v 1.79 2003/10/27 20:04:34 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -154,7 +154,8 @@
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
 
   my $result;
-  if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || $target eq 'tex' || $target eq 'analyze') {
+  if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' ||
+      $target eq 'tex' || $target eq 'analyze') {
     my $style = $Apache::lonhomework::type;
     if ( $style eq 'survey'  && $target ne 'analyze') {
       if ($target eq 'web' || $target eq 'answer' || $target eq 'tex') {
@@ -175,7 +176,11 @@
 	&grade_response($max,$randomize);
       }  elsif ( $target eq 'analyze') {
 	  my @shown = &whichfoils($max,$randomize);
-	  &Apache::response::analyze_store_foilgroup(\@shown,['text','value']);
+	  &Apache::response::analyze_store_foilgroup(\@shown,
+						  ['text','value','location']);
+	  my $part_id="$Apache::inputtags::part.$Apache::inputtags::response[-1]";
+	  push (@{ $Apache::lonhomework::analyze{"$part_id.options"} },
+		('true','false'));
       }
     }
   }
Index: loncom/homework/rankresponse.pm
diff -u loncom/homework/rankresponse.pm:1.25 loncom/homework/rankresponse.pm:1.26
--- loncom/homework/rankresponse.pm:1.25	Mon Oct 27 14:27:09 2003
+++ loncom/homework/rankresponse.pm	Mon Oct 27 15:04:34 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # rank style response
 #
-# $Id: rankresponse.pm,v 1.25 2003/10/27 19:27:09 albertel Exp $
+# $Id: rankresponse.pm,v 1.26 2003/10/27 20:04:34 albertel Exp $
 # Copyright Michigan State University Board of Trustees
 #
 # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -93,7 +93,8 @@
 sub end_foilgroup {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result;
-    if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || $target eq 'tex') {
+    if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' ||
+	$target eq 'tex' || $target eq 'analyze') {
 	my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2');
 	my $randomize = &Apache::lonxml::get_param('randomize',$parstack,
 						   $safeeval,'-2');
@@ -108,7 +109,7 @@
 	} elsif ( $target eq 'analyze') {
 	    my @shown = &whichfoils($max,$randomize);
 	    &Apache::response::analyze_store_foilgroup(\@shown,
-						       ['text','value']);
+						  ['text','value','location']);
 	}
 	&Apache::lonxml::increment_counter(&getfoilcounts($max));
     } elsif ($target eq 'edit') {