[LON-CAPA-cvs] cvs: loncom /imspackages imsprocessor.pm
raeburn
lon-capa-cvs@mail.lon-capa.org
Wed, 05 Apr 2006 19:45:56 -0000
raeburn Wed Apr 5 15:45:56 2006 EDT
Modified files:
/loncom/imspackages imsprocessor.pm
Log:
Fixes so matching questions imported from WebCT Vista 4 IMS packages now work correctly.
Index: loncom/imspackages/imsprocessor.pm
diff -u loncom/imspackages/imsprocessor.pm:1.37 loncom/imspackages/imsprocessor.pm:1.38
--- loncom/imspackages/imsprocessor.pm:1.37 Wed Apr 5 13:33:51 2006
+++ loncom/imspackages/imsprocessor.pm Wed Apr 5 15:45:53 2006
@@ -2366,6 +2366,7 @@
if ("@state" eq "questestinterop item presentation flow response_lid render_choice") {
$$settings{$id}{$list}{randomize} = $attr->{shuffle};
}
+# Multiple Choice, True/False and Combination
if ("@state" eq "questestinterop item presentation flow response_lid render_choice flow_label response_label") {
$answer_id = $attr->{ident};
push(@{$$allanswers{$id}{$list}},$answer_id);
@@ -2424,6 +2425,7 @@
$grp = $attr->{ident};
push(@{$$settings{$id}{grps}},$grp);
%{$$settings{$id}{$grp}} = ();
+ @{$$allanswers{$id}{$grp}} = ();
@{$$settings{$id}{$grp}{correctanswer}} = ();
$$settings{$id}{$grp}{rcardinality} = $attr->{rcardinality};
}
@@ -2431,7 +2433,7 @@
$currtexttype = lc($attr->{texttype});
$$settings{$id}{$grp}{texttype} = $currtexttype;
}
- if ("@state" eq "questestinterop item presentation flow flow response_grp render_choice response_label") {
+ if ("@state" eq "questestinterop item presentation flow flow response_grp render_choice flow_label response_label") {
$answer_id = $attr->{ident};
push(@{$$allanswers{$id}{$grp}},$answer_id);
%{$$settings{$id}{$grp}{$answer_id}} = ();
@@ -2545,9 +2547,11 @@
$$settings{$id}{$str_id}{$label}{$textlabel} = $text;
}
}
+# Matching
if ("@state" eq "questestinterop item presentation flow response_lid render_choice flow_label response_label material mattext") {
$$settings{$id}{$list}{$answer_id}{text} .= $text;
}
+# Multiple choice, True/False, Combination
if ("@state" eq "questestinterop item presentation flow response_lid render_choice flow_label response_label material mat_extension webct:localizable_mattext") {
$$settings{$id}{$list}{$answer_id}{text} = $text;
}
@@ -2571,6 +2575,17 @@
}
}
}
+# Matching
+ if ("@state" eq "questestinterop item presentation flow flow response_grp material mattext") {
+ $$settings{$id}{$grp}{text} = $text;
+ unless ($text eq '') {
+ push(@{$$allchoices{$id}},$grp);
+ }
+ }
+ if ("@state" eq "questestinterop item presentation flow flow response_grp render_choice flow_label response_label material mattext") {
+ $$settings{$id}{$grp}{$answer_id}{text} = $text;
+ }
+# Numerical
if ("@state" eq "questestinterop item resprocessing itemproc_extension unit_eval conditionvar varequal") {
$$settings{$id}{$numid}{$unitid}{text} = $text;
}
@@ -3900,7 +3915,6 @@
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#(<img src=")([^>]+)>#$1../../resfiles/$2 />#gi;
$$settings{$id}{$list}{$$allanswers{$id}{$list}[$k]}{text} =~ s#</?p>##g;
}