Posts made by Joseph Rézeau

Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators

Please note that, due to the "Javascript cleaning process" in Moodle's HTML editor, the code lines quoted in my previous post have an extra X added to the o n K e y P r e s s events.

I am attaching a screenshot showing where to enter the length values when edition check boxes or radio buttons with !other field.

Joseph

Attachment image00.jpg
Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators

Questionnaire module

At the moment, in questions edit mode, for the Text Box question type, you can type the desired length of the box in the Length field. In order to have the same facility for the (optional) !other field in check boxes and radio buttons questions, you'll have to hack your Questionnaire file questiontypes.class.php

1- in function radio_survey_display($data)

around line 920

2- in function check_survey_display($data)

around line 960

replace

$other_text = '&nbsp;<input type="text" size="20" name="'.$cid.'" onKeyPress="other_check(this.name)"';

with

$other_text = '&nbsp;<input type="text" size="'.$this->length.'" name="'.$cid.'" onKeyPress="other_check(this.name)"';

See attached screen shot for result.

Joseph

PS.- I will include this hack in my forthcoming Questionnaire module enhancements.

Attachment image00.jpg