/*####################################################################### # RDOS operating system # Copyright (C) 1988-2008, Leif Ekblad # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. The only exception to this rule # is for commercial usage in embedded systems. For information on # usage in commercial embedded systems, contact embedded@rdos.net # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # The author of this program may be contacted at leif@rdos.net # # quizn3.cpp # Quiz neurodiversity version 3 class # #######################################################################*/ #include #include #include #include "quizn3.h" #include "file.h" #include "quizdbn3.h" #define CI 1 #define MAX_IN_ROW 4096 #define FALSE 0 #define TRUE !FALSE class TRace { public: TRace(); void Add(TQuizRow *Row); void WriteUsRow(TFile &file, int index, const char *text); void WriteNonUsRow(TFile &file, int index, const char *text); void WriteEntry(TFile &file, int val, int count); static void WriteHeader(TFile &file); int UsCount[10]; int UsAsCount[10]; int NonUsCount[10]; int NonUsAsCount[10]; }; /*########################################################################## # # Name : TQuizN3::TQuizN3 # # Purpose....: Constructor for TQuizN3 # # In params..: Filename to load quiz from # Out params.: * # Returns....: * # ##########################################################################*/ TQuizN3::TQuizN3(const char *FileName, TQuiz *QuizI, TQuiz *QuizII, TQuiz *QuizIII, TQuiz *QuizNd, TQuiz *Quiz5, TQuiz *Quiz6, TQuiz *Quiz7, TQuiz *Quiz8, TQuiz *Quiz9, TQuiz *QuizR1, TQuiz *QuizR2, TQuiz *QuizR3, TQuiz *QuizR4, TQuiz *QuizR5, TQuiz *QuizR6, TQuiz *QuizR7, TQuiz *QuizS1, TQuiz *QuizS2, TQuiz *QuizS3, TQuiz *QuizS4, TQuiz *QuizS5, TQuiz *QuizS6, TQuiz *QuizS7, TQuiz *QuizS8, TQuiz *QuizS9, TQuiz *QuizS10, TQuiz *QuizS11, TQuiz *QuizS12, TQuiz *QuizN1, TQuiz *QuizN2) : TQuiz(173), FDataFile(FileName) { DefineCross(0, QuizI); DefineCross(1, QuizII); DefineCross(2, QuizIII); DefineCross(3, QuizNd); DefineCross(4, Quiz5); DefineCross(5, Quiz6); DefineCross(6, Quiz7); DefineCross(7, Quiz8); DefineCross(8, Quiz9); DefineCross(9, QuizR1); DefineCross(10, QuizR2); DefineCross(11, QuizR3); DefineCross(12, QuizR4); DefineCross(13, QuizR5); DefineCross(14, QuizR6); DefineCross(15, QuizR7); DefineCross(16, QuizS1); DefineCross(17, QuizS2); DefineCross(18, QuizS3); DefineCross(19, QuizS4); DefineCross(20, QuizS5); DefineCross(21, QuizS6); DefineCross(22, QuizS7); DefineCross(23, QuizS8); DefineCross(24, QuizS9); DefineCross(25, QuizS10); DefineCross(26, QuizS11); DefineCross(27, QuizS12); DefineCross(28, QuizN1); DefineCross(29, QuizN2); SetupTexts(); DefineQuiz(); InitReferers(); LoadReferers(); SetupControlGroups(); SortReferers(); SetupCross(QuizI, QuizII, QuizIII, QuizNd, Quiz5, Quiz6, Quiz7, Quiz8, Quiz9, QuizR1, QuizR2, QuizR3, QuizR4, QuizR5, QuizR6, QuizR7, QuizS1, QuizS2, QuizS3, QuizS4, QuizS5, QuizS6, QuizS7, QuizS8, QuizS9, QuizS10, QuizS11, QuizS12, QuizN1, QuizN2); LoadPopulations(); Calculate(); } /*########################################################################## # # Name : TQuizN3::~TQuizN3 # # Purpose....: Destructor for TQuizN3 # # In params..: * # Out params.: * # Returns....: * # ##########################################################################*/ TQuizN3::~TQuizN3() { } /*################## TQuizN3::GetPcaCount ########################## * Purpose....: Return number of available PCA axises # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ int TQuizN3::GetPcaCount() { return 4; } /*################## TQuizN3::GetCatCount ########################## * Purpose....: Return number of categories for question # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ int TQuizN3::GetCatCount(int Question) { if (Question >= 147) return 6; else return 3; } /*################## TQuiz::GetQuizN ########################## * Purpose....: Return number of questions in the quiz (not counting fictive or temporary questions) # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ int TQuizN3::GetQuizN() { return 147; } /*########################################################################## # # Name : TQuizN3::WriteName # # Purpose....: Write quiz name # # In params..: * # Out params.: * # Returns....: * # ##########################################################################*/ void TQuizN3::WriteName(TFile &File) { File.Write("N3"); } /*########################################################################## # # Name : TQuizN3::WriteLongName # # Purpose....: Write long quiz name # # In params..: * # Out params.: * # Returns....: * # ##########################################################################*/ void TQuizN3::WriteLongName(TFile &File) { File.Write("neurodiversity version 3"); } /*################## TQuizN3::DefineQuiz ########################## * Purpose....: Define global IDs in quiz # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ void TQuizN3::DefineQuiz() { } /*########################################################################## # # Name : TQuizN3::SetupTexts # # Purpose....: Init quiz texts and more # # In params..: * # Out params.: * # Returns....: * # ##########################################################################*/ void TQuizN3::SetupTexts() { Quiz[13].Reverse = TRUE; Quiz[16].Reverse = TRUE; Quiz[26].Reverse = TRUE; Quiz[27].Reverse = TRUE; Quiz[29].Reverse = TRUE; Quiz[30].Reverse = TRUE; Quiz[47].Reverse = TRUE; Quiz[81].Reverse = TRUE; Quiz[82].Reverse = TRUE; Quiz[84].Reverse = TRUE; Quiz[85].Reverse = TRUE; Quiz[86].Reverse = TRUE; Quiz[87].Reverse = TRUE; Quiz[136].Reverse = TRUE; Quiz[137].Reverse = TRUE; Quiz[138].Reverse = TRUE; Quiz[139].Reverse = TRUE; Quiz[140].Reverse = TRUE; Quiz[142].Reverse = TRUE; Quiz[143].Reverse = TRUE; Quiz[0].MyGroup = GROUP_ASPIE_TALENT; Quiz[1].MyGroup = GROUP_ASPIE_SOCIAL; Quiz[2].MyGroup = GROUP_ASPIE_TALENT; Quiz[3].MyGroup = GROUP_ASPIE_TALENT; Quiz[4].MyGroup = GROUP_ASPIE_TALENT; Quiz[5].MyGroup = GROUP_ASPIE_TALENT; Quiz[6].MyGroup = GROUP_ASPIE_TALENT; Quiz[7].MyGroup = GROUP_ASPIE_TALENT; Quiz[8].MyGroup = GROUP_NT_TALENT; Quiz[9].MyGroup = GROUP_NT_TALENT; Quiz[10].MyGroup = GROUP_NT_TALENT; Quiz[11].MyGroup = GROUP_NT_TALENT; Quiz[12].MyGroup = GROUP_NT_TALENT; Quiz[13].MyGroup = GROUP_NT_TALENT; Quiz[14].MyGroup = GROUP_NT_TALENT; Quiz[15].MyGroup = GROUP_NT_TALENT; Quiz[16].MyGroup = GROUP_NT_TALENT; Quiz[17].MyGroup = GROUP_ASPIE_OBSESSION; Quiz[18].MyGroup = GROUP_ASPIE_OBSESSION; Quiz[19].MyGroup = GROUP_ASPIE_OBSESSION; Quiz[20].MyGroup = GROUP_ASPIE_OBSESSION; Quiz[21].MyGroup = GROUP_ASPIE_OBSESSION; Quiz[22].MyGroup = GROUP_ASPIE_OBSESSION; Quiz[23].MyGroup = GROUP_ASPIE_OBSESSION; Quiz[24].MyGroup = GROUP_ASPIE_OBSESSION; Quiz[25].MyGroup = GROUP_ASPIE_OBSESSION; Quiz[26].MyGroup = GROUP_NT_SOCIAL; Quiz[27].MyGroup = GROUP_NT_OBSESSION; Quiz[28].MyGroup = GROUP_NT_OBSESSION; Quiz[29].MyGroup = GROUP_NT_OBSESSION; Quiz[30].MyGroup = GROUP_NT_OBSESSION; Quiz[31].MyGroup = GROUP_ASPIE_SOCIAL; Quiz[32].MyGroup = GROUP_ASPIE_SOCIAL; Quiz[33].MyGroup = GROUP_NT_TALENT; Quiz[34].MyGroup = GROUP_ASPIE_SOCIAL; Quiz[35].MyGroup = GROUP_ASPIE_HUNTING; Quiz[36].MyGroup = GROUP_NT_SOCIAL; Quiz[37].MyGroup = GROUP_NT_OBSESSION; Quiz[38].MyGroup = GROUP_ENVIRONMENT; Quiz[39].MyGroup = GROUP_NT_SOCIAL; Quiz[40].MyGroup = GROUP_NT_SOCIAL; Quiz[41].MyGroup = GROUP_NT_SOCIAL; Quiz[42].MyGroup = GROUP_NT_SOCIAL; Quiz[43].MyGroup = GROUP_NT_SOCIAL; Quiz[44].MyGroup = GROUP_NT_SOCIAL; Quiz[45].MyGroup = GROUP_NT_SOCIAL; Quiz[46].MyGroup = GROUP_NT_SOCIAL; Quiz[47].MyGroup = GROUP_NT_SOCIAL; Quiz[48].MyGroup = GROUP_NT_SOCIAL; Quiz[49].MyGroup = GROUP_ASPIE_NVC; Quiz[50].MyGroup = GROUP_NT_NVC; Quiz[51].MyGroup = GROUP_ASPIE_NVC; Quiz[52].MyGroup = GROUP_ASPIE_NVC; Quiz[53].MyGroup = GROUP_ASPIE_NVC; Quiz[54].MyGroup = GROUP_ASPIE_NVC; Quiz[55].MyGroup = GROUP_ASPIE_NVC; Quiz[56].MyGroup = GROUP_ASPIE_NVC; Quiz[57].MyGroup = GROUP_ASPIE_NVC; Quiz[58].MyGroup = GROUP_ASPIE_NVC; Quiz[59].MyGroup = GROUP_ASPIE_NVC; Quiz[60].MyGroup = GROUP_ASPIE_NVC; Quiz[61].MyGroup = GROUP_ASPIE_NVC; Quiz[62].MyGroup = GROUP_ASPIE_NVC; Quiz[63].MyGroup = GROUP_ASPIE_NVC; Quiz[64].MyGroup = GROUP_ASPIE_NVC; Quiz[65].MyGroup = GROUP_ASPIE_NVC; Quiz[66].MyGroup = GROUP_ASPIE_NVC; Quiz[67].MyGroup = GROUP_ASPIE_NVC; Quiz[68].MyGroup = GROUP_ASPIE_NVC; Quiz[69].MyGroup = GROUP_ASPIE_NVC; Quiz[70].MyGroup = GROUP_ASPIE_NVC; Quiz[71].MyGroup = GROUP_ASPIE_NVC; Quiz[72].MyGroup = GROUP_NT_NVC; Quiz[73].MyGroup = GROUP_NT_NVC; Quiz[74].MyGroup = GROUP_NT_NVC; Quiz[75].MyGroup = GROUP_NT_NVC; Quiz[76].MyGroup = GROUP_NT_NVC; Quiz[77].MyGroup = GROUP_NT_NVC; Quiz[78].MyGroup = GROUP_NT_NVC; Quiz[79].MyGroup = GROUP_NT_NVC; Quiz[80].MyGroup = GROUP_NT_NVC; Quiz[81].MyGroup = GROUP_NT_NVC; Quiz[82].MyGroup = GROUP_NT_SOCIAL; Quiz[83].MyGroup = GROUP_NT_NVC; Quiz[84].MyGroup = GROUP_NT_NVC; Quiz[85].MyGroup = GROUP_NT_NVC; Quiz[86].MyGroup = GROUP_NT_SOCIAL; Quiz[87].MyGroup = GROUP_NT_NVC; Quiz[88].MyGroup = GROUP_NT_NVC; Quiz[89].MyGroup = GROUP_NT_SENSORY; Quiz[90].MyGroup = GROUP_ASPIE_HUNTING; Quiz[91].MyGroup = GROUP_ASPIE_HUNTING; Quiz[92].MyGroup = GROUP_ASPIE_HUNTING; Quiz[93].MyGroup = GROUP_ASPIE_HUNTING; Quiz[94].MyGroup = GROUP_ASPIE_HUNTING; Quiz[95].MyGroup = GROUP_ASPIE_HUNTING; Quiz[96].MyGroup = GROUP_NT_HUNTING; Quiz[97].MyGroup = GROUP_NT_HUNTING; Quiz[98].MyGroup = GROUP_NT_HUNTING; Quiz[99].MyGroup = GROUP_NT_HUNTING; Quiz[100].MyGroup = GROUP_NT_HUNTING; Quiz[101].MyGroup = GROUP_NT_HUNTING; Quiz[102].MyGroup = GROUP_ASPIE_SENSORY; Quiz[103].MyGroup = GROUP_ASPIE_SENSORY; Quiz[104].MyGroup = GROUP_ASPIE_SENSORY; Quiz[105].MyGroup = GROUP_ASPIE_SENSORY; Quiz[106].MyGroup = GROUP_ASPIE_SENSORY; Quiz[107].MyGroup = GROUP_ASPIE_SENSORY; Quiz[108].MyGroup = GROUP_ASPIE_SENSORY; Quiz[109].MyGroup = GROUP_ASPIE_SENSORY; Quiz[110].MyGroup = GROUP_ASPIE_SENSORY; Quiz[111].MyGroup = GROUP_ASPIE_SENSORY; Quiz[112].MyGroup = GROUP_NT_SENSORY; Quiz[113].MyGroup = GROUP_NT_SENSORY; Quiz[114].MyGroup = GROUP_NT_SENSORY; Quiz[115].MyGroup = GROUP_NT_SENSORY; Quiz[116].MyGroup = GROUP_NT_SENSORY; Quiz[117].MyGroup = GROUP_NT_SENSORY; Quiz[118].MyGroup = GROUP_NT_SENSORY; Quiz[119].MyGroup = GROUP_ENVIRONMENT; Quiz[120].MyGroup = GROUP_ENVIRONMENT; Quiz[121].MyGroup = GROUP_ENVIRONMENT; Quiz[122].MyGroup = GROUP_ENVIRONMENT; Quiz[123].MyGroup = GROUP_ENVIRONMENT; Quiz[124].MyGroup = GROUP_ENVIRONMENT; Quiz[125].MyGroup = GROUP_ENVIRONMENT; Quiz[126].MyGroup = GROUP_NT_OBSESSION; Quiz[127].MyGroup = GROUP_NT_NVC; Quiz[128].MyGroup = GROUP_ASPIE_NVC; Quiz[129].MyGroup = GROUP_MIXED; Quiz[130].MyGroup = GROUP_ASPIE_SOCIAL; Quiz[131].MyGroup = GROUP_NT_NVC; Quiz[132].MyGroup = GROUP_ASPIE_SOCIAL; Quiz[133].MyGroup = GROUP_ASPIE_NVC; Quiz[134].MyGroup = GROUP_NT_NVC; Quiz[135].MyGroup = GROUP_MIXED; Quiz[136].MyGroup = GROUP_NT_TALENT; Quiz[137].MyGroup = GROUP_NT_SOCIAL; Quiz[138].MyGroup = GROUP_NT_NVC; Quiz[139].MyGroup = GROUP_NT_SENSORY; Quiz[140].MyGroup = GROUP_ENVIRONMENT; Quiz[141].MyGroup = GROUP_ASPIE_SOCIAL; Quiz[142].MyGroup = GROUP_NT_NVC; Quiz[143].MyGroup = GROUP_NT_OBSESSION; Quiz[144].MyGroup = GROUP_ASPIE_SOCIAL; Quiz[145].MyGroup = GROUP_NT_SOCIAL; Quiz[146].MyGroup = GROUP_ASPIE_SOCIAL; Quiz[147].MyGroup = GROUP_ENVIRONMENT; Quiz[148].MyGroup = GROUP_MIXED; Quiz[149].MyGroup = GROUP_MIXED; Quiz[150].MyGroup = GROUP_MIXED; Quiz[151].MyGroup = GROUP_MIXED; Quiz[152].MyGroup = GROUP_ENVIRONMENT; Quiz[153].MyGroup = GROUP_MIXED; Quiz[154].MyGroup = GROUP_NT_SOCIAL; Quiz[155].MyGroup = GROUP_ENVIRONMENT; Quiz[156].MyGroup = GROUP_ENVIRONMENT; Quiz[157].MyGroup = GROUP_ENVIRONMENT; Quiz[158].MyGroup = GROUP_MIXED; Quiz[159].MyGroup = GROUP_MIXED; Quiz[160].MyGroup = GROUP_ENVIRONMENT; Quiz[161].MyGroup = GROUP_MIXED; Quiz[162].MyGroup = GROUP_MIXED; Quiz[163].MyGroup = GROUP_MIXED; Quiz[164].MyGroup = GROUP_ENVIRONMENT; Quiz[165].MyGroup = GROUP_MIXED; Quiz[166].MyGroup = GROUP_MIXED; Quiz[167].MyGroup = GROUP_ENVIRONMENT; Quiz[168].MyGroup = GROUP_ENVIRONMENT; Quiz[169].MyGroup = GROUP_ENVIRONMENT; Quiz[170].MyGroup = GROUP_ENVIRONMENT; Quiz[171].MyGroup = GROUP_ENVIRONMENT; Quiz[172].MyGroup = GROUP_ASPIE_SOCIAL; #ifdef ENGLISH Quiz[0].Text = "Do you tend to get so absorbed by your special interests that you forget or ignore everything else?"; Quiz[1].Text = "Is your sense of humor different from mainstream or considered odd?"; Quiz[2].Text = "Do you focus on one interest at a time and become an expert on that subject?"; Quiz[3].Text = "Do you or others think that you have unconventional ways of solving problems?"; Quiz[4].Text = "Do you have values & views that are either very old-fashioned or way ahead of their time?"; Quiz[5].Text = "Do you take an interest in, and remember, details that others do not seem to notice?"; Quiz[6].Text = "Do you notice patterns in things all the time?"; Quiz[7].Text = "Do you need periods of contemplation?"; Quiz[8].Text = "Do you get confused by verbal instructions - especially several at the same time?"; Quiz[9].Text = "Do you tend to get so stuck on details that you miss the overall picture?"; Quiz[10].Text = "Do you find it hard to multi-task or shift your attention rapidly from one thing to another and therefore need to finish one task before turning to the next?"; Quiz[11].Text = "Do you have difficulty describing & summarising things for example events, conversations or something you've read?"; Quiz[12].Text = "Do you need to do things yourself in order to remember them?"; Quiz[13].Text = "If there is an interruption, can you quickly return to what you were doing before?"; Quiz[14].Text = "Do you find it very hard to learn things that you are not interested in?"; Quiz[15].Text = "Do you find it difficult to take notes in lectures?"; Quiz[16].Text = "Can you easily keep track of several different people's conversations?"; Quiz[17].Text = "Does it feel vitally important to be left undisturbed when focusing on your special interests?"; Quiz[18].Text = "Before doing something or going somewhere, do you need to have a picture in your mind of what's going to happen so as to be able to prepare yourself mentally first?"; Quiz[19].Text = "Do you prefer to wear the same clothes and/or eat the same food every day?"; Quiz[20].Text = "Do you become frustrated if an activity that is important to you gets interrupted?"; Quiz[21].Text = "Do you have strong attachments to certain favorite objects?"; Quiz[22].Text = "Do you get frustrated if you can't sit on your favorite seat?"; Quiz[23].Text = "Do you have certain routines which you need to follow?"; Quiz[24].Text = "Do you find it disturbing or upsetting when others show up either later or sooner than agreed?"; Quiz[25].Text = "Do you need lists and schedules in order to get things done?"; Quiz[26].Text = "Do you enjoy meeting new people?"; Quiz[27].Text = "Are your views typical of your peer group?"; Quiz[28].Text = "Are you usually unaware of/disinterested in what is currently in vogue?"; Quiz[29].Text = "Do you take pride in your appearance?"; Quiz[30].Text = "Do you enjoy gossip?"; Quiz[31].Text = "Are you somewhat of a daydreamer, often lost in your own thoughts?"; Quiz[32].Text = "Do you have problems starting and / or finishing projects?"; Quiz[33].Text = "Are you easily distracted?"; Quiz[34].Text = "Are you poor at organizing your work and / or life?"; Quiz[35].Text = "Are you or have you been hyperactive?"; Quiz[36].Text = "Do you have a tendency to become stuck when asked questions in social situation?"; Quiz[37].Text = "Do you dislike or have difficulty with team sports and other group endeavours?"; Quiz[38].Text = "Has it been harder for you than for others to keep friends?"; Quiz[39].Text = "Do you avoid talking face to face with someone you don't know very well?"; Quiz[40].Text = "Do you get very tired after socializing, and need to regenerate alone?"; Quiz[41].Text = "Do you dislike being touched or hugged unless you're prepared or have asked for it?"; Quiz[42].Text = "Do people think you are aloof and distant?"; Quiz[43].Text = "Do you find it hard to be emotionally close to other people?"; Quiz[44].Text = "Do you dislike shaking hands?"; Quiz[45].Text = "Do you prefer to do things on your own even if you could use others' help or expertise?"; Quiz[46].Text = "Do you dislike it when people drop by to visit you uninvited?"; Quiz[47].Text = "Do you find it natural to wave or say 'hi' when you meet people?"; Quiz[48].Text = "Do you dislike reading aloud?"; Quiz[49].Text = "Do people comment on your unusual mannerisms and habits?"; Quiz[50].Text = "Do people sometimes think you are smiling at the wrong occasion?"; Quiz[51].Text = "Do you often have lots of thoughts that you find hard to verbalize?"; Quiz[52].Text = "Do you often don't know where to put your arms?"; Quiz[53].Text = "Do you tend to talk either too softly or too loudly?"; Quiz[54].Text = "Have you been accused of staring?"; Quiz[55].Text = "Have others commented or have you observed yourself that you make unusual facial expressions?"; Quiz[56].Text = "Have others told you that you have an odd posture or gait?"; Quiz[57].Text = "Do you wring your hands, rub your hands together or twirl your fingers?"; Quiz[58].Text = "Do recently heard phrases, tunes or rhythms tend to stick and repeat themselves in your head?"; Quiz[59].Text = "Do you rock back-&-forth or side-to-side (e.g. for comfort, to calm yourself, when excited or overstimulated)?"; Quiz[60].Text = "In conversations, do you use small sounds that others don't seem to use?"; Quiz[61].Text = "Do you have a habit of repeating your own or others' last words, internally or out loud (echolalia)?"; Quiz[62].Text = "Do you tap your ears or press your eyes (e.g. when thinking, when stressed or distressed)?"; Quiz[63].Text = "Do you fiddle with things?"; Quiz[64].Text = "Do you use stock phrases or phrases borrowed from other situations or people?"; Quiz[65].Text = "Do you pace (e.g. when thinking or anxious)?"; Quiz[66].Text = "Do you tend to look a lot at people you like and little or not at all at people you dislike?"; Quiz[67].Text = "Do you bite your lip, cheek or tongue (e.g. when thinking, when anxious or nervous)?"; Quiz[68].Text = "Do you stutter when stressed?"; Quiz[69].Text = "Do you talk to yourself?"; Quiz[70].Text = "Do you have difficulties with pronunciation?"; Quiz[71].Text = "Do you sometimes mix up pronouns and, for example, say \"you\" or \"we\" when you mean \"me\" or vice versa?"; Quiz[72].Text = "Do you find it difficult to figure out how to behave in various situations?"; Quiz[73].Text = "Do others often misunderstand you?"; Quiz[74].Text = "In conversations, do you have trouble with things like timing and reciprocity?"; Quiz[75].Text = "Do you tend to express your feelings in ways that may baffle others?"; Quiz[76].Text = "Do you forget you are in a social situation when something gets your attention?"; Quiz[77].Text = "Do you find it difficult to work out people's intentions?"; Quiz[78].Text = "Do you tend to interpret things literally and/or reply to rhetorical questions?"; Quiz[79].Text = "Are you usually unaware of social rules & boundaries unless they are clearly spelled out?"; Quiz[80].Text = "Do you tend to say things that are considered socially inappropriate?"; Quiz[81].Text = "Do you instinctively know when it is your turn to speak when talking on the phone?"; Quiz[82].Text = "Are you good at returning social courtesies and gestures?"; Quiz[83].Text = "Do you often talk about your special interests whether others seem to be interested or not?"; Quiz[84].Text = "Do you know when you are expected to offer an apology?"; Quiz[85].Text = "Are you good at interpreting facial expressions?"; Quiz[86].Text = "Do you find yourself at ease in romantic situations?"; Quiz[87].Text = "Do you find it easy to describe your feelings?"; Quiz[88].Text = "Are you so honest and sincere yourself that you assume everyone is?"; Quiz[89].Text = "Do you have problems recognizing faces (prosopagnosia)?"; Quiz[90].Text = "Do you enjoy watching a spinning or blinking object?"; Quiz[91].Text = "Do you have a fascination for slowly flowing water?"; Quiz[92].Text = "Do you sometimes have an urge to jump over things?"; Quiz[93].Text = "Do you enjoy mimicking animal sounds?"; Quiz[94].Text = "Do you enjoy walking on your toes?"; Quiz[95].Text = "Have you been fascinated about making traps?"; Quiz[96].Text = "Do you find it difficult to take messages on the telephone and pass them on correctly?"; Quiz[97].Text = "Do you drop things when your attention is on other things?"; Quiz[98].Text = "Do you have problems filling out forms?"; Quiz[99].Text = "Do you find it hard to recognise phone numbers when said in a different way?"; Quiz[100].Text = "Do you mix up digits in numbers like 95 and 59?"; Quiz[101].Text = "Do you have trouble reading clocks?"; Quiz[102].Text = "Do you suddenly feel distracted by distant sounds?"; Quiz[103].Text = "Do you notice small sounds that others don't, or feel pained by loud or irritating noise?"; Quiz[104].Text = "Do you have difficulties filtering out background noise when talking to someone?"; Quiz[105].Text = "Do you feel tortured by clothes tags, clothes that are too tight or are made in the 'wrong' material?"; Quiz[106].Text = "Are you hypo- or hypersensitive to physical pain, or even enjoy some types of pain?"; Quiz[107].Text = "Are you sensitive to changes in humidity and air pressure?"; Quiz[108].Text = "Are your eyes extra sensitive to stong light and glare?"; Quiz[109].Text = "Do you instinctively become frightened by the sound of a motor-bike?"; Quiz[110].Text = "Does it come more natural to you to think in pictures than in words?"; Quiz[111].Text = "Do you dislike it when people stamp their foot in the floor?"; Quiz[112].Text = "Do you have poor awareness or body control and a tendency to fall, stumble or bump into things?"; Quiz[113].Text = "Do you have difficulties imitating & timing the movements of others, e.g. when learning new dance steps or in gym class?"; Quiz[114].Text = "Do you have poor concept of time?"; Quiz[115].Text = "Do you find it hard to tell the age of people?"; Quiz[116].Text = "Do you have difficulties judging distances, height, depth or speed?"; Quiz[117].Text = "Do you have difficulties with activities requiring manual precision, e.g sewing, tying shoe-laces, fastening buttons or handling small objects?"; Quiz[118].Text = "Do you have problems finding your way to new places?"; Quiz[119].Text = "Do you tend to shut down or have a meltdown when stressed or overwhelmed?"; Quiz[120].Text = "Has it been harder for you to make it on your own, than it seems to be for most others of the same age?"; Quiz[121].Text = "Are you sometimes afraid in safe situations?"; Quiz[122].Text = "Do you have difficulty accepting criticism, correction, and direction?"; Quiz[123].Text = "Are you prone to getting depressions?"; Quiz[124].Text = "Have you been bullied, abused or taken advantage of?"; Quiz[125].Text = "Do you tend to be impatient and/or impulsive?"; Quiz[126].Text = "Do you often feel out-of-sync with others?"; Quiz[127].Text = "Do you sometimes not feel anything at all, even though other people expect you to?"; Quiz[128].Text = "In conversations, do you need extra time to carefully think out your reply, so that there may be a pause before you answer?"; Quiz[129].Text = "Have you had the feeling of playing a game, pretending to be like people around you?"; Quiz[130].Text = "Do you or others think that you have unusual eating habits?"; Quiz[131].Text = "Have you taken initiative only to find out it was not wanted?"; Quiz[132].Text = "Do you have immature interests?"; Quiz[133].Text = "Do you turn words around in conversations?"; Quiz[134].Text = "Do you expect other people to know your thoughts, experiences and opinions without you having to tell them?"; Quiz[135].Text = "Is your writing difficult to read?"; Quiz[136].Text = "Can you easily remember verbal instructions?"; Quiz[137].Text = "Are you good at teamwork?"; Quiz[138].Text = "Do you have a good sense for what is the right thing to do socially?"; Quiz[139].Text = "Do you find it easy to estimate the age of people?"; Quiz[140].Text = "Are you gracious about criticism, correction and direction?"; Quiz[141].Text = "Do you have an alternative view of what is attractive in the opposite sex?"; Quiz[142].Text = "Do you judge a potential mate as most anybody else would?"; Quiz[143].Text = "Do you naturally fit into the expected gender stereotypes?"; Quiz[144].Text = "Do you have unusual sexual preferences?"; Quiz[145].Text = "Do you become shy or passive when you see somebody of the opposite sex that you are interested in?"; Quiz[146].Text = "Do you prefer romantic relationships to develop fast?"; Quiz[147].Text = "EAT - Am terrified about being overweight"; Quiz[148].Text = "EAT - Avoid eating when I am hungry"; Quiz[149].Text = "EAT - Find myself preoccupied with food"; Quiz[150].Text = "EAT - Have gone on eating binges where I feel I may not be able to stop"; Quiz[151].Text = "EAT - Cut my food into small pieces"; Quiz[152].Text = "EAT - Aware of the calorie content of foods I eat"; Quiz[153].Text = "EAT - Particularly avoid food with a high carbohydrate content (bread, rice, potatoes, etc.)"; Quiz[154].Text = "EAT - Feel that others would prefer if I ate more"; Quiz[155].Text = "EAT - Vomit after I have eaten"; Quiz[156].Text = "EAT - Feel extremely guilty after eating"; Quiz[157].Text = "EAT - Am preoccupied with a desire to be thinner"; Quiz[158].Text = "EAT - Think about burning up calories when I exercise"; Quiz[159].Text = "EAT - Other people think I'm too thin"; Quiz[160].Text = "EAT - Am preoccupied with the thought of having fat on my body"; Quiz[161].Text = "EAT - Take longer than others to eat my meals"; Quiz[162].Text = "EAT - Avoid foods with sugar in them"; Quiz[163].Text = "EAT - Eat diet foods"; Quiz[164].Text = "EAT - Feel that food controls my life"; Quiz[165].Text = "EAT - Display self-control around food"; Quiz[166].Text = "EAT - Feel that others pressure me to eat"; Quiz[167].Text = "EAT - Give too much time and thought to food"; Quiz[168].Text = "EAT - Feel uncomfortable after eating sweets"; Quiz[169].Text = "EAT - Engage in dieting behavior"; Quiz[170].Text = "EAT - Like my stomach to be empty"; Quiz[171].Text = "EAT - Have the impulse to vomit after meals"; Quiz[172].Text = "EAT - Enjoy trying new rich foods"; #endif #ifdef SWEDISH Quiz[0].Text = "Brukar du bli så absorberad av dina specialintressen att du glömmer/struntar i allting annat?"; Quiz[1].Text = "Är ditt sinne för humor annorlunda än andras eller ansett som udda?"; Quiz[2].Text = "Brukar du fördjupa dig i ett ämne i taget och bli expert det?"; Quiz[3].Text = "Tycker du själv eller din omgivning att du löser problem på okonventionella sätt?"; Quiz[4].Text = "Har du värderingar som antingen är väldigt gammaldags eller långt före sin tid?"; Quiz[5].Text = "Brukar du lägga märke till och intressera dig för detaljer som andra inte verkar se eller bry sig om?"; Quiz[6].Text = "Ser du mönster i saker hela tiden?"; Quiz[7].Text = "Behöver du perioder av begrundande?"; Quiz[8].Text = "Blir du förvirrad av verbala instruktioner - särskilt flera på en gång?"; Quiz[9].Text = "Händer det att du fastnar så för vissa detaljer att du missar eller struntar i helhetsbilden?"; Quiz[10].Text = "Har du svårt att göra flera saker samtidigt, snabbt skifta fokus från en sak till en annan och därför behov av att få göra klart det du håller på med innan du kan ta itu med något annat?"; Quiz[11].Text = "Har du svårt att sammanfatta och redogöra för t ex konversationer, händelser eller något du läst?"; Quiz[12].Text = "Har du behov av att göra saker själv för att riktigt minnas dem?"; Quiz[13].Text = "Om du blir avbruten, kan du snabbt återgå till vad du gjorde innan?"; Quiz[14].Text = "Är det svårt för dig att lära dig sånt som du inte är intresserad av?"; Quiz[15].Text = "Har du svårt att göra anteckningar under föreläsningar?"; Quiz[16].Text = "Kan du lätt hålla koll på flera olika människors konversationer?"; Quiz[17].Text = "Känns det livsviktigt att få vara ifred när du ägnar dig åt dina specialintressen?"; Quiz[18].Text = "Innan du gör något eller går någonstans, behöver du ha en inre bild av vad som kommer att hända så du kan förbereda dig?"; Quiz[19].Text = "Föredrar du att använda samma kläder och/eller äta samma mat varje dag?"; Quiz[20].Text = "Blir du frustrerad om en för dig viktig aktivitet blir avbruten?"; Quiz[21].Text = "Är du exceptionellt fäst vid vissa favoritsaker?"; Quiz[22].Text = "Blir du frustrerad om du inte får sitta på din favoritplats?"; Quiz[23].Text = "Har du vissa rutiner som du behöver följa?"; Quiz[24].Text = "Blir du störd eller upprörd när andra kommer antingen för för sent eller för tidigt?"; Quiz[25].Text = "Behöver du listor och scheman för att få saker gjorda?"; Quiz[26].Text = "Trivs du med att möta nya människor?"; Quiz[27].Text = "Är dina åsikter typiska för dina jämnåriga?"; Quiz[28].Text = "Är du ofta omedveten om eller ointresserad av vad som för tillfället råkar vara modernt/inne?"; Quiz[29].Text = "Är du stolt över ditt utseende?"; Quiz[30].Text = "Tycker du om skvaller?"; Quiz[31].Text = "Är du lite av en dagdrömmare, ofta borta i dina egna tankar?"; Quiz[32].Text = "Har du problem att starta och / eller slutföra projekt?"; Quiz[33].Text = "Blir du lätt distraherad?"; Quiz[34].Text = "Är du dålig på att organisera ditt arbete och / eller liv?"; Quiz[35].Text = "Är du eller har du varit hyperaktiv"; Quiz[36].Text = "Låser det sig för dig när du får frågor i sociala situationer?"; Quiz[37].Text = "Har du problem med lagsporter och andra saker som kräver samarbete i grupp?"; Quiz[38].Text = "Har du haft svårare än andra att behålla vänner?"; Quiz[39].Text = "Undviker du att prata ansikte-mot-ansikte med folk du inte känner mycket väl?"; Quiz[40].Text = "Brukar du bli utmattad av att umgås med folk och behöva vila ut ifred efteråt?"; Quiz[41].Text = "Ogillar du att bli tagen i eller kramad om du inte är beredd eller har bett om det?"; Quiz[42].Text = "Tycker folk att du är reserverad och distanserad?"; Quiz[43].Text = "Tycker du det är svårt att vara känslomässigt nära andra människor?"; Quiz[44].Text = "Ogillar du att behöva ta i hand?"; Quiz[45].Text = "Föredrar du att göra saker på egen hand även om du skulle ha användning för andras hjälp och expertis?"; Quiz[46].Text = "Ogillar du när folk kommer på besök oanmälda?"; Quiz[47].Text = "Tycker du det är naturligt att vinka eller säga 'hej' när du möter folk?"; Quiz[48].Text = "Ogillar du högläsning?"; Quiz[49].Text = "Brukar folk kommentera ditt ovanliga uppförande och dina ovanliga vanor?"; Quiz[50].Text = "Tycker andra ibland att du ler vid fel tillfällen?"; Quiz[51].Text = "Har du ofta massor av tankar som du har svårt för att formulera i ord?"; Quiz[52].Text = "Vet du ofta inte var du ska göra av dina armar?"; Quiz[53].Text = "Har du en tendens att tala antingen för tyst eller för högt?"; Quiz[54].Text = "Har du blivit anklagad för att stirra?"; Quiz[55].Text = "Har andra kommenterat eller har du själv observerat att du har ovanliga ansiktsuttryck?"; Quiz[56].Text = "Har andra kommenterat att du har udda kroppshållning eller gångstil?"; Quiz[57].Text = "Brukar du gnugga händer, eller vrida händerna eller fingrarna om varandra?"; Quiz[58].Text = "Brukar fraser, melodier eller rytmer du nyligen hört fastna i huvudet och fortsätta spelas upp om och om igen?"; Quiz[59].Text = "Brukar du gunga fram-&-tillbaka eller i sidled (t ex för att lunga ner dig, när du är upprymd eller övertimulerad)?"; Quiz[60].Text = "I samtal, använder du små ljud som andra inte verkar använda?"; Quiz[61].Text = "Har du för vana att upprepa de sista orden som du själv eller någon annan just sagt?"; Quiz[62].Text = "Brukar du trumma på öronen eller trycka på ögonen (t ex när du tänker, när du är stressad eller upprörd)?"; Quiz[63].Text = "Brukar du fingra på saker?"; Quiz[64].Text = "Brukar du memorera och använda uttryck som du kopierat från andra människor och situationer?"; Quiz[65].Text = "Brukar du vanka av och an (t ex när du tänker eller är orolig)?"; Quiz[66].Text = "Har du en tendens att titta mycket på människor du gillar och lite eller inte alls på människor du ogillar?"; Quiz[67].Text = "Brukar du bita dig i läppen, kinden eller tungan (t ex när du tänker, när du är orolig eller nervös)?"; Quiz[68].Text = "Stammar du när du blir stressad?"; Quiz[69].Text = "Brukar du prata med dig själv?"; Quiz[70].Text = "Har du svårigheter med uttal?"; Quiz[71].Text = "Blandar du ibland ihop pronomen och t ex säger \"vi\" eller \"du\" när du menar \"jag\" eller tvärtom?"; Quiz[72].Text = "Är det svårt att veta hur du ska bete dig i olika situationer?"; Quiz[73].Text = "Blir du ofta missförstådd av andra?"; Quiz[74].Text = "I samtal, brukar du ha problem med saker som timing, turtagning och ömsesidighet?"; Quiz[75].Text = "Brukar du uttrycka känslor på sätt som förbryllar andra?"; Quiz[76].Text = "Glömmer du bort att du är i en social situation när något annat fångar ditt intresse?"; Quiz[77].Text = "Har du svårt att räkna ut folks intentioner?"; Quiz[78].Text = "Har du en tendens att tolka saker bokstavligt och/eller svara på retoriska frågor?"; Quiz[79].Text = "Är du oftast omedveten om outtalade sociala regler?"; Quiz[80].Text = "Brukar du säga saker som anses socialt opassande?"; Quiz[81].Text = "Känner du instinktivt på dig när det är din tur att tala när du pratar i telefon?"; Quiz[82].Text = "Är du bra på att återgälda sociala gester och artigheter?"; Quiz[83].Text = "Brukar du gärna prata om dina specialintressen oavsett om någon verkar intresserad eller inte?"; Quiz[84].Text = "Känner du på dig när det förväntas att du ska be folk om ursäkt?"; Quiz[85].Text = "Är du bra på att tolka ansiktsuttryck?"; Quiz[86].Text = "Trivs du i romantiska situationer?"; Quiz[87].Text = "Har du lätt att beskriva dina känslor?"; Quiz[88].Text = "Är det så naturligt för dig att vara totalt ärlig att du tror alla är sådana?"; Quiz[89].Text = "Har du svårt att känna igen ansikten?"; Quiz[90].Text = "Gillar du att titta på något som snurrar eller blinkar?"; Quiz[91].Text = "Är du fascinerad av långsamt flytande vatten?"; Quiz[92].Text = "Brukar du ibland ha ett behov av att hoppa över saker?"; Quiz[93].Text = "Gillar du att härma djurläten?"; Quiz[94].Text = "Gillar du att gå på tå?"; Quiz[95].Text = "Har du varit fascinerad av att tillverka fällor?"; Quiz[96].Text = "Tycker du det är svårt att ta meddelenden på telefon och skicka dem vidare rätt?'"; Quiz[97].Text = "Tappar du saker när din uppmärksamhet är på annat håll?"; Quiz[98].Text = "Har du svårt att fylla i formulär?"; Quiz[99].Text = "Har du svårt att känna igen telefonnummer om de sägs på ett annat sätt?"; Quiz[100].Text = "Blandar du ihop siffor i tal som t.ex. 95 och 59?"; Quiz[101].Text = "Har du svårigheter att läsa av klockor?"; Quiz[102].Text = "Blir du plötsligt distraherad av avlägsna ljud?"; Quiz[103].Text = "Brukar du höra ljud som andra inte hör eller plågas av höga eller störande ljud?"; Quiz[104].Text = "Har du svårt att filtrera bort störande bakgrundsljud när du talar med någon?"; Quiz[105].Text = "Pinas du av skavande sömmar och etiketter i kläderna, av kläder som sitter åt eller som är gjorda i 'fel' material?"; Quiz[106].Text = "Är du över- eller underkänslig för smärta eller t.o.m tycker om vissa sorters smärta?"; Quiz[107].Text = "Är du känslig för omslag i luftryck och luftfuktighet?"; Quiz[108].Text = "Är dina ögon extra känsliga för starkt ljus och bländning?"; Quiz[109].Text = "Blir du instinktivt rädd för ljudet från en motorcykel?"; Quiz[110].Text = "Är det mer naturligt för dig att tänka i bilder än i ord?"; Quiz[111].Text = "Ogillar du när folk stampar med foten i golvet?"; Quiz[112].Text = "Har du dålig koll på eller kontroll över kroppen och tendens att ramla, snubbla eller springa in i saker?"; Quiz[113].Text = "Har du svårt att imitera och tajma andras rörelser, t ex när du ska lära dig nya danssteg eller göra gymnastikpass i grupp?"; Quiz[114].Text = "Har du dålig tidsuppfattning?"; Quiz[115].Text = "Har du svårt för att bedöma andra människors ålder?"; Quiz[116].Text = "Har du svårigheter att bedöma avstånd, höjd, djup eller fart?"; Quiz[117].Text = "Har du svårigheter med aktiviteter som kräver finmotorisk precision, t ex att sy, knyta skosnören, knäppa knappar och hantera små föremål?"; Quiz[118].Text = "Har du svårt att hitta till nya platser?"; Quiz[119].Text = "Brukar du stänga av eller bryta ihop när du blir stressad eller överväldigad?"; Quiz[120].Text = "Har du haft svårare att klara dig själv än andra i samma ålder?"; Quiz[121].Text = "Är du ibland rädd i ofarliga situationer?"; Quiz[122].Text = "Har du svårt för att acceptera kritik, korrektion och direktiv?"; Quiz[123].Text = "Brukar du få depressioner?"; Quiz[124].Text = "Har du blivit mobbad, lurad, utnyttjad eller illa behandlad?"; Quiz[125].Text = "Brukar du vara otålig och/eller impulsiv?"; Quiz[126].Text = "Känner du dig ofta ur fas med andra?"; Quiz[127].Text = "Händer det att du inte känner något alls fastän andra tycker att du borde?"; Quiz[128].Text = "I samtal, brukar du behöva extra tid att noggant tänka ut vad du ska säga, så att det kan uppstå en paus innan du svarar?"; Quiz[129].Text = "Har du haft en känsla av att spela ett spel för att vara som andra runt omkring dig?"; Quiz[130].Text = "Tycker du själv eller din omgivning att du har ovanliga matvanor?"; Quiz[131].Text = "Har du tagit initiativ som inte visat sig önskade?"; Quiz[132].Text = "Har du omogna intressen?"; Quiz[133].Text = "Blandar du om ord i konversationer?"; Quiz[134].Text = "Förväntar du dig att andra ska känna till dina tankar, upplevelser och åsikter utan att du behöver berätta?"; Quiz[135].Text = "Är det svårt att läsa vad du skrivit?"; Quiz[136].Text = "Kommer du lätt ihåg verbala instruktioner?"; Quiz[137].Text = "Är du bra på att arbeta i grupp?"; Quiz[138].Text = "Har du en bra känla för vad som är rätt socialt?"; Quiz[139].Text = "Har du lätt för att bedömma människors ålder?"; Quiz[140].Text = "Accepterar du lätt kritik, tillrättavisningar och instruktioner?"; Quiz[141].Text = "Har du avvikande uppfattning om vad som är attraktivt hos det motsatta könet?"; Quiz[142].Text = "Bedömmer du en potentiell partner på samma sätt som de flesta andra människor?"; Quiz[143].Text = "Passar du naturligt in i de förväntade könsrollerna?"; Quiz[144].Text = "Har du ovanliga sexuella preferenser?"; Quiz[145].Text = "Blir du blyg eller passiv när du ser någon av motsatt kön som du är intresserad av?"; Quiz[146].Text = "Föredrar du om romantiska relationer utvecklas snabbt?"; Quiz[147].Text = "EAT - Am terrified about being overweight"; Quiz[148].Text = "EAT - Avoid eating when I am hungry"; Quiz[149].Text = "EAT - Find myself preoccupied with food"; Quiz[150].Text = "EAT - Have gone on eating binges where I feel I may not be able to stop"; Quiz[151].Text = "EAT - Cut my food into small pieces"; Quiz[152].Text = "EAT - Aware of the calorie content of foods I eat"; Quiz[153].Text = "EAT - Particularly avoid food with a high carbohydrate content (bread, rice, potatoes, etc.)"; Quiz[154].Text = "EAT - Feel that others would prefer if I ate more"; Quiz[155].Text = "EAT - Vomit after I have eaten"; Quiz[156].Text = "EAT - Feel extremely guilty after eating"; Quiz[157].Text = "EAT - Am preoccupied with a desire to be thinner"; Quiz[158].Text = "EAT - Think about burning up calories when I exercise"; Quiz[159].Text = "EAT - Other people think I'm too thin"; Quiz[160].Text = "EAT - Am preoccupied with the thought of having fat on my body"; Quiz[161].Text = "EAT - Take longer than others to eat my meals"; Quiz[162].Text = "EAT - Avoid foods with sugar in them"; Quiz[163].Text = "EAT - Eat diet foods"; Quiz[164].Text = "EAT - Feel that food controls my life"; Quiz[165].Text = "EAT - Display self-control around food"; Quiz[166].Text = "EAT - Feel that others pressure me to eat"; Quiz[167].Text = "EAT - Give too much time and thought to food"; Quiz[168].Text = "EAT - Feel uncomfortable after eating sweets"; Quiz[169].Text = "EAT - Engage in dieting behavior"; Quiz[170].Text = "EAT - Like my stomach to be empty"; Quiz[171].Text = "EAT - Have the impulse to vomit after meals"; Quiz[172].Text = "EAT - Enjoy trying new rich foods"; #endif } /*########################################################################## # # Name : TQuizN3::InitReferers # # Purpose....: Init referers # # In params..: * # Out params.: * # Returns....: * # ##########################################################################*/ void TQuizN3::InitReferers() { AddReferer("livejournal.com/community/asperger", "livejournal.com/community/asperger"); AddReferer("flashback.info", "flashback.info"); AddReferer("aspiesforfreedom.", "aspiesforfreedom.com"); AddReferer("aspergianisland.com", "aspergianisland.com"); AddReferer("wrongplanet.net", "wrongplanet.net"); AddReferer("rdos.net/sv", "rdos.net/sv"); AddReferer("aspalsta.net", "aspalsta.net/viewtopic.php?t=1951"); AddReferer("circvsmaximvs.com", "circvsmaximvs.com/showthread.php?t=14129"); AddReferer("panterachat.com", "panterachat.com/phpBB/viewtopic.php?t=24332"); AddReferer("kaytastrophe.com", "kaytastrophe.com/index.php?topic=708.0"); AddReferer("tbg.nu", "tbg.nu/news_show/109118/40"); AddReferer("vof.se", "vof.se/forum/viewtopic.php?t=3080"); AddReferer("autismspeaks.org", "autismspeaks.org/community/forums"); AddReferer("nordisk.nu", "nordisk.nu/showthread.php?t=3117"); AddReferer("swedvdr.org", "swedvdr.org/forums.php?action=viewtopic"); AddReferer("filmtipset.se", "filmtipset.se/forum.cgi?id=1339244"); AddReferer("tvsushi.com", "forum.tvsushi.com/index.php?showtopic=52752"); AddReferer("smogon.com", "smogon.com/forums/showthread.php?t=29171"); AddReferer("mommyconnection.org", "mommyconnection.org/board/index.php/topic,2840.0.html"); AddReferer("calientemamas.com", "calientemamas.com/forum_posts.asp?TID=12136"); AddReferer("forums.britxbox.co.uk", "forums.britxbox.co.uk/viewtopic.php?t=54722"); AddReferer("goonfleet.com", "goonfleet.com/showthread.php?t=77152"); } /*################## TQuizN3::LoadReferers ########################## * Purpose....: Load referers # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ void TQuizN3::LoadReferers() { TQuizRow Row; TReferer *ref; FDataFile.SetPos(0); while (FDataFile.Read(&Row, sizeof(Row))) { if (Row.Gender == 1) UpdateReferer(&MaleRef, Row.AsResult, Row.NtResult, Row.GroupResult); else UpdateReferer(&FemaleRef, Row.AsResult, Row.NtResult, Row.GroupResult); ref = FindReferer(Row.Referer); if (!ref) ref = AddReferer(Row.Referer, Row.Referer); if (ref) UpdateReferer(ref, Row.AsResult, Row.NtResult, Row.GroupResult); if (Row.Aspie == 1) UpdateReferer(&SelfAsRef, Row.AsResult, Row.NtResult, Row.GroupResult); if (Row.Aspie == 2) UpdateReferer(&AsRef, Row.AsResult, Row.NtResult, Row.GroupResult); if (Row.ADHD == 2) UpdateReferer(&AddRef, Row.AsResult, Row.NtResult, Row.GroupResult); if (Row.OCD == 2) UpdateReferer(&OCDRef, Row.AsResult, Row.NtResult, Row.GroupResult); if (Row.Dyslexia == 2) UpdateReferer(&DyslexiaRef, Row.AsResult, Row.NtResult, Row.GroupResult); if (Row.Bipolar == 2) UpdateReferer(&BipolarRef, Row.AsResult, Row.NtResult, Row.GroupResult); if (Row.Social == 2) UpdateReferer(&SocialPhobiaRef, Row.AsResult, Row.NtResult, Row.GroupResult); if (Row.Aspie) { if (Row.Gender == 1) UpdateReferer(&MaleAsRef, Row.AsResult, Row.NtResult, Row.GroupResult); else UpdateReferer(&FemaleAsRef, Row.AsResult, Row.NtResult, Row.GroupResult); } } } /*########################################################################## # # Name : TQuizN3::LoadPopulations # # Purpose....: Load populations # # In params..: * # Out params.: * # Returns....: * # ##########################################################################*/ void TQuizN3::LoadPopulations() { TQuizRow Row; int i; int id; TReferer *ref; char DxArr[DX_COUNT]; char score; int IdArr[MAX_QUESTIONS]; for (i = 0; i < N; i++) { Quiz[i].NoAnswer = 0; IdArr[i] = GetGlobalId(i); } FDataFile.SetPos(0); while (FDataFile.Read(&Row, sizeof(Row))) { BirthMonth.Add(Row.AsResult, Row.NtResult, Row.BirthMonth); // Row.Quiz[182] = Row.Dyslexia + 1; // Row.Quiz[185] = Row.Bipolar + 1; // Row.Quiz[186] = Row.Social + 1; for (i = 0; i < N; i++) { if (Row.Quiz[i] == 0) Quiz[i].NoAnswer++; else { if (i < 182) { score = Row.Quiz[i] - 1; id = IdArr[i]; // DsmAs.Add(Row.Aspie, id, score); // DsmAdd.Add(Row.ADHD, id, score); // DsmDyslexia.Add(Row.Dyslexia, id, score); // DsmBipolar.Add(Row.Bipolar, id, score); // DsmSocialPhobia.Add(Row.Social, id, score); } } } for (i = 0; i < DX_COUNT; i++) DxArr[i] = DX_STATE_UNKNOWN; if (Row.Aspie == 2) DxArr[DX_AS] = DX_STATE_YES; if (Row.Aspie == 1) DxArr[DX_AS] = DX_STATE_SELF; if (Row.Aspie == 0) DxArr[DX_AS] = DX_STATE_NO; if (Row.ADHD == 2) DxArr[DX_ADD] = DX_STATE_YES; if (Row.ADHD == 1) DxArr[DX_ADD] = DX_STATE_SELF; if (Row.ADHD == 0) DxArr[DX_ADD] = DX_STATE_NO; if (Row.OCD == 2) DxArr[DX_OCD] = DX_STATE_YES; if (Row.OCD == 1) DxArr[DX_OCD] = DX_STATE_SELF; if (Row.OCD == 0) DxArr[DX_OCD] = DX_STATE_NO; if (Row.Dyslexia == 2) DxArr[DX_DYSLEXIA] = DX_STATE_YES; if (Row.Dyslexia == 1) DxArr[DX_DYSLEXIA] = DX_STATE_SELF; if (Row.Dyslexia == 0) DxArr[DX_DYSLEXIA] = DX_STATE_NO; if (Row.Bipolar == 2) DxArr[DX_BIPOLAR] = DX_STATE_YES; if (Row.Bipolar == 1) DxArr[DX_BIPOLAR] = DX_STATE_SELF; if (Row.Bipolar == 0) DxArr[DX_BIPOLAR] = DX_STATE_NO; if (Row.Social == 2) DxArr[DX_SOCIAL_PHOBIA] = DX_STATE_YES; if (Row.Social == 1) DxArr[DX_SOCIAL_PHOBIA] = DX_STATE_SELF; if (Row.Social == 0) DxArr[DX_SOCIAL_PHOBIA] = DX_STATE_NO; All.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); if (Row.Aspie) { if (Row.AsResult < Row.NtResult) LowAs.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); if (Row.Gender == 1) { if (Row.BirthYear > 1986) YoungMale.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); AsMale.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); } else { if (Row.BirthYear > 1986) YoungFemale.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); AsFemale.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); } if (Row.Aspie == 2) As.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); if (Row.Aspie == 1) AspieControl.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); } if (Row.ADHD >= 1) { Add.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); if (Row.Gender == 1) AddMale.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); else AddFemale.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); } if (Row.Dyslexia >= 1) Dyslexia.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); if (Row.Bipolar >= 1) Bipolar.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); if (Row.Social >= 1) SocialPhobia.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); if (strlen(Row.Referer) == 0) { Mix.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); if (Row.Gender == 1) MixMale.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); else MixFemale.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); } else { ref = FindReferer(Row.Referer); if (ref && ref->NT) NtControl.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); } if (Row.NtResult - Row.AsResult >= 35) { Nt.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); if (Row.Gender == 1) NtMale.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); else NtFemale.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); } if (Row.AsResult - Row.NtResult >= 35) { Aspie.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); if (Row.Gender == 1) AspieMale.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); else AspieFemale.Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); } } } /*########################################################################## # # Name : TQuizN3::SetupControlGroups # # Purpose....: Setup control-groups # # In params..: * # Out params.: * # Returns....: * # ##########################################################################*/ void TQuizN3::SetupControlGroups() { DefineNt("flashback.info"); DefineNt("rdos.net/sv"); DefineNt("circvsmaximvs.com"); DefineNt("panterachat.com"); DefineNt("kaytastrophe.com"); DefineNt("tbg.nu"); DefineNt("vof.se"); DefineNt("nordisk.nu"); DefineNt("swedvdr.org"); DefineNt("filmtipset.se"); DefineNt("tvsushi.com"); DefineNt("smogon.com"); DefineNt("mommyconnection.org"); DefineNt("calientemamas.com"); DefineNt("forums.britxbox.co.uk"); DefineNt("goonfleet.com"); DefineAspie("wrongplanet.net"); DefineAspie("livejournal.com/community/asperger"); DefineAspie("aspiesforfreedom."); DefineAspie("aspergianisland.com"); DefineAspie("assupportgrouponline.co.uk"); DefineAspie("neurodiversity.com/diagnostic_instruments.html"); } /*########################################################################## # # Name : TQuizN3::SetupCross # # Purpose....: Setup cross-references # # In params..: * # Out params.: * # Returns....: * # ##########################################################################*/ void TQuizN3::SetupCross(TQuiz *QuizI, TQuiz *QuizII, TQuiz *QuizIII, TQuiz *QuizNd, TQuiz *Quiz5, TQuiz *Quiz6, TQuiz *Quiz7, TQuiz *Quiz8, TQuiz *Quiz9, TQuiz *QuizR1, TQuiz *QuizR2, TQuiz *QuizR3, TQuiz *QuizR4, TQuiz *QuizR5, TQuiz *QuizR6, TQuiz *QuizR7, TQuiz *QuizS1, TQuiz *QuizS2, TQuiz *QuizS3, TQuiz *QuizS4, TQuiz *QuizS5, TQuiz *QuizS6, TQuiz *QuizS7, TQuiz *QuizS8, TQuiz *QuizS9, TQuiz *QuizS10, TQuiz *QuizS11, TQuiz *QuizS12, TQuiz *QuizN1, TQuiz *QuizN2) { DefineCross(QuizN2, 0, 0); DefineCross(QuizN2, 1, 1); DefineCross(QuizN2, 2, 2); DefineCross(QuizN2, 3, 4); DefineCross(QuizN2, 4, 5); DefineCross(QuizN2, 5, 6); DefineCross(QuizN2, 6, 7); DefineCross(QuizN2, 7, 8); DefineCross(QuizN2, 8, 9); DefineCross(QuizN2, 9, 10); DefineCross(QuizN2, 10, 11); DefineCross(QuizN2, 11, 13); DefineCross(QuizN2, 12, 12); DefineCross(QuizN2, 13, 14); DefineCross(QuizN2, 14, 15); DefineCross(QuizN2, 15, 16); DefineCross(QuizN2, 16, 17); DefineCross(QuizN2, 17, 20); DefineCross(QuizN2, 18, 21); DefineCross(QuizN2, 19, 22); DefineCross(QuizN2, 20, 23); DefineCross(QuizN2, 21, 24); DefineCross(QuizN2, 22, 26); DefineCross(QuizN2, 23, 25); DefineCross(QuizN2, 24, 27); DefineCross(QuizN2, 25, 28); DefineCross(QuizN2, 26, 30); DefineCross(QuizN2, 27, 31); DefineCross(QuizN2, 28, 32); DefineCross(QuizN2, 29, 33); DefineCross(QuizN2, 30, 34); DefineCross(QuizN2, 31, 35); DefineCross(QuizN2, 32, 36); DefineCross(QuizN2, 33, 37); DefineCross(QuizN2, 34, 39); DefineCross(QuizN2, 35, 40); DefineCross(QuizN2, 36, 41); DefineCross(QuizN2, 37, 42); DefineCross(QuizN2, 38, 43); DefineCross(QuizN2, 39, 45); DefineCross(QuizN2, 40, 44); DefineCross(QuizN2, 41, 46); DefineCross(QuizN2, 42, 47); DefineCross(QuizN2, 43, 48); DefineCross(QuizN2, 44, 49); DefineCross(QuizN2, 45, 51); DefineCross(QuizN2, 46, 53); DefineCross(QuizN2, 47, 54); DefineCross(QuizN2, 48, 55); DefineCross(QuizN2, 49, 59); DefineCross(QuizN2, 50, 60); DefineCross(QuizN2, 51, 61); DefineCross(QuizN2, 52, 62); DefineCross(QuizN2, 53, 63); DefineCross(QuizN2, 54, 64); DefineCross(QuizN2, 55, 65); DefineCross(QuizN2, 56, 66); DefineCross(QuizN2, 57, 67); DefineCross(QuizN2, 58, 68); DefineCross(QuizN2, 59, 69); DefineCross(QuizN2, 60, 70); DefineCross(QuizN2, 61, 71); DefineCross(QuizN2, 62, 72); DefineCross(QuizN2, 63, 73); DefineCross(QuizN2, 64, 74); DefineCross(QuizN2, 65, 75); DefineCross(QuizN2, 66, 76); DefineCross(QuizN2, 67, 77); DefineCross(QuizN2, 68, 78); DefineCross(QuizN2, 69, 79); DefineCross(QuizN2, 70, 80); DefineCross(QuizN2, 71, 81); DefineCross(QuizN2, 72, 82); DefineCross(QuizN2, 73, 83); DefineCross(QuizN2, 74, 84); DefineCross(QuizN2, 75, 85); DefineCross(QuizN2, 76, 139); DefineCross(QuizN2, 77, 86); DefineCross(QuizN2, 78, 87); DefineCross(QuizN2, 79, 88); DefineCross(QuizN2, 80, 89); DefineCross(QuizN2, 81, 91); DefineCross(QuizN2, 82, 90); DefineCross(QuizN2, 83, 3); DefineCross(QuizN2, 84, 92); DefineCross(QuizN2, 85, 93); DefineCross(QuizN2, 86, 94); DefineCross(QuizN2, 87, 52); DefineCross(QuizN2, 88, 97); DefineCross(QuizN2, 89, 98); DefineCross(QuizN2, 90, 100); DefineCross(QuizN2, 91, 101); DefineCross(QuizN2, 92, 102); DefineCross(QuizN2, 93, 103); DefineCross(QuizN2, 94, 104); DefineCross(QuizN2, 95, 105); DefineCross(QuizN2, 96, 106); DefineCross(QuizN2, 97, 107); DefineCross(QuizN2, 98, 108); DefineCross(QuizN2, 99, 109); DefineCross(QuizN2, 100, 111); DefineCross(QuizN2, 101, 112); DefineCross(QuizN2, 102, 114); DefineCross(QuizN2, 103, 115); DefineCross(QuizN2, 104, 116); DefineCross(QuizN2, 105, 117); DefineCross(QuizN2, 106, 119); DefineCross(QuizN2, 107, 118); DefineCross(QuizN2, 108, 120); DefineCross(QuizN2, 109, 121); DefineCross(QuizN2, 110, 122); DefineCross(QuizN2, 111, 123); DefineCross(QuizN2, 112, 125); DefineCross(QuizN2, 113, 126); DefineCross(QuizN2, 114, 127); DefineCross(QuizN2, 115, 128); DefineCross(QuizN2, 116, 129); DefineCross(QuizN2, 117, 130); DefineCross(QuizN2, 118, 131); DefineCross(QuizN2, 119, 132); DefineCross(QuizN2, 120, 133); DefineCross(QuizN2, 121, 134); DefineCross(QuizN2, 122, 135); DefineCross(QuizN2, 123, 136); DefineCross(QuizN2, 124, 137); DefineCross(QuizN2, 125, 38); DefineCross(QuizN2, 126, 138); DefineCross(QuizN2, 127, 140); DefineCross(QuizN2, 128, 141); DefineCross(QuizN2, 129, 142); DefineCross(QuizN2, 130, 143); DefineCross(QuizN2, 131, 144); DefineCross(QuizN2, 132, 145); DefineCross(QuizN2, 133, 146); DefineCross(QuizN2, 134, 147); DefineCross(QuizN2, 135, 149); DefineCross(QuizN2, 136, 150); DefineCross(QuizN2, 137, 151); DefineCross(QuizN2, 138, 152); DefineCross(QuizN2, 139, 153); DefineCross(QuizN2, 140, 154); DefineCross(QuizN2, 141, 155); DefineCross(QuizN2, 142, 95); DefineCross(QuizN2, 143, 99); DefineCross(QuizN2, 144, 158); DefineGlobalId(145, 1178); DefineGlobalId(146, 1179); DefineGlobalId(147, 1180); DefineGlobalId(148, 1181); DefineGlobalId(149, 1182); DefineGlobalId(150, 1183); DefineGlobalId(151, 1184); DefineGlobalId(152, 1185); DefineGlobalId(153, 1186); DefineGlobalId(154, 1187); DefineGlobalId(155, 1188); DefineGlobalId(156, 1189); DefineGlobalId(157, 1190); DefineGlobalId(158, 1191); DefineGlobalId(159, 1192); DefineGlobalId(160, 1193); DefineGlobalId(161, 1194); DefineGlobalId(162, 1195); DefineGlobalId(163, 1196); DefineGlobalId(164, 1197); DefineGlobalId(165, 1198); DefineGlobalId(166, 1199); DefineGlobalId(167, 1200); DefineGlobalId(168, 1201); DefineGlobalId(169, 1202); DefineGlobalId(170, 1203); DefineGlobalId(171, 1204); DefineGlobalId(172, 1205); } /*########################################################################## # # Name : TQuizN3::GetReferer # # Purpose....: Get referer population # # In params..: * # Out params.: * # Returns....: * # ##########################################################################*/ void TQuizN3::GetReferer(const char *referer, TPopulation *pop) { int i; TReferer *ref; TQuizRow Row; char DxArr[DX_COUNT]; for (i = 0; i < DX_COUNT; i++) DxArr[DX_COUNT] = DX_STATE_UNKNOWN; for (i = 0; i < RefCount; i++) { ref = RefArr[i]; if (ref->IsMatch(referer)) break; } FDataFile.SetPos(0); while (FDataFile.Read(&Row, sizeof(Row))) if (ref->IsMatch(Row.Referer)) pop->Add(Row.AsResult, Row.NtResult, DxArr, Row.Gender, Row.Quiz, Row.GroupResult, Row.DxResult); } /*################## IsPca ########################## * Purpose....: Check quiz row against pca-type # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ static int IsPca(TQuizRow *row, int PcaType) { switch (PcaType) { case PCA_TYPE_ALL: case PCA_TYPE_MIXED: return TRUE; case PCA_TYPE_MALE: if (row->Gender == 1) return TRUE; else return FALSE; case PCA_TYPE_FEMALE: if (row->Gender == 2) return TRUE; else return FALSE; case PCA_TYPE_YOUNG: if (row->BirthYear >= 1975) return TRUE; else return FALSE; case PCA_TYPE_OLD: if (row->BirthYear < 1975) return TRUE; else return FALSE; case PCA_TYPE_AS: if (row->Aspie == 2) return TRUE; else return FALSE; } return FALSE; } /*################## TQuizN3::ExportExcelCases ########################## * Purpose....: Export cases as excel-data. Make ? into 'NO' case # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ void TQuizN3::ExportExcelCase(const char *filename, int PcaType) { TQuizRow Row; int i; int ival; char str[80]; TFile file(filename, 0); file.Write("\"\", "); file.Write("\"\", "); for (i = 0; i < GetQuizN(); i++) { if (PcaType != PCA_TYPE_MIXED || Quiz[i].MyGroup == GROUP_MIXED) { file.Write("\""); // strncpy(str, Quiz[i].Text, 35); // str[35] = 0; sprintf(str, "#%d", i + 1); file.Write(str); file.Write("\""); if (i != N - 1) file.Write(", "); } } file.Write("\n"); FDataFile.SetPos(0); while (FDataFile.Read(&Row, sizeof(Row))) { if (IsPca(&Row, PcaType)) { sprintf(str, "\"%d\", ", Row.AsResult); file.Write(str); sprintf(str, "\"%d\", ", Row.NtResult); file.Write(str); for (i = 0; i < GetQuizN(); i++) { if (PcaType != PCA_TYPE_MIXED || Quiz[i].MyGroup == GROUP_MIXED) { ival = Row.Quiz[i]; if (ival) ival--; if (ival > 2) ival = 0; sprintf(str, "%d", ival); file.Write(str); if (i != GetQuizN() - 1) file.Write(", "); } } file.Write("\n"); } } } /*################## TQuizN3::ExportExcelAspie ########################## * Purpose....: Export cases as excel-data. Invert NT questions # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ void TQuizN3::ExportExcelAspie(const char *filename) { TQuizRow Row; int i; int ival; char str[80]; TFile file(filename, 0); file.Write("\"\", "); file.Write("\"\", "); for (i = 0; i < N; i++) { file.Write("\""); sprintf(str, "#%d", i + 1); file.Write(str); file.Write("\""); if (i != N - 1) file.Write(", "); } file.Write("\n"); FDataFile.SetPos(0); while (FDataFile.Read(&Row, sizeof(Row))) { if (Row.Quiz[147]) { sprintf(str, "\"%d\", ", Row.AsResult); file.Write(str); sprintf(str, "\"%d\", ", Row.NtResult); file.Write(str); for (i = 0; i < N; i++) { ival = Row.Quiz[i]; if (ival) { if (Quiz[i].Reverse) ival = GetCatCount(i) - ival; else ival--; } if (ival >= GetCatCount(i)) ival = 0; sprintf(str, "%d", ival); file.Write(str); if (i != N - 1) file.Write(", "); } file.Write("\n"); } } } /*################## TQuizN3::ExportExcelGroups ########################## * Purpose....: Export group cases in excel format # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ void TQuizN3::ExportExcelGroups(const char *filename) { TQuizRow Row; int i; int ival; int group; int ok; char str[80]; TFile file(filename, 0); int GroupSum[GROUP_COUNT]; int GroupCount[GROUP_COUNT]; file.Write("\"\", "); file.Write("\"\", "); for (i = 0; i < GROUP_COUNT; i++) { file.Write("\""); strncpy(str, Group[i].PosName, 35); str[35] = 0; // sprintf(str, "#%d", i + 1); file.Write(str); file.Write("\""); if (i != GROUP_COUNT - 1) file.Write(", "); } file.Write("\n"); FDataFile.SetPos(0); while (FDataFile.Read(&Row, sizeof(Row))) { for (i = 0; i < GROUP_COUNT; i++) { GroupSum[i] = 0; GroupCount[i] = 0; } for (i = 0; i < GetQuizN(); i++) { ival = Row.Quiz[i]; if (ival) { if (Quiz[i].Reverse) ival = 3 - ival; else ival--; group = Quiz[i].MyGroup; GroupSum[group] += ival; GroupCount[group]++; } } ok = TRUE; for (i = 0; i < GROUP_COUNT; i++) if (GroupCount[i] == 0) ok = FALSE; if (ok) { sprintf(str, "\%d\", ", Row.AsResult); file.Write(str); sprintf(str, "\"%d\", ", Row.NtResult); file.Write(str); for (i = 0; i < GROUP_COUNT; i++) { ival = round(100.0 * (long double)GroupSum[i] / (long double)GroupCount[i]); sprintf(str, "\"%d\"", ival); file.Write(str); if (i != GROUP_COUNT - 1) file.Write(", "); } file.Write("\n"); } } } /*################## TQuizN3::ImportMvsp ########################## * Purpose....: Import MVSP loadings # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ void TQuizN3::ImportMvsp(const char *filename, int PcaType) { char buf[MAX_IN_ROW]; int size; char *rowstr; char *ptr; long pos = 0; int i; long double d1, d2, d3, d4; int q; int count; TFile infile(filename); while (size = infile.Read(buf, MAX_IN_ROW)) { buf[size] = 0; rowstr = strstr(buf, "#"); if (rowstr) { rowstr++; ptr = strstr(rowstr, "\r"); if (ptr) *ptr = 0; else rowstr = 0; } pos += strlen(buf) + 1; infile.SetPos(pos); if (rowstr) { for (i = 0; i < strlen(rowstr); i++) { switch (rowstr[i]) { case ',': rowstr[i] = '.'; break; case 0x9: case 0xd: rowstr[i] = ' '; break; } } if (sscanf(rowstr, "%d %Lf %Lf %Lf %Lf", &q, &d1, &d2, &d3, &d4) == 5) { if (PcaType != PCA_TYPE_MIXED) { if (PcaType == PCA_TYPE_FEMALE) d2 = -d2; if (PcaType == PCA_TYPE_ALL) d3 = -d3; // if (PcaType == PCA_TYPE_ALL) // d4 = -d4; // if (d1 > 0 && d2 > 0) // { // if (d1 > d2) // { // d1 = d1 - d2; // d2 = 0; // } // else // { // d2 = d2 - d1; // d1 = 0; // } // } } switch (PcaType) { case PCA_TYPE_ALL: Quiz[q - 1].Pca[0] = d1; Quiz[q - 1].Pca[1] = d2; Quiz[q - 1].Pca[2] = d3; Quiz[q - 1].Pca[3] = d4; break; case PCA_TYPE_MALE: Quiz[q - 1].MalePca[0] = d1; Quiz[q - 1].MalePca[1] = d2; Quiz[q - 1].MalePca[2] = d3; Quiz[q - 1].MalePca[3] = d4; break; case PCA_TYPE_FEMALE: Quiz[q - 1].FemalePca[0] = d1; Quiz[q - 1].FemalePca[1] = d2; Quiz[q - 1].FemalePca[2] = d3; Quiz[q - 1].FemalePca[3] = d4; break; case PCA_TYPE_YOUNG: Quiz[q - 1].YoungPca[0] = d1; Quiz[q - 1].YoungPca[1] = d2; Quiz[q - 1].YoungPca[2] = d3; Quiz[q - 1].YoungPca[3] = d4; break; case PCA_TYPE_OLD: Quiz[q - 1].OldPca[0] = d1; Quiz[q - 1].OldPca[1] = d2; Quiz[q - 1].OldPca[2] = d3; Quiz[q - 1].OldPca[3] = d4; break; case PCA_TYPE_ASIA: Quiz[q - 1].AsiaPca[0] = d1; Quiz[q - 1].AsiaPca[1] = d2; Quiz[q - 1].AsiaPca[2] = d3; Quiz[q - 1].AsiaPca[3] = d4; break; case PCA_TYPE_AS: Quiz[q - 1].AsPca[0] = d1; Quiz[q - 1].AsPca[1] = d2; Quiz[q - 1].AsPca[2] = d3; Quiz[q - 1].AsPca[3] = d4; break; case PCA_TYPE_MIXED: Quiz[q - 1].MixedPca[0] = d1; Quiz[q - 1].MixedPca[1] = d2; Quiz[q - 1].MixedPca[2] = d3; Quiz[q - 1].MixedPca[3] = d4; break; } } } } } /*################## TQuizN3::WriteEat ########################## * Purpose....: Write eating disorder test report # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ void TQuizN3::WriteEat(const char *filename) { int Count; long double AsSum; long double NtSum; long double DiffSum; long double EatSum; long double AsMean; long double NtMean; long double DiffMean; long double EatMean; long double AsSd; long double NtSd; long double DiffSd; long double EatSd; long double AsCorr; long double NtCorr; long double DiffCorr; long double val; long double zx; long double zy; TQuizRow Row; int i; int ival; char str[80]; Count = 0; AsSum = 0; NtSum = 0; EatSum = 0; DiffSum = 0; FDataFile.SetPos(0); while (FDataFile.Read(&Row, sizeof(Row))) { if (Row.EatResult) { Count++; AsSum += Row.AsResult; NtSum += Row.NtResult; DiffSum += Row.AsResult - Row.NtResult; EatSum += Row.EatResult; } } AsMean = AsSum / Count; NtMean = NtSum / Count; DiffMean = DiffSum / Count; EatMean = EatSum / Count; AsSum = 0; NtSum = 0; EatSum = 0; DiffSum = 0; FDataFile.SetPos(0); while (FDataFile.Read(&Row, sizeof(Row))) { if (Row.EatResult) { val = (long double)Row.AsResult - AsMean; AsSum += val * val; val = (long double)Row.NtResult - NtMean; NtSum += val * val; val = (long double)(Row.AsResult - Row.NtResult) - DiffMean; DiffSum += val * val; val = (long double)Row.EatResult - EatMean; EatSum += val * val; } } AsSd = sqrt(AsSum / (Count - 1)); NtSd = sqrt(NtSum / (Count - 1)); DiffSd = sqrt(DiffSum / (Count - 1)); EatSd = sqrt(EatSum / (Count - 1)); AsSum = 0; NtSum = 0; DiffSum = 0; FDataFile.SetPos(0); while (FDataFile.Read(&Row, sizeof(Row))) { if (Row.EatResult) { zx = ((long double)Row.EatResult - EatMean) / EatSd; zy = ((long double)Row.AsResult - AsMean) / AsSd; AsSum += zx * zy; zy = ((long double)Row.NtResult - NtMean) / NtSd; NtSum += zx * zy; zy = ((long double)(Row.AsResult - Row.NtResult) - DiffMean) / DiffSd; DiffSum += zx * zy; } } AsCorr = AsSum / (Count - 1); NtCorr = NtSum / (Count - 1); DiffCorr = DiffSum / (Count - 1); printf("Mean Aspie score: %5.1Lf, SD: %5.1Lf\r\n", AsMean, AsSd); printf("Mean NT score: %5.1Lf, SD: %5.1Lf\r\n", NtMean, NtSd); printf("Mean score diff: %5.1Lf, SD: %5.1Lf\r\n", DiffMean, DiffSd); printf("Mean EAT-26 score: %5.1Lf, SD: %5.1Lf\r\n", EatMean, EatSd); printf("EAT - Aspie score correlation: %5.2Lf\r\n", AsCorr); printf("EAT - NT score correlation: %5.2Lf\r\n", NtCorr); printf("EAT - score diff correlation: %5.2Lf\r\n", DiffCorr); } /*################## round ########################## * Purpose....: round long double to int # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ int round(long double val) { return (int)(val + 0.5); } /*################## WriteCenteredFieldHeader ########################## * Purpose....: Write centered field header for table # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ void WriteCenteredFieldHeader(TFile &File, int RelWidth) { char str[80]; sprintf(str, "\n\n", RelWidth); File.Write(str); File.Write("

