Questionnaire- Enhanced version June 2007

Questionnaire- Enhanced version June 2007

by Joseph Rézeau -
Number of replies: 21
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi,

Thanks to Mike Churchward's collaboration I am pleased to announce that all of my bug fixes and proposed improvements have now been integrated into the Questionnaire module. Since no changes have been made to the database, however, the version number remains the same.

If you want to take advantage of these improvements - at no risk - you are encouraged to replace your existing Questionnaire files with the new ones. Those are available either as CVS (in contrib folder), the recommended option for those who have easy access to CVS or as a zipped file, to be found at http://download.moodle.org/plugins/mod/ or in the moodle modules and plugins database here (download latest version). Tested on Moodle 1.6, 1.7 and 1.8, on Windows XP, php 5.1.4.

Please report any bugs and (reasonable) wishes in this thread.

Note.- At the moment the language files are complete for English and French; Spanish is half done; anyone wanting to translate to other languages is welcome to do so.

Joseph

Average of ratings: -
In reply to Joseph Rézeau

Re: Questionnaire- Enhanced version June 2007

by Antony OSullivan -

Most excellent indeedo...

I download the version in... http://download.moodle.org/plugins/mod/questionnaire.zip

And it works... except for one minor hassle...

And when I look at "View All Responses"... some of the questions now have... a print_r dump!

You might want to edit - questiontypes.class.php  and take out lines 720 to 722...

echo ('<pre>');
print_r ($rids);
echo ('</pre>');

..

Whilst you are there... you might want to change line 1844 from:

'ORDER BY a.id,a.question_id,c.id';

To:

'ORDER BY c.id,a.id,a.question_id';

---------------------

3. 
Array ( [0] => 39 [1] => 40 [2] => 41
<<SNIP SNIP (to make this posting short) >>
 [92] => 133 [93] => 134 [94] => 135 [95] => 136 ) 
Are you male or female? (Please tick one answer).

---------------------

In reply to Antony OSullivan

Re: Questionnaire- Enhanced version June 2007

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Antony,

Many thanks for testing and for your report.

1- You might want to edit - questiontypes.class.php and take out lines 720 to 722...echo ('<pre>');
print_r ($rids);
echo ('</pre>');

Oops! that was left from debugging... I will of course remove it.

2-Whilst you are there... you might want to change line 1844 from:

'ORDER BY a.id,a.question_id,c.id';
To:
'ORDER BY c.id,a.id,a.question_id';

What result do you want to be achieved by this change, please?

3- Array ( [0] => 39 [1] => 40 [2] => 41
<<SNIP SNIP (to make this posting short) >>
[92] => 133 [93] => 134 [94] => 135 [95] => 136 )
Are you male or female? (Please tick one answer).

Sorry, I do not understand this part of your post.

All the best

Joseph

PS.- Since all changes to CVS have to go through Mike first, it may take a couple of days before they become effective.

In reply to Joseph Rézeau

Re: Questionnaire- Enhanced version June 2007

by Antony OSullivan -

locallib.php

Line 1259

$strmissing = ''; // missing questions

You might want this to be a SPACE...  or something like:  ": "

As the #1 is attached to the end of "questions"... with no space...

----- EG -----

You are missing the following required questions#1. #2. #3. #4. #5. #6. #7. #8. #9. #10. #11. #12. #13. #14. #15. #16. #17. #18.

-----

(Should not be changed in language file... as someone will take out the extra space one day by mistake)

In reply to Antony OSullivan

Re: Questionnaire- Enhanced version June 2007

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hum, I do not see a problem here. Lang file has these two strings which already include a colon and a non-breaking space at the end:

$string['missingquestion'] = 'You are missing required question:&nbsp;';
$string['missingquestions'] = 'You are missing required question(s):&nbsp;';

Result looks OK to me:

You are missing required question(s): #1. #2. #4. #5. #6. #7. #8. #9. #10. #11. #12.

Joseph

EDIT.- I think you are not using the most recent English lang. file. Could you check?

In reply to Joseph Rézeau

Re: Questionnaire- Enhanced version June 2007

by Antony OSullivan -

From the lates CVS...

The ":&nbsp;" does not appear in all language files... for my particular system it must be using:  en  (not en_utf8)

[root@www lang]# find -type f -exec grep -H -i missingquestion {} \;

./de_utf8/questionnaire.php:$string['missingquestions'] = 'Folgende Fragen mss en noch beantwortet werden.';

