View Issue Details

IDProjectCategoryView StatusLast Update
14228Feature requestsTheme editorpublic2020-02-03 17:28
ReporterDenisChenu Assigned To 
PrioritynoneSeverityfeature 
Status newResolutionopen 
Summary14228: Survey and Question Theme need more information
Description

We need a lot more information than this currently available (and we have some that seem not needed).

For example : we don't have : current radix (see https://github.com/LimeSurvey/LimeSurvey/pull/1164), or current core question attribute.
I think too it can be interesting to have some global settings : sitename, adminname, adminemail (for example : for auto title).

Additional Information

In theme editor : we can set a value an use it in included twig , but not in questin part since this one is loaded oit of twig system.
It can be great to include totally (but long work) in twig.

For starting : i think we must call only one time answers.twig , and answers.twig call his row with existing information.
Then https://github.com/LimeSurvey/LimeSurvey/pull/1164/files#diff-a8124ae5316979e6a5f20714ce8a3968R21 can be set one time and not at each row (for example).

And question template have aAnswers + aSubQuestions (currently i don't know if they have it : then can not really do a question template with multiple answer really hacked (example : change order of subquestion).

TagsNo tags attached.

Relationships

related to 14202 new Feature requests Readd "column style" css for multiple column but in attribute 
has duplicate 14449 closedDenisChenu Feature requests Question template : unable to make a complete system due to lack of information 
related to 13516 closeddominikvitt Bug reports Cannot access localized (i18n) values for a custom question attribute 
related to 14282 closedDenisChenu Bug reports Language of Survey is set to default in token form 
related to 14723 assignedcdorin Development  Global attribute or question dependance 
related to 14922 assignedcdorin Bug reports Hidden question attribute not available for printanwers_question.twig template 
related to 15814 new Feature requests Allow to use Relevance help for printable survey in Survey theme 

Activities

DenisChenu

DenisChenu

2018-11-07 16:40

developer   ~49579

Last edited: 2018-11-07 16:40

View 2 revisions

I think need :
Current situation of the page : language (it's in surveyInfo, but really this array is a mess)
Current situation on instance : sitename, adminname, adminemail for starting
Current oQuestion with current language + oSubquestions with current lmanguage + oAnswers with current language
Current attribute with current language (no need to test utf8, for example attribute.other_replace_text directly (this a must have for core too))
Current oGroup with language

DenisChenu

DenisChenu

2018-11-20 14:00

developer   ~49708

oToken : https://github.com/LimeSurvey/LimeSurvey/pull/1175

LouisGac

LouisGac

2018-12-20 12:05

developer   ~50030

really this array is a mess

DenisChenu

DenisChenu

2018-12-20 12:32

developer   ~50035

Yes,

Need too to move out of survey all are not related to survey …

DenisChenu

DenisChenu

2019-01-25 10:19

developer   ~50305

Separation between survey theme and question theme

Then for Survey :

  1. Current situation of the page : what page is shown, what current language
  2. Current instance partial (sitename, adminname, adminemail)
  3. … to complete …
DenisChenu

DenisChenu

2019-05-17 08:53

developer   ~51979

@LouisGac : i think i try to fix it in 4.0 , what is your advice :

  1. Send aQuestionAttributes + aQuestionsSubQuestion + aQuestionsAnswers, each as array in App()->twigRenderer->renderQuestion($sView, $aData) always.
  2. Create 3 (or more) twig function getQuestionAttribute($attributeName = null) : only usable in question sending the attribute for current question and current language (all in arry or a single one.

What i want current only : it's because i don't want to reproduce this issue : https://bugs.limesurvey.org/view.php?id=14576 current survey must allow only data from current survey.

DenisChenu

DenisChenu

2019-12-03 17:20

developer   ~54935

@tpartner : you made a lot of theme. What it's your opinion on this one ?

tpartner

tpartner

2019-12-03 17:34

developer   ~54936

I definitely see the advantage to having more information like the core question attributes exposed in the custom question files.

DenisChenu

DenisChenu

2019-12-03 17:37

developer   ~54937

And you prefer by functions or by array ?

{{ coreAttributes.hidden }} or {{ getQuestionAttribute("hidden") }} ?

DenisChenu

DenisChenu

2019-12-03 17:46

developer   ~54938

array:

questionAttribute [
    attribute => value
]
questionAnswerBase [
    code => [
        code,
        text (in current language),
    ]
]
Forced to scale 0
questionAnswerScale [
    code => [
        code,
        text (in current language),
    ]
]
For scale 1

questionSubQuestions [
    code => [
        code (EM code),
        value,
        status => [
            valid => ExpressionManager status,
            relevance => current relevance,
        ]
    ]
]
questionSubQuestionsX [
    code => [
        code,
        text,
    ]
]
questionSubQuestionsY [
    code => [
        code,
        text,
    ]
]

Unsure about questionAnswers about scale 0 and 1, and questionSubQuestions (EM column with values) and questionSubQuestionsX/Y : can be related to columns, but not always …

tpartner

tpartner

2019-12-03 19:22

developer   ~54940

I prefer an array as I can see it all at a glance.

DenisChenu

DenisChenu

2019-12-04 07:45

developer   ~54941

I check on 4.X if we have this array for attributes.
And see how we can add answers and subquestions and expression manager status :).

tpartner

tpartner

2019-12-04 14:52

developer   ~54947

You da man!

DenisChenu

DenisChenu

2019-12-12 15:16

developer   ~55011

OK,

MLaybe don't need answers + answersScale

questionAnswers [
 [scaleid] => [
    code => [
        code,
        text (in current language),
    ]
 ]
]

{% for answers in questionAnswers[0] %} must work :)

Issue History

Date Modified Username Field Change
2018-11-07 16:35 DenisChenu New Issue
2018-11-07 16:40 DenisChenu Additional Information Updated View Revisions
2018-11-07 16:40 DenisChenu Note Added: 49579
2018-11-07 16:40 DenisChenu Note Edited: 49579 View Revisions
2018-11-08 18:57 DenisChenu Relationship added related to 13516
2018-11-20 14:00 DenisChenu Note Added: 49708
2018-11-24 11:06 DenisChenu Relationship added related to 14282
2018-12-20 12:05 LouisGac Note Added: 50030
2018-12-20 12:32 DenisChenu Note Added: 50035
2019-01-25 10:08 DenisChenu Summary Theme + Question template need more information => Survey Theme need more information
2019-01-25 10:14 DenisChenu Relationship added related to 14449
2019-01-25 10:19 DenisChenu Note Added: 50305
2019-05-10 15:33 DenisChenu Relationship deleted related to 14449
2019-05-10 15:33 DenisChenu Relationship added has duplicate 14449
2019-05-10 15:34 DenisChenu Relationship added related to 14202
2019-05-17 08:53 DenisChenu Note Added: 51979
2019-10-01 14:56 DenisChenu Summary Survey Theme need more information => Survey and Question Theme need more information
2019-10-22 14:59 DenisChenu Relationship added related to 14723
2019-12-03 17:20 DenisChenu Note Added: 54935
2019-12-03 17:34 tpartner Note Added: 54936
2019-12-03 17:37 DenisChenu Note Added: 54937
2019-12-03 17:46 DenisChenu Note Added: 54938
2019-12-03 19:22 tpartner Note Added: 54940
2019-12-04 07:45 DenisChenu Note Added: 54941
2019-12-04 14:52 tpartner Note Added: 54947
2019-12-12 15:16 DenisChenu Note Added: 55011
2020-01-21 14:20 DenisChenu Relationship added related to 14922
2020-02-03 17:28 DenisChenu Relationship added related to 15814