Questionnaire Module - 4th Release

Questionnaire Module - 4th Release

by Mike Churchward -
Number of replies: 123
Picture of Core developers Picture of Plugin developers Picture of Testers

Lots of people have asked for this to be available in a download form outside of CVS. It isn't on the module page yet, so I'm providing it here.

As before, its in two parts: this first part (this post) has everything but the images directory and the second part (next post) has the images.

mike

Average of ratings: -

Re: Questionnaire Module - 4th Release

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

Hmmmm.

It is a survey. I called it a questionnaire to differentiate it. Can you think of another appropriate French translation?

mike

Re: Questionnaire Module - 4th Release

by Jean-Pierre Pawlak -

Maybe it's best to change the French translation of Survey to Enquête or Consultation?

I'll pass on the question to the French forum.

Re: Questionnaire Module - 4th Release

by Peter Sereinigg -

I tried to install it, latest moodle version, all parameters in the ini, but when i try to start this php admin page i can not load this page ... error page not found. all seams to be correct installed, any idea?

Thanks Peter

Re: Questionnaire Module - 4th Release

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

Can you post more details?

Specifically, the URL of the page you are trying to access and the full error message you are getting.

Thanks,

mike

Re: Questionnaire Module - 4th Release

by Peter Sereinigg -

http://test.powerlearning.at/moodle/mod/questionnaire/phpESP/admin

in the ini:

// Base URL for phpESP

// The string $server['HTTP_HOST'] will be replaced by the server name

$ESPCONFIG['base_url'] = 'http://' . $server['HTTP_HOST'] . '/moodle/mod/questionnaire/phpESP/';

// URL of the images directory (for <img src='...'> tags)

$ESPCONFIG['image_url'] = $ESPCONFIG['base_url'] . 'images/';

// URL of the automatic survey publisher

$ESPCONFIG['autopub_url'] = $ESPCONFIG['base_url'] . 'public/survey.php';

// URL of the CSS directory (for themes)

$ESPCONFIG['css_url'] = $ESPCONFIG['base_url'] . 'public/css/';


Error: Die Seite kann nicht angezeigt werden (in english: cant show the page, page not found)

Attachment MWSnap109_2004-03-06_16_31_39.jpg

Re: Questionnaire Module - 4th Release

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

Hi Peter -

I created an account on your site (miketest), and tried the URL you specified. It seemed to work. It tried to access the 'manage.php' file correctly, but couldn't because I wasn't an administrator.

The URL it displayed was: http://test.powerlearning.at/moodle/mod/questionnaire/phpESP/admin/manage.php.

What URL is being displayed when you get the error message?

mike

Re: Questionnaire Module - 4th Release

by Lars Jensen -
Hi Mike,

Thanks for this module - another great enhancement of moodle. I installed it per your directions, and mostly it works - I had the following problems:

  1. When selecting Add... to add a module, the questionnaire module is listed as modulename
  2. In the screen where the module is configured, the items to be configured are listed as:
    qtype
    questionnaireid
  3. The "respond once" option doesn't seem to work. Even when this is selected, students are able to take the survey several times.
  4. If anyone knows the url for a survey, they can go there and take the survey. My impression was that only the students in the class would be able to do the survey. Is this in the plans? Perhaps this could be done by creating a phpESP group of the same name as the moodle courseID and then have all students enrolled in the course be a member of the phpESP and then require that the survey be private.
  5. The "Change Access to a Survey" option was not listed on the phpESP admin page. Why is that? Are all surveys in the questionnaire module public?
Thanks,
Lars.

Re: Questionnaire Module - 4th Release

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

Hi Lars -

For your problems 1 and 2, make sure you have copied the 'questionnaire' language file to the language directory you are using. Currently, there is only English included in the release, although I know others have been developed.

For problem 3, I'm not sure why that is happening. It works fine on all installations I have tested. This is a Moodle check, so it won't work if you go directly to the database as you discuss in problem 4.

For problem 4, you are correct. I haven't spent the effort yet link Moodle access into survey groups (other than admin). Your suggestion is worth looking into.

For problem 5, I'm not sure. I have indeed set all surveys to public in the phpESP config file, and controlled access through Moodle (with the issue you identified in problem 4). I suppose that working on problem 4 might help this issue as well.

mike

Re: Questionnaire Module - 4th Release

by Peter Sereinigg -
you are admin now (for testing)... there is no errormessage just browser says: page can not be found

Re: Questionnaire Module - 4th Release

by Lars Jensen -
Hi Mike,

On point 3, a student is able to take a survey multiple times from inside Moodle, even if the instructor has chosen "respond once" in the setup of the questionnaire... -Everything else seems to function according to expectation.

What is supposed to happen the second time a student attempts a survey - is the student supposed to be denied at the onset, or at the time the student attempts to submit the survey the second time?

Thanks,
Lars.

Re: Questionnaire Module - 4th Release

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

That's very strange. I can't replicate that behaviour.

What you should see, is when you click on the survey, a message comes up saying:
"You have already filled out this questionnaire for us. Thank you."

This uses the database table, 'questionnaire_attempts', to track the attempts. Can you verify that the table is present and is being populated properly? Any survey subittal will show up as an entry with the userid, questionnaire id and timestamp. If the survey is set to 'respond once', and an entry exists with that user's userid, it will not let them take it again.

