version 1.52, 2013/07/27 22:04:49
|
version 1.53, 2013/08/02 12:56:26
|
Line 334 sub parse_manifest {
|
Line 334 sub parse_manifest {
|
$$resources{$identifier}{file} = $attr->{href}; |
$$resources{$identifier}{file} = $attr->{href}; |
} else { |
} else { |
push(@{$$hrefs{$identifier}},$attr->{href}); |
push(@{$$hrefs{$identifier}},$attr->{href}); |
} |
} |
} |
} |
} elsif ($cms eq 'angel5') { |
} elsif ($cms eq 'angel5') { |
if ($attr->{href} =~ m/^_assoc\\$identifier\\(.+)$/) { |
if ($attr->{href} =~ m/^_assoc\\$identifier\\(.+)$/) { |
Line 371 sub parse_manifest {
|
Line 371 sub parse_manifest {
|
} |
} |
if ("@state" eq "manifest webct:ContentObject webct:Name") { |
if ("@state" eq "manifest webct:ContentObject webct:Name") { |
if ($cms eq 'webctvista4') { |
if ($cms eq 'webctvista4') { |
$$resources{$identifier}{title} = (split(/,/,$text))[-1]; |
if ($text =~ /,/) { |
|
$$resources{$identifier}{title} = (split(/,/,$text))[-1]; |
|
} else { |
|
$$resources{$identifier}{title} = $text; |
|
} |
} |
} |
} |
} |
}, "dtext"], |
}, "dtext"], |
Line 563 sub copy_resources {
|
Line 567 sub copy_resources {
|
if (ref($$resources{$$resources{$key}{usedby}}{imagetitle}) eq 'ARRAY') { |
if (ref($$resources{$$resources{$key}{usedby}}{imagetitle}) eq 'ARRAY') { |
$imgtitle = $$resources{$$resources{$key}{usedby}}{imagetitle}[$i]; |
$imgtitle = $$resources{$$resources{$key}{usedby}}{imagetitle}[$i]; |
} |
} |
if (($img =~ /^\Q$filestem\E/i) && ($imgtitle =~ /\Q$extension\E/i)) { |
if ($imgtitle =~ /\Q$extension\E/i) { |
$copyfile = $img.'_'.$imgtitle; |
$copyfile = $imgtitle; |
last; |
last; |
} elsif ($img =~ /^\Q$filestem\E/i) { |
} elsif ($img =~ /^\Q$filestem\E/i) { |
$copyfile = $img.'.'.$extension; |
$copyfile = $img.'.'.$extension; |
Line 2408 sub parse_webctvista4_question {
|
Line 2412 sub parse_webctvista4_question {
|
@{$$settings{$id}{numids}} = (); |
@{$$settings{$id}{numids}} = (); |
%{$$allanswers{$id}} = (); |
%{$$allanswers{$id}} = (); |
$$settings{$id}{title} = $attr->{title}; |
$$settings{$id}{title} = $attr->{title}; |
|
$$settings{$id}{title} =~ s/\%/pct_/g; |
} |
} |
if ("@state" eq "questestinterop item presentation flow material mat_extension webct:calculated webct:var") { |
if ("@state" eq "questestinterop item presentation flow material mat_extension webct:calculated webct:var") { |
$currvar = $attr->{'webct:name'}; |
$currvar = $attr->{'webct:name'}; |
Line 2642 sub parse_webctvista4_question {
|
Line 2647 sub parse_webctvista4_question {
|
text_h => |
text_h => |
[sub { |
[sub { |
my ($text) = @_; |
my ($text) = @_; |
|
$text =~ s/\s*\&\s*/_and_/g; |
if ($currtexttype eq '/text/html') { |
if ($currtexttype eq '/text/html') { |
$text =~ s#(<img\ssrc=")([^"]+)">#$1../resfiles/$2#g; |
$text =~ s#(<img\ssrc=")([^"]+)">#$1../resfiles/$2#g; |
} |
} |
if ("@state" eq "questestinterop item presentation flow material matimage") { |
if ("@state" eq "questestinterop item presentation flow material matimage") { |
my $imagetitle = (split(/,/,$text))[-1]; |
my $imagetitle; |
|
if ($text =~ /,/) { |
|
$imagetitle = (split(/,/,$text))[-1]; |
|
} else { |
|
$imagetitle = $text; |
|
} |
$$settings{$id}{imagetitle} = $imagetitle; |
$$settings{$id}{imagetitle} = $imagetitle; |
push(@{$$resources{$res}{imagetitle}},$imagetitle); |
push(@{$$resources{$res}{imagetitle}},$imagetitle); |
} |
} |
Line 3474 sub build_problem_container {
|
Line 3485 sub build_problem_container {
|
$probtitle{$id} =~ s/\s+/_/g; |
$probtitle{$id} =~ s/\s+/_/g; |
$probtitle{$id} =~ s/:/_/g; |
$probtitle{$id} =~ s/:/_/g; |
$probtitle{$id} =~ s/\//_/g; |
$probtitle{$id} =~ s/\//_/g; |
$probtitle{$id} .= '_'.$id; |
if ($cms eq 'webctce4') { |
|
$probtitle{$id} .= '_'.$id; |
|
} |
} |
} |
if (($cms eq 'webctce4' && $container ne 'database') || |
if (($cms eq 'webctce4' && $container ne 'database') || |
($cms eq 'webctvista4')) { |
($cms eq 'webctvista4')) { |
Line 3996 sub write_webct4_questions {
|
Line 4009 sub write_webct4_questions {
|
if (($cms eq 'webctvista4') && (defined($$settings{$id}{image}))) { |
if (($cms eq 'webctvista4') && (defined($$settings{$id}{image}))) { |
my $imgsrc = '../../resfiles/'.$$settings{$id}{image}; |
my $imgsrc = '../../resfiles/'.$$settings{$id}{image}; |
if (defined($$settings{$id}{imagetitle})) { |
if (defined($$settings{$id}{imagetitle})) { |
$imgsrc .= '_'.$$settings{$id}{imagetitle}; |
$imgsrc = '../../resfiles/'.$$settings{$id}{imagetitle}; |
} |
} |
$questionimage = qq|<p><img src="$imgsrc" /></p>|; |
$questionimage = qq|<p><img src="$imgsrc" /></p>|; |
} |
} |
Line 4530 $$settings{$id}{$list}{jumbledtext}[$k]
|
Line 4543 $$settings{$id}{$list}{jumbledtext}[$k]
|
$title =~ s/\s/_/g; |
$title =~ s/\s/_/g; |
$title =~ s/:/_/g; |
$title =~ s/:/_/g; |
$title =~ s/\//_/g; |
$title =~ s/\//_/g; |
$title .= '_'.$id; |
|
open(PROB,">$destdir/problems/$probdir/$title.problem"); |
open(PROB,">$destdir/problems/$probdir/$title.problem"); |
print PROB $output; |
print PROB $output; |
close PROB; |
close PROB; |