Select Moodle version:

Activities: Questionnaire

Custom Survey Creation
Maintained by: Picture of Mike Churchward Mike Churchward, Picture of Joseph Rézeau Joseph Rézeau

Create your own surveys using this tool.


NOTE: If you are upgrading to Moodle 2.3 or greater, make sure you have upgraded the questionnaire module to the latest version of Moodle 2.2, in your Moodle 2.2 codebase before upgrading to Moodle 2.3 or greater.

DEVELOPERS NOTE - Questionnaire is tracked in Github at Contact Mike Churchward if you want "push" access.

(originally based on phpESP)





Picture of Mike Churchward
Mike Churchward (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Joseph Rézeau
    Mon, May 27, 2013, 4:47 AM
    Needs more testing. In the meantime you can use the 2.4 version of Questionnaire on a Moodle 2.5 site.
  • Picture of Robert Morley
    Sat, Jun 22, 2013, 12:36 AM
    I have just upgraded my moodle from 1.9-2.2-2.4.4, but I did not upgrade the questionnaire mod at version 2.2. Now I am trying to upgrade to the current version for 2.4 and I just get a blank page when I try and update the database. No checkmark or anything. I have also tried the versions for 2.3 and 2.2, with no success. Any ideas on how to get the mod working?
  • Picture of Joseph Rézeau
    Sat, Jun 22, 2013, 3:04 PM
    @Robert, it appears you did not follow these instructions "NOTE: If you are upgrading to Moodle 2.3 or greater, make sure you have upgraded the questionnaire module to the latest version of Moodle 2.2, in your Moodle 2.2 codebase before upgrading to Moodle 2.3 or greater."
    The only thing you can do now is to completely remove the Questionnaire plugin from your moodle site (you will lose all Questionnaire data) and start with a fresh version for Moodle 2.4.
  • Oam
    Tue, Jul 9, 2013, 10:01 PM
    Hi Joseph,
    Can I use Questionnaire on a Moodle 2.5 production site ? If not, why ?
    Thanks !
  • Picture of Tolulope Adetula
    Tue, Aug 20, 2013, 12:00 AM
    Hello Mike & Joseph,
    I must really commend you guys for this great plugin. Kudos!
    I however have a slight issue. When the user completes the questionnaire and gets redirected to a page, if the user clicks back to on the questionnaire link, it displays a "You have already filled the questionnaire" i.e. the administrator set it to once response.My challenge is, if their is no navigation enabled or no block allowed for such user, the user cannot go back to the course page except he\/she goes through the browsers back button.
    Can you tell me what code to edit. Thanks
  • Picture of Joseph Rézeau
    Tue, Aug 20, 2013, 1:37 AM
    Tolupe, please re-post your question to the Questionnaire forum on, where I will answer it.
    To all Questionnaire users, please note : this is NOT the right place to ask questions about the Questionnaire plugin. Please use the questionnaire forum!
  • Picture of Chris Fryer
    Wed, Oct 9, 2013, 7:12 PM

    Occasionally I see the following error in our logs:

    PHP Fatal error: Class 'questionnaire' not found in /srv/www/mod/questionnaire/lib.php on line 892

    This is defined in 'locallib.php', which is required at the start of lib.php. I suspect it is actually something to do with the way APC handles included and required files, because the error goes away for a while after I restart apache. But I notice you're using a mixture of relative and absolute paths for require_once calls. Since locallib.php is not a unique filename in Moodle, there's a danger APC will overwrite it. I think the relative paths should be made absolute by making reference to $CFG->dirroot in the paths.
  • Picture of Joseph Rézeau
    Wed, Oct 9, 2013, 7:43 PM
    @Chris Fryer, thanks for your message, I will look at this problem.
  • Picture of Mohsen Farahi
    Tue, Oct 15, 2013, 7:08 AM
    After creating a questionnaire and students responding, when checking 'All Responses' it says "Error reading from database". The debug info is as follows:

    Debug info: SQLState: 42000
    Error Code: 156
    Message: [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near the keyword 'user'.

    SELECT, T.response, R.submitted AS submitted, R.username, U.username AS username, AS user, U.lastname, U.firstname, R.survey_id, AS rid FROM mdl_questionnaire_response_text T, mdl_questionnaire_response R, mdl_user U WHERE question_id=518 AND response_id IN (210) AND T.response_id = AND = CAST(R.username AS INT) ORDER BY U.lastname, U.firstname
    [array (
    Error code: dmlreadexception
    Stack trace:
    line 423 of \lib\dml\moodle_database.php: dml_read_exception thrown
    line 260 of \lib\dml\sqlsrv_native_moodle_database.php: call to moodle_database->query_end()
    line 367 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->query_end()
    line 788 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->do_query()
    line 836 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->get_recordset_sql()
    line 462 of \mod\questionnaire\questiontypes\questiontypes.class.php: call to sqlsrv_native_moodle_database->get_records_sql()
    line 679 of \mod\questionnaire\questiontypes\questiontypes.class.php: call to questionnaire_question->get_response_text_results()
    line 636 of \mod\questionnaire\questiontypes\questiontypes.class.php: call to questionnaire_question->display_response_text_results()
    line 2561 of \mod\questionnaire\questionnaire.class.php: call to questionnaire_question->display_results()
    line 552 of \mod\questionnaire\report.php: call to questionnaire->survey_results()

    Clearly in the query ' AS user' needs to be changed to ' AS [user]'

    We are using MS SQL 2012.

  • Picture of Tyler Gilpin
    Fri, Nov 22, 2013, 10:20 PM
    Moodle 2.6 support?
  • Picture of Joseph Rézeau
    Fri, Nov 22, 2013, 10:24 PM
    Questionnaire 2.6 for Moodle 2.6 will be released in the coming weeks. Please watch the Questionnaire forum at for announcements.
  • Picture of David Pethick
    Thu, Feb 13, 2014, 9:39 AM
    Good afternoon. My name is David Pethick and I was wondering how I might go about requesting a modification/improvement to the questionnaire module and if it would even be possible?

    Would it be OK to post the requirement here on this forum?

    I've already listed a job in the jobs section at

    And as mentioned above depending on cost I would be very willing to contribute if you thought it was a good idea.

    Regards David
  • ;-)
    Mon, Mar 3, 2014, 11:41 PM
    Hi Joseph,
    is it possible to change separator in txt exported file? I would like use a ; or a | or a § ... what have I to change? Can you help me please?
    Thank you
  • Picture of Joseph Rézeau
    Tue, Mar 4, 2014, 1:17 AM
    If you want to hack your questionnaire files, you'll find function generate_csv in file questionnaire.class.php.
  • Matt Bury
    Wed, Mar 12, 2014, 12:27 AM
    Hi Joseph and Mike,

    I just installed this module on a Moodle 2.5 (running on a public LAMP stack) via the admin panel and everything went smoothly. However, when I created an instance to test it, clicked on "Save and display", I got a file permissions error, "A file permissions error has occurred. Please check the permissions on the script and the directory it is in and try again." The file permissions had been set to 711 throughout the package. I changed the /moodle/mod/questionnaire/ directory and all its contents (recursively) to 755 and everything worked fine after that.

    This seems to happen with a few plugins in the repo.

    Just so that you know smile
1 2 3
Please login to post comments