Diff for /loncom/homework/radiobuttonresponse.pm between versions 1.32 and 1.34

version 1.32, 2001/12/13 23:36:39 version 1.34, 2002/01/07 18:03:57
Line 65  sub end_radiobuttonresponse { Line 65  sub end_radiobuttonresponse {
   if ($target eq 'edit') { $result=&Apache::edit::end_table(); }    if ($target eq 'edit') { $result=&Apache::edit::end_table(); }
   &Apache::response::end_response;    &Apache::response::end_response;
   pop @Apache::lonxml::namespace;    pop @Apache::lonxml::namespace;
     &Apache::lonxml::deregister('Apache::radiobuttonresponse',('foilgroup','foil','conceptgroup'));
   return $result;    return $result;
 }  }
   
Line 77  sub start_foilgroup { Line 78  sub start_foilgroup {
 }  }
   
 sub storesurvey {  sub storesurvey {
   if ( defined $ENV{'form.submitted'}) {    if ( !defined($ENV{'form.submitted'})) { return ''; }
     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]+/) {    if ( $response !~ /[0-9]+/) { return ''; }
       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);    $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.submission"}=&Apache::lonnet::hash2str(%responsehash);
       $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.awarddetail"}='SUBMITTED';    $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.awarddetail"}='SUBMITTED';
       &Apache::lonxml::debug("submitted a $response<br />\n");    &Apache::lonxml::debug("submitted a $response<br />\n");
     }  
   }  
   return '';    return '';
 }  }
   
Line 154  sub end_foilgroup { Line 153  sub end_foilgroup {
 sub getfoilcounts {  sub getfoilcounts {
   my ($parstack,$safeeval)=@_;    my ($parstack,$safeeval)=@_;
   my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2');    my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2');
   my @names = @{ $Apache::response::foilgroup{'names'} };    my @names;
   my $truecnt=0;    my $truecnt=0;
   my $falsecnt=0;    my $falsecnt=0;
   my $name;    my $name;
     if ( $Apache::response::foilgroup{'names'} ) {
       @names= @{ $Apache::response::foilgroup{'names'} };
     }
   foreach $name (@names) {    foreach $name (@names) {
     if ($Apache::response::foilgroup{$name.'.value'} eq 'true') {      if ($Apache::response::foilgroup{$name.'.value'} eq 'true') {
       $truecnt++;        $truecnt++;
Line 196  sub whichfoils { Line 197  sub whichfoils {
   my @truelist;    my @truelist;
   my @falselist;    my @falselist;
   
   my @names = @{ $Apache::response::foilgroup{'names'} };    my @names;
     if ( $Apache::response::foilgroup{'names'} ) {
       @names= @{ $Apache::response::foilgroup{'names'} };
     }
   foreach my $name (@names) {    foreach my $name (@names) {
     #result.="<br /><b>$name</b> is <i> $Apache::response::foilgroup{$name.'.value'} </i>";      #result.="<br /><b>$name</b> is <i> $Apache::response::foilgroup{$name.'.value'} </i>";
     if ($Apache::response::foilgroup{$name.'.value'} eq 'true') {      if ($Apache::response::foilgroup{$name.'.value'} eq 'true') {
Line 257  sub displayfoils { Line 261  sub displayfoils {
   
 sub displayanswers {  sub displayanswers {
   my ($max,$answer)=@_;    my ($max,$answer)=@_;
   my @names = @{ $Apache::response::foilgroup{'names'} };  
   my @whichopt = &whichfoils($max,$answer);    my @whichopt = &whichfoils($max,$answer);
   my $result=&Apache::response::answer_header('radiobuttonresponse');    my $result=&Apache::response::answer_header('radiobuttonresponse');
   foreach my $name (@whichopt) {    foreach my $name (@whichopt) {

Removed from v.1.32  
changed lines
  Added in v.1.34


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