Diff for /loncom/imspackages/imsprocessor.pm between versions 1.20 and 1.22

version 1.20, 2005/05/03 18:38:37 version 1.22, 2005/07/12 16:05:59
Line 24 Line 24
 package Apache::imsprocessor;  package Apache::imsprocessor;
   
 use Apache::lonnet;  use Apache::lonnet;
   use Apache::loncleanup;
 use LWP::UserAgent;  use LWP::UserAgent;
 use HTTP::Request::Common;  use HTTP::Request::Common;
 use LONCAPA::Configuration;  use LONCAPA::Configuration;
Line 2864  sub write_webct4_questions { Line 2865  sub write_webct4_questions {
         }          }
         if ($$settings{$id}{texttype} eq 'text/html') {          if ($$settings{$id}{texttype} eq 'text/html') {
             $$settings{$id}{text} = &HTML::Entities::decode($$settings{$id}{text});              $$settings{$id}{text} = &HTML::Entities::decode($$settings{$id}{text});
             $$settings{$id}{text} = &Apache::lonxml::htmlclean($$settings{$id}{text});              $$settings{$id}{text} = &Apache::loncleanup::htmlclean($$settings{$id}{text});
             $$settings{$id}{text} =~ s#(<img src=["']?)([^>]+)(/?>)#$1../../resfiles/$2 />#gi;              $$settings{$id}{text} =~ s#(<img src=["']?)([^>]+)(/?>)#$1../../resfiles/$2 />#gi;
             $$settings{$id}{text} =~ s#<([bh])r>#<$1r />#g;              $$settings{$id}{text} =~ s#<([bh])r>#<$1r />#g;
 #            $$settings{$id}{text} =~ s#<p>#</p><p>#g;  #            $$settings{$id}{text} =~ s#<p>#</p><p>#g;
Line 2892  sub write_webct4_questions { Line 2893  sub write_webct4_questions {
         $resourcedata{$symb.'randomize'} = 'yes';          $resourcedata{$symb.'randomize'} = 'yes';
         $resourcedata{$symb.'maxfoils'} = 10;          $resourcedata{$symb.'maxfoils'} = 10;
         if ($context eq 'CSTR') {          if ($context eq 'CSTR') {
             $output = qq|<problem>              unless ($$settings{$id}{class} eq 'numerical') {
                   $output = qq|<problem>
 |;  |;
               }
         }          }
         $$total{prob} ++;          $$total{prob} ++;
         if (exists($$settings{$id}{uri})) {          if (exists($$settings{$id}{uri})) {
Line 2954  sub write_webct4_questions { Line 2957  sub write_webct4_questions {
                             }                              }
                             if ($$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{texttype} eq 'text/html') {                              if ($$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{texttype} eq 'text/html') {
                                 $$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text} = &HTML::Entities::decode($$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text});                                  $$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text} = &HTML::Entities::decode($$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text});
                                 $$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text} = &Apache::lonxml::htmlclean($$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text});                                  $$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text} = &Apache::loncleanup::htmlclean($$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text});
                                 $$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text} =~  s#(<img src=")([^>]+)>#$1../../resfiles/$2 />#gi;                                  $$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text} =~  s#(<img src=")([^>]+)>#$1../../resfiles/$2 />#gi;
                                 $$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text} =~  s#</?p>##g;                                  $$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text} =~  s#</?p>##g;
   
Line 2996  sub write_webct4_questions { Line 2999  sub write_webct4_questions {
                             }                              }
                             if ($$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{texttype} eq 'text/html') {                              if ($$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{texttype} eq 'text/html') {
                                 $$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text} = &HTML::Entities::decode($$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text});                                  $$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text} = &HTML::Entities::decode($$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text});
                                 $$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text} = &Apache::lonxml::htmlclean($$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text});                                  $$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text} = &Apache::loncleanup::htmlclean($$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text});
   
                                 $$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text} =~  s#(<img src=")([^>]+)>#$1../../resfiles/$2 />#gi;                                  $$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text} =~  s#(<img src=")([^>]+)>#$1../../resfiles/$2 />#gi;
                                 $$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text} =~  s#</?p>##g;                                  $$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text} =~  s#</?p>##g;
