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

foxr foxr at source.lon-capa.org
Mon Jun 25 06:36:00 EDT 2012


foxr		Mon Jun 25 10:36:00 2012 EDT

  Modified files:              
    /loncom/homework	optionresponse.pm 
  Log:
  BZ 6597 - support noprompt attribute in <foilgroup> tag.  When present and 
  having a value of '1' supresses the prompt to select all that are true.
  
  
  
Index: loncom/homework/optionresponse.pm
diff -u loncom/homework/optionresponse.pm:1.185 loncom/homework/optionresponse.pm:1.186
--- loncom/homework/optionresponse.pm:1.185	Wed Apr 18 19:45:39 2012
+++ loncom/homework/optionresponse.pm	Mon Jun 25 10:36:00 2012
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # option list style responses
 #
-# $Id: optionresponse.pm,v 1.185 2012/04/18 19:45:39 raeburn Exp $
+# $Id: optionresponse.pm,v 1.186 2012/06/25 10:36:00 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -203,13 +203,15 @@
 					     -2,0);
     my $checkboxvalue=&Apache::lonxml::get_param('checkboxvalue',$parstack,$safeeval);
     my $checkboxchoices=(&Apache::lonxml::get_param('checkboxoptions',$parstack,$safeeval) ne 'nochoice');
+    my $noprompt       =&Apache::lonxml::get_param('noprompt', $parstack, $safeeval);
+
     if ($target eq 'tex' && $tex_option_switch eq 'nochoice') {@opt=();}
     &Apache::lonxml::debug("Options are $#opt");
     my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2');
     my $randomize = &Apache::lonxml::get_param('randomize',$parstack,
 					       $safeeval,'-2');
     if ($target eq 'web' || $target eq 'tex') {
-      $result.=&displayfoils($target,$max,$randomize,$TeXlayout,$checkboxvalue,$checkboxchoices,$tex_option_switch, at opt);
+      $result.=&displayfoils($target,$max,$randomize,$TeXlayout,$checkboxvalue,$checkboxchoices,$tex_option_switch, $noprompt, @opt);
       $Apache::lonxml::post_evaluate=0;
     } elsif ( $target eq 'answer') {
       $result.=&displayanswers($max,$randomize, at opt);
@@ -486,7 +488,7 @@
 
 sub displayfoils {
   my ($target,$max,$randomize,$TeXlayout,$checkboxvalue,$checkboxchoices,
-      $tex_option_switch, at opt)=@_;
+      $tex_option_switch, $no_tfprompt, @opt)=@_;
   if (!defined(@{ $Apache::response::foilgroup{'names'} })) {return;}
   my @names = @{ $Apache::response::foilgroup{'names'} };
   my @truelist;
@@ -552,7 +554,7 @@
     }
     my $internal_counter=$Apache::lonxml::counter;
     my $checkboxopt=&check_box_opt($target,$checkboxvalue, at opt);
-    if ($checkboxopt) {
+    if ($checkboxopt && (!$no_tfprompt)) {
        $result.='<br />'.
                 ($checkboxchoices?&mt('Choices: ').'<b>'.$opt[0].','.$opt[1].'</b>. ':'').
                  &mt('Select all that are <b>[_1]</b>.',$checkboxopt);




More information about the LON-CAPA-cvs mailing list