Permalink
Browse files

for answers that have graphics and no text don't add the html markup …

…stuffs
  • Loading branch information...
1 parent eca7522 commit 3cf9f2b0c013649857de10ad0f686209143b5359 @schelcj committed Oct 9, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 create.pl
View
@@ -289,7 +289,11 @@ sub create_question {
my $question_text = format_latex_for_mathjax($question->{question});
my $answers = scalar keys %{$question->{answers}};
- # TODO test resource for any images to add to the question
+
+ if (exists $question->{resource}) {
+ # TODO test resource for any images to add to the question
+ }
+
$agent->post(
qq{$UMLESSONS_URL/2k/manage/inquiry/create/$UNIT_URL_NAME/$name}, {
choice => 'multiple_choice',
@@ -336,7 +340,7 @@ sub add_answers {
foreach my $answer (sort keys %{$answers}) {
my $roman = lc(roman($answer_number));
my $order = qq{c$roman.$answer_number};
- my $answer_text = $answers->{$answer};
+ my $answer_text = $answers->{$answer}->{text};
## no tidy
my $count = ()= $answer_text =~ /\$/g;
@@ -350,7 +354,7 @@ sub add_answers {
op => 'save',
order => $order,
qq{order.$order} => $order,
- response => format_latex_for_mathjax($answer_text),
+ response => ($answer_text) ? format_latex_for_mathjax($answer_text) : $EMPTY,
section => qq{answers.c$roman},
correct => ($answer eq $correct_answer) ? 'TRUE' : 'FALSE',
feedback => $EMPTY,

0 comments on commit 3cf9f2b

Please sign in to comment.