Diff for /loncom/homework/radiobuttonresponse.pm between versions 1.135 and 1.139

version 1.135, 2008/09/05 12:50:45 version 1.139, 2008/11/20 15:19:15
Line 25 Line 25
 # http://www.lon-capa.org/  # http://www.lon-capa.org/
 #  #
   
   
   
 package Apache::radiobuttonresponse;  package Apache::radiobuttonresponse;
 use strict;  use strict;
 use HTML::Entities();  use HTML::Entities();
Line 65  sub start_radiobuttonresponse { Line 67  sub start_radiobuttonresponse {
     if ($target eq 'meta') {      if ($target eq 'meta') {
  $result=&Apache::response::meta_package_write('radiobuttonresponse');   $result=&Apache::response::meta_package_write('radiobuttonresponse');
     } elsif ($target eq 'edit' ) {      } elsif ($target eq 'edit' ) {
  $result.=&Apache::edit::start_table($token).   $result.=&Apache::edit::start_table($token)
     '<tr><td>'.&Apache::lonxml::description($token).             .'<tr><td>'.&Apache::lonxml::description($token)
     &Apache::loncommon::help_open_topic('Radio_Response_Problems').             .&Apache::loncommon::help_open_topic('Radio_Response_Problems')
     "</td><td>Delete:".             .'</td>'
     &Apache::edit::deletelist($target,$token)             .'<td><span class="LC_nobreak">'.&mt('Delete?').' '
     ."</td><td>&nbsp".&Apache::edit::end_row()             .&Apache::edit::deletelist($target,$token)
     .&Apache::edit::start_spanning_row();             .'</span></td>'
              .'<td>&nbsp'.&Apache::edit::end_row()
              .&Apache::edit::start_spanning_row();
  $result.=   $result.=
     &Apache::edit::text_arg('Max Number Of Shown Foils:','max',      &Apache::edit::text_arg('Max Number Of Shown Foils:','max',
     $token,'4').      $token,'4').
     &Apache::edit::select_arg('Randomize Foil Order','randomize',      &Apache::edit::select_arg('Randomize Foil Order:','randomize',
       ['yes','no'],$token).        ['yes','no'],$token).
     &Apache::edit::select_arg('Display Direction','direction',      &Apache::edit::select_arg('Display Direction','direction',
       ['vertical','horizontal'],$token).        ['vertical','horizontal'],$token).
Line 401  sub displayallfoils { Line 405  sub displayallfoils {
     return $result;      return $result;
 }  }
   
 =pod  
   
 =item &whichfoils($max,$randomize)  
   
 Randomizes the list of foils.  
 Respects  
   - each foils desire to be randomized  
   - the existance of Concept groups of foils (select 1 foil from each)  
   - and selects a single correct statement from all possilble true statments  
   - and limits it to a toal of $max foils  
   
 WARNING: this routine uses the random number generator, it should only  
 be called once per target, otherwise it can cause randomness changes in  
 homework problems.  
   
 Arguments  
   $max - maximum number of foils to select (including the true one)  
          (so a max of 5 is: 1 true, 4 false)  
   
   $randomize - whether to randomize the listing of foils, by default  
                will randomize, only if randomize is 'no' will it not  
   
 Returns  
   $answer - location in the array of the correct answer  
   @foils  - array of foil names in to display order  
   
 =cut  
   
 sub whichfoils {  sub whichfoils {
     my ($max,$randomize)=@_;      my ($max,$randomize)=@_;
Line 831  sub insert_foil { Line 808  sub insert_foil {
 }  }
 1;  1;
 __END__  __END__
   
   
   
   =head1 NAME
   
   Apache::radiobuttonresponse
   
   =head1 SYNOPSIS
   
   Handles multiple-choice style responses.
   
   This is part of the LearningOnline Network with CAPA project
   described at http://www.lon-capa.org.
   
   =head1 SUBROUTINES
   
   =over
   
   =item start_radiobuttonresponse()
   
   =item bubble_line_count()
   
   =item end_radiobuttonresponse()
   
   =item start_foilgroup()
   
   =item storesurvey()
   
   =item grade_response()
   
   =item end_foilgroup()
   
   =item getfoilcounts()
   
   =item format_prior_answer()
   
   =item displayallfoils()
   
   =item &whichfoils($max,$randomize)
   
   Randomizes the list of foils.
   Respects
     - each foils desire to be randomized
     - the existance of Concept groups of foils (select 1 foil from each)
     - and selects a single correct statement from all possilble true statments
     - and limits it to a toal of $max foils
   
   WARNING: this routine uses the random number generator, it should only
   be called once per target, otherwise it can cause randomness changes in
   homework problems.
   
   Arguments
     $max - maximum number of foils to select (including the true one)
            (so a max of 5 is: 1 true, 4 false)
   
     $randomize - whether to randomize the listing of foils, by default
                  will randomize, only if randomize is 'no' will it not
   
   Returns
     $answer - location in the array of the correct answer
     @foils  - array of foil names in to display order
   
   =item displayfoils()
   
   =item displayallanswers()
   
   =item displayanswers()
   
   =item start_conceptgroup()
   
   =item end_conceptgroup()
   
   =item insert_conceptgroup()
   
   =item start_foil()
   
   =item end_foil()
   
   =item insert_foil()
   
   =back
   
   =cut
     

Removed from v.1.135  
changed lines
  Added in v.1.139


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>