Diff for /loncom/interface/loncommon.pm between versions 1.55 and 1.56

version 1.55, 2002/08/21 17:18:08 version 1.56, 2002/08/22 13:39:42
Line 885  sub keyword { Line 885  sub keyword {
     return exists($Keywords{$word});      return exists($Keywords{$word});
 }  }
   
 ###################################################  
 #         Old code, to be removed soon            #  
 ###################################################  
 # -------------------------------------------------------- Return related words  
 #sub related {  
 #    my $newword=shift;  
 #    $newword=~s/\W//g;  
 #    $newword=~tr/A-Z/a-z/;  
 #    my $tindex=$theindex{$newword};  
 #    if ($tindex) {  
 #        my %found=();  
 #        foreach (split(/\,/,$therelated[$tindex])) {  
 ## - Related word found  
 #            my ($ridx,$rcount)=split(/\:/,$_);  
 ## - Direct relation index  
 #            my $directrel=$rcount/$thecount[$tindex];  
 #            if ($directrel>$thethreshold) {  
 #               foreach (split(/\,/,$therelated[$ridx])) {  
 #                  my ($rridx,$rrcount)=split(/\:/,$_);  
 #                  if ($rridx==$tindex) {  
 ## - Determine reverse relation index  
 #                     my $revrel=$rrcount/$thecount[$ridx];  
 ## - Calculate full index  
 #                     $found{$ridx}=$directrel*$revrel;  
 #                     if ($found{$ridx}>$thethreshold) {  
 #                        foreach (split(/\,/,$therelated[$ridx])) {  
 #                            my ($rrridx,$rrrcount)=split(/\:/,$_);  
 #                            unless ($found{$rrridx}) {  
 #                               my $revrevrel=$rrrcount/$thecount[$ridx];  
 #                               if (  
 #                          $directrel*$revrel*$revrevrel>$thethreshold  
 #                               ) {  
 #                                  $found{$rrridx}=  
 #                                       $directrel*$revrel*$revrevrel;  
 #                               }  
 #                            }  
 #                        }  
 #                     }  
 #                  }  
 #               }  
 #            }  
 #        }  
 #    }  
 #    return ();  
 #}  
   
 ###############################################################  ###############################################################
   
 =pod   =pod 
Line 947  Uses global $thesaurus_db_file. Line 901  Uses global $thesaurus_db_file.
 =cut  =cut
   
 ###############################################################  ###############################################################
   
 sub get_related_words {  sub get_related_words {
     my $keyword = shift;      my $keyword = shift;
     my %thesaurus_db;      my %thesaurus_db;
Line 1370  sub upfile_store { Line 1323  sub upfile_store {
     return $datatoken;      return $datatoken;
 }  }
   
   =pod
   
 =item load_tmp_file($r)  =item load_tmp_file($r)
   
 Load uploaded file from tmp, $r should be the HTTP Request object,  Load uploaded file from tmp, $r should be the HTTP Request object,
Line 1391  sub load_tmp_file { Line 1346  sub load_tmp_file {
     $ENV{'form.upfile'}=join('',@studentdata);      $ENV{'form.upfile'}=join('',@studentdata);
 }  }
   
   =pod
   
 =item upfile_record_sep()  =item upfile_record_sep()
   
 Separate uploaded file into records  Separate uploaded file into records
Line 1406  sub upfile_record_sep { Line 1363  sub upfile_record_sep {
     }      }
 }  }
   
   =pod
   
 =item record_sep($record)  =item record_sep($record)
   
 Separate a record into fields $record should be an item from the upfile_record_sep(), needs $ENV{'form.upfiletype'}  Separate a record into fields $record should be an item from the upfile_record_sep(), needs $ENV{'form.upfiletype'}
Line 1456  sub record_sep { Line 1415  sub record_sep {
     return %components;      return %components;
 }  }
   
   =pod
   
 =item upfile_select_html()  =item upfile_select_html()
   
 return HTML code to select file and specify its type  return HTML code to select file and specify its type
Line 1474  sub upfile_select_html { Line 1435  sub upfile_select_html {
 ENDUPFORM  ENDUPFORM
 }  }
   
   =pod
   
 =item csv_print_samples($r,$records)  =item csv_print_samples($r,$records)
   
 Prints a table of sample values from each column uploaded $r is an  Prints a table of sample values from each column uploaded $r is an
Line 1504  sub csv_print_samples { Line 1467  sub csv_print_samples {
     $r->print('</tr></table><br />'."\n");      $r->print('</tr></table><br />'."\n");
 }  }
   
   =pod
   
 =item csv_print_select_table($r,$records,$d)  =item csv_print_select_table($r,$records,$d)
   
 Prints a table to create associations between values and table columns.  Prints a table to create associations between values and table columns.
Line 1536  sub csv_print_select_table { Line 1501  sub csv_print_select_table {
     return $i;      return $i;
 }  }
   
   =pod
   
 =item csv_samples_select_table($r,$records,$d)  =item csv_samples_select_table($r,$records,$d)
   
 Prints a table of sample values from the upload and can make associate samples to internal names.  Prints a table of sample values from the upload and can make associate samples to internal names.

Removed from v.1.55  
changed lines
  Added in v.1.56


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