[LON-CAPA-cvs] cvs: loncom /homework response.pm /homework/caparesponse caparesponse.pm

www lon-capa-cvs@mail.lon-capa.org
Mon, 04 Dec 2006 20:35:09 -0000


www		Mon Dec  4 15:35:09 2006 EDT

  Modified files:              
    /loncom/homework	response.pm 
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  Just saving my work on Maxima - currently stuck with Bug #5102
  
  
Index: loncom/homework/response.pm
diff -u loncom/homework/response.pm:1.149 loncom/homework/response.pm:1.150
--- loncom/homework/response.pm:1.149	Tue Oct 17 15:35:37 2006
+++ loncom/homework/response.pm	Mon Dec  4 15:35:06 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # various response type definitons response definition
 #
-# $Id: response.pm,v 1.149 2006/10/17 19:35:37 albertel Exp $
+# $Id: response.pm,v 1.150 2006/12/04 20:35:06 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -470,6 +470,14 @@
 	$result.=&Apache::edit::tag_start($target,$token);
 	$result.=&Apache::edit::text_arg('String to display for answer:',
 					 'answerdisplay',$token);
+	$result.=&Apache::edit::select_arg('Algebra System:',
+					   'cas',
+					   ['maxima'],
+					   $token);
+	$result.=&Apache::edit::text_arg('Algebra System:',
+					 'cas',$token);
+	$result.=&Apache::edit::text_arg('Argument Array:',
+					 'args',$token);
 	$result.=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
     } elsif ($target eq 'modified') {
 	my $constructtag;
@@ -494,8 +502,7 @@
     my $id=$Apache::inputtags::response[-1];
     if ( $target eq 'grade' && &Apache::response::submitted() ) {
 	my $response = &Apache::response::getresponse();
-	if ( $response =~ /[^\s]/ && 
-	     $Apache::response::custom_answer_type eq 'loncapa/perl') {
+	if ( $response =~ /[^\s]/ ) {
 	    if (!$Apache::lonxml::default_homework_loaded) {
 		&Apache::lonxml::default_homework_load($safeeval);
 	    }
@@ -509,8 +516,14 @@
 	    
 	    my $award = &Apache::run::run('{ my $submission=$LONCAPA::mathresponse_submission;'.$Apache::response::custom_answer.'}',$safeeval);
 	    if (!&Apache::inputtags::valid_award($award)) {
-		$error = $award;
-		$award = 'ERROR';
+		if ($award==1) {
+		    $award='EXACT_ANS';
+		} elsif ($award==0) {
+		    $award='INCORRECT';
+		} else {
+		    $error = $award;
+		    $award = 'ERROR';
+		}
 	    }
 	    &Apache::response::handle_previous(\%previous,$award);
 	    $Apache::lonhomework::results{"resource.$part.$id.awarddetail"}=
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.196 loncom/homework/caparesponse/caparesponse.pm:1.197
--- loncom/homework/caparesponse/caparesponse.pm:1.196	Fri Nov 10 12:47:41 2006
+++ loncom/homework/caparesponse/caparesponse.pm	Mon Dec  4 15:35:06 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.196 2006/11/10 17:47:41 albertel Exp $
+# $Id: caparesponse.pm,v 1.197 2006/12/04 20:35:06 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -324,11 +324,11 @@
     }
     
     if ($tag eq 'formularesponse') {
-#	if ($$args_ref{'samples'}) {
+	if ($$args_ref{'samples'}) {
 	    $$args_ref{'type'}='fml';
-#	} else {
-#	    $$args_ref{'type'}='math';
-#	}
+	} else {
+	    $$args_ref{'type'}='math';
+	}
     } elsif ($tag eq 'numericalresponse') {
 	$$args_ref{'type'}='float';
     }