--- loncom/homework/optionresponse.pm 2011/03/03 21:05:35 1.174
+++ loncom/homework/optionresponse.pm 2011/06/07 17:27:37 1.176
@@ -1,7 +1,7 @@
# LearningOnline Network with CAPA
# option list style responses
#
-# $Id: optionresponse.pm,v 1.174 2011/03/03 21:05:35 www Exp $
+# $Id: optionresponse.pm,v 1.176 2011/06/07 17:27:37 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -225,12 +225,11 @@ sub end_foilgroup {
my $part_id="$Apache::inputtags::part.$Apache::inputtags::response[-1]";
push (@{ $Apache::lonhomework::analyze{"$part_id.options"} },@opt);
} elsif ( $target eq 'grade') {
+
my $nonlenient=0;
my $part=$Apache::inputtags::part;
my $lenientparm=&Apache::lonnet::EXT("resource.$part.lenient");
- &Apache::lonnet::logthis("Parameter ".$part." ".$lenientparm);
-
if ($Apache::lonhomework::scantronmode) {
$nonlenient=0;
# Grading an exam: we are grading lenient unless told not to
@@ -244,8 +243,8 @@ sub end_foilgroup {
$nonlenient=0;
}
}
- &Apache::lonnet::logthis("Non-Lenient set to ".$nonlenient);
if ( &Apache::response::submitted()) {
+
my @whichopt = &whichfoils($max,$randomize);
my $temp=1;my $name;
my %responsehash;
@@ -310,7 +309,6 @@ sub end_foilgroup {
#
# Non-lenient mode. All right or all wrong
#
- &Apache::lonnet::logthis("In non-lenient");
my $ad;
if ($wrong==0 && $ignored==0) {
$ad='EXACT_ANS';
@@ -329,7 +327,6 @@ sub end_foilgroup {
#
# This is lenient mode
#
- &Apache::lonnet::logthis("This is in lenient mode ... nice");
my $ad;
if ($wrong==0 && $right==0) {
#nothing submitted only assign a score if we
@@ -463,7 +460,6 @@ sub displayfoils {
my $part=$Apache::inputtags::part;
my $id=$Apache::inputtags::response[-1];
my $break;
- my $solved=$Apache::lonhomework::history{"resource.$part.solved"};
if ( ($target ne 'tex') &&
&Apache::response::show_answer() ) {
my $temp=1;
@@ -854,6 +850,9 @@ sub end_foil {
&Apache::lonxml::warning(&mt('Foils without names exist. This can cause problems to malfunction.'));
$name=$Apache::lonxml::curdepth;
}
+ if ($name eq "0") {
+ &Apache::lonxml::error(&mt('Foil name [_1] is not supported. Please choose another name.',''.$name.''));
+ }
&Apache::lonxml::debug("Using a name of :$name:");
if (defined($Apache::response::foilnames{$name})) {
&Apache::lonxml::error(&mt("Foil name [_1] appears more than once. Foil names need to be unique.",''.$name.''));