Skip to content

Commit

Permalink
Improve length measuring for choices select header
Browse files Browse the repository at this point in the history
better handles entities
  • Loading branch information
drlippman committed Mar 27, 2020
1 parent 095e5b3 commit b133159
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assess2/questions/answerboxes/ChoicesAnswerBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function generate(): void
if ($displayformat == "select") {
$msg = '?';
foreach ($questions as $qv) {
if (strlen($qv)>2 && !($qv{0}=='&' && $qv{strlen($qv)-1}==';')) {
if (mb_strlen(html_entity_decode($qv))>3) { //strlen($qv)>2 && !($qv{0}=='&' && $qv{strlen($qv)-1}==';')) {
$msg = _('Select an answer');
break;
}
Expand Down
2 changes: 1 addition & 1 deletion assessment/displayq2.php
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,7 @@ function makeanswerbox($anstype, $qn, $la, $options,$multi,$colorbox='') {
if ($displayformat == "select") {
$msg = '?';
foreach ($questions as $qv) {
if (strlen($qv)>2 && !($qv{0}=='&' && $qv{strlen($qv)-1}==';')) {
if (mb_strlen(html_entity_decode($qv))>3) { // (strlen($qv)>2 && !($qv{0}=='&' && $qv{strlen($qv)-1}==';')) {
$msg = _('Select an answer');
break;
}
Expand Down

0 comments on commit b133159

Please sign in to comment.