From: Alistair Y. <ali...@sm...> - 2005-05-10 10:23:43
|
everything's fine apart from the question numbers but I suppose I can use sql "order by" ordinal to get the real order. Alistair On 10 May 2005, at 11:03, Paul Trafford wrote: > Alistair, > > Co-incidentally, I'm doing something similar, though back-end using > Perl, primarily just to output table of results as a csv file, one row > per user, so this oriented around table questionnaire_results. > > For a given resource, my method with pseudo code is: > > 1. get list of question ids, basically: > =# select questionnaire_question_id from questionnaire_questions where > resource_id=$id; > > 2. get list of user response (questionnaire_result_id), basically: > =# select questionnaire_result_id from questionnaire_results where > resource_id=$id; > > 3. Loop through users and questions to get responses: - > For each $questionnaire_result_id { > for each $question_id { > > =# select big_strings.string,questionnaire_responses.item from > questionnaire_responses LEFT OUTER JOIN big_strings ON > big_strings.big_string_id=questionnaire_responses.comment_big_string_id > WHERE > questionnaire_responses.questionnaire_result_id=$questionnaire_result_i > d AND questionnaire_responses.questionnaire_question_id=$question_id; > }} > > This should give data for filling a table with all users' text > responses and the codes (0,1,2,..100) for the option responses. > > As long as you've got the qn_id's sorted, then hopefully you're sorted! > > - Paul T > > At 10:29 10/05/2005, Alistair Young wrote: >> there isn't a problem with the front end - I just have to match a >> text string, such as "Question 8" with the question's text in the db. >> To do that I need to use the ordinal field, which can't handle >> localisation as I've just found out. e.g. "Question 8" could refer to >> an entry in the db anywhere between 701 and 799. >> >> Now, the real problem. Having sorted the questionnaire numbering in >> the front end, a user has then used this layout to create a Gaelic >> version of the questionnaire but as the numbering is already sorted, >> they don't have to mess about moving questions, so there is no 701. >> Everything in the Gaelic questionnaire is 100, 200, ... 2400 etc. >> >> I'll get there, evennwhalleeeee >> >> Alistair >> >> On 10 May 2005, at 10:18, Peter Crowther wrote: >> >>>> From: Andrew Booth [mailto:a.g...@le...] >>>> The ordinal value simply sets the order in which the >>>> questions appear. By >>>> default they are 100 apart, but you can set them to any >>>> value. In your case, >>>> question 9 would be presented before question 8. >>>> >>>> Aggie >>>> >>>> -----Original Message----- >>>> From: [...] Alistair Young >>>> in the questionnaire_questions table there's an "ordinal" >>>> field, which >>>> seems to be related to the question number, i.e. ordinal=100 means >>>> question number 1. >>>> However, Question 8 in the questionnaire shows as ordinal="701" and >>>> Question 9 shows as ordinal="8". >>>> >>>> Is there any relation between ordinal and question number or >>>> is it pure chance? >>> >>> Is the ordinal sorted as a string rather than as an integer, by any >>> chance? This would give the observed behaviour. >>> >>> - Peter >> >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by Oracle Space Sweepstakes >> Want to be the first software developer in space? >> Enter now for the Oracle Space Sweepstakes! >> http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click >> _______________________________________________ >> Bodington-developers mailing list >> Bod...@li... >> https://lists.sourceforge.net/lists/listinfo/bodington-developers >> </x-flowed> > |