Should the Questionnaire title default to empty?

Should the Questionnaire title default to empty?

by Nate Baxley -
Number of replies: 4

I've run into an annoyance with questionnaire that I think can be fixed fairly easily. When duplicating a questionnaire it brings the name and title filled in already with the same value. So to change what the questionnaire is called, you have to change both values, on two different forms.

The title is defaulting to the name, but it seems to actually copy the 'name' value to 'title'. A different approach would be to allow the title to be empty and default it to the name when it's used. For example, in the print_survey_start function there is a line:
echo '<h3 class="surveyTitle">'.s($this->survey->title).'</h3>';
that could be changed to 
echo '<h3 class="surveyTitle">'.s((strlen($this->survey->title)>0?$this->survey->title:$this->survey->name).'</h3>';

You would also have to make the title field not a required field. This would solve the problem above such that unless you specified a custom title, you would only have to change the name to get it to display correctly.

Average of ratings: -
In reply to Nate Baxley

Re: Should the Questionnaire title default to empty?

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

Hi Nate,

Which versions of Moodle and Questionnaire are you using?

Which method do you use to "duplicate" a questionnaire?

Let's take an example, using Moodle 2.6 or latest 2.7.

I have a questionnaire Named "Questionnaire 01" and entitled "Course evaluation". In Teacher Edit mode, I click the Edit link and, in the menu, I click the Duplicate link. Once my Questionnaire 01 has been duplicated, it is displayed in my course's list of activities under the same name, Questionnaire 01. So I click the little pen icon next to that name, and change this to Questionnaire 02. The title of the questionnaire remains unchanged ("Course evaluation").

You write "[...] to change what the questionnaire is called [...]". This is not clear, please refer to Name and Title, not "is called" which is ambiguous.

I agree that it may seem unnecessary and confusing to have both a Name and a Title for a Questionnaire instance, but I do not quite understand why you see this as a problem. Please explain.

Joseph

In reply to Joseph Rézeau

Re: Should the Questionnaire title default to empty?

by Nate Baxley -
Sorry for leaving some holes.  We're currently using Moodle 2.6.3 and Questionnaire 2014041801.  We're using the duplicate function from the Edit dropdown.


Here's our problem.  Our users don't generally have a difference between the name and the title.  In fact our support person didn't realize there was  a title field.  When they first setup the Questionnaire and fill in the name, field, that value is copied to the title field in the database (automatically).  When they later come and duplicate the questionnaire and rename it, they need to go to both fields in order to rename it completely (which they haven't done because they didn't know the title field existed).


I propose an alternative to copying the value of the name field to the title field when the questionnaire is created.  Allow the title field to be left blank and when displaying the title field, the plugin should check to see if the field has been given an explicit value and if not it should display the name field.  In this way, when users make a copy of the questionnaire without realizing there are two fields, they will only have to change the name of the Questionnaire once, in the name field, and the title field will inherit that value implicitly. 

In reply to Nate Baxley

Re: Should the Questionnaire title default to empty?

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 the clarification, Nate. I have opened an issue in the tracker and might adopt your "fix" in a further version of Questionnaire. CONTRIB-5274.

Joseph

In reply to Joseph Rézeau

Re: Should the Questionnaire title default to empty?

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

After thinking this over, I've decided not to take any action. Indeed, when a Questionnaire instance is duplicated, it may be desirable to keep the same "title".

Joseph