Diff for /loncom/homework/radiobuttonresponse.pm between versions 1.95 and 1.98

version 1.95, 2004/10/07 20:28:30 version 1.98, 2005/01/10 19:21:57
Line 118  sub storesurvey { Line 118  sub storesurvey {
     my $response = $ENV{'form.HWVAL_'.$Apache::inputtags::response['-1']};      my $response = $ENV{'form.HWVAL_'.$Apache::inputtags::response['-1']};
     &Apache::lonxml::debug("Here I am!:$response:");      &Apache::lonxml::debug("Here I am!:$response:");
     if ( $response !~ /[0-9]+/) { return ''; }      if ( $response !~ /[0-9]+/) { return ''; }
       my $part = $Apache::inputtags::part;
     my $id = $Apache::inputtags::response['-1'];      my $id = $Apache::inputtags::response['-1'];
     my @whichfoils=@{ $Apache::response::foilgroup{'names'} };      my @whichfoils=@{ $Apache::response::foilgroup{'names'} };
     my %responsehash;      my %responsehash;
     $responsehash{$whichfoils[$response]}=$response;      $responsehash{$whichfoils[$response]}=$response;
     $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.submission"}=&Apache::lonnet::hash2str(%responsehash);      my $responsestr=&Apache::lonnet::hash2str(%responsehash);
     $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.awarddetail"}='SUBMITTED';      $Apache::lonhomework::results{"resource.$part.$id.submission"}=
    $responsestr;
       my %previous=&Apache::response::check_for_previous($responsestr,$part,$id);
       my $ad=$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}='SUBMITTED';
       &Apache::response::handle_previous(\%previous,$ad);
     &Apache::lonxml::debug("submitted a $response<br />\n");      &Apache::lonxml::debug("submitted a $response<br />\n");
     return '';      return '';
 }  }
Line 307  sub whichfoils { Line 312  sub whichfoils {
  &Apache::lonxml::error(&HTML::Entities::encode("No valid value assigned ($Apache::response::foilgroup{$name.'.value'}) for foil $name in <foilgroup>",'<>&"'));   &Apache::lonxml::error(&HTML::Entities::encode("No valid value assigned ($Apache::response::foilgroup{$name.'.value'}) for foil $name in <foilgroup>",'<>&"'));
     }      }
  }   }
    if (!$havetrue && $Apache::lonhomework::type ne 'survey') {
       &Apache::lonxml::error("There are no true statements available.<br />");
    }
     } else {      } else {
  my $current=0;   my $current=0;
  &Apache::lonhomework::showhash(%Apache::response::foilgroup);   &Apache::lonhomework::showhash(%Apache::response::foilgroup);
Line 598  sub end_foil { Line 606  sub end_foil {
  my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval);   my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval);
  if ($value ne 'unused') {   if ($value ne 'unused') {
     my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval);      my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval);
     if (!$name) { $name=$Apache::lonxml::curdepth; }      if (!$name) {
    &Apache::lonxml::error("Foils without names exist. This can cause problems to malfunction.");
    $name=$Apache::lonxml::curdepth;
       }
     if (defined($Apache::response::foilnames{$name})) {      if (defined($Apache::response::foilnames{$name})) {
  &Apache::lonxml::error(&mt("Foil name <b><tt>[_1]</tt></b> appears more than once. Foil names need to be unique.",$name));   &Apache::lonxml::error(&mt("Foil name <b><tt>[_1]</tt></b> appears more than once. Foil names need to be unique.",$name));
     }      }

Removed from v.1.95  
changed lines
  Added in v.1.98


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