Community Forums

ATutor Bug Reports

Text presentation issues in tests


You must be signed-in to post.

AuthorSubject
 
Page: 1
IndieRect

Avatar for IndieRect
Subject: Text presentation issues in testsQuote this post in your reply
Our users have discovered two minor bugs in Test&Survey Manager (ATutor 1.5.1).

1.
File include/html/tests_questions.inc.php, from line 93, reads

if (strlen($row['question']) > 45) {
echo AT_print(substr(htmlentities($row['question']), 0, 43), 'tests_questions.question') . '...';
} else {
echo AT_print(htmlentities($row['question']), 'tests_questions.question');
}

The function htmlentities() mashes up questions written in Ukrainian (UTF-8).
I suggest using htmlspecialchars() function instead, like in tools/tests/questions.php, line 152. By the way line 153 of the latter file obviously lacks this function.


2.
Test answers are formatted using 'tests_answers.answer' as a $field_name parameter of AT_print() function. In include/lib/constants.inc.php a formatting option AT_FORMAT_NONE is applied to such a field. This disables some required math & physical formatting such as subscripts and superscripts. I see no sound arguments for such field to be formatted in a way different than 'tests_questions.question' are.
Posted: 2005-09-07 09:50:51
heidi

Avatar for heidi
Subject: formattingQuote this post in your reply
thanks for posting this bug. we\'ve taken note of the issues.

in regards to formatting answers - for security we\'ve not allowed html for user input (other than instructor). however you\'ve brought up a good example of where this could be a problem. we\'ll have to consider it. thanks again.
Posted: 2005-09-08 14:04:32
IndieRect

Avatar for IndieRect
Subject: Text presentation issues in testsQuote this post in your reply
When saying "answers" in my previous post I actually meant "answer choices". They ARE instructor input. For an example please see file tools/tests/preview.php, line 195:

echo '<input type="radio" name="question_'.$row['question_id'].'" value="'.$i.'" id="choice_'.$row['question_id'].'_'.$i.'" /><label for="choice_'.$row['question_id'].'_'.$i.'">'.AT_print($row['choice_'.$i], 'tests_answers.answer').'</label>';

Sorry for misformulating!
Posted: 2005-09-08 16:51:24
 
Page: 1

You must be signed-in to post.

Related Articles