Actions

Question attributes redesign: Difference between revisions

From LimeSurvey Manual

m (Text replacement - "ExpressionManager" to "ExpressionScript Engine")
 
(14 intermediate revisions by 3 users not shown)
Line 3: Line 3:
== Domain diagram ==
== Domain diagram ==


TODO
[[File:domaindiagram.png|Domain diagram]]


== Class diagram ==
== Class diagram ==
Line 17: Line 17:
== Scenarios ==
== Scenarios ==


All use-cases go here.
* Get potential question attribute from core
* Import question attribute from XML/question theme
* Add (replace ?) question attribute from plugins
* Save question attribute value (for all language or not)
* Load question attributes for question type/question id
* Load question attributes for question type/question id for a single language (for qanda/QuestionTheme and SurveyTheme)
* …
 
---
 
> Load question attributes for question type/question id for a single language (for qanda/QuestionTheme and SurveyTheme)
 
If you already can load for ''all'' languages, you don't have to load for ''one'' language, IMO. Unless the number of languages are > 20, which I don't think happens very often...? Also, this is done via lazy loading through the ORM. I think. (Unless explicitly loading it eagerly.)
 
[[User:Olle|Olle]] ([[User talk:Olle|talk]]) 17:31, 3 February 2020 (CET)
 
For twig : is better to have a single language … <nowiki>{{ Question.i18attribute }}</nowiki> and not <nowiki>{{ Question.i18attribute[????] }}</nowiki>
 
[[User:DenisChenu|DenisChenu]] ([[User talk:DenisChenu|talk]]) 17:38, 3 February 2020 (CET)
 
OK, good point. That's not how it works now?
 
[[User:Olle|Olle]] ([[User talk:Olle|talk]]) 17:41, 3 February 2020 (CET)
 
 
In QuestionTemplate.php https://github.com/LimeSurvey/LimeSurvey/commit/b34f839d202ba0061412b5bd313d08e1d34d3309 yes, but not in QuestionAttribute https://github.com/LimeSurvey/LimeSurvey/blob/1891591465f646c51eac8ff4523e91c6343b1d68/application/models/QuestionAttribute.php#L253-L260, then need to remind this point.
 
[[User:DenisChenu|DenisChenu]] ([[User talk:DenisChenu|talk]]) 18:16, 3 February 2020 (CET)


== Notes ==
== Notes ==


TODO
TODO
== Future evolution and remark ==
* Question class is clearly a Theme related attribute. Not linked to specific question [[User:DenisChenu|DenisChenu]] ([[User talk:DenisChenu|talk]])
* Can we remove timer attribute from core please !  https://manual.limesurvey.org/Question_type_-_Short_free_text#Timer : remind : Not only for on,e question, didn't update any HTML/CSS part (only js)  [[User:DenisChenu|DenisChenu]] ([[User talk:DenisChenu|talk]])
* All expression part (min value , max number) are done in LimeExpressionScript Engine : totally unrelated to QuestionTheme  [[User:DenisChenu|DenisChenu]] ([[User talk:DenisChenu|talk]])

Latest revision as of 15:40, 11 February 2020

Question attribute code saw a rise in complexity between LS3 and LS4. This page will take a step back and analyze if it can be simplified.

Domain diagram

Domain diagram

Class diagram

TODO

Database design

TODO.

Will not change.

Scenarios

  • Get potential question attribute from core
  • Import question attribute from XML/question theme
  • Add (replace ?) question attribute from plugins
  • Save question attribute value (for all language or not)
  • Load question attributes for question type/question id
  • Load question attributes for question type/question id for a single language (for qanda/QuestionTheme and SurveyTheme)

---

> Load question attributes for question type/question id for a single language (for qanda/QuestionTheme and SurveyTheme)

If you already can load for all languages, you don't have to load for one language, IMO. Unless the number of languages are > 20, which I don't think happens very often...? Also, this is done via lazy loading through the ORM. I think. (Unless explicitly loading it eagerly.)

Olle (talk) 17:31, 3 February 2020 (CET)

For twig : is better to have a single language … {{ Question.i18attribute }} and not {{ Question.i18attribute[????] }}

DenisChenu (talk) 17:38, 3 February 2020 (CET)

OK, good point. That's not how it works now?

Olle (talk) 17:41, 3 February 2020 (CET)


In QuestionTemplate.php https://github.com/LimeSurvey/LimeSurvey/commit/b34f839d202ba0061412b5bd313d08e1d34d3309 yes, but not in QuestionAttribute https://github.com/LimeSurvey/LimeSurvey/blob/1891591465f646c51eac8ff4523e91c6343b1d68/application/models/QuestionAttribute.php#L253-L260, then need to remind this point.

DenisChenu (talk) 18:16, 3 February 2020 (CET)

Notes

TODO

Future evolution and remark