Diff for /loncom/imspackages/imsexport.pm between versions 1.10 and 1.13

version 1.10, 2012/05/07 02:12:54 version 1.13, 2016/06/20 16:39:26
Line 395  sub process_content { Line 395  sub process_content {
         }          }
     } elsif ($symb =~ m-\.(sequence|page)___\d+___uploaded/$cdom/$cnum/-) {      } elsif ($symb =~ m-\.(sequence|page)___\d+___uploaded/$cdom/$cnum/-) {
         $$content_file = &replicate_content($cdom,$cnum,$tempexport,$symb,$count,\$message,$href,'uploaded');          $$content_file = &replicate_content($cdom,$cnum,$tempexport,$symb,$count,\$message,$href,'uploaded');
     } elsif ($symb =~ m-\.(sequence|page)___\d+___([^/]+)/([^/]+)-) {      } elsif ($symb =~ m-\.(?:sequence|page)___\d+___($match_domain/$match_name/.+)$-) {
         my $canedit = 0;          my $url = &Apache::lonnet::clutter($1);
         if ($2 eq $env{'user.domain'} && $3 eq $env{'user.name'})  {          $url =~ s{^/res/}{/priv/};
             $canedit= 1;  
         }  
 # only include problem code where current user is author  
         if (($format eq 'html') || ($format eq 'plaintext')) {          if (($format eq 'html') || ($format eq 'plaintext')) {
             my $title = $curRes->title;              my $title = $curRes->title;
             $$content_file = &replicate_content($cdom,$cnum,$tempexport,$symb,$count,\$message,$href,$format,$currdirpath,$title,$testbank);              $$content_file = &replicate_content($cdom,$cnum,$tempexport,$symb,$count,\$message,$href,$format,$currdirpath,$title,$testbank);
         } elsif ($format eq 'xml') {          } elsif ($format eq 'xml') {
             if ($canedit) {  # only include problem code where current user is author or co-author,
   # or this is a course "author" resource.
               my ($ownername,$ownerdom,$ownerhome) = &Apache::lonnet::constructaccess($url);
               if (($ownername ne '') && ($ownerdom ne '') && ($ownerhome ne '')) {
                 $$content_file = &replicate_content($cdom,$cnum,$tempexport,$symb,$count,\$message,$href,'resource');                  $$content_file = &replicate_content($cdom,$cnum,$tempexport,$symb,$count,\$message,$href,'resource');
             } else {              } else {
                 $$content_file = &replicate_content($cdom,$cnum,$tempexport,$symb,$count,\$message,$href,'noedit');                  $$content_file = &replicate_content($cdom,$cnum,$tempexport,$symb,$count,\$message,$href,'noedit');
Line 673  sub simpleproblem  { Line 673  sub simpleproblem  {
                 %values = &evaloptionhash($options);                  %values = &evaloptionhash($options);
                 $output .= qq|                  $output .= qq|
 <problem>  <problem>
     <startouttext />$qtext<endouttext />
   <optionresponse max="$maxfoils" randomize="$randomize">    <optionresponse max="$maxfoils" randomize="$randomize">
     <foilgroup options="$options">      <foilgroup options="$options">
 |;  |;
Line 701  sub simpleproblem  { Line 702  sub simpleproblem  {
             } else {              } else {
                 $output .= qq|                  $output .= qq|
 <problem>  <problem>
     <startouttext />$qtext<endouttext />
   <radiobuttonresponse max="$maxfoils" randomize="$randomize">    <radiobuttonresponse max="$maxfoils" randomize="$randomize">
    <foilgroup>    <foilgroup>
 |;  |;
                 for (my $k=0; $k<10; $k++) {                  for (my $k=0; $k<10; $k++) {
                     my $iter = $k+1;                      my $iter = $k+1;
Line 727  sub simpleproblem  { Line 729  sub simpleproblem  {
 </problem>  </problem>
 |;  |;
             }              }
         } elsif ($qtype eq 'stringanswer') {          } elsif ($qtype eq 'string') {
             my $stringanswer = $qparms{$prefix.'stringanswer'};              my $stringanswer = $qparms{$prefix.'stringanswer'};
             my $stringtype=$qparms{$prefix.'stringtype'};              my $stringtype=$qparms{$prefix.'stringtype'};
             $output .= qq|              $output .= qq|
 <problem>  <problem>
   <stringresponse answer="$stringanswer" type="$stringtype">    <stringresponse answer="$stringanswer" type="$stringtype">
     <textline>    <startouttext />$qtext<endouttext />
     </textline>      <textline />
             |;              |;
             if ($hint) {              if ($hint) {
                 $output .= '                  $output .= '
Line 748  sub simpleproblem  { Line 750  sub simpleproblem  {
   </stringresponse>    </stringresponse>
 </problem>  </problem>
 |;  |;
           } elsif ($qtype eq 'numerical') {
               my $sigfigs = $qparms{$prefix.'numericalsigfigs'};
               my $unit = $qparms{$prefix.'numericalunit'};
               my $answer = $qparms{$prefix.'numericalanswer'};
               my $tolerance = $qparms{$prefix.'numericaltolerance'};
               my $format = $qparms{$prefix.'numericalformat'};
               my $scriptblock = $qparms{$prefix.'numericalscript'};
               $output .= qq|
   <problem>
   |;
               if ($scriptblock) {
                   $output .= qq|
   <script type="loncapa/perl">
   $scriptblock
   </script>|;
                }
                $output .= qq|
   <startouttext />$qtext<endouttext />
   <numericalresponse answer="$answer" |;
                if ($unit ne '') {
                    $output .= qq|unit="$unit" |;
                }
                if ($format ne '') {
                    $output .= qq|format="$format" |;
                }
                $output =~ s{ $}{};
                $output .= '>';
                if ($tolerance ne '') {
                    $output .= qq|
     <responseparam name="tol" type="tolerance" default="$tolerance" description="Numerical Tolerance" />|;
                }
                if ($sigfigs) {
                    $output .= qq|
     <responseparam name="sig" type="int_range" default="$sigfigs" description="Significant Digits" />|;
                }
                $output .= qq|
     <textline />|;
               if ($hint) {
                   $output .= qq|
     <hintgroup>
       <hintpart on="default">
         <startouttext />'.$hint.'<endouttext/>
       </hintpart>
     </hintgroup>|;
               }
               $output .= qq|
   </numericalresponse>
   </problem>
   |;
         } else {          } else {
             $output .= qq|              $output .= qq|
 <problem>  <problem>
Line 846  sub templatedpage { Line 897  sub templatedpage {
   <domain>$udom</domain>    <domain>$udom</domain>
 |;  |;
     }      }
     foreach (sort keys %syllabusfields) {      foreach (sort(keys(%syllabusfields))) {
         $output .= qq|          $output .= qq|
 <$_>  <$_>
  <name>$syllabusfields{$_}</name>   <name>$syllabusfields{$_}</name>

Removed from v.1.10  
changed lines
  Added in v.1.13


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