Other ways to extract all responses from a given (arbitrary) questionnaire

Other ways to extract all responses from a given (arbitrary) questionnaire

by Technical Services Office ADDU -
Number of replies: 10

Are there other ways to extract all responses for a given (arbitrary) questionnaire aside from the "Download in text format" facility via web--ways such as via command line or via SQL query statements in mysql?  If yes, could you please provide links/URLs or names of programs (or the SQL query statement that can do it).

Unfortunately, I have a user that "accidentally" creates questionnaires that are too long despite being advised not to do so.  As such, we cannot extract the responses for the user's questionnaires via the "Download in text format" function--a limit of php may have been reached.  I've tried changing the usually recommended settings in php.ini (or php-cli.ini?) to no avail.

I've been trying to search the Internet for quite some time but found no solution as of now.

Info regarding the questionnaire tables in mysql might help too.  Is there an ER diagram of the questionnaire tables?


  • Moodle version:  3.1
  • PHP version:  5.5
  • other info may available upon request
Average of ratings: -
In reply to Technical Services Office ADDU

Re: Other ways to extract all responses from a given (arbitrary) questionnaire

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

What version of questionnaire are you using? The latest release for 3.1 (3.1.0 (Build - 2016052000) (2016020201)) includes significant improvements to the text download function.

mike

In reply to Mike Churchward

Re: Other ways to extract all responses from a given (arbitrary) questionnaire

by Technical Services Office ADDU -

Hi.

I have the same version -- 3.1.0 (Build - 2016052000) (2016020201).

I'm suspecting the following:

  • Some other php.ini or (php-cli.ini?) setting, other than those usually mentioned, that I have not tried adjusting
  • The questionnaire composed by that particular user will generate a really big response file due to all the responses (for example: around 90 questions and almost 1600 respondents -- also, a lot of the questions have text boxes for arbitrary responses).  The file generated will become too big that limits are reached (execution time, size limits,...).
I'm therefore thinking that maybe I can get the results of a questionnaire by that user via mysql or other methods.

BTW, thank you for replying.

Bons  smile
In reply to Mike Churchward

Re: Other ways to extract all responses from a given (arbitrary) questionnaire

by Technical Services Office ADDU -

Hi.

Any updates regarding other ways to extract all responses for a given (arbitrary) questionnaire aside from the "Download in text format" facility via web--ways such as via command line or via SQL query statements in mysql?  If yes, could you please provide links/URLs or names of programs (or the SQL query statement that can do it).

In reply to Technical Services Office ADDU

Re: Other ways to extract all responses from a given (arbitrary) questionnaire

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

You might try using the Ad-hoc Database Query plugin and see if one of the user contributed queries can either directly give you what you want, or be adapted to do so.

If you go to https://docs.moodle.org/31/en/ad-hoc_contributed_reports and scan through the contributions, there are some that deal with questionnaires.

In reply to Technical Services Office ADDU

Re: Other ways to extract all responses from a given (arbitrary) questionnaire

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

Hi.

There are sixteen tables making up the data of a questionnaire and its submissions. Any method you use to extract the response data (code or SQL), would need to manage all of that data into some useful output.

The new CSV export function actually creates a very large complex SQL statement to extract the responses for a questionnaire. You could try and capture that from a running instance?

mike

In reply to Mike Churchward

Re: Other ways to extract all responses from a given (arbitrary) questionnaire

by Technical Services Office ADDU -

Is there a data dictionary for the questionnaire tables and is there also an E-R diagram which would show the relationships between the tables of questionnaire?  It would help in trying to formulate a program/script that will extract the data needed.

In reply to Technical Services Office ADDU

Re: Other ways to extract all responses from a given (arbitrary) questionnaire

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

There are no DD's or E-R diagrams, sorry. If you look at the tables, you can probably deduce the relationships. And there are tools that can look at MySQL tables and create those diagrams.

Feel free to ask questions here as well.

mike

In reply to Mike Churchward

Re: Other ways to extract all responses from a given (arbitrary) questionnaire

by Ben Loudon -

Hi

Do you have a list of these 16 tables to get me started?

I need to create an ad-hoc report so I can schedule the export of peoples answers.

Thanks Ben

In reply to Ben Loudon

Re: Other ways to extract all responses from a given (arbitrary) questionnaire

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

If you look at the file "/mod/questionnaire/db/install.xml", it defines the entire data structure for the module. This is the same for all Moodle plugins.

mike

Average of ratings: Useful (1)
In reply to Mike Churchward

Re: Other ways to extract all responses from a given (arbitrary) questionnaire

by Ben Loudon -

Thanks Mike

I have managed to create an ad-hoc report with basically survey, user,question, answer

My plan was to then schedule this and email it out as attachment for processing into another system.

However the ad-hoc reports only lets you email out the results in the body of an email not as an attachment.

I have been using  some of the Core APIs for creating/updating users and checking course completions.

Are there any plans for a Questionnaires API? Or are you aware of any other way of getting the output from a questionnaire to an external system

Thanks for any help you can give. As normal I am working to short deadlines with out enough knowledge smile

Ben