Line 3028  sub write_webct4_questions { Line 3031  sub write_webct4_questions {
                                                             
                             $$settings{$id}{$grp}{$answer_id}{text} = &HTML::Entities::decode($$settings{$id}{$grp}{$answer_id}{text});                              $$settings{$id}{$grp}{$answer_id}{text} = &HTML::Entities::decode($$settings{$id}{$grp}{$answer_id}{text});
                             $test_for_html = &test_for_html($$settings{$id}{$grp}{$answer_id}{text});                              $test_for_html = &test_for_html($$settings{$id}{$grp}{$answer_id}{text});
                             $$settings{$id}{$grp}{$answer_id}{text} = &Apache::lonxml::chtmlclean($$settings{$id}{$grp}{$answer_id}{text});                              $$settings{$id}{$grp}{$answer_id}{text} = &Apache::loncleanup::htmlclean($$settings{$id}{$grp}{$answer_id}{text});
                             $$settings{$id}{$grp}{$answer_id}{text} =~  s#(<img src=")([^>]+)>#$1../../resfiles/$2 />#gi;                              $$settings{$id}{$grp}{$answer_id}{text} =~  s#(<img src=")([^>]+)>#$1../../resfiles/$2 />#gi;
                             $$settings{$id}{$grp}{$answer_id}{text} =~  s#</?p>##g;                              $$settings{$id}{$grp}{$answer_id}{text} =~  s#</?p>##g;
                         }                          }
Line 3091  sub write_webct4_questions { Line 3094  sub write_webct4_questions {
                 for (my $k=0; $k<@{$$allchoices{$id}}; $k++) {                  for (my $k=0; $k<@{$$allchoices{$id}}; $k++) {
                     if ($$settings{$id}{$$allchoices{$id}[$k]}{texttype} eq 'text/html') {                      if ($$settings{$id}{$$allchoices{$id}[$k]}{texttype} eq 'text/html') {
                         $$settings{$id}{$$allchoices{$id}[$k]}{text} = &HTML::Entities::decode($$settings{$id}{$$allchoices{$id}[$k]}{text});                          $$settings{$id}{$$allchoices{$id}[$k]}{text} = &HTML::Entities::decode($$settings{$id}{$$allchoices{$id}[$k]}{text});
                         $$settings{$id}{$$allchoices{$id}[$k]}{text} = &Apache::lonxml::htmlclean($$settings{$id}{$$allchoices{$id}[$k]}{text});                          $$settings{$id}{$$allchoices{$id}[$k]}{text} = &Apache::loncleanup::htmlclean($$settings{$id}{$$allchoices{$id}[$k]}{text});
                         $$settings{$id}{$$allchoices{$id}[$k]}{text} =~  s#(<img src=")([^>]+)>#$1../../resfiles/$2 />#gi;                          $$settings{$id}{$$allchoices{$id}[$k]}{text} =~  s#(<img src=")([^>]+)>#$1../../resfiles/$2 />#gi;
                         $$settings{$id}{$$allchoices{$id}[$k]}{text} =~  s#</?p>##g;                          $$settings{$id}{$$allchoices{$id}[$k]}{text} =~  s#</?p>##g;
                     }                      }
Line 3278  sub write_webct4_questions { Line 3281  sub write_webct4_questions {
 </script>  </script>
 |;  |;
                     if ($context eq 'CSTR') {                      if ($context eq 'CSTR') {
                         $output = $scriptblock.$output;                          $output = "<problem>\n".$scriptblock.$output;
                         my $ansformat = '';                          my $ansformat = '';
                         my $sigfig = '0,15';                          my $sigfig = '0,15';
                         if ($$settings{$id}{$numid}{format} eq 'sig') {                          if ($$settings{$id}{$numid}{format} eq 'sig') {

Removed from v.1.20  
changed lines
  Added in v.1.22


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