[LON-CAPA-cvs] cvs: loncom /homework imageresponse.pm inputtags.pm matchresponse.pm optionresponse.pm radiobuttonresponse.pm rankresponse.pm response.pm /homework/caparesponse caparesponse.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Mon, 22 Sep 2003 20:49:02 -0000
This is a MIME encoded message
--albertel1064263742
Content-Type: text/plain
albertel Mon Sep 22 16:49:02 2003 EDT
Modified files:
/loncom/homework imageresponse.pm inputtags.pm matchresponse.pm
optionresponse.pm radiobuttonresponse.pm
rankresponse.pm response.pm
/loncom/homework/caparesponse caparesponse.pm
Log:
- added &Apache::response::show_answer() to better check for if problemstatus inhibiting should be occuring or not
--albertel1064263742
Content-Type: text/plain
Content-Disposition: attachment; filename="albertel-20030922164902.txt"
Index: loncom/homework/imageresponse.pm
diff -u loncom/homework/imageresponse.pm:1.34 loncom/homework/imageresponse.pm:1.35
--- loncom/homework/imageresponse.pm:1.34 Fri Aug 1 11:50:43 2003
+++ loncom/homework/imageresponse.pm Mon Sep 22 16:49:01 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# image click response style
#
-# $Id: imageresponse.pm,v 1.34 2003/08/01 15:50:43 albertel Exp $
+# $Id: imageresponse.pm,v 1.35 2003/09/22 20:49:01 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -113,7 +113,7 @@
if ($target eq 'tex') {$result.="\\vskip 0 mm \n";} else {$result.="<br />\n";}
my $image=$Apache::response::foilgroup{"$name.image"};
&Apache::lonxml::debug("image is $image");
- if ($Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"} =~ /^correct/ ) {
+ if ( &Apache::response::show_answer() ) {
if ($target eq 'tex') {
$result.=$Apache::response::foilgroup{"$name.image"}."\\vskip 0 mm \n";
} else {
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.116 loncom/homework/inputtags.pm:1.117
--- loncom/homework/inputtags.pm:1.116 Wed Sep 17 17:29:44 2003
+++ loncom/homework/inputtags.pm Mon Sep 22 16:49:01 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# input definitons
#
-# $Id: inputtags.pm,v 1.116 2003/09/17 21:29:44 www Exp $
+# $Id: inputtags.pm,v 1.117 2003/09/22 20:49:01 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -455,7 +455,8 @@
$message = &mt("Unknown message").": $award";
$button=1;
}
- if (lc($Apache::lonhomework::problemstatus) eq 'no') {
+ if (lc($Apache::lonhomework::problemstatus) eq 'no' &&
+ $Apache::inputtags::status[-1] ne 'SHOW_ANSWER') {
$message = &mt("Answer Submitted");
$bgcolor=$possiblecolors{'correct'};
$button=1;
Index: loncom/homework/matchresponse.pm
diff -u loncom/homework/matchresponse.pm:1.22 loncom/homework/matchresponse.pm:1.23
--- loncom/homework/matchresponse.pm:1.22 Mon Sep 15 14:13:52 2003
+++ loncom/homework/matchresponse.pm Mon Sep 22 16:49:01 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Full matching style response
#
-# $Id: matchresponse.pm,v 1.22 2003/09/15 18:13:52 sakharuk Exp $
+# $Id: matchresponse.pm,v 1.23 2003/09/22 20:49:01 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -369,7 +369,7 @@
%name_letter_map=
%{ $Apache::response::itemgroup{'name_letter_map'} };
}
- if (($solved =~ /^correct/) || ($status eq 'SHOW_ANSWER')) {
+ if ( &Apache::response::show_answer() ) {
foreach my $name (@whichfoils) {
my $text=$Apache::response::foilgroup{$name.'.text'};
my $value=$Apache::response::foilgroup{$name.'.value'};
Index: loncom/homework/optionresponse.pm
diff -u loncom/homework/optionresponse.pm:1.85 loncom/homework/optionresponse.pm:1.86
--- loncom/homework/optionresponse.pm:1.85 Tue Sep 9 09:36:11 2003
+++ loncom/homework/optionresponse.pm Mon Sep 22 16:49:01 2003
@@ -1,7 +1,7 @@
# LearningOnline Network with CAPA
# option list style responses
#
-# $Id: optionresponse.pm,v 1.85 2003/09/09 13:36:11 sakharuk Exp $
+# $Id: optionresponse.pm,v 1.86 2003/09/22 20:49:01 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -303,9 +303,8 @@
my $break;
my $solved=$Apache::lonhomework::history{"resource.$part.solved"};
my $status=$Apache::inputtags::status[-1];
- if (
- ($target ne 'tex') &&
- (($solved =~ /^correct/) || ($status eq 'SHOW_ANSWER')) ) {
+ if ( ($target ne 'tex') &&
+ &Apache::response::show_answer() ) {
foreach $name (@whichopt) {
my $text=$Apache::response::foilgroup{$name.'.text'};
if ($text!~/^\s*$/) {
Index: loncom/homework/radiobuttonresponse.pm
diff -u loncom/homework/radiobuttonresponse.pm:1.72 loncom/homework/radiobuttonresponse.pm:1.73
--- loncom/homework/radiobuttonresponse.pm:1.72 Fri Jun 20 00:05:13 2003
+++ loncom/homework/radiobuttonresponse.pm Mon Sep 22 16:49:01 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# mutliple choice style responses
#
-# $Id: radiobuttonresponse.pm,v 1.72 2003/06/20 04:05:13 albertel Exp $
+# $Id: radiobuttonresponse.pm,v 1.73 2003/09/22 20:49:01 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -205,7 +205,7 @@
my $part=$Apache::inputtags::part;
my $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"};
my %lastresponse=&Apache::lonnet::str2hash($lastresponse);
- if (($Apache::lonhomework::history{"resource.$part.solved"} =~ /^correct/) || ($Apache::inputtags::status[-1] eq 'SHOW_ANSWER')) {
+ if (&Apache::response::show_answer() ) {
foreach my $name (@names) {
if ($Apache::response::foilgroup{$name.'.value'} ne 'unused') {
$result.="<br />".$Apache::response::foilgroup{$name.'.value'};
@@ -373,7 +373,7 @@
my $solved=$Apache::lonhomework::history{"resource.$part.solved"};
my $status=$Apache::inputtags::status[-1];
if ( ($target ne 'tex') &&
- (($solved =~ /^correct/) || ($status eq 'SHOW_ANSWER')) ) {
+ &Apache::response::show_answer() ) {
foreach my $name (@whichfoils) {
if ($target ne 'tex') {
$result.="<br />";
Index: loncom/homework/rankresponse.pm
diff -u loncom/homework/rankresponse.pm:1.17 loncom/homework/rankresponse.pm:1.18
--- loncom/homework/rankresponse.pm:1.17 Mon Jul 21 15:42:17 2003
+++ loncom/homework/rankresponse.pm Mon Sep 22 16:49:01 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# rank style response
#
-# $Id: rankresponse.pm,v 1.17 2003/07/21 19:42:17 albertel Exp $
+# $Id: rankresponse.pm,v 1.18 2003/09/22 20:49:01 albertel Exp $
# Copyright Michigan State University Board of Trustees
#
# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -241,7 +241,7 @@
my $status=$Apache::inputtags::status[-1];
my @whichopt=(1..($#whichfoils+1));
my @correctorder=&get_correct_order($tol,@whichfoils);
- if (($solved =~ /^correct/) || ($status eq 'SHOW_ANSWER')) {
+ if ( &Apache::response::show_answer() ) {
foreach my $name (@whichfoils) {
my $text=$Apache::response::foilgroup{$name.'.text'};
my $value=shift(@correctorder);
Index: loncom/homework/response.pm
diff -u loncom/homework/response.pm:1.84 loncom/homework/response.pm:1.85
--- loncom/homework/response.pm:1.84 Wed Aug 20 10:05:40 2003
+++ loncom/homework/response.pm Mon Sep 22 16:49:01 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# various response type definitons response definition
#
-# $Id: response.pm,v 1.84 2003/08/20 14:05:40 sakharuk Exp $
+# $Id: response.pm,v 1.85 2003/09/22 20:49:01 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -556,6 +556,14 @@
return @whichopt;
}
+sub show_answer {
+ my $part = $Apache::inputtags::part;
+ my $award = $Apache::lonhomework::history{"resource.$part.solved"};
+ my $status = $Apache::inputtags::status[-1];
+ return ( ($award =~ /^correct/
+ && lc($Apache::lonhomework::problemstatus) ne 'no')
+ || $status eq "SHOW_ANSWER");
+}
1;
__END__
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.113 loncom/homework/caparesponse/caparesponse.pm:1.114
--- loncom/homework/caparesponse/caparesponse.pm:1.113 Mon Sep 22 16:39:17 2003
+++ loncom/homework/caparesponse/caparesponse.pm Mon Sep 22 16:49:01 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# caparesponse definition
#
-# $Id: caparesponse.pm,v 1.113 2003/09/22 20:39:17 sakharuk Exp $
+# $Id: caparesponse.pm,v 1.114 2003/09/22 20:49:01 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -169,9 +169,7 @@
$safeeval);
my $award = $Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"};
my $status = $Apache::inputtags::status['-1'];
- if ( ($award =~ /^correct/
- && lc($Apache::lonhomework::problemstatus) ne 'no')
- || $status eq "SHOW_ANSWER") {
+ if ( &Apache::response::show_answer() ) {
my (@formats)=&Apache::lonxml::get_param_var('format',$parstack,
$safeeval);
my $unit=&Apache::lonxml::get_param_var('unit',$parstack,
--albertel1064263742--