functionality is available.
+ $output .= '(Not shown to students) '."\n".'The following alternates were imported from the corresponding WebCT Vista 4 jumbled sentence question, but are not included in the LON-CAPA version, because this style of question does not currently support multiple correct solutions.'."\n";
+ for (my $i=2; $i<@{$$settings{$id}{$list}{jumbled}}; $i++) {
+ my $altid = $i-1;
+ my $jnum = 0;
+ $output .= $altid.'. ';
+ for (my $k=0; $k<@{$$settings{$id}{$list}{jumbledtype}}; $k++) {
+ if ($$settings{$id}{$list}{jumbledtype}[$k] eq 'No') {
+ $output .= "$$settings{$id}{$list}{jumbledtext}[$k]" ;
+ } elsif ($$settings{$id}{$list}{jumbledtype}[$k] eq 'Yes') {
+ $jnum ++;
+ my $jumble_item = $$settings{$id}{$list}{jumbled}[$i][$jnum];
+ $output .= '['.$$settings{$id}{$list}{$jumble_item}{text}.']';
+ }
+ }
+ $output .= " \n";
+ }
+ $output .= '';
+ }
+ }
+ }
} else {
if ($context eq 'CSTR') {
$output .= qq|$$settings{$id}{text}
$questionimage\n|;
} else {
$resourcedata{$symb.'questiontext'} = ''.$$settings{$id}{text}.'
'.$questionimage;
}
- if ($$settings{$id}{class} eq 'multiplechoice') {
+ if (($$settings{$id}{class} eq 'multiplechoice') ||
+ ($$settings{$id}{class} eq 'combination')) {
foreach my $list (@{$$settings{$id}{lists}}) {
my $numfoils = @{$$allanswers{$id}{$list}};
if ($$settings{$id}{$list}{rcardinality} eq 'Single') {
@@ -3839,7 +3989,6 @@ sub write_webct4_questions {
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} = &Apache::loncleanup::htmlclean($$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text});
-
$$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text} =~ s#(:utf8", "$destdir/problems/$probdir/$title.problem");
+ $title =~ s/:/_/g;
+ $title .= '_'.$id;
+ open(PROB,">$destdir/problems/$probdir/$title.problem");
print PROB $output;
close PROB;
} else {
@@ -4601,7 +4759,7 @@ sub write_bb6_questions {
$title =~ s/\s/_/g;
$title =~ s/\W//g;
$title .= '_'.$id;
- open(PROB,">:utf8", "$newdir/$title.problem");
+ open(PROB,">$newdir/$title.problem");
print PROB $output;
close PROB;
} else {
@@ -5170,20 +5328,18 @@ sub angel_content {
# ---------------------------------------------------------------- WebCT content
sub webct4_content {
my ($res,$docroot,$destdir,$settings,$dom,$user,$type,$title,$resrcfiles) = @_;
- if (!open(FILE,">$destdir/resfiles/$res.html")) {
- &Apache::lonnet::logthis("IMS import error: Cannot open file - $destdir/resfiles/$res.html - $!");
- } else {
- push(@{$resrcfiles}, "$res.html");
- my $linktag = '';
- if (defined($$settings{url})) {
- $linktag = qq|$destdir/resfiles/$res.html")) {
+ &Apache::lonnet::logthis("IMS import error: Cannot open file - $destdir/resfiles/$res.html - $!");
+ } else {
+ push(@{$resrcfiles}, "$res.html");
+ my $linktag = qq|$title|;
} else {
$linktag .= qq|>$$settings{url}|;
}
- }
- print FILE qq|
+ print FILE qq|
$title
@@ -5191,7 +5347,8 @@ sub webct4_content {
$linktag
|;
- close(FILE);
+ close(FILE);
+ }
}
}