mike

Re: Questionnaire Module - 4th Release

by Lars Jensen -
Hi Mike,

Yes, I see the questionnaire_attempts table, but it has no data to browse... It doesn't look like it is being populated properly.

Lars

Re: Questionnaire Module - 4th Release

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

Hi Lars -

You may want to download the entire questionnaire module from CVS again, just to make sure you don't have some incorrect code there.

mike

Re: Questionnaire Module - 4th Release

by Lars Jensen -
Hi Mike,

I did download the entire module from CVS, cleaned out and recreated all the database tables, and nothing changed. Students can still take "respond once" surveys multiple times.

Lars.

Re: Questionnaire Module - 4th Release

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

Just double-checking. You are using the "Add Questionnaire" activity feature, and not providing a direct link to the survey handler, correct?

Are you okay with PHP? If so, you need to see what's happening when the function 'questionnaire_record_submission' is being called in 'mod/questionnaire/view.php' on line 78. That function records the submission in the 'prefix_questionnaire_attempts' table. You are saying that you see no entries in that table, so something is going wrong there.

mike

Re: Questionnaire Module - 4th Release

by Lars Jensen -
Hi Mike,

Yes, I am adding the questionnaire with "Add questionnare."

I'm not sure how to check the "questionnaire_record_submissions"...

Lars.

Re: Questionnaire Module - 4th Release

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

Can you add the line:

echo "<pre>Viewform:\n"; print_r($viewform); echo "\nMSG:\n"; print_r($msg); echo "</pre>";

to just before line 77 of 'mod/questionnaire/view.php' (line 77 contains: 'if ($viewform->submit == "Submit Survey" AND empty($msg)) {')?

Then, submit a survey and capture what is output on the screen.

Thanks,

mike

Re: Questionnaire Module - 4th Release

by Lars Jensen -
Hi Mike,

After adding above line, all I see on the page below the survey is this:

Viewform:

MSG:

Nothing else - no message. This is the case both before and after submitting a survey.

Lars.

Re: Questionnaire Module - 4th Release

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

So, for some reason, 'viewform' isn't being set.

Around line 11, you'll see a line that says:

$viewform = data_submitted($PHP_SELF);

Try replacing it with:

$viewform = data_submitted($CFG->wwwroot. "/mod/questionnaire/view.php");

mike.

Re: Questionnaire Module - 4th Release

by Lars Jensen -
Hi Mike,

This made a difference. The first time the student takes the survey, the screen reads as below after the survey is submitted. This time it was not possible for the strudent to take the survey again. I guess this had to do with the change at line 11 ?

Thanks again.
Lars.

Viewform:
stdClass Object
(
[referer] => http://sibelius.tmcc.edu/m2/course/view.php?id=2
[userid] => id=364
[sid] => 2
[rid] =>
[sec] => 1
[2] => asd
[3] => 2
[submit] => Submit Survey
)

MSG:



Re: Questionnaire Module - 4th Release

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

Yep. Sometimes the PHP global I was using ($PHP_SELF) doesn't work (apparently). I've updated the CVS version with the same fix. You can get the new files from there.

Thanks for helping track this.

mike

Re: Questionnaire Module - 4th Release

by Peter Sereinigg -

Sorry ...

not not yet, but tomorrow we will trace the problem ... my admin an me to we have no idea, it looks like the serverpath is not included and therefore i got this dns error ..

You will read from me in the next days...

Unitil solving the problem I am using phpesp from one of my different hosts...

Peter

Re: Questionnaire Module - 4th Release

by Peter Sereinigg -

Hi Mike

No sucess until now,

these are the problems we found out:

  • some of the links, which are created dynamic domain + ... have "//" insite
  • when using german as default language it does not work, it works with us ..
    we changed the _( funktion for testing this ... it startet working - better)
  • and now idea why, several clicks have several results (may works/dont work---work/dont/...)
    NO Problem with cash on IE, maybe a serverproblem
  • we are still searching ...

That may be the reason, when you are looking on my site you have a different language and no problems ...

Re: Questionnaire Module - 4th Release

by Roger Leitch -

Hi

I have installed this ok but get the problem with the langauge translations not showing up.

modulename etc.

  • GNU Gettext: Emulated
  • default_lang: en_US
  • current lang: en_US
  • available langs: sv_SE, pt_PT, pt_BR, nl_NL, ja_JP, it_IT, fr_FR, es_ES, en_US, el_GR, de_DE, da_DK, en
    (da, de, el, en, es, fr, it, ja, nl, pt, sv)
  • GNU Gettext test: %%%% Gettext Test Failed

Any suggestions?

Secondly - it looks like I can add a questionnaire to a course, but I cannot see how to create the questionaires.  The admin/manage.php just takes me to the main moodle login page.

Thanks

Roger

Re: Questionnaire Module - 4th Release

by Roger Leitch -

Found out how to create a questionaire - had to turn off the admin login

$ESPCONFIG['auth_design'] = false;   in the phpESP.ini.php file

After completing a survey and clicking on "return"  I got:


A required parameter was missing

And sent back to the home page rather than the course.

In spite of the problems, this looks great.  

If the admin could be done within Moodle (or simply linked from the add dialogue) and an option to view / publish results inside a course then this would be really useful to me.

Roger

Re: Questionnaire Module - 4th Release

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

You can do that, or login as a valid 'admin' user (any Moodle user with 'admin' privileges). I suggest using this method; then you can add user access for other users.

You need to access the admin functions using the entire path to the phpESP directory (http://[yoursite]/[yourroot]/mod/questionnaire/phpESP/admin/).

Are you adding a survey to a course, and then filling it out?

mike

Re: Questionnaire Module - 4th Release

by Lars Jensen -
Hi Mike and Roger,

One problem with having multiple users is that they can see each other's surveys: One user will be able to select surveys created by another instructor, and possibly mess up the statistics of the survey.

The only way I see to control this is to only have the admin user be able to create surveys.

Isn't this correct, Mike?

Lars.

Re: Questionnaire Module - 4th Release

by Roger Leitch -

Hi,

I was using the right URL but only  got the moodle login screen.  (moodle set to always require login).

I have some courses I want to run that invite participants to share experiences - some of this is achieved by surveys e.g. tick which boxes apply. 

The choice module is select one only from a small list, so I had started using a quiz although it tries to assign grades!!.

The questionaire is better suited to what I want if I can get it working properly.

Ideally the questionnaire link in a course used to reach the questionnaire to fill it in, should point to the results after it is closed. (this can be done manually by creating a web link/page resource and pointing it to the results URL as follows: http://www.siteid.com/moodle/mod/questionnaire/phpESP/admin/manage.php?where=results&sid=2  Where the last No is the survey concerned.

Roger

Re: Questionnaire Module - 4th Release

by Nicolas Martignoni -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
The "Survey" module translation was changed from "Questionnaire" to "Consultation pédagogique" the 25 march 2004 wink, just to cope with the "real" Questionnaire module !

You'll have to download the latest french language pack to benefit of this new wording.

Cheers

Re: Questionnaire Module - 4th Release

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

Sort of.

Right now, there is no way to make a questionnaire specific to a course. So, any instructor would be able to use any questionnaire.

Having them created by the administrator won't change this though.

I really need to find time to go back and finish the Moodle integration. Right now, it is only partially done (but was enough to get me what I needed).

mike

Re: Questionnaire Module - 4th Release

by Shane Phillips -

Mike,

When I load this module and go to insert it from the Add menu, it is listed as modulename.  Also all of the fields on the netry page are enclosed in .  Any ideas?

Shane

Re: Questionnaire Module - 4th Release

by Shane Phillips -

Thanks!

Also when I try to export to a CSV file, i get the following message:

WarningError exporting survey as: /tmp/Tech_Survey.csv : fopen(/tmp/Tech_Survey.csv): failed to open stream: No such file or directory in D:\Intranet\Root\moodle\mod\questionnaire\phpESP\admin\include\function\survey_export_csv.inc on line 146

Can you help with that?

Shane

Re: Questionnaire Module - 4th Release

by Chardelle Busch -
Picture of Core developers

Hi Mike,

Your questionnaire module looks like it might work for something I have been wanting--a Likert-scale type of questionnaire.  Do you have a demo questionnaire installed somewhere?   I have a question that I haven't been able to figure out from these posts or from the sourceforge page:  It looks like when a questionnaire is submitted it can go to a "Thank You" type of page.  Is it possible that this page could return a score to the user along with some text based on that score?  For example, a questionnaire on stress with questions like Rate your stress on a scale of 1 to 7, etc.  Then have a results page based on a score that has text, e.g. You scored 33, This means you have high stress.......

Thank you,

Chardelle

Re: Questionnaire Module - 4th Release

by W Page -
Hi Chardelle!

I do not think that a score is returned with the "Thank you" page option.  You may need to code for that.

WP1

Re: Questionnaire Module - 4th Release

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

It looks like it can't use you '/tmp' directory. The questionnaire program saves the 'csv' files to the '/tmp' directory first.

This should be a configurable item, but I'll have to look into it.

mike

Re: Questionnaire Module - 4th Release

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

The questionnaire is meant to be used as a survey tool, rather than as an interactive quiz.

You may want to try the 'quiz' module. The new 'lesson' module may have some feature like this as well. I know it can generate different pages depending on the answers to questions.

mike

Re: Questionnaire Module - 4th Release

by Marc Dastous -

I know I should know the answer to this, but I'm drawing a blank.  I have all of the aesthetic stuff working with this module except I can't get the icon  to show up in the Module configuration or wherever the Questionaire icon is supposed to appear.

What do I need to do?

Marc

Re: Questionnaire Module - 4th Release

by Thomas Robb -
You need to have a 16x16px .gif file called 'icon.gif' within your module's folder.  If it's there and moodle has sensed that your module is available, it should automatically appear.

For example, look at the moodle/course/format/weeks.php file and you will see this block of code:

/// Then all the links to activities by type
    $moddata = array();
    $modicon = array();
    if ($modnamesused) {
        foreach ($modnamesused as $modname => $modfullname) {
            if ($modname != "label") {
                $moddata[] = "<a href=¥"../mod/$modname/index.php?id=$course->id¥">".$modnamesplural[$modname]."</a>";
                $modicon[] = "<img src=¥"$CFG->modpixpath/$modname/icon.gif¥" height=16 width=16 alt=¥"¥">";
            }
        }
    }
    print_side_block($stractivities, "", $moddata, $modicon);

You might check by inserting  'print_object($CFG)' at the beginning of the block to ascertain whether your module has been included in $CFG->modpixpath

Re: Questionnaire Module - 4th Release

by Marc Dastous -

I figured it out.  For some reason on my EasyPHP1.7 test server it didn't show up.  So I decided to upload it to the live test server and it works perfectly.  Go figure.

Thanks for the reply though.

Marc

Re: Questionnaire Module - 4th Release

by Marc Dastous -

Mike;

I just want to say that finding this module on the Moodle Forums will save me HOURS if not DAYS worth of work!!  For three days I had attempted, unsuccessfully mind you, to install phpESP on my host's server.  Your Questionnaire module incorporating phpESP works perfectly and will enable me to electronically acquire more data for my research without the additional "snail mail" costs I was facing.

I don't care that it's not 100% integrated into Moodle yet, it dsoes the trick for me.  I just want to thank you for this wonderful addition to Moodle.

Marc

Re: Questionnaire Module - 4th Release

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

Thanks.   blush

Truth is, I have it on my list to integrate more fully, but it 'works well enough for me' right now, so it keeps sliding down in priority.

mike

Re: Questionnaire Module - 4th Release

by Joe Griffin -
Hi

Sounds like a module I could use. What's the latest? I couldn't seem to find it in the CVS? Where should I be looking (some folders were empty in the zip files I downloaded)?

Thanks

Joe

Re: Questionnaire Module - 4th Release

by Joe Griffin -
Thanks. I was down one level in CVS and didn't realise. Got it now and about to install.

Joe

Re: Questionnaire Module - 4th Release

by Marc Dastous -

Has anyone figured out how to change the (Rate (Scale 1..5) to (Scale 1..N) with N/A as the precision?

I would like a scale like this:

1 - Strongly Disagree
2 - Disagree
3 - Neutral
4 - Agree
5 - Strongly Agree
N/A - Not Applicable

Not

1 - Strongly Disagree
2 - Disagree
3 - Neutral
4 - Agree
5 - Strongly Agree
6 - N/A

Re: Questionnaire Module - 4th Release

by Lars Jensen -
Hi Marc,

Put 5 in the "length" field and 1 in the "precision" field.

Lars.

Re: Questionnaire Module - 4th Release

by Roger Leitch -

In the Length box put the size of the scale you want - in your example this would be 5.

To get a N/A column put -1 in the Precision Box.

e.g.

  Yes/No Text Box Essay Box Radio Buttons Check Boxes Dropdown Box Rate (scale 1..5) Date Numeric Section Text

Produced

12345678910N/A
question line 1
queston line 2

Another point is that the meaning of the scores needs to be included in the text above

e.g.

<br>
<br>1 = Completely Unaware
<br>5 = Never thought about it before etc.

Roger

Re: Questionnaire Module - 4th Release

by William Waller -
I am having a problem with setting this up. The problem comes from the fact that my host uses mysql database usernames preceeded by a prefix. The username format looks like the following

name1_name2

This is not a valid format when creating any user name in moodle. Therefore, I am getting an error trying to access the admin features of phpESP. Any suggestions?...

Re: Questionnaire Module - 4th Release

by William Waller -
I also turned the admin login feature in phpESP as suggested in a previous reply and successfully gained access to phpESP admin features. I created a test survey and activated it. I logged into moodle and added the survey to a course. When I try to access the survey, I get the following error msg...

That questionnaire is not available yet. Try again later.

Any help is appreciated...

Re: Questionnaire Module - 4th Release

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

That message will get returned if it can't find the questionnaire, or the questionnaire isn't active. I'll change some code so that it gives a more appropriate message if the record isn't found.

In the meantime, verify that the questionnaire is active. Also, make sure that you've configured the database parts of the questionnaire config file for your system. You will need to setup the database host, name, and prefix.

mike

Re: Questionnaire Module - 4th Release

by Sean S -
Are the zip files at the top of this thread the most current versions? I checked the CVS page, but I don't know what to download. Zip files are so much easier.

I also checked the modules page and didn't see it there either.

Re: Questionnaire Module - 4th Release

by Sean S -
Thanks Tim,

I got it and installed it, the tables worked fine but I cannot access the phpesp admin page. I think I may have configured the base url incorrectly as I did not fully understand what was meant by root. Anyhow that didn't work so I redid the config file and left that field as default and I still cannot access it via

http://[yoursite]/[yourroot]/mod/

Any ideas?

I'm not using CVS. I don't understand what it is or what the benefits are. All I want is a zip file and then I can upload to my site. I like to keep things simple.

Re: Questionnaire Module - 4th Release

by W Page -
Hi Mike!

I thought the most recent files in the CVS were updated nightly and put in zip format.

Martin could verify this.

WP1

Re: Questionnaire Module - 4th Release

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Yes, all directories in /contrib and /moodle/mod and /moodle/filter are downloaded and zipped up every day.

Re: Questionnaire Module - 4th Release

by Sean S -
I just looked at all I could see were were three choices
  • latest stable release 1.3.1
  • latest stable nightly 1.3.1+
  • latest development nightly 1.4
Where can I find individual modules? All I want is the questionaire.

Moodle is starting to get bothersome to me, it is not intuitive and navigating this site is not easy. If I do not click a link from an email it takes me about 10 minutes to find this thread.

I just checked that the Link Tim provided does work, but when you visit the modules page it is not listed. http://moodle.org/download/modules/#activities How Tim found it I'll never know.

Re: Questionnaire Module - 4th Release

by Tim Allen -

Yes, I understand. 

I wonder if Martin would consider adding the questionnaire module to the modules download page (as a non-standard one)?  It would make downloading easier for those not familiar with CVS.  A number of people have expressed interest in it so I think it is justified IMHO.

I think it might also be useful to add a link/comment to the modules download page informing moodlers that other modules can be downloaded from http://moodle.org/download.php/modules/modulename.zip

Tim.

Re: Questionnaire Module - 4th Release

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Please feel free to help us improve the site - it's a work in progress.

As for Questionnaire I actually thought it WAS on the download page.  My apologies!  It is now.

Re: Questionnaire Module - 4th Release

by Sean S -
Now that the CVS/zip question is resolved, I'm still having trouble getting the questionaire to work properly.  My original question is/was:

I got it and installed it, the tables worked fine but I cannot access the phpesp admin page. I think I may have configured the base url incorrectly as I did not fully understand what was meant by root. Anyhow that didn't work so I redid the config file and left that field as default and I still cannot access it via

http://[yoursite]/[yourroot]/mod/

Any ideas?

Re: Questionnaire Module - 4th Release

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

You need to have a line something like:

// The string $server['HTTP_HOST'] will be replaced by the server name

$ESPCONFIG['base_url'] = 'http://' . $server['HTTP_HOST'] . '/moodle-1.4/mod/questionnaire/phpESP/';

In this case (my test server), the directory 'moodle-1.4' is the root for the site.

But, having said that, it would be so much easier if I just changed the phpESP config file to use the values already in your Moodle file. So I have!

Replace your '/mod/questionnaire/phpESP/admin/phpESP.ini.php' with the attached one, and your system should be setup correctly. I will also update CVS.

Also, when you access the admin page, use: 'http://[yoursite]/[yourroot]/mod/questionnaire/phpESP/'. Replace [yousite] with your Moodle url, and [yourroot] with any directory specific to your Moodle installation (you may not have one). If you are using the latest module, that link appears on the mod page when you add or update a questionnaire module to your course (Survey Management phpESP).

mike

Re: Questionnaire Module - 4th Release

by Saeed Ahmed -

Hi,

I have just tried to install this and get it working.  Have got moodle installed in Inetpub\wwwroot as well as the questionnaire module.  Tried to get the config.php in \moodle right but seems I have done something wrong. 

If I browse to http://intranet/moodle I get the config error page :

 

Error: Moodle could not connect to the database.

It's possible the database itself is just not working at the moment.

The admin should also check that the database details have been correctly specified in config.php

Database host: machinename.domainname.internal (have tried localhost too)
Database name: survey
Database user: survey

I have set the db users permissions and checked the database to make sure I have the name correct.

Is there something obvious I am missing??

Sid.

Re: Questionnaire Module - 4th Release

by Saeed Ahmed -

My bad.

I just noticed the line that says LEAVE BLANK for dbname and dbuser and password!

Whoops!

Just so I know someone is reading this and help is available, post a response!

Re: Questionnaire Module - 4th Release

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

Don't worry, we are here.... wink

It sounds like the problem was in your Moodle config file, correct? If you have the latest version of the questionnaire module, including the new phpESP.ini.php file, that's all you should need.

mike

Re: Questionnaire Module - 4th Release

by Saeed Ahmed -

Yes it was in the config.php file.

I have Moodle installed and seems OK.  Now just have to work out how to use it!

I wanted the questionnaire module so I could do a survey of what sort of kit students have at home and their knowledge prior to starting ICT in the school.  Can I use this module for that and is there a way to analyse results?

If yes, perfect.  If I am barking up the wrong tree I'l seek an alternative.

And am I right in thinking moodle can be used to share resources, plan and conduct lessons etc?

Thanks for response.

Sid.

Re: Questionnaire Module - 4th Release

by N Hansen -
I clicked on your link and it took me to a religious joke website, nothing moodle related?!?

Re: Questionnaire Module - 4th Release

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

This should only happen if you are not logged in. The first time, you need to be logged into an administrator account.

Let me know if this is happening after you have already logged in.

mike

Re: Questionnaire Module - 4th Release

by Marc Dastous -

Mike;

I am about to begin my Doctoral studies and this tool is WONDERUL!!!  I have created a test survey and it works like a charm.

Thank you to Lars and Roger for their help with the N/A situation, that worked like a charm.

This is another example of why Open Source RULES!!!!!!!

Marc

Re: Questionnaire Module - 4th Release

by Sean S -
Thank you that did the trick. Now all I need to do is start making a survey!

Re: Questionnaire Module - 4th Release

by Sean S -
I just made a survey and then activated it but when I try to take it I get the following error.

Warning: main(../../../../config.php): failed to open stream: No such file or directory in /path/to/moodle/mod/questionnaire/phpESP/admin/phpESP.ini.php on line 12

any tips?

Re: Questionnaire Module - 4th Release

by Saeed Ahmed -

Below is an extract from my phpESp.ini

I dont know what I am doing here. 

If my server name was "wce-svr-002",

The moodle directory was "inetpub\wwwroot\moodle"

Database name was "survey"

And I had set up a user for that DB with username "survey" and password "password"

What do I need to input or change in the phpesp.ini file??

And should browsing to \mod\questionnaire\phpesp\admin keep taking me to manage.php??

TIA

Sid.

<?php

# $Id: phpESP.ini.php,v 1.3 2004/07/07 04:04:04 mchurch Exp $

// Written by James Flemer
// For eGrad2000.com
// <jflemer@alum.rpi.edu>

//


if (!defined('ESP_BASE')) define('ESP_BASE', dirname(dirname(__FILE__)) .'/');
if (isset($_SERVER))  $server =& $_SERVER;
else                  $server =& $HTTP_SERVER_VARS;

/**
 * Here are all the configuration options.
 */

// Base URL for phpESP
// The string $server['HTTP_HOST'] will be replaced by the server name
//$ESPCONFIG['base_url'] = 'http://' . $server['localhost'] . '/moodle/mod/questionnaire/phpESP/';
$ESPCONFIG['base_url'] = $CFG->wwwroot.'/mod/questionnaire/phpESP/';

// URL of the images directory (for <img src='...'> tags)
$ESPCONFIG['image_url'] = $ESPCONFIG['base_url'] . 'images/';

// URL of the automatic survey publisher
$ESPCONFIG['autopub_url'] = $ESPCONFIG['base_url'] . 'public/survey.php';

// URL of the CSS directory (for themes)
$ESPCONFIG['css_url'] = $ESPCONFIG['base_url'] . 'public/css/';

// Database connection information
$ESPCONFIG['db_host'] = $CFG->localhost;
$ESPCONFIG['db_user'] = $CFG->;
$ESPCONFIG['db_pass'] = $CFG->;
$ESPCONFIG['db_name'] = $CFG->;

// MOODLE ADDITIONS:
$MDL_PREFIX = "";
$MDL_MODULE = "questionnaire_";
$ESPCONFIG['accesstable'] = $MDL_PREFIX.$MDL_MODULE."access";

Re: Questionnaire Module - 4th Release

by Sean S -
This thread has gotten rather extensive. Over 80 replies. Is there any chance that the questionaire module could get it's own forum? I have a few questions/suggestions I would like to ask but don't want to append them to the end of this mammoth thread.

With a seperate forum, it would probably increase interest in this module. Just my two cents.

Re: Questionnaire Module - 4th Release

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

You shouldn't have to change anything in the phpesp.ini.php file, if you are using the latest one (which you are). Everything looks fine, except for your database connection information. Your database connection lines should look like this:

// Database connection information
$ESPCONFIG['db_host'] = $CFG->dbhost;
$ESPCONFIG['db_user'] = $CFG->dbuser;
$ESPCONFIG['db_pass'] = $CFG->dbpass;
$ESPCONFIG['db_name'] = $CFG->dbname;

There is one other potential problem I noticed there. If you use a database prefix for your Moodle tables, put it in the '$MDL_PREFIX' variable. I will update this file to use the one from the Moodle config. (you can find the updated file here)

Yes, browsing to '\mod\questionnaire\phpesp\admin' should take you to manage.php.

Re: Questionnaire Module - 4th Release

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

The questionnaire module is probably the perfect tool for that. phpESP doesn't provide much in the way of analysis tools, but if you look at the phpESP management page, you'll see that you can export CSV data from your surveys, and do something called 'cross tabulation'.

Moodle is the perfect tool for planning and conducting lessons - that's what it was designed for! wink

Planning courses can be done through the teacher's forum of a course, while you are developing the course, or by setting up a course just for this purpose and assigning only the people needed to plan.

Sharing resources is not the primary purpose of Moodle, but I use it for that. I have courses set up for teachers and administrators only, and I use the 'file' option to create directories and store related files. You can then access these:

  • through the file menu,
  • creating a specific resource pointing to a file,
  • creating a directory resource,
  • adding resource and activity filtering, and using auto-linking by file / resource name,
  • linking in a forum post.

For students, you can share resources through forum posts. Each post can have one file. I encourage them to describe the contents in the post. You can also use ratings to assign a value to the file.

Hope this helps.

mike

Re: Questionnaire Module - 4th Release

by Saeed Ahmed -

OK,

So what do I need to do next to set up a questionnaire? 

Browsing to http://intranet/moodle/mod/questionnaire gives me an error saying "A required parameter was missing".

I didnt use a db prefix and have changed the phpesp.ini file back to normal.

Is there a "How To" document for this module for people like me who have no php skills to speak off and are setting up from scratch?!

What do I need to do in order to set up a questionnaire now?  And can I use a csv file to import users?  I want to do a school and college wide survey and dont really fancy creating 1400 users!

Thanks for all the help.

Sid.

Re: Questionnaire Module - 4th Release

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

Setting up a questionnaire requires two distinct steps. The first one is to create a survey using phpESP; the second is to add that questionnaire activity to a Moodle course.

To create a survey, go to the phpESP management interface as an administrator. This is found at http://[your_site]/[your_moodle]/mod/questionnaire/phpESP. The directory you specified cannot be accessed directly. Once there you can create a new survey. Before you can access this survey in Moodle, you will need to activate it (use the 'Change Status' option at the management interface).

Once you have a survey or surveys created, you can add them as questionnaires to a Moodle course. From the Activity drop-down, choose Questionnaire, and fill in the details. The survey you created will be available from the drop-down there (but only if you activated it).

As far as importing users, you don't need to import users to a survey. Moodle users of a course will be able to use questionnaires in that course. If you want to import users to Moodle, read the help file on your Moodle site about this (you can find it here as well).

mike

Re: Questionnaire Module - 4th Release

by Jake Callery -

Hi, thanks for the response, unfortunately I was logged in as an admin.  I have just noticed however that on the "Adding a new Questionnaire" page, that there is an error:

Line: 202
Char: 1
Error: 'HTMLArea' is undefined
Code:0
URL:http://68.61.99.41/moodle/course/mod.php?id=3&section=1&add=questionnaire

I have also noticed that if I try to view the Questionnaire Admin page, I get a page cannot be displayed error, but if I go there on the local network, I get kicked back to the login page.

I'm pretty stumped, and I even downloaded the newest .ini.php file from you.

Thanks very much for the continued support!


-Jake

Re: Questionnaire Module - 4th Release

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

The HTMLArea problem needs to be fixed, but that's not your problem.

It sounds like you may have different values defined in your moodle/config.php file than you are using to access the page. Your example uses an IP address, but is that what your site is configured as in your config file?

If I try to do this using an IP on my test site, I get the same problem. If I use the domain name, its fine.

What is the value for $CFG->wwwroot defined in your config.php file?

mike

Re: Questionnaire Module - 4th Release

by Jake Callery -

Thanks again for the reply!  Unfortunately this is a test server and doesn't have a domain, but I can get a domain and point it to this box later this week.

my wwwroot line looks like the following:
$CFG->wwwroot   = 'http://68.61.99.41/moodle';

Thanks again!

-Jake

Re: Questionnaire Module - 4th Release

by Marc Dastous -

Saeed, that is where it should take you.  This is the administrative page for phpESP.   You would begin to "Create a new survey" here.

Then, once the survey has been released, you can access it in the Moodle questionnaire resource.

Marc

Re: Questionnaire Module - 4th Release

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

Hmmm. That's very odd. I can only duplicate the behaviour you're describing if I have a domain defined in my config file and access via IP. I changed my config to use the IP, and it still worked okay.

You said:

I have also noticed that if I try to view the Questionnaire Admin page, I get a page cannot be displayed error, but if I go there on the local network, I get kicked back to the login page.

What is the URL when you 'try to view the Questionnaire Admin page'? How are you doing this?

What are you entering when you 'go there on the local network'?

mike

Re: Questionnaire Module - 4th Release

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

Use the 'Create a New Survey' menu item. Its pretty self explanatory after that.

Once you've created a survey and activated it, you can add it as an activity to a Moodle course.

mike

Re: Questionnaire Module - 4th Release

by Saeed Ahmed -

Sorry,

I am not explaining myself properly.  If I browse to /phpesp/admin then I am taken to the manage.php file, which looks same as phpesp.ini file. 

I dont see a window with any create new survey option. No menu, just a php script is seen.

Saeed

Re: Questionnaire Module - 4th Release

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

Hmmm. That's not right.

Is everything else under Moodle working correctly?

Can you post a screen capture of your browser when you are looking at that page, including the URL?

mike

Re: Questionnaire Module - 4th Release

by Saeed Ahmed -

Everything else appears to be fine.  I have not used it for anything else yet because this survey module is what got me interested!

have attached some screenshots in the word document attached.

Saeed.

Re: Questionnaire Module - 4th Release

by Saeed Ahmed -

lets try the attachment again!

Dont think it'l work due to 50kb size limit.  screenshots make the file size a lot bigger.

Saeed.

Re: Questionnaire Module - 4th Release

by Saeed Ahmed -

Sorry about the number of posts and attachments!

Its the only way I can show you though.  The webserver I am toying with is not public facing.

Apologies, but can you help?  I really want this to work!

Saeed.

Re: Questionnaire Module - 4th Release

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

I can't explain this. Both of those directories have 'index.php' files in them that automatically redirect to '/mod/questionnaire/phpESP/admin/manage.php'. What I'm seeing here looks like a direct print out of your phpESP.ini.php file. In other words, php is not being interpreted.

Do you get the same thing when you go to:
http://intranet/moodle/mod/questionnaire/phpesp/admin/manage.php.

Are you sure that you can execute php correctly using your 'http://intranet' URL?

mike

Re: Questionnaire Module - 4th Release

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

Aha! There is definitely something wrong with this file. When I click on it, it loads directly into my browser (like you are seeing). Because its a php file, it should offer me the chance to 'open' it or 'save' it, not load. Let me look...

Okay, somehow the file you are using has been formatted as an HTML file. The entire file has been enclosed in <pre></pre> tags, and all of the HTML characters have been escaped.

I have attached a good version for you here. Right click on it, and choose 'Save As..'. Maybe that will work better.

mike

Re: Questionnaire Module - 4th Release

by Saeed Ahmed -

Yep.

Exactly the same thing if browsing to that URL.

I have got My PHP 4.3.7 installed on the server and set permissions so IUSR_MACHINE has execute rights to php.exe and php4ts.dll and read/write access to the necessary directories.

Saeed.

Re: Questionnaire Module - 4th Release

by Jake Callery -

Hi Mike,
The URL I use from outside the local network is:
http://68.61.99.41/moodle/mod/questionnaire/phpESP
when I access that from a remote network  I get a page cannot be found

Don't worry about the issue with the local network, I think its getting confused with the different IPs that I'm accessing it with and dropping my login.  So if you have any ideas why I can't get to it from a remote machine that would be great!
(I did notice that on the local network I get redirected to:
http://reverend/moodle/mod/questionnaire/phpESP/admin/manage.php
before kicked back to the login page, don't know if that helps)

Everything else in moodle seems to be working properly, .php files are being interpreted 
correctly, and index.php is set to be served  up by default.

I'm wondering if it has anything to do with the fact that the server is behind a router?  It there anything special that needs to be forwarded through or something?

Also would this be better as a new thread in this forum?

Thanks again for all of the help! I can't wait to get it working!

--------------------------------------------------------------------------
Previous Conversation:
Hmmm. That's very odd. I can only duplicate the behaviour you're describing if I have a domain defined in my config file and access via IP. I changed my config to use the IP, and it still worked okay.

You said:

I have also noticed that if I try to view the Questionnaire Admin page, I get a page cannot be displayed error, but if I go there on the local network, I get kicked back to the login page.

What is the URL when you 'try to view the Questionnaire Admin page'? How are you doing this?

What are you entering when you 'go there on the local network'?

mike

Re: Questionnaire Module - 4th Release

by Saeed Ahmed -

Thanks for that!  Got me through that stage!

now what does this mean?

Notice: Undefined variable: CFG in G:\Inetpub\WWWroot\moodle\mod\questionnaire\phpESP\admin\phpESP.ini.php on line 23

Notice: Undefined variable: CFG in G:\Inetpub\WWWroot\moodle\mod\questionnaire\phpESP\admin\phpESP.ini.php on line 35

Notice: Undefined variable: CFG in G:\Inetpub\WWWroot\moodle\mod\questionnaire\phpESP\admin\phpESP.ini.php on line 36

Notice: Undefined variable: CFG in G:\Inetpub\WWWroot\moodle\mod\questionnaire\phpESP\admin\phpESP.ini.php on line 37

Notice: Undefined variable: CFG in G:\Inetpub\WWWroot\moodle\mod\questionnaire\phpESP\admin\phpESP.ini.php on line 38

Warning: Cannot modify header information - headers already sent by (output started at G:\Inetpub\WWWroot\moodle\mod\questionnaire\phpESP\admin\phpESP.ini.php:23) in G:\Inetpub\WWWroot\moodle\mod\questionnaire\phpESP\admin\include\funcs.inc on line 67

HTTP 503 Service Unavailable

[ Connection to database failed. Please check configuration. ]

Re: Questionnaire Module - 4th Release

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

Looks like you have files from different versions of the questionnaire module.

I would suggest you delete the questionnaire module and reinstall it. To delete it, go to your admin - configuration - modules function and select 'delete' for questionnaire. Then, go and get the latest questionnaire files from http://moodle.org/download/modules/. Unzip them into your questionnaire page and go back to your admin page.

Let me know if the problems persist after that.

mike

Re: Questionnaire Module - 4th Release

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

The redirection your local network is doing is correct. You should get bounced back to the manage.php page. It kicks you back to login if it thinks you're not logged in (which could be due to the different IP's you refer to). The fact that the redirected URL has no IP in it shows that your config file has a different wwwroot in it than what you are accessing. This will screw up you login cookies, and would explain why its not working there.

I tried to access by the IP you gave. I couldn't access any of the moodle site. The error that comes back is from the web server and indicates that either the pages aren't under the '/moodle' directory, or the server has been configured to hide that site. I think you need to check where you have installed Moodle, and how you server is configued to serve it.

mike

Re: Questionnaire Module - 4th Release

by Sean McKay -
Hi Mike,

Does the questionnaire allow for anonymous results?

Thanks,
Sean

Re: Questionnaire Module - 4th Release

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Ummm. Not really.

The questionnaire_response table stores the username of all respondents, and the questionnaire_attempts stores the userid's.

Why, what were you thinking of doing?

mike

Re: Questionnaire Module - 4th Release

by Sean McKay -
Hi Mike,

What I need is the ability for a student to give an anonymous answer to a course assessment to give feedback to the prof or instructor regarding the online course or specific module they have just completed.

Now, it may not *really* be anonymous as there is a record in the database of who gave an answer so you don't get duplicate answers, however in userland, where the instructor interacts with Moodle, it should be anonymous so that the instructor can't figure out how an individual answered a survey.

Sean

Thank You For Your Support

by feras abu nemreh -

Dear Mr.Mike Churchward

Thank You For Your Support,I'm install the questionnaire moodle in my localhost and I'm use the admin page to create survey and I'm successfully and I'm see the survey its work  but  i want to know how can i add the course and make the relation between the survey with the course ?

i wasn't understood where the course id you call  and asign value in the man page  

$course->id where the class you create it and

 can i  read  from prefix_questionnaire and join with the survey (course join with the survey)  ?

Thanks ,