[limesurvey-developers] Idea: Order answer by attribute
The leading Open Source survey tool
Brought to you by:
c_schmitz
From: Shnoulle <cou...@sh...> - 2010-12-02 08:52:51
|
Hello, I made some modification on LimeSurvey for a client, i don't know if it's a good idea to implement this function in LimeSurvey core. If yes : i put it on the dev version, If not : i put a patch to adapt. The idea: order answer/sub-question with attribute. - Using question code <-> attribute description to match (ex : Q1 for question code , Q1 for attribute description) - Take a list with comma in attribute, and order the answer code matching. Maybe i can put an optionnal parameter in Question : order by attribute 'number'. And i use a mysql request, i'm not sure it work on another SQL: (i put order in ia[9]) if (isset($ia[9]) && $ia[9]!="") { $SQLquoteCodeOrder="'".implode("','", explode(",", $ia[9]))."'"; $ansquery = "SELECT * FROM {$dbprefix}answers WHERE qid={$ia[0]} AND language='{$_SESSION['s_lang']}' AND scale_id=0 AND code in ({$SQLquoteCodeOrder}) ORDER BY FIELD( code,{$SQLquoteCodeOrder}), sortorder, answer"; } I know 1.91 are in starting block then maybe for 1.92 :) -- Denis Chenu |