\n"); File.Write("\n"); } /*################## WriteFieldFooter ########################## * Purpose....: Write field footer for table # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ void WriteFieldFooter(TFile &File) { File.Write("\n\n"); File.Write("

\n"); File.Write("\n"); } /*################## TRace::TRace ########################## * Purpose....: Initialize TRace # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ TRace::TRace() { int i; for (i = 0; i < 10; i++) { UsCount[i] = 0; UsAsCount[i] = 0; NonUsCount[i] = 0; NonUsAsCount[i] = 0; } } /*################## TRace::Add ########################## * Purpose....: Add an answer # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ void TRace::Add(TQuizRow *Row) { int index = -1; int diff = Row->AsResult - Row->NtResult; if (Row->Country == 7302) { if (Row->Ancestry == 3) index = 0; // american indian if (Row->Ancestry == 5) index = 1; if (Row->Ancestry == 6) index = 2; // hispanic if (Row->Ancestry >= 1000 && Row->Ancestry < 2000) index = 1; if ((Row->Ancestry >= 2000 && Row->Ancestry < 3000) || Row->Ancestry == 3205) index = 3; // white if (Row->Ancestry >= 3000 && Row->Ancestry < 4000 && Row->Ancestry != 3205) index = 4; // arab if (Row->Ancestry >= 4000) index = 5; // asian if (index >= 0) { UsCount[index]++; if (diff >= 35) UsAsCount[index]++; } } else { if (Row->Ancestry == 3) // && Row->Hair >= 6 && Row->Eye >= 5) index = 0; // american indian if (Row->Ancestry == 5) index = 1; // african american if (Row->Ancestry == 6) index = 2; // hispanic if (Row->Ancestry >= 1000 && Row->Ancestry < 2000) index = 3; // black african if ((Row->Ancestry >= 2000 && Row->Ancestry < 3000) || Row->Ancestry == 3205) index = 4; // white if (Row->Ancestry >= 3000 && Row->Ancestry < 4000 && Row->Ancestry != 3205) index = 5; // arab if (Row->Ancestry >= 4000) index = 6; // asian if (index >= 0) { NonUsCount[index]++; if (diff >= 35) NonUsAsCount[index]++; } } } /*################## TRace::WriteHeader ########################## * Purpose....: Write header in table # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ void TRace::WriteHeader(TFile &file) { file.Write(""); WriteCenteredFieldHeader(file, 25); file.Write("Race"); WriteFieldFooter(file); WriteCenteredFieldHeader(file, 12); file.Write("All"); WriteFieldFooter(file); WriteCenteredFieldHeader(file, 12); file.Write("Aspie"); WriteFieldFooter(file); WriteCenteredFieldHeader(file, 12); file.Write("Interest"); WriteFieldFooter(file); WriteCenteredFieldHeader(file, 12); file.Write("AS proportion"); WriteFieldFooter(file); file.Write(""); } /*################## TRace::WriteEntry ########################## * Purpose....: Write entry in table # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ void TRace::WriteEntry(TFile &file, int val, int count) { char str[80]; long double dev; long double sd; long double mean; long double r; long double rsum; int ival; WriteCenteredFieldHeader(file, 12); #ifdef CI mean = (long double)val / (long double)count; r = 1.0 - mean; rsum = (long double)val * r * r; r = -mean; rsum += (long double)(count - val) * r * r; if (count > 1 && val) { sd = sqrt(rsum / ((long double)count - 1)); dev = 1.96 * sd / sqrt(count); r = mean - dev; if (r < 0.0) r = 0.0; ival = round(1000.0 * r); sprintf(str, "%d.%01d", ival / 10, ival % 10); file.Write(str); r = mean + dev; if (r > 1.0) r = 1.0; ival = round(1000.0 * r); sprintf(str, "-%d.%01d%", ival / 10, ival % 10); file.Write(str); } else file.Write("---"); #else ival = val * 1000 / count; sprintf(str, "%d.%01d%", ival / 10, ival % 10); file.Write(str); #endif WriteFieldFooter(file); } /*################## TRace::WriteUsRow ########################## * Purpose....: Write row in table # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ void TRace::WriteUsRow(TFile &file, int index, const char *text) { char str[80]; int sum; int i; file.Write(""); WriteCenteredFieldHeader(file, 25); file.Write(text); WriteFieldFooter(file); WriteCenteredFieldHeader(file, 12); sprintf(str, "%d", UsCount[index]); file.Write(str); WriteFieldFooter(file); WriteCenteredFieldHeader(file, 12); sprintf(str, "%d", UsAsCount[index]); file.Write(str); WriteFieldFooter(file); sum = 0; for (i = 0; i < 10; i++) sum += UsCount[i]; if (sum) { WriteEntry(file, UsCount[index], sum); if (UsCount[index]) WriteEntry(file, UsAsCount[index], UsCount[index]); } else file.Write("---"); file.Write(""); } /*################## TRace::WriteNonUsRow ########################## * Purpose....: Write row in table # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ void TRace::WriteNonUsRow(TFile &file, int index, const char *text) { char str[80]; int sum; int i; file.Write(""); WriteCenteredFieldHeader(file, 25); file.Write(text); WriteFieldFooter(file); WriteCenteredFieldHeader(file, 12); sprintf(str, "%d", NonUsCount[index]); file.Write(str); WriteFieldFooter(file); WriteCenteredFieldHeader(file, 12); sprintf(str, "%d", NonUsAsCount[index]); file.Write(str); WriteFieldFooter(file); sum = 0; for (i = 0; i < 10; i++) sum += NonUsCount[i]; if (sum) { WriteEntry(file, NonUsCount[index], sum); if (NonUsCount[index]) WriteEntry(file, NonUsAsCount[index], NonUsCount[index]); } else file.Write("---"); file.Write(""); } /*################## TQuizN3::WriteRace ########################## * Purpose....: Write race report # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ void TQuizN3::WriteRace(const char *filename) { TQuizRow Row; int i; int ival; char str[80]; TFile file(filename, 0); TRace race; FDataFile.SetPos(0); while (FDataFile.Read(&Row, sizeof(Row))) race.Add(&Row); file.Write("

