--- loncom/homework/structuretags.pm 2004/02/02 17:28:53 1.231
+++ loncom/homework/structuretags.pm 2004/02/16 17:19:36 1.236
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.231 2004/02/02 17:28:53 sakharuk Exp $
+# $Id: structuretags.pm,v 1.236 2004/02/16 17:19:36 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -200,6 +200,16 @@ sub problem_edit_footer {
';
}
+sub option {
+ my ($value,$name) = @_;
+ my $result ="
+ ".&option('CAN_ANSWER' ,'problemstate').&mt("Answerable")."
+ ".&option('CANNOT_ANSWER_tries' ,'problemstate').&mt("Open with full tries")."
+ ".&option('CANNOT_ANSWER_correct','problemstate').&mt("Open and correct")."
+ ".&option('SHOW_ANSWER' ,'problemstate').&mt("Show Answer")."
+
+
+
+Problem Type:
+
+
+
+Feedback Mode:
+
+
+
+
";
my $numtoanalyze=$ENV{'form.numtoanalyze'};
if (!$numtoanalyze) { $numtoanalyze=20; }
$result.= 's existed, so we need to the grading
&Apache::inputtags::grade;
} elsif ( ($target eq 'web' || $target eq 'tex') &&
@@ -984,6 +1031,8 @@ sub start_part {
}
}
if (($Apache::lonhomework::type eq 'exam') && ($allow_print_points)) { $result .= '\fbox{\textit{'.$weight.' pt}}';}
+ } elsif ($target eq 'web') {
+ $result.='';
}
}
}
@@ -1015,7 +1064,9 @@ sub end_part {
my $result='';
if ( $target eq 'meta' ) {
$result='';
- } elsif ( $target eq 'grade' && $status eq 'CAN_ANSWER' && !$hidden) {
+ } elsif ($target eq 'grade' &&
+ ($status eq 'CAN_ANSWER' || $Apache::lonhomework::scantronmode) &&
+ !$hidden) {
$result=&Apache::inputtags::grade;
} elsif (($target eq 'web' || $target eq 'tex') && !$hidden ) {
my $gradestatus=&Apache::inputtags::gradestatus($Apache::inputtags::part,
@@ -1035,9 +1086,10 @@ sub end_part {
sub start_preduedate {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex') {
+ &Apache::lonxml::debug("State in preduedate is ". $Apache::inputtags::status['-1']);
if ($Apache::inputtags::status['-1'] ne 'CAN_ANSWER' &&
- $Apache::inputtags::status['-1'] ne 'CANNOT_ANSWER' &&
- $Apache::inputtags::status['-1'] ne 'SHOW_ANSWER') {
+ $Apache::inputtags::status['-1'] ne 'CANNOT_ANSWER') {
+ &Apache::lonxml::debug("Wha? ". ($Apache::inputtags::status['-1'] ne 'SHOW_ANSWER'));
&Apache::lonxml::get_all_text("/preduedate",$parser);
}
}
@@ -1050,12 +1102,12 @@ sub end_preduedate {
sub start_postanswerdate {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
- if ($target eq 'web' || $target eq 'grade' || $target eq 'tex') {
+ if ($target eq 'web' || $target eq 'grade') {
if ($Apache::inputtags::status['-1'] ne 'SHOW_ANSWER') {
&Apache::lonxml::get_all_text("/postanswerdate",$parser);
}
} elsif ($target eq 'tex') {
- return '\vskip 0 mm \noindent';
+ &Apache::lonxml::get_all_text("/postanswerdate",$parser);
}
return '';
}