[LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm /interface lonparmset.pm rat/client parameter.html
albertel
lon-capa-cvs-allow@mail.lon-capa.org
Sat, 17 Nov 2007 02:51:30 -0000
albertel Fri Nov 16 21:51:30 2007 EDT
Modified files:
/rat/client parameter.html
/loncom/interface lonparmset.pm
/loncom/homework lonhomework.pm
Log:
- BUG#4998 - add a problem status feedback mode that displays the correct answer if the student exceeds maxium number of tries for that part
Index: rat/client/parameter.html
diff -u rat/client/parameter.html:1.48 rat/client/parameter.html:1.49
--- rat/client/parameter.html:1.48 Fri Nov 2 17:20:19 2007
+++ rat/client/parameter.html Fri Nov 16 21:50:32 2007
@@ -3,7 +3,7 @@
The LearningOnline Network with CAPA
Parameter Input Window
//
-// $Id: parameter.html,v 1.48 2007/11/02 21:20:19 albertel Exp $
+// $Id: parameter.html,v 1.49 2007/11/17 02:50:32 albertel Exp $
//
// Copyright Michigan State University Board of Trustees
//
@@ -563,6 +563,10 @@
' type="radio" '+callradiostringeval('yes'));
if (svalue=='yes') { choicewrite(' checked'); }
choicewrite('> Yes</label><br />');
+ choicewrite('<label><input name="stringval" value="answer"'+
+ ' type="radio" '+callradiostringeval('answer'));
+ if (svalue=='answer') { choicewrite(' checked'); }
+ choicewrite('> Yes, and show correct answer if they exceed the maxium number of tries.</label><br />');
choicewrite('<label><input name="stringval" value="no"'+
' type="radio" '+callradiostringeval('no'));
if (svalue=='no') { choicewrite(' checked'); }
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.386 loncom/interface/lonparmset.pm:1.387
--- loncom/interface/lonparmset.pm:1.386 Fri Nov 2 19:32:31 2007
+++ loncom/interface/lonparmset.pm Fri Nov 16 21:50:49 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.386 2007/11/02 23:32:31 albertel Exp $
+# $Id: lonparmset.pm,v 1.387 2007/11/17 02:50:49 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2798,6 +2798,7 @@
[ 'no', 'No' ]],
'string_problemstatus'
=> [[ 'yes', 'Yes' ],
+ [ 'answer', 'Yes, and show correct answer if they exceed the maxium number of tries.' ],
[ 'no', 'No, don\'t show correct/incorrect feedback.' ],
[ 'no_feedback_ever', 'No, show no feedback at all.' ]],
);
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.284 loncom/homework/lonhomework.pm:1.285
--- loncom/homework/lonhomework.pm:1.284 Tue Nov 13 18:26:08 2007
+++ loncom/homework/lonhomework.pm Fri Nov 16 21:51:29 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Homework handler
#
-# $Id: lonhomework.pm,v 1.284 2007/11/13 23:26:08 albertel Exp $
+# $Id: lonhomework.pm,v 1.285 2007/11/17 02:51:29 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -494,6 +494,10 @@
$Apache::lonhomework::history{"resource.$id.solved"}=~/^excused/) {
$status = 'CANNOT_ANSWER';
}
+ if ($status eq 'CANNOT_ANSWER'
+ && &show_answer_problem_status()) {
+ $status = 'SHOW_ANSWER';
+ }
}
if ($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER') {
my $interval=&Apache::lonnet::EXT("resource.$id.interval");
@@ -883,6 +887,7 @@
sub show_problem_status {
return ($show_problem_status eq 'yes'
+ || $show_problem_status eq 'answer'
|| $show_problem_status eq '');
}
@@ -893,6 +898,10 @@
sub show_no_problem_status {
return ($show_problem_status eq 'no_feedback_ever');
}
+
+ sub show_answer_problem_status {
+ return ($show_problem_status eq 'answer');
+ }
}
sub editxmlmode {