[LON-CAPA-cvs] cvs: loncom /interface londocs.pm
raeburn
raeburn at source.lon-capa.org
Mon Jul 4 12:47:03 EDT 2011
raeburn Mon Jul 4 16:47:03 2011 EDT
Modified files:
/loncom/interface londocs.pm
Log:
- Include question type (MC) for multiple choice in testbank export.
- Work in progress.
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.454 loncom/interface/londocs.pm:1.455
--- loncom/interface/londocs.pm:1.454 Mon Jul 4 13:01:53 2011
+++ loncom/interface/londocs.pm Mon Jul 4 16:47:03 2011
@@ -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.455 2011/07/04 16:47:03 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -918,7 +918,7 @@
} elsif ($line =~ m{(|\Q</label>\E)\Q<br />Correct:<b><label>\E}) {
$foilcounter ++;
$mc_answer = $alphabet[$foilcounter];
- } elsif ($line !~ m{</label><br />}) {
+ } elsif ($line !~ m{\Q</label>\E(|\Q</b>\E)\Q<br />\E}) {
$line =~ s/^(\s+|\s+)$//g;
$line =~ s{^\Q<b>\E([^<]+)\Q</b>\E$}{1};
push(@tosave,$line);
@@ -929,10 +929,15 @@
}
}
if (@tosave) {
- $content = $currdirpath."\t".$title."\t".join("\t", at tosave);
+ my $qtype;
if ($mc_answer) {
- $content .= "\t".$mc_answer."\n";
+ $qtype = 'MC';
}
+ $content = $currdirpath."\t".$title."\t$qtype\t".join("\t", at tosave);
+ if ($mc_answer) {
+ $content .= "\t".$mc_answer;
+ }
+ $content .= "\n";
}
} else {
$content = '<html><body>'.$content.'</body></html>';
More information about the LON-CAPA-cvs
mailing list