US population

"); file.Write(""); TRace::WriteHeader(file); race.WriteUsRow(file, 0, "Native American"); race.WriteUsRow(file, 1, "Black African"); race.WriteUsRow(file, 2, "Hispanic"); race.WriteUsRow(file, 3, "Caucasian"); race.WriteUsRow(file, 4, "Arab"); race.WriteUsRow(file, 5, "Asian"); file.Write("
"); file.Write("

"); file.Write("

Non-US population

"); file.Write(""); TRace::WriteHeader(file); race.WriteNonUsRow(file, 0, "Native American"); race.WriteNonUsRow(file, 1, "African American"); race.WriteNonUsRow(file, 2, "Hispanic"); race.WriteNonUsRow(file, 3, "African"); race.WriteNonUsRow(file, 4, "Caucasian"); race.WriteNonUsRow(file, 5, "Arab"); race.WriteNonUsRow(file, 6, "Asian"); file.Write("
"); } /*################## TQuizN3::WriteRetest ########################## * Purpose....: Write retest report # * In params..: * # * Out params.: * # * Returns....: * # * Created....: 96-11-20 le # *##########################################################################*/ void TQuizN3::WriteRetest(const char *filename) { TQuizRow Row; int userid; int i; int index; int birthyear; int birthmonth; int gender; long double val; long double AsSum; long double NtSum; long double AsMean; long double NtMean; long double QMean[147]; long double AsSd; long double NtSd; long double QSd[147]; long double AsTot; long double NtTot; int AsCount; int NtCount; long double QTot[147]; int QCount[147]; long double sd; int AsArr[20]; int NtArr[20]; int q; int count; long double sum; int QArr[14][20]; int ok; char str[80]; TFile file(filename, 0); for (userid = 0; userid < MAX_USERS; userid++) UserInfo[userid] = 0; FDataFile.SetPos(0); while (FDataFile.Read(&Row, sizeof(Row))) { userid = Row.userid; if (userid) { if (UserInfo[userid] == 0) { UserInfo[userid] = new TUserInfo; UserInfo[userid]->Count = 1; UserInfo[userid]->BirthYear = Row.BirthYear; UserInfo[userid]->BirthMonth = Row.BirthMonth; UserInfo[userid]->AsSum = Row.AsResult; UserInfo[userid]->NtSum = Row.NtResult; } else UserInfo[userid]->Count++; } } AsCount = 0; NtCount = 0; AsTot = 0; NtTot = 0; for (q = 0; q < 147; q++) { QTot[q] = 0; QCount[q] = 0; } for (userid = 1; userid < MAX_USERS; userid++) { if (UserInfo[userid]) { if (UserInfo[userid]->Count > 1) { for (i = 0; i < 20; i++) { AsArr[i] = 0; NtArr[i] = 0; for (q = 0; q < 14; q++) QArr[q][i] = 0; } index = 0; FDataFile.SetPos(0); while (FDataFile.Read(&Row, sizeof(Row))) { if (Row.userid == userid) { ok = FALSE; if (index == 0) { birthyear = Row.BirthYear; birthmonth = Row.BirthMonth; gender = Row.Gender; ok = TRUE; UserInfo[userid]->Count = 1; UserInfo[userid]->BirthYear = Row.BirthYear; UserInfo[userid]->BirthMonth = Row.BirthMonth; UserInfo[userid]->AsSum = Row.AsResult; UserInfo[userid]->NtSum = Row.NtResult; } else { if ( birthyear == Row.BirthYear && birthmonth == Row.BirthMonth && gender == Row.Gender) { ok = TRUE; UserInfo[userid]->Count++; UserInfo[userid]->AsSum += Row.AsResult; UserInfo[userid]->NtSum += Row.NtResult; } } if (ok) { AsArr[index] = Row.AsResult; NtArr[index] = Row.NtResult; for (q = 0; q < 14; q++) QArr[q][index] = Row.Quiz[q]; index++; } } } if (index > 1) { AsSum = 0; NtSum = 0; for (i = 0; i < index; i++) { AsSum += AsArr[i]; NtSum += NtArr[i]; } AsMean = AsSum / index; NtMean = NtSum / index; for (q = 0; q < 147; q++) { count = 0; sum = 0; for (i = 0; i < index; i++) { if (QArr[q][i]) { sum += QArr[q][i] - 1; count++; } } if (count) QMean[q] = sum / count; else QMean[q] = 0; } AsSum = 0; NtSum = 0; for (i = 0; i < index; i++) { val = AsArr[i] - AsMean; AsSum += val * val; val = NtArr[i] - NtMean; NtSum += val * val; } AsSd = sqrt(AsSum / index); NtSd = sqrt(NtSum / index); for (q = 0; q < 147; q++) { count = 0; sum = 0; for (i = 0; i < index; i++) { if (QArr[q][i]) { val = QArr[q][i] - 1 - QMean[q]; sum += val * val; count++; } } if (count) { QSd[q] = sqrt(sum / count); QTot[q] += QSd[q]; QCount[q]++; } else QSd[q] = 0; } AsTot += AsSd; AsCount++; NtTot += NtSd; NtCount++; // sprintf(str, "Userid: %d, AS: %5.1Lf (%5.1Lf), NT: %5.1Lf (%5.1Lf)
", userid, AsMean, AsSd, NtMean, NtSd); // file.Write(str); // // for (q = 0; q < 135; q++) // { // if (QSd[q] > 0.1) // { // sprintf(str, "#%d, Sd = %5.1Lf
", q, QSd[q]); // file.Write(str); // } // } } } } } AsSd = AsTot / AsCount; NtSd = NtTot / NtCount; #ifdef ENGLISH file.Write("

Retest result

\n"); #endif #ifdef SWEDISH file.Write("

Omtestnings resultat

\n"); #endif #ifdef ENGLISH sprintf(str, "Population size: %d", AsCount); #endif #ifdef SWEDISH sprintf(str, "Populationsstorlek: %d", AsCount); #endif file.Write(str); file.Write("

"); #ifdef ENGLISH sprintf(str, "AS score standard deviation: %2.1Lf", AsSd); #endif #ifdef SWEDISH sprintf(str, "AS poäng standardavvikelse: %2.1Lf", AsSd); #endif file.Write(str); file.Write("
"); #ifdef ENGLISH sprintf(str, "NT score standard deviation: %2.1Lf", NtSd); #endif #ifdef SWEDISH sprintf(str, "NT poäng standardavvikelse: %2.1Lf", NtSd); #endif file.Write(str); file.Write("

"); }