Talk:Question object types
From LimeSurvey Manual
Question object specification text
- I think specification is not the same as (our) implementation.
- Olle: True. But the current implementation in LS3 lacks specification. There needs to be something written down that exactly specifies what's needed and why.
- Sam: Agree, the current implementation is just a refactoring of LS2 code (moving global functions to OO), it can and should be adapted to whatever requirements come up with.
- Olle: True. But the current implementation in LS3 lacks specification. There needs to be something written down that exactly specifies what's needed and why.
- Specifications should consist of interfaces (and optionally abstract classes) only.
- Olle: Question types will need to include CSS, Javascript, HTML, pictures etc. So only interfaces is not enough.
- Sam: It doesn't matter what they include, we just need to specify how it should interact. For example, for example how it tells us what javascript / css to publish to a publicly accessible directory. Note that I agree that we should give a "logically structured" example plugin, that should not be part of the contract in my opinion.
- Olle: Question types will need to include CSS, Javascript, HTML, pictures etc. So only interfaces is not enough.
Use-cases
renderExportData || Way of exporting : data + "syntax of data" : SPSS/Stata/triple-S/etc ...
Is this necessary? The question could just export data with getStatisticsData, feed the data to an exporter which takes care of it. Given we have a way to represent data that all thinkable question types could deal with.
Olle (talk) 15:10, 25 April 2016 (CEST)
Unsure getStatisticsData have all needed information . Example with numeric vs integer in tripleS syntax for example.
DenisChenu (talk) 15:16, 25 April 2016 (CEST)
Current LS3 implementation
Note, this is the current state and some of these are mostly because it is a refactoring from LS2.
1. Uses an interface.
2. Defines what columns it needs via a fieldname => column type map.
3. Defines what EM expressions apply to it.
4. Defines a render functionality that renders the content.
5. Defines a list of classes that should be in the wrapping div.
- Sam: Regarding the current minimum requirements with 6 render functions:
(11:44:52 AM) sammousa: @ollehar, I don't like the 5 render functions on the question interface
(11:45:34 AM) sammousa: 3 of them are for statistics, but instead there should be 1 "canonical" form for statistical information that LS can then properly render into different formats
(11:45:50 AM) sammousa: (I don't want to implement a new question type just to have it use a different kind of display for statistics)
(11:46:24 AM) sammousa: Also I don't think we should have renderEditForm, but instead we should provide some format where a question can define its settings.
(11:46:49 AM) sammousa: Having each question render HTML will make templating practically impossible; also when I develop a new type of question
(11:47:10 AM) sammousa: I don't want to think about HTML code for the settings, I just want to say: setting A is a boolean setting