./pt_br/questionnaire.php:$string['missingquestions'] = 'Est&atilde;o faltando as seguintes perguntas ';

./pt/questionnaire.php:$string['missingquestions'] = 'No respondeu s seguintes questes obrigatrias';

./de/questionnaire.php:$string['missingquestions'] = 'Folgende Fragen mssen noch beantwortet werden.';

./es_utf8/questionnaire.php:$string['missingquestion'] = 'No ha respondido a la pregunta obligatoria siguiente:&nbsp;';

./es_utf8/questionnaire.php:$string['missingquestions'] = 'No ha respondido a la s preguntas obligatorias sigueintes:&nbsp;';

./nl/questionnaire.php:$string['missingquestions'] = 'Volgende vereiste vragen m oet je nog beantwoorden';

./pt_br_utf8/questionnaire.php:$string['missingquestions'] = 'Est&atilde;o faltando as seguintes perguntas ';

./nl_utf8/questionnaire.php:$string['missingquestions'] = 'Volgende vereiste vragen moet je nog beantwoorden';

./en/questionnaire.php:$string['missingquestions'] = 'You are missing the following required questions';

./pt_utf8/questionnaire.php:$string['missingquestions'] = 'No respondeu s seguintes questes obrigatrias';

./fr_ca_utf8/questionnaire.php:$string['missingquestions'] = 'You are missing the following required questions';

./en_utf8/questionnaire.php:$string['missingquestion'] = 'You are missing required question:&nbsp;';

./en_utf8/questionnaire.php:$string['missingquestions'] = 'You are missing required question(s):&nbsp;';

./fr_utf8/questionnaire.php:$string['missingquestion'] = 'Vous n\'avez pas rpondu  la question obligatoire suivante&nbsp;:&nbsp;';

./fr_utf8/questionnaire.php:$string['missingquestions'] = 'Vous n\'avez pas rpondu aux questions obligatoires suivantes&nbsp;:&nbsp;';

./es/questionnaire.php:$string['missingquestions'] = 'Le falta completar las siguientes preguntas requisitas';

In reply to Antony OSullivan

Re: Questionnaire- Enhanced version June 2007

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

That's right, the only language files which exadtly correspond to the present Questionnaire version are:

  • en_utf8 : interface language strings & help files
  • fr_utf8 : interface language strings & help files
  • es_utf8 : interface language strings (help files forthcoming)

All of the other language files have been carried over from the previous version. Since a significant number of language strings have been changed or created in the newer version, those older language files are more or less obsolete.

How come you are using en rather than en_utf8 (which has been standard since Moodle 1.6)? If you are willing to convert the contents of en_utf8 to en, then that's fine. And anyone is welcome to translate the new en_utf8 lang. files to other languages. Converting the hard-coded (i.e. English) language strings from the previous version of Questionnaire into customizable language strings was an important part of the work I did, and I hope anyone needing up--to-date language files in other languages will now do their share of the job.smile

Joseph


In reply to Joseph Rézeau

Re: Questionnaire- Enhanced version June 2007

by Antony OSullivan -

I am using 1.8 and in the default languages section... it says  English (en) ... other choices are English (en_us)...


Something must be wrong somewhere...

In reply to Antony OSullivan

Re: Questionnaire- Enhanced version June 2007

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
No, no, this is OK. In the language dropdown list you see English(en), Français(fr), etc. I was actually referring to the language files themselves, which e.g. for English are located either in the en folder (pre Moodle 1.6 versions) or the en_utf8 folder (from version 1.6).
Another question is: have you followed my recommendation regarding the preferred location of the language files at the end of my README_v2.txt file:


It is of course possible to upload the questionnaire module directory into your moodle\mod\ subdirectory. All the necessary language files are included. However, this is not recommended practise.
a. If you need to customize or translate the questionnaire module language files, you can't do this if they are not in their proper place.
b. If one of the help files points to another help file, the relative paths are not recognized.

This is why I *strongly recommend* copying all the language files in the questionnaire directory to their "proper" places on your moodle site:
COPY FROM -> TO
\moodle\mod\questionnaire\lang\en_utf8\questionnaire.php -> \moodle\lang\en_utf8\questionnaire.php
\moodle\mod\questionnaire\lang\en_utf8\help\questionnaire\ -> \moodle\lang\en_utf8\help\questionnaire\
---
moodle\mod\questionnaire\lang\fr_utf8\questionnaire.php -> \moodledata\lang\fr_utf8\questionnaire.php
moodle\mod\questionnaire\lang\fr_utf8\help\questionnaire\ -> \moodledata\lang\fr_utf8\help\questionnaire\

