Diff for /loncom/homework/optionresponse.pm between versions 1.102 and 1.103

version 1.102, 2004/02/19 21:55:54 version 1.103, 2004/03/08 23:23:04
Line 27 Line 27
 #  #
 package Apache::optionresponse;  package Apache::optionresponse;
 use strict;  use strict;
 use Apache::response;  use Apache::response();
   use Apache::lonlocal;
   
 BEGIN {  BEGIN {
   &Apache::lonxml::register('Apache::optionresponse',('optionresponse'));    &Apache::lonxml::register('Apache::optionresponse',('optionresponse'));
Line 41  sub start_optionresponse { Line 42  sub start_optionresponse {
   push (@Apache::lonxml::namespace,'optionresponse');    push (@Apache::lonxml::namespace,'optionresponse');
   my $id = &Apache::response::start_response($parstack,$safeeval);    my $id = &Apache::response::start_response($parstack,$safeeval);
   %Apache::hint::option=();    %Apache::hint::option=();
     undef(%Apache::response::foilnames);
   if ($target eq 'edit') {    if ($target eq 'edit') {
     $result.=&Apache::edit::start_table($token).      $result.=&Apache::edit::start_table($token).
  "<tr><td>Multiple Option Response Question ".   "<tr><td>Multiple Option Response Question ".
Line 75  sub end_optionresponse { Line 77  sub end_optionresponse {
   &Apache::lonxml::deregister('Apache::optionresponse',('foilgroup','foil','conceptgroup'));    &Apache::lonxml::deregister('Apache::optionresponse',('foilgroup','foil','conceptgroup'));
   my $result;    my $result;
   if ($target eq 'edit') { $result=&Apache::edit::end_table(); }    if ($target eq 'edit') { $result=&Apache::edit::end_table(); }
     undef(%Apache::response::foilnames);
   return $result;    return $result;
 }  }
   
Line 565  sub end_foil { Line 568  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);
       my $location =&Apache::lonxml::get_param('location',$parstack,$safeeval);        $Apache::response::foilnames{$name}++;
       &Apache::lonxml::debug("Got a name of :$name:");        &Apache::lonxml::debug("Got a name of :$name:");
       if (!$name) { $name=$Apache::lonxml::curdepth; }        if (!$name) { $name=$Apache::lonxml::curdepth; }
       &Apache::lonxml::debug("Using a name of :$name:");        &Apache::lonxml::debug("Using a name of :$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));
         }
         my $location =&Apache::lonxml::get_param('location',$parstack,$safeeval);
       if ( $Apache::optionresponse::conceptgroup        if ( $Apache::optionresponse::conceptgroup
    && !&Apache::response::showallfoils() ) {     && !&Apache::response::showallfoils() ) {
  push @{ $Apache::response::conceptgroup{'names'} }, $name;   push @{ $Apache::response::conceptgroup{'names'} }, $name;

Removed from v.1.102  
changed lines
  Added in v.1.103


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