Diff for /loncom/homework/inputtags.pm between versions 1.170 and 1.176

version 1.170, 2005/06/28 21:41:08 version 1.176, 2005/10/18 21:46:42
Line 46  sub initialize_inputtags { Line 46  sub initialize_inputtags {
     @Apache::inputtags::response=();      @Apache::inputtags::response=();
     # list of all response ids seen in this problem      # list of all response ids seen in this problem
     @Apache::inputtags::responselist=();      @Apache::inputtags::responselist=();
       # list of all current hint ids
       @Apache::inputtags::hint=();
       # list of all hint ids seen in this problem
       @Apache::inputtags::hintlist=();
     # list of whether or not a specific response was previously used      # list of whether or not a specific response was previously used
     @Apache::inputtags::previous=();      @Apache::inputtags::previous=();
     # submission it was used in      # submission it was used in
Line 75  sub check_for_duplicate_ids { Line 79  sub check_for_duplicate_ids {
     my %check;      my %check;
     foreach my $id (@Apache::inputtags::partlist,      foreach my $id (@Apache::inputtags::partlist,
     @Apache::inputtags::responselist,      @Apache::inputtags::responselist,
       @Apache::inputtags::hintlist,
     @Apache::inputtags::importlist) {      @Apache::inputtags::importlist) {
  $check{$id}++;   $check{$id}++;
     }      }
Line 301  sub end_hiddenline { Line 306  sub end_hiddenline {
 # $which -> 'uploadedonly'  -> only newly uploaded files  # $which -> 'uploadedonly'  -> only newly uploaded files
 #           'portfolioonly' -> only allow files from portfolio  #           'portfolioonly' -> only allow files from portfolio
 #           'both' -> allow files from either location  #           'both' -> allow files from either location
   # $extratext -> additional text to go between the link and the input box
 # returns a table row <tr>   # returns a table row <tr> 
 sub file_selector {  sub file_selector {
     my ($part,$id,$uploadedfiletypes,$which)=@_;      my ($part,$id,$uploadedfiletypes,$which,$extratext)=@_;
     if (!$uploadedfiletypes) { return ''; }      if (!$uploadedfiletypes) { return ''; }
   
     my $jspart=$part;      my $jspart=$part;
Line 324  sub file_selector { Line 330  sub file_selector {
   
  if ($uploadedfile) {   if ($uploadedfile) {
     my $url=$Apache::lonhomework::history{"resource.$part.$id.uploadedurl"};      my $url=$Apache::lonhomework::history{"resource.$part.$id.uploadedurl"};
     push (@Apache::lonxml::extlinks,$url);      &Apache::lonxml::extlink($url);
     &Apache::lonnet::allowuploaded('/adm/essayresponse',$url);      &Apache::lonnet::allowuploaded('/adm/essayresponse',$url);
     my $icon=&Apache::loncommon::icon($url);      my $icon=&Apache::loncommon::icon($url);
     my $curfile='<a href="'.$url.'"><img src="'.$icon.      my $curfile='<a href="'.$url.'"><img src="'.$icon.
Line 338  sub file_selector { Line 344  sub file_selector {
  $result.='<br />'.'<strong>'.&mt('OR:').'</strong><br />';   $result.='<br />'.'<strong>'.&mt('OR:').'</strong><br />';
     }      }
     if ($which eq 'portfolioonly' || $which eq 'both') {       if ($which eq 'portfolioonly' || $which eq 'both') { 
  $result.='<a href='."'".'javascript:void(window.open("/adm/portfolio?mode=selectfile&amp;fieldname=HWPORT'.$jspart.'_'.$id.'","cat","height=600,width=800,scrollbars=1,resizable=1,menubar=2,location=1"))'."'".'>'.   $result.=$extratext.'<a href='."'".'javascript:void(window.open("/adm/portfolio?mode=selectfile&amp;fieldname=HWPORT'.$jspart.'_'.$id.'","cat","height=600,width=800,scrollbars=1,resizable=1,menubar=2,location=1"))'."'".'>'.
     &mt('Select Portfolio Files').'</a><br />'.      &mt('Select Portfolio Files').'</a><br />'.
     '<input type="text" size="50" name="HWPORT'.$jspart.'_'.$id.'" value="" />'.      '<input type="text" size="50" name="HWPORT'.$jspart.'_'.$id.'" value="" />'.
     '<br />';      '<br />';
Line 426  sub decideoutput { Line 432  sub decideoutput {
     $message=&mt('Incorrect.');      $message=&mt('Incorrect.');
     $bgcolor=$possiblecolors{'charged_try'};      $bgcolor=$possiblecolors{'charged_try'};
  }   }
  if ($award eq 'ASSIGNED_SCORE') {   if ($env{'request.filename'} =~ 
       m|/res/lib/templates/examupload.problem$|) {
     $message = &mt("A score has been assigned.");      $message = &mt("A score has been assigned.");
       $added_computer_text=1;
  } else {   } else {
     if ($target eq 'tex') {      if ($target eq 'tex') {
  $message = '\textbf{'.$message.'}';   $message = '\textbf{'.$message.'}';

Removed from v.1.170  
changed lines
  Added in v.1.176


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