Whichever solution you adopt you should make sure that the latest lang files you downloaded from CVS are located in both places, to make sure!
Joseph
In reply to Joseph Rézeau

Re: Questionnaire- Enhanced version June 2007

by Bug Catcher -
Hi Joseph,

I have tested your Questionnaire and notice that the preview mode of the "unique answer for each question" does not reflect correctly. Please kindly see the picture in this message.

But when the Questionnaire is being "publish" into the course, it reflected correctly on the "unique answer for each question".

Do hope to hear from your reply regarding this preview mode of the "unique answer for each question".
Attachment Preview.jpg
In reply to Bug Catcher

Re: Questionnaire- Enhanced version June 2007

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Bug Catcher,
You are quite right, the Preview mode is only meant - as the word preview implies - to give an idea of the general aspect of the Questionnaire, not to make it fully usable. This is why the (Javascript) routines which do that kind of checking are not implemented in Preview mode. I agree that it might be useful to make the Preview more like the real thing, and will see if I can do it but no promises...
Joseph
In reply to Joseph Rézeau

Re: Questionnaire- Enhanced version June 2007

by Bug Catcher -
Hi Joseph,

I also have created a proposal new buttons for your Questionnaire module. (See diagram)

One is the Delete Selected and Delete All buttons to manage the Questionnaires.

Second is the Export of Excel format of your Questionnaire, which give user another choice of export Questionnaire result into other format beside CSV format.
Attachment Excel.jpg
In reply to Bug Catcher

Re: Questionnaire- Enhanced version June 2007

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Two good suggestions. I'll put them on my list of TODO things.
Joseph
In reply to Bug Catcher

Re: Questionnaire- Enhanced version June 2007

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Bug Catcher,

1- On second thoughts... why would you want a Delete Selected button here? As with all other module activities, the normal way to delete an instance is to use the Delete icon in a course's Topics.

2- However, what can happen is the case of an uncompletely created questionnaire, which will not disappear from the Copy existing list even though the teacher has deleted its instance as explained above. In this case, there is provision in the questionnaire task for deleting of such "orphan" questionnaires. This clean-up cron task is scheduled to run every 12 hours.

Were you thinking of case #1 or #2?

Joseph

In reply to Joseph Rézeau

Re: Questionnaire- Enhanced version June 2007

by Bug Catcher -
Hi Joseph,

I was thinking of the case #1 (On second thoughts... why would you want a Delete Selected button here? As with all other module activities, the normal way to delete an instance is to use the Delete icon in a course's Topics.)

The delete selected button is used to delete two or more Questionnaires that the teacher or administrator do not want them. The teacher and administrator would like like to delete 30 questionnaire from a pool of 100 questionnaire by manual delete them one by one at a time. (That will be too time consuming)

By the way, sorry for the late reply.
In reply to Joseph Rézeau

Re: Questionnaire- Enhanced version June 2007

by Bug Catcher -
Hi Joseph,

Just one last thing regarding about the course-mapping (which is discuss on the another posting).

Is it possible to have the replies being grouped into individual course? (See diagram - the diagram is actually taken from the Feedback module.)

What I really like best from Feedback module is the possible of course-mapping and the replies that can be grouped into individual course.

As for the Questionnaire module, I think the best feature would be the "unique answer for each question".


Attachment CourseMap.jpg
In reply to Bug Catcher

Re: Questionnaire- Enhanced version June 2007

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Thanks for another good suggestion... to go on my TODO things list.
Joseph
In reply to Joseph Rézeau

Re: Questionnaire- Enhanced version June 2007

by Jonathan Harker -
Hi,

I came across some errors in mod/questionnaire during the upgrade of a Moodle client from 1.5 to 1.8 using PostgreSQL. I thought I would bring to your attention a change that fixed the error that you may want to evaluate and include in upstream code.

The commit diff is on our local Moodle tracking git repo here.

Cheers,

Jonathan Harker
Catalyst IT Limited

In reply to Jonathan Harker

Re: Questionnaire- Enhanced version June 2007

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Thank you. I have no knowledge of PostgreSQL, and no way to test it, so I hope your fix is OK. I'll ask Mike Churchward to commit the fix to CVS.
Joseph
In reply to Jonathan Harker

Re: Questionnaire- Enhanced version June 2007

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

I can’t get your diff to match up with any version of that file. What branch of contrib did you 'diff' this with?

mike