| … | |
… | |
| 165 | |
165 | |
| 166 | $i++; |
166 | $i++; |
| 167 | $answerIsCorrectQ = $rh_answer_results ->{$key} -> {score}; |
167 | $answerIsCorrectQ = $rh_answer_results ->{$key} -> {score}; |
| 168 | $normalizedSubmittedAnswer = $rh_answer_results ->{$key} -> {student_ans}; |
168 | $normalizedSubmittedAnswer = $rh_answer_results ->{$key} -> {student_ans}; |
| 169 | $normalizedSubmittedAnswer = '' if ($normalizedSubmittedAnswer =~ /^error:\s+empty/); |
169 | $normalizedSubmittedAnswer = '' if ($normalizedSubmittedAnswer =~ /^error:\s+empty/); |
|
|
170 | $normalizedCorrectAnswer = $rh_answer_results ->{$key} -> {original_correct_ans}; |
|
|
171 | |
|
|
172 | ## Handle the case where the answer evaluator does not return original_correct_ans |
|
|
173 | if ((!defined $normalizedCorrectAnswer) or (!$normalizedCorrectAnswer =~ /\S/)) { |
| 170 | $normalizedCorrectAnswer = $rh_answer_results ->{$key} -> {correct_ans}; |
174 | $normalizedCorrectAnswer = $rh_answer_results ->{$key} -> {correct_ans}; |
|
|
175 | } |
|
|
176 | |
| 171 | $errors = $rh_answer_results ->{$key} -> {ans_message}; |
177 | $errors = $rh_answer_results ->{$key} -> {ans_message}; |
| 172 | $errors = '' if ($errors eq 'empty'); |
178 | $errors = '' if ($errors eq 'empty'); |
| 173 | #$ans_name = $rh_answer_results ->{$key} -> {ans_name}; |
179 | #$ans_name = $rh_answer_results ->{$key} -> {ans_name}; |
| 174 | #$ans_name =~ s/$ANSWER_PREFIX//; # this handles implicitly defined answer names. |
180 | #$ans_name =~ s/$ANSWER_PREFIX//; # this handles implicitly defined answer names. |
| 175 | $ans_name = $i; # just number the answers in order |
181 | $ans_name = $i; # just number the answers in order |
| … | |
… | |
| 398 | chmod(0666, "$TMPPROBDIR${psvn}output.tex"); |
404 | chmod(0666, "$TMPPROBDIR${psvn}output.tex"); |
| 399 | |
405 | |
| 400 | ## system("/usr/math/bin/latex2html -init_file ${Global::mainDirectory}latex2html.init -dir $PROBDIR -prefix $psvn ${htmlDirectory}tmp/l2h/${psvn}output.tex > ${htmlDirectory}tmp/l2h/${psvn}l2h.log"); |
406 | ## system("/usr/math/bin/latex2html -init_file ${Global::mainDirectory}latex2html.init -dir $PROBDIR -prefix $psvn ${htmlDirectory}tmp/l2h/${psvn}output.tex > ${htmlDirectory}tmp/l2h/${psvn}l2h.log"); |
| 401 | my $latex2HTML_result = &makeL2H($TMPPROBDIR, $psvn) ; |
407 | my $latex2HTML_result = &makeL2H($TMPPROBDIR, $psvn) ; |
| 402 | warn( "LaTeX2HTML failed. Returned with status: $latex2HTML_result\n" ) if $latex2HTML_result ; |
408 | warn( "LaTeX2HTML failed. Returned with status: $latex2HTML_result\n" ) if $latex2HTML_result ; |
| 403 | |
409 | |
| 404 | ##Get rid of all unwanted stuff in html document created by latex2html |
410 | ##Get rid of all unwanted stuff in html document created by latex2html |
| 405 | unless(-e "${TMPPROBDIR}${psvn}output.html") { |
411 | unless(-e "${TMPPROBDIR}${psvn}output.html") { |
| 406 | warn "Can't rename ${TMPPROBDIR}${psvn}output.html"; |
412 | warn "Can't rename ${TMPPROBDIR}${psvn}output.html"; |
| 407 | return (0); ### there was a failure in latex2html processing |
413 | return (0); ### there was a failure in latex2html processing |
| 408 | ### we just give a warning so that so that l2hPrecreateSet.pl can continue |
414 | ### we just give a warning so that so that l2hPrecreateSet.pl can continue |