Atto ::: atto_question
Maintained by Richard JonesRichard Jones
Creates a button visible to teachers that inserts a text link, question number and display mode into Moodle editable text with delimiter tags which will be picked up by moodle_filter_simplequestion.
Latest release:
29 sites
7 fans
Current versions available: 1

This plugin adds an editor button to the ATTO editor toolbar.  The button can be used to enter a code for the Moodle Simple Question plugin, this button is not available to students.

The button activates a dialog requiring the link text for the question, the question number and the display mode (embed or popup). 

You can find the question number by looking at the questions in your question bank.  Click the preview question link and look in the URL, the first id is the question's id number.

Question number xxx is replaced by a simple encryption technique such that the original id number is not displayed to the user in the popup URL.

The button requires filter_simplequestion to be installed.

Potential privacy issues

None known.


Screenshot #0


Richard Jones
Richard Jones (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Mon, Nov 27, 2017, 8:50 AM
    Approval issue created: CONTRIB-7131
  • Sat, Mar 24, 2018, 8:11 PM
    Thanks for good plugin.
    I got a problem.
    When applying 'question' plugin to atto toolbar config, I get an error when registering new e-mail user as below.
    (moodle.3.4.2 php7.0 centos7 mariadb10.1
    Debug info: SELECT id FROM {user} WHERE id = ? AND deleted = ?
    [array (
    0 => 0,
    1 => 0,
    Error code: invaliduser

    Stack trace: •line 1546 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
    •line 1522 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
    •line 6015 of /lib/accesslib.php: call to moodle_database->get_record()
    •line 59 of /lib/editor/atto/plugins/question/lib.php: call to context_user::instance()
    •line 7678 of /lib/moodlelib.php: call to atto_question_params_for_js()
    •line 131 of /lib/editor/atto/lib.php: call to component_callback()
    •line 406 of /lib/form/editor.php: call to atto_texteditor->use_editor()
    •line 192 of /lib/pear/HTML/QuickForm/Renderer/Tableless.php: call to MoodleQuickForm_editor->toHtml()
    •line 3061 of /lib/formslib.php: call to HTML_QuickForm_Renderer_Tableless->renderElement()
    •line 418 of /lib/pear/HTML/QuickForm/element.php: call to MoodleQuickForm_Renderer->renderElement()
    •line 1643 of /lib/pear/HTML/QuickForm.php: call to HTML_QuickForm_element->accept()
    •line 1802 of /lib/formslib.php: call to HTML_QuickForm->accept()
    •line 1686 of /lib/pear/HTML/QuickForm.php: call to MoodleQuickForm->accept()
    •line 445 of /lib/pear/HTML/Common.php: call to HTML_QuickForm->toHtml()
    •line 964 of /lib/formslib.php: call to HTML_Common->display()
    •line 156 of /login/signup_form.php: call to moodleform->display()
    •line 480 of /theme/boost/classes/output/core_renderer.php: call to login_signup_form->export_for_template()
    •line 210 of /lib/outputrenderers.php: call to theme_boost\output\core_renderer->render_login_signup_form()
    •line 114 of /login/signup.php: call to renderer_base->render()
  • Richard Jones
    Tue, Mar 27, 2018, 10:20 AM
    Hi Polaris. That's weird but I will take a look and see if I can reproduce that. I assume that it doesn't prevent any user registration or use of Atto editor?
  • Richard Jones
    Tue, Mar 27, 2018, 11:29 AM
    So the registration process includes a call to find the editor preferences it seems. The atto question button has a check to see if the user is permitted to use that button. If the user is in the process of authentication they won't be logged on yet. As long as the editor button is working for them as expected when they are logged on I can fix that.
  • Thu, Jan 24, 2019, 5:46 PM
    Hi Richard,
    I receved this warning with a debug message after a upgrade of my moodle site.

    Notice: Constant START_TAG already defined in /home/my_moodle/filter/simplequestion/settings.php on line 31
    Notice: Constant END_TAG already defined in /home/my_moodle/filter/simplequestion/settings.php on line 32
    Notice: Constant LINKTEXTLIMIT already defined in /home/my_moodle/filter/simplequestion/settings.php on line 33
    Notice: Constant KEY already defined in /home/my_moodle/filter/simplequestion/settings.php on line 34
    Notice: Constant HEIGHT already defined in /home/my_moodle/filter/simplequestion/settings.php on line 35
    Notice: Constant WIDTH already defined in /home/my_moodle/filter/simplequestion/settings.php on line 36

    Maybe it is usefull for you wink
  • Richard Jones
    Fri, Jan 25, 2019, 12:25 PM
    Hi Jean-Marc. OK, many thanks, I will check that. As far as I remember the settings.php is the only place those are defined.
Please login to post comments