--- loncom/interface/londocs.pm 2011/07/04 13:01:53 1.454 +++ loncom/interface/londocs.pm 2011/07/21 03:31:12 1.456 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.454 2011/07/04 13:01:53 raeburn Exp $ +# $Id: londocs.pm,v 1.456 2011/07/21 03:31:12 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -681,7 +681,8 @@ sub build_package { $currdirpath = 'Top'; my $pcslist = $curRes->map_hierarchy(); if ($pcslist ne '') { - foreach my $pc (split(/,/,$pcslist)) { + foreach my $pc (split(/,/,$pcslist),$curRes->map_pc()) { + next if ($pc <= 1); my $res = $navmap->getByMapPc($pc); if (ref($res)) { my $encloser = $res->title(); @@ -896,7 +897,8 @@ sub replicate_content { grade_courseid => $cdom.'_'.$cnum, grade_domain => $env{'user.domain'}, grade_username => $env{'user.name'}, - grade_imsexport => 1, + grade_imsexport => 1, + instructor_comments => 'hide', ); my $feedurl=&Apache::lonnet::clutter($url); my ($userview,$response)=&Apache::lonnet::ssi_body($feedurl,%form); @@ -917,11 +919,11 @@ sub replicate_content { $foilcounter ++; } elsif ($line =~ m{(|\Q\E)\Q
Correct:
}) { + $mc_answer = $alphabet[$foilcounter-1]; + } elsif ($line !~ m{\Q\E(|\Q
\E)\Q
\E}) { $line =~ s/^(\s+|\s+)$//g; $line =~ s{^\Q\E([^<]+)\Q\E$}{1}; - push(@tosave,$line); + $tosave[$foilcounter] .= $line.' '; } $content = join("\t",@tosave); if ($mc_answer) { @@ -929,10 +931,15 @@ sub replicate_content { } } if (@tosave) { - $content = $currdirpath."\t".$title."\t".join("\t",@tosave); + my $qtype; if ($mc_answer) { - $content .= "\t".$mc_answer."\n"; + $qtype = 'MC'; } + $content = $currdirpath."\t".$title."\t$qtype\t".join("\t",@tosave); + if ($mc_answer) { + $content .= "\t".$mc_answer; + } + $content .= "\n"; } } else { $content = ''.$content.'';