Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Survey 2 module: Difference between revisions

From MoodleDocs
m (Text replacement - "</code>" to "</syntaxhighlight>")
 
(72 intermediate revisions by 17 users not shown)
Line 1: Line 1:
{{Moodle 2.1}}For notes, discussion and eventually a full spec of the new Survey module for 2.1 that combines all the features of
{{Infobox Project
|name = New Survey module
|state = Development in progress
|tracker = MDL-36350
|discussion = https://moodle.org/mod/forum/discuss.php?d=215159
|assignee = MediaTouch 2000 srl - Daniele Cordella
}}


# Survey
# Questionnaire
# Feedback


into one module.
'''I am going to add make unstable surveypro since next monday with further developments.'''
'''Because of this, anybody wanting to upgrade the surveypro module up to current stable status should be use MOODLE_30_STABLE branch, no matter the Moodle version used (from 2.6.x to 3.0.x).


This is the list of the frequently asked features request that moodle users addressed to me over last few years.
'''Since Monday November 23, 2015, master will be for development, and only will work under Moodle 3.0.0 and newer. MOODLE_30_STABLE will be the stable supported branch were fixes will be applied.'''
It may be a good starting point. The following list is NOT ordered by feature relevance.


==Module settings page==
*option: allow/deny save without submit
*option: allow/deny record modification after submit
*option: allow/deny the access to submitted answers
*option: allow/deny submitted record deletion
(Example: This option should appear like:
<code>
<div>Submitted answers are available <select name="dropdown_7" size="1">
<option value="0">to all users</option>
<option value="1" >to submitter only</option>
<option value="2" >to submitter group only</option>
</select></div>
</code>
)
*custom form and css
*download of submitted records in some standard format
*type of field (char(n), text, number, alphanumeric, boolean, date, picture, file, email, url...) with type check at submit time (and number of digit check for char(n) fields).


This information may not be used at field definition time but is useful for data verification/check.
{{Moodle 2.6}}This page is for collecting feature requests for a the new Survey module that replaces Survey, Questionnaire and Feedback.
 
The module is currently under development, so the general features list will also include a completion status, if any. For those who like to test a prototype of the module a Github repo is available [https://docs.moodle.org/dev/Survey_2_module#Current_module_status].
 
==General features of the Module==
* translate previously built survey1, feedback and questionnaire at installation time. (The general idea for the module is currently translate at installation time all previous existing survey module instances. Questionnaire and feedback instances can be translated at will using an upgrade helper)
* upload exported feedback or questionnaires (survey1 doesn't export questionnaires templates)
* (available) save instances of survey2 as a template to reuse it or export it
* (available) import saved survey2 templates
* (partially available) support for groups and groupings
* (available custom css) custom user survey2 page layout (custom html and css, as it already is in database module)
* (available) download of submissions in txt, xls and ods
* (available) conditional branching
* (available) handle more than one input form template (and find a way to allow this or that layout to this or that user).
* (available) order survey fields in editing mode
* (available) group fields in the page layout with fieldset
* (available) relations between tables (Example: one record for the profile of my company one related record for each intervention request submitted by my company)
* (available) email submissions to students/teachers/both/none
* email submissions to address specified in a designated question field (for surveys not requiring login)
* indication that students are currently taking (but haven't completed) the questionnaire
* (available) for text fields, simple data checking ('must be numeric', 'must contain X character', 'must have exact length n', etc.)
* (available) full web accessibility features to the same level as elsewhere in Moodle e.g. labels on text fields, fieldsets on groups of radio buttons & checkboxes.
* gradebook integration (to allow simple polls to control conditional activities)
** assigning grades to specific answers to specific questions in a survey
** may only work for certain question types (e.g. radio buttons, rating)
** once a student has a grade for their survey completion, that grade can be used elsewhere in the system to control activity display.  usecase - simple poll with 1 question "what are you planning to study next", 5 radio buttons, each answer a different course assigned grade 20%, 40%, 60%, 80%, 100%.  Then 5 conditional activities set up, for if grade <21%, <41% etc and each one has content specific to the course chosen in the radio button providing basic info on that subject.  Or similarly if you have different focus areas in your course that students can self-select into/swap between a more complex survey could be used with this to decide which focus area to put students into.
* improve templates (to allow impact views and impressions)
* enhance the editing
* ability to have public surveys that do not require users to be logged in
* would be great for learners to be able to export using Portfolio Export. This would enable things such as self-assessments in Mahara.
 
==Instance settings page==
In the moudle instance settings page, the following fine grained control over the record submitted will be an optional Admin setting, so standard users with standard access to recor submitted can just work as usual.
* Access section: 20 types of survey, distinguished by:
:-> ppl who is allowed to R/O,
:-> ppl who is allowed to R/W,
:-> ppl who is allowed to delete a record
The reationale is: once a record has been submitted by a user, who is allowed to see it (R/O access)?, who is allowed to edit it (R/W access)?, who is allowed to delete it?
 
Combining all the options the come out 20 cases are defined as follows where:
:ALL means, all the people accessing the survey;
:GROUP means people belonging to the group of the user who submitted the record;
:OWNER is the user who submitted the record;
:NONE is none.
{| class="wikitable"
|-
! type
! R/O
! R/W
! delete
|-
| 1
| ALL
| ALL
| ALL
|-
| 2
| ALL
| ALL
| GROUP
|-
| 3
| ALL
| ALL
| OWNER
|-
| 4
| ALL
| ALL
| NONE
|-
| 5
| ALL
| GROUP
| GROUP
|-
| 6
| ALL
| GROUP
| OWNER
|-
| 7
| ALL
| GROUP
| NONE
|-
| 8
| ALL
| OWNER
| OWNER
|-
| 9
| ALL
| OWNER
| NONE
|-
| 10
| ALL
| NONE
| NONE
|-
| 11
| GROUP
| GROUP
| GROUP
|-
| 12
| GROUP
| GROUP
| OWNER
|-
| 13
| GROUP
| GROUP
| NONE
|-
| 14
| GROUP
| OWNER
| OWNER
|-
| 15
| GROUP
| OWNER
| NONE
|-
| 16
| GROUP
| NONE
| NONE
|-
| 17
| OWNER
| OWNER
| OWNER
|-
| 18
| OWNER
| OWNER
| NONE
|-
| 19
| OWNER
| NONE
| NONE
|-
| 20
| NONE
| NONE
| NONE
|}


(Example:
* option: allow/deny save without submission (save and restart)
Please, enter your card ID: _______
* option: anonymous survey or named responses
This field should be defined, for instance, as char(7))
* option: allow access to records any time/after you've submitted/after close date/never
*opening and closing submission dates
* opening and closing submission dates
*relations between tables
* number of maximun allowed submission
(Example:
* option whether to show results immediately after submission, or a thank you message with link to results.
one record for the profile of my company
one related record for each intervention request submitted by my company)


==Field level settings==
==Field level settings==
*mandatory/non mandatory field option
* type of field (char(n), text, number, alphanumeric, boolean, date, picture, file, email, url...) with type check at submit time (and number of digit check for char(n) fields). This information may not be used at field definition time but is useful for data verification/check.
*define a range of valid answers for fields allowing this
 
(Example:
(Example: Please, enter your card ID: _______ This field should be defined, for instance, as char(7))
* option: mandatory/non mandatory field
* free text description field for further description and advices to the completer
*define a range of valid answers for fields allowing this (see next examples)
(Example 1:
Please, enter your seniority. (limited between 0 and 50 years)
Please, enter your seniority. (limited between 0 and 50 years)


Example:
Example 2:
Date of birth: (limited between 18 and 100 years ago))
Date of birth: (limited between 18 and 100 years ago))
*define fields default to be loaded at "new record" display time
*define fields default to be loaded at "new record" display time
*optional "other" text field for drop down menu/radio button/check box.
*optional "other" text field for drop down menu/radio button/check box. (see next example)
(Example for drop down:
(Example for drop down:


  Where were you born? <code><select name="dropdown_14" size="1"><option value="1" selected="selected">Spain</option><option value="2" >France</option><option value="3" >other, please specify</option></select>  <input type="text" name="dropdown_14_other" size="10" maxlength="10" value="" /></code>
  Where were you born? <syntaxhighlight lang="php"><select name="dropdown_14" size="1"><option value="1" selected="selected">Spain</option><option value="2" >France</option><option value="3" >other, please specify</option></select>  <input type="text" name="dropdown_14_other" size="10" maxlength="10" value="" /></syntaxhighlight>


If you choose "other" in the drop down menu the field will be enabled and become mandatory, otherwise it will be disabled.
If you choose "other" in the drop down menu the field will be enabled and become mandatory, otherwise it will be disabled.
)
)
*define read-only fields (auto filled by the software) like, current_date, user_name, record_ID...
* custom question numbers
* question name to name columns header in the downloaded document
 
==Question types==
 
Question types should be plug-ins so that they can be extended locally if required.  The following list covers types which exist in at least one of the current survey modules.


==New fields types==
* radio buttons (horizontal & vertical display)
*short date (with month and years only, to answer question like: When had you the first evidence of this disease?)
* short text entry
*order list. A list of available items and the answer is supposed to order them.
* long text entry
*time
* checkbox
* drop down menu
* customisable likert scale for rating
* date (Example: When were you born?)


===New question types===
* short date (with month and years only, to answer question like: When had you the first evidence of this disease?)
* time
(Example:
(Example:
When do you usually take breakfast?
When do you usually take breakfast?
)
)
* "static text"/"read only" fields (auto filled by the software) like, current_date, user_name, record_ID, counter...
* allocation (Drag and drop)
* ranking
* conditional drop-down where the first list populates the second
* tabular question with multiple answers, of any depth.
                                    : Occurrence Quantity  Location
                                        Bluebird    2      Hobart 
                                        Jay        1      Kingston
                                        .
                                        .
                                        .
==Result display==
* report per survey, per user and per question
* report about non-respondent users
* choose for a question whether to display results as
** a table
** a bar chart
** a pie chart
Would be great to be able to analyse the results according to a particular answer. eg: Show results for just one gender
==Question management==


==Uncategorised requested features==
* questions can be copied within an activity
*handle more than one view_single/view_list/find/input layout (and allow this or that layout to users on the basis of capabilities).
* question sets can be created as templates for re-use [maybe later]
* question sets can be used across multiple courses [maybe later]
* questions can be re-ordered within an activity
* question sets can be combined to create a template
* questions can be deleted from an activity, but there should be an "are you sure" check first.


The idea is: On the basis of capability you will access your specific layout with only a field subset.
==Answer Piping & Conditional Questions==
If you have this capability, you will find all the fields of the survey, otherwise you will find only a subset of them.


The same feature may be provided in the following way:
*Allow follow on questions related to the previous.
At fields level definition the course creator should be allowed to mark the field "field1" as
*Do You Smoke? Yes/No If Yes is selected a conditional question appears, How Many per Day, if No is selected move on to question 6 appears
#visible and enabled to all
#visible to all but enabled to users with view_field1 capability only
#visible and enabled to users with view_field1 capability only


*allow course creator to add custom number to question inside layouts (i.e.: 1, 2, 2a, 2b, 3...) to respect questions hierarchy
*allow course creator to indent questions inside layouts to respect questions hierarchy (as it is already possible the indent of resources inside courses)
*conditional branching
(Example:


1. Gender: <code><input type="radio" name="gender" value="0" checked="checked"/></code>F <code><input type="radio" name="gender" value="1" /></code>M
*Answer Piping such as:
1a. How many pregnancies have you had? <code><select><option value="0" selected="selected">0</option><option value="1">1</option><option value="2">2</option><option value="more">more</option></select></code> (should be disabled when answer 1 == F)
*Q1 Which dog breed do you prefer?
1b. Question relevant only for males? <code><select disabled="disabled"><option value="aa" selected="selected">aa</option><option value="bb">bb</option><option value="cc">cc</option><option value="more">other</option></select></code> (should be disabled when answer 1 == M)
*Labrador
)
*Spaniel
*Collie
*Other
 
 
*Q2 In question 1 you stated you prefer the (Q1 Answer) as a breed, what do you like about it. [Where (Q1 Answer) is replaced with the chosen answer such as 'Labrador'
*Temperament
*Looks
*Colour
*Other
 
==Current module status==
The module currently under development is named Collection, so it can be easily deployed over existing installations with almost no impact on current Surveys. For those interested in testing, Daniele Cordella, the main developer of the module, prepared a Github repo from where you can download the module prototype in it's current status: https://github.com/kordan/moodle-mod_survey. Please note the module is aimed towards the development branch (master), using it on stable versions such as 2.2 or 2.3 is not supported. Note: prior to install the module, please 1) uninstall standard Moodle Survey module and remove the code from the mod/survey folder 2) replace mod/survey with the code form Github repository 3) visit Admin notification page or launch CLI update script.
 
==Future plans==
* community sharing and code refinements
* add module to contrib plugin as "Survey" to allow extensive testing as well as AMOS translations
* complete Questionanire and Feedback migration helpers
* integrate module into core for 2.5 release
 
==See also==
* [https://docs.moodle.org/32/en/Surveypro_module Surveypro module] user documentation in Moodle Docs.

Latest revision as of 20:27, 14 July 2021

New Survey module
Project state Development in progress
Tracker issue MDL-36350
Discussion https://moodle.org/mod/forum/discuss.php?d=215159
Assignee MediaTouch 2000 srl - Daniele Cordella


I am going to add make unstable surveypro since next monday with further developments. Because of this, anybody wanting to upgrade the surveypro module up to current stable status should be use MOODLE_30_STABLE branch, no matter the Moodle version used (from 2.6.x to 3.0.x).

Since Monday November 23, 2015, master will be for development, and only will work under Moodle 3.0.0 and newer. MOODLE_30_STABLE will be the stable supported branch were fixes will be applied.


Moodle 2.6 This page is for collecting feature requests for a the new Survey module that replaces Survey, Questionnaire and Feedback.

The module is currently under development, so the general features list will also include a completion status, if any. For those who like to test a prototype of the module a Github repo is available [1].

General features of the Module

  • translate previously built survey1, feedback and questionnaire at installation time. (The general idea for the module is currently translate at installation time all previous existing survey module instances. Questionnaire and feedback instances can be translated at will using an upgrade helper)
  • upload exported feedback or questionnaires (survey1 doesn't export questionnaires templates)
  • (available) save instances of survey2 as a template to reuse it or export it
  • (available) import saved survey2 templates
  • (partially available) support for groups and groupings
  • (available custom css) custom user survey2 page layout (custom html and css, as it already is in database module)
  • (available) download of submissions in txt, xls and ods
  • (available) conditional branching
  • (available) handle more than one input form template (and find a way to allow this or that layout to this or that user).
  • (available) order survey fields in editing mode
  • (available) group fields in the page layout with fieldset
  • (available) relations between tables (Example: one record for the profile of my company one related record for each intervention request submitted by my company)
  • (available) email submissions to students/teachers/both/none
  • email submissions to address specified in a designated question field (for surveys not requiring login)
  • indication that students are currently taking (but haven't completed) the questionnaire
  • (available) for text fields, simple data checking ('must be numeric', 'must contain X character', 'must have exact length n', etc.)
  • (available) full web accessibility features to the same level as elsewhere in Moodle e.g. labels on text fields, fieldsets on groups of radio buttons & checkboxes.
  • gradebook integration (to allow simple polls to control conditional activities)
    • assigning grades to specific answers to specific questions in a survey
    • may only work for certain question types (e.g. radio buttons, rating)
    • once a student has a grade for their survey completion, that grade can be used elsewhere in the system to control activity display. usecase - simple poll with 1 question "what are you planning to study next", 5 radio buttons, each answer a different course assigned grade 20%, 40%, 60%, 80%, 100%. Then 5 conditional activities set up, for if grade <21%, <41% etc and each one has content specific to the course chosen in the radio button providing basic info on that subject. Or similarly if you have different focus areas in your course that students can self-select into/swap between a more complex survey could be used with this to decide which focus area to put students into.
  • improve templates (to allow impact views and impressions)
  • enhance the editing
  • ability to have public surveys that do not require users to be logged in
  • would be great for learners to be able to export using Portfolio Export. This would enable things such as self-assessments in Mahara.

Instance settings page

In the moudle instance settings page, the following fine grained control over the record submitted will be an optional Admin setting, so standard users with standard access to recor submitted can just work as usual.

  • Access section: 20 types of survey, distinguished by:
-> ppl who is allowed to R/O,
-> ppl who is allowed to R/W,
-> ppl who is allowed to delete a record

The reationale is: once a record has been submitted by a user, who is allowed to see it (R/O access)?, who is allowed to edit it (R/W access)?, who is allowed to delete it?

Combining all the options the come out 20 cases are defined as follows where:

ALL means, all the people accessing the survey;
GROUP means people belonging to the group of the user who submitted the record;
OWNER is the user who submitted the record;
NONE is none.
type R/O R/W delete
1 ALL ALL ALL
2 ALL ALL GROUP
3 ALL ALL OWNER
4 ALL ALL NONE
5 ALL GROUP GROUP
6 ALL GROUP OWNER
7 ALL GROUP NONE
8 ALL OWNER OWNER
9 ALL OWNER NONE
10 ALL NONE NONE
11 GROUP GROUP GROUP
12 GROUP GROUP OWNER
13 GROUP GROUP NONE
14 GROUP OWNER OWNER
15 GROUP OWNER NONE
16 GROUP NONE NONE
17 OWNER OWNER OWNER
18 OWNER OWNER NONE
19 OWNER NONE NONE
20 NONE NONE NONE
  • option: allow/deny save without submission (save and restart)
  • option: anonymous survey or named responses
  • option: allow access to records any time/after you've submitted/after close date/never
  • opening and closing submission dates
  • number of maximun allowed submission
  • option whether to show results immediately after submission, or a thank you message with link to results.

Field level settings

  • type of field (char(n), text, number, alphanumeric, boolean, date, picture, file, email, url...) with type check at submit time (and number of digit check for char(n) fields). This information may not be used at field definition time but is useful for data verification/check.

(Example: Please, enter your card ID: _______ This field should be defined, for instance, as char(7))

  • option: mandatory/non mandatory field
  • free text description field for further description and advices to the completer
  • define a range of valid answers for fields allowing this (see next examples)

(Example 1: Please, enter your seniority. (limited between 0 and 50 years)

Example 2: Date of birth: (limited between 18 and 100 years ago))

  • define fields default to be loaded at "new record" display time
  • optional "other" text field for drop down menu/radio button/check box. (see next example)

(Example for drop down:

Where were you born?

<select name="dropdown_14" size="1"><option value="1" selected="selected">Spain</option><option value="2" >France</option><option value="3" >other, please specify</option></select>  <input type="text" name="dropdown_14_other" size="10" maxlength="10" value="" />

If you choose "other" in the drop down menu the field will be enabled and become mandatory, otherwise it will be disabled. )

  • custom question numbers
  • question name to name columns header in the downloaded document

Question types

Question types should be plug-ins so that they can be extended locally if required. The following list covers types which exist in at least one of the current survey modules.

  • radio buttons (horizontal & vertical display)
  • short text entry
  • long text entry
  • checkbox
  • drop down menu
  • customisable likert scale for rating
  • date (Example: When were you born?)

New question types

  • short date (with month and years only, to answer question like: When had you the first evidence of this disease?)
  • time

(Example: When do you usually take breakfast? )

  • "static text"/"read only" fields (auto filled by the software) like, current_date, user_name, record_ID, counter...
  • allocation (Drag and drop)
  • ranking
  • conditional drop-down where the first list populates the second
  • tabular question with multiple answers, of any depth.
                                   : Occurrence Quantity   Location
                                       Bluebird    2       Hobart  
                                       Jay         1       Kingston
                                       .
                                       .
                                       .

Result display

  • report per survey, per user and per question
  • report about non-respondent users
  • choose for a question whether to display results as
    • a table
    • a bar chart
    • a pie chart

Would be great to be able to analyse the results according to a particular answer. eg: Show results for just one gender

Question management

  • questions can be copied within an activity
  • question sets can be created as templates for re-use [maybe later]
  • question sets can be used across multiple courses [maybe later]
  • questions can be re-ordered within an activity
  • question sets can be combined to create a template
  • questions can be deleted from an activity, but there should be an "are you sure" check first.

Answer Piping & Conditional Questions

  • Allow follow on questions related to the previous.
  • Do You Smoke? Yes/No If Yes is selected a conditional question appears, How Many per Day, if No is selected move on to question 6 appears


  • Answer Piping such as:
  • Q1 Which dog breed do you prefer?
  • Labrador
  • Spaniel
  • Collie
  • Other


  • Q2 In question 1 you stated you prefer the (Q1 Answer) as a breed, what do you like about it. [Where (Q1 Answer) is replaced with the chosen answer such as 'Labrador'
  • Temperament
  • Looks
  • Colour
  • Other

Current module status

The module currently under development is named Collection, so it can be easily deployed over existing installations with almost no impact on current Surveys. For those interested in testing, Daniele Cordella, the main developer of the module, prepared a Github repo from where you can download the module prototype in it's current status: https://github.com/kordan/moodle-mod_survey. Please note the module is aimed towards the development branch (master), using it on stable versions such as 2.2 or 2.3 is not supported. Note: prior to install the module, please 1) uninstall standard Moodle Survey module and remove the code from the mod/survey folder 2) replace mod/survey with the code form Github repository 3) visit Admin notification page or launch CLI update script.

Future plans

  • community sharing and code refinements
  • add module to contrib plugin as "Survey" to allow extensive testing as well as AMOS translations
  • complete Questionanire and Feedback migration helpers
  • integrate module into core for 2.5 release

See also