Diff for /loncom/interface/lonpdfupload.pm between versions 1.22 and 1.25

version 1.22, 2012/09/14 11:24:06 version 1.25, 2015/06/09 21:22:57
Line 122  sub handler() { Line 122  sub handler() {
 sub get_javascripts() {  sub get_javascripts() {
           
     my $message = &mt('Please choose a PDF-File.');      my $message = &mt('Please choose a PDF-File.');
       &js_escape(\$message);
   
     # simple test if the upload ends with ".pdf"      # simple test if the upload ends with ".pdf"
     # it's only for giving a message to the user      # it's only for giving a message to the user
Line 183  sub processPDF { Line 184  sub processPDF {
         &grade_pdf(@pdfdata);          &grade_pdf(@pdfdata);
     } else {      } else {
         $result .= '<p class="LC_error">'          $result .= '<p class="LC_error">'
                   .&mt("Can't find any valid PDF formfields.")                    .&mt("Can't find any valid PDF form fields.")
                   .'</p>';                    .'</p>';
     }      }
 }  }
Line 193  sub get_pdf_data() { Line 194  sub get_pdf_data() {
     my $pdf = CAM::PDF->new($env{'form.file'});      my $pdf = CAM::PDF->new($env{'form.file'});
   
     if($pdf) {      if($pdf) {
         my @formFields = $pdf->getFormFieldList(); #get names of formfields          my @formFields = $pdf->getFormFieldList(); #get names of form fields
   
         foreach my $field (@formFields) {          foreach my $field (@formFields) {
             my $dict = $pdf->getFormFieldDict($pdf->getFormField($field)); # get formfield dictonary              my $dict = $pdf->getFormFieldDict($pdf->getFormField($field)); # get form field dictonary
   
             # this is necessary because CAM::PDF has a problem with formfieldnames which include a              # this is necessary because CAM::PDF has a problem with form fieldnames which include a
             # dot in fieldnames. So a fieldname like "i.am.aFormfield" will offer three fieldnames              # dot in fieldnames. So a fieldname like "i.am.aFormfield" will offer three fieldnames
             # "i", "i.am" and "i.am.aFormfield". The fragmentary names keep no values and will be ignored.              # "i", "i.am" and "i.am.aFormfield". The fragmentary names keep no values and will be ignored.
             if($dict->{'V'}) {              if($dict->{'V'}) {
Line 380  sub parse_grade_answer { Line 381  sub parse_grade_answer {
                        'DRAFT' => &mt('Copy saved but not submitted.'),                         'DRAFT' => &mt('Copy saved but not submitted.'),
      );       );
   
     foreach my $key (keys %answerhash) {      foreach my $key (keys(%answerhash)) {
         if($shortcut eq $key) {          if($shortcut eq $key) {
             return $answerhash{$shortcut};              return $answerhash{$shortcut};
         }            }  
Line 394  sub dumpenv  { Line 395  sub dumpenv  {
     my $r = shift;      my $r = shift;
   
     $r->print ("<br />-------------------<br />");      $r->print ("<br />-------------------<br />");
     foreach my $key (sort (keys %env)) {      foreach my $key (sort(keys(%env))) {
         $r->print ("<br />$key -> $env{$key}");          $r->print ("<br />$key -> $env{$key}");
     }      }
     $r->print ("<br />-------------------<br />");      $r->print ("<br />-------------------<br />");
     $r->print ("<br />-------------------<br />");      $r->print ("<br />-------------------<br />");
     foreach my $key (sort (keys %ENV)) {      foreach my $key (sort(keys(%ENV))) {
         $r->print ("<br />$key -> $ENV{$key}");          $r->print ("<br />$key -> $ENV{$key}");
     }      }
     $r->print ("<br />-------------------<br />");      $r->print ("<br />-------------------<br />");

Removed from v.1.22  
changed lines
  Added in v.1.25


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