Diff for /loncom/homework/inputtags.pm between versions 1.271.2.9 and 1.271.2.10

version 1.271.2.9, 2011/10/10 17:47:58 version 1.271.2.10, 2013/04/30 21:45:47
Line 185  sub start_textfield { Line 185  sub start_textfield {
             }              }
         }          }
         unless ($newvariation) {          unless ($newvariation) {
     $oldresponse = &HTML::Entities::encode($Apache::lonhomework::history{"resource.$partid.$resid.submission"},'<>&"');              if ((($env{'form.grade_username'} eq '') && ($env{'form.grade_domain'} eq '')) ||
                   (($env{'form.grade_username'} eq $env{'user.name'}) &&
                    ($env{'form.grade_domain'} eq $env{'user.domain'}))) {
                   $oldresponse = $Apache::lonhomework::history{"resource.$partid.$resid.submission"};
               } elsif (($Apache::lonhomework::history{"resource.$partid.type"} eq 'anonsurvey') ||
                       ($Apache::lonhomework::history{"resource.$partid.type"} eq 'anonsurveycred')) {
                   $oldresponse = '* '.&mt('only shown to submitter').' *';
               } else {
                   $oldresponse = $Apache::lonhomework::history{"resource.$partid.$resid.submission"};
               }
         }          }
  if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {   if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
     my $cols = &Apache::lonxml::get_param('cols',$parstack,$safeeval);      my $cols = &Apache::lonxml::get_param('cols',$parstack,$safeeval);
Line 200  sub start_textfield { Line 209  sub start_textfield {
             my $textareaclass = 'class="LC_richDetectHtml"';              my $textareaclass = 'class="LC_richDetectHtml"';
     $result.= '<textarea wrap="hard" name="HWVAL_'.$resid.'" id="HWVAL_'.$resid.'" '.      $result.= '<textarea wrap="hard" name="HWVAL_'.$resid.'" id="HWVAL_'.$resid.'" '.
       'rows="'.$rows.'" cols="'.$cols.'" '.$textareaclass.'>'.        'rows="'.$rows.'" cols="'.$cols.'" '.$textareaclass.'>'.
                       $oldresponse;                        &HTML::Entities::encode($oldresponse,'<>&"');
     if ($oldresponse ne '') {      if ($oldresponse ne '') {
   
  #get rid of any startup text if the user has already responded   #get rid of any startup text if the user has already responded
Line 352  sub start_textline { Line 361  sub start_textline {
                 }                  }
             }              }
             unless ($newvariation) {              unless ($newvariation) {
         $oldresponse = $Apache::lonhomework::history{"resource.$partid.$id.submission"};                  if ((($env{'form.grade_username'} eq '') && ($env{'form.grade_domain'} eq '')) ||
                       (($env{'form.grade_username'} eq $env{'user.name'}) &&
                        ($env{'form.grade_domain'} eq $env{'user.domain'}))) {
                       $oldresponse = $Apache::lonhomework::history{"resource.$partid.$id.submission"};
                   } elsif (($Apache::lonhomework::history{"resource.$partid.type"} eq 'anonsurvey') ||
                           ($Apache::lonhomework::history{"resource.$partid.type"} eq 'anonsurveycred') ||
                           ($Apache::lonhomework::type eq 'anonsurvey') ||
                           ($Apache::lonhomework::type eq 'anonsurveycred')) {
                           $oldresponse = '* '.&mt('only shown to submitter').' *';
                   } else {
                       $oldresponse = $Apache::lonhomework::history{"resource.$partid.$id.submission"};
                   }
         &Apache::lonxml::debug("oldresponse $oldresponse is ".ref($oldresponse));          &Apache::lonxml::debug("oldresponse $oldresponse is ".ref($oldresponse));
   
         if (ref($oldresponse) eq 'ARRAY') {          if (ref($oldresponse) eq 'ARRAY') {
     $oldresponse = $oldresponse->[$#Apache::inputtags::inputlist];      $oldresponse = $oldresponse->[$#Apache::inputtags::inputlist];
         }          }

Removed from v.1.271.2.9  
changed lines
  Added in v.1.271.2.10


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