Diff for /loncom/homework/lonsimpleproblemedit.pm between versions 1.29 and 1.30

version 1.29, 2009/10/19 15:15:03 version 1.30, 2009/12/02 18:33:20
Line 128  sub foil { Line 128  sub foil {
     unless ($positions{$position}) {      unless ($positions{$position}) {
  $position='random';   $position='random';
     }      }
     my $selectvalue=&Apache::loncommon::select_form      my $selectvalue=&Apache::loncommon::select_form(
                                 ($value,'value'.$number,%values);                          $value,
     my $selectposition=&Apache::loncommon::select_form                          'value'.$number,
                                ($position,'position'.$number,%positions);                          &Apache::lonlocal::texthash(%values));
       my $selectposition=&Apache::loncommon::select_form(
                              $position,
                              'position'.$number,
                              &Apache::lonlocal::texthash(%positions));
     my $text=$qparms{$prefix.'text'.$number};      my $text=$qparms{$prefix.'text'.$number};
     my %lt=&Apache::lonlocal::texthash('foil'  => 'Foil',      my %lt=&Apache::lonlocal::texthash('foil'  => 'Foil',
        'value' => 'Value',         'value' => 'Value',
Line 284  sub handler { Line 288  sub handler {
         );          );
         $r->print('<form name="simpleedit" method="post">');          $r->print('<form name="simpleedit" method="post">');
 # Question Type          # Question Type        
  my %questiontypes=('radio'  =>           my %questiontypes=(
                                '1 out of N multiple choice (radio button)',                 'radio'     => '1 out of N multiple choice (radio button)',
    'option' => 'Option response',                 'option'    => 'Option Response',
                            'string' => 'Short string response',                 'string'    => 'Short string response',
                            'essay'  => 'Essay, open end',                 'essay'     => 'Essay, open end',
                            'numerical' => 'Numerical response');                 'numerical' => 'Numerical Response');
         $qtype=$qparms{$prefix.'questiontype'};          $qtype=$qparms{$prefix.'questiontype'};
         unless (defined($qtype)) { $qtype='radio'; }          unless (defined($qtype)) { $qtype='radio'; }
         unless ($questiontypes{$qtype}) { $qtype='radio'; }          unless ($questiontypes{$qtype}) { $qtype='radio'; }
         $r->print(          $r->print(
             '<fieldset style="width:400px;">'              '<fieldset style="width:400px;">'
            .'<legend>'.&mt('Question Type').'</legend>'             .'<legend>'.&mt('Question Type').'</legend>'
            .&Apache::loncommon::select_form             .&Apache::loncommon::select_form(
             ($qtype,'questiontype',%questiontypes)                  $qtype,
                   'questiontype',
                   &Apache::lonlocal::texthash(%questiontypes))
            .'</fieldset>'             .'</fieldset>'
         );          );
         $r->print(          $r->print(
Line 318  sub handler { Line 324  sub handler {
             unless (defined($maxfoils)) { $maxfoils=10; }              unless (defined($maxfoils)) { $maxfoils=10; }
             unless ($maxfoils=~/^\d+$/) { $maxfoils=10; }              unless ($maxfoils=~/^\d+$/) { $maxfoils=10; }
             if ($maxfoils<=0) { $maxfoils=10; }              if ($maxfoils<=0) { $maxfoils=10; }
     my %randomizes=('yes' => 'Display foils in random order',              my %randomizes=(
     'no'  => 'Display foils in order given');                     'yes' => 'Display foils in random order',
                      'no'  => 'Display foils in order given');
     my $randomize=$qparms{$prefix.'randomize'};      my $randomize=$qparms{$prefix.'randomize'};
             unless (defined($randomize)) { $randomize='yes'; }              unless (defined($randomize)) { $randomize='yes'; }
             unless ($randomizes{$randomize}) { $randomize='yes'; }              unless ($randomizes{$randomize}) { $randomize='yes'; }
Line 327  sub handler { Line 334  sub handler {
   '<table bgcolor="#00ee44" cellspacing="4" cellpadding="2" style="width:100%">'.    '<table bgcolor="#00ee44" cellspacing="4" cellpadding="2" style="width:100%">'.
           '<tr><td>'.&mt('Max number of foils displayed').            '<tr><td>'.&mt('Max number of foils displayed').
 ': <input type="text" size="3" name="maxfoils" value="'.$maxfoils.'" />&nbsp;&nbsp;'.  ': <input type="text" size="3" name="maxfoils" value="'.$maxfoils.'" />&nbsp;&nbsp;'.
       &Apache::loncommon::select_form                        &Apache::loncommon::select_form(
       ($randomize,'randomize',%randomizes).                            $randomize,
                             'randomize',
                             &Apache::lonlocal::texthash(%randomizes)).
   '</td></tr><tr><td bgcolor="#F0F0F0">');    '</td></tr><tr><td bgcolor="#F0F0F0">');
 # Option Response: Options  # Option Response: Options
     if ($qtype eq 'option') {      if ($qtype eq 'option') {
Line 371  sub handler { Line 380  sub handler {
     $r->print(      $r->print(
   '<table bgcolor="#00ee44" cellspacing="4" cellpadding="2" style="width:100%">'.    '<table bgcolor="#00ee44" cellspacing="4" cellpadding="2" style="width:100%">'.
           '<tr><td><label>'.&mt('Correct answer').': <input type="text" size="20" name="stringanswer" value="'.$stringanswer.'" /></label>&nbsp;&nbsp;'.            '<tr><td><label>'.&mt('Correct answer').': <input type="text" size="20" name="stringanswer" value="'.$stringanswer.'" /></label>&nbsp;&nbsp;'.
       &Apache::loncommon::select_form                        &Apache::loncommon::select_form(
       ($stringtype,'stringtype',%stringtypes).                            $stringtype,
                             'stringtype',
                             &Apache::lonlocal::texthash(%stringtypes)).
   '</td></tr></table><br />');    '</td></tr></table><br />');
 # Hint  # Hint
     $r->print(&hint());      $r->print(&hint());

Removed from v.1.29  
changed lines
  Added in v.1.30


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