Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2003
    Location
    Dublin, Ireland
    Posts
    87

    Grin Trying to get a basic questions and answers bit on a page....

    But it's not adding up the correct answers, not sure if I'm doing it right, have set the %Questions1Result% to 0 and then a load of if statements saying that if the EditField1 = 1 then %Questions1Result%=+1

    When I total up the results (ie: when you click the button at the end and it goes through all these if statements) it still returns on the message box that the %Questions1Result%=0 (or default or whatever text I use to declare the %Questions1Result% at the beginning....

    Anyone have any ideas?

    Below is a copy of what I have in the actions box....

    Thank you


    <IR_ACTIONS_LIST>
    <Action name="Set Value">
    <Type>6</Type>
    <Function>0</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Variable>%Questions1Result%</Variable>
    <Value>0</Value>
    <Evaluate>0</Evaluate>
    </Action>
    <Action name="Blank Line">
    <Type>203</Type>
    <Function>2</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>EditField1=1</Condition>
    </Action>
    <Action name="Set Value">
    <Type>6</Type>
    <Function>0</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Variable>%Questions1Result%</Variable>
    <Value>%Questions1Result%+1</Value>
    <Evaluate>0</Evaluate>
    </Action>
    <Action name="END IF">
    <Type>201</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Blank Line">
    <Type>203</Type>
    <Function>2</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>EditField2=1</Condition>
    </Action>
    <Action name="Set Value">
    <Type>6</Type>
    <Function>0</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Variable>%Questions1Result%</Variable>
    <Value>%Questions1Result%+1</Value>
    <Evaluate>0</Evaluate>
    </Action>
    <Action name="END IF">
    <Type>201</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Blank Line">
    <Type>203</Type>
    <Function>2</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>EditField3=1</Condition>
    </Action>
    <Action name="Set Value">
    <Type>6</Type>
    <Function>0</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Variable>%Questions1Result%</Variable>
    <Value>%Questions1Result%+1</Value>
    <Evaluate>0</Evaluate>
    </Action>
    <Action name="END IF">
    <Type>201</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Blank Line">
    <Type>203</Type>
    <Function>2</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>EditField4=1</Condition>
    </Action>
    <Action name="Set Value">
    <Type>6</Type>
    <Function>0</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Variable>%Questions1Result%</Variable>
    <Value>%Questions1Result%+1</Value>
    <Evaluate>0</Evaluate>
    </Action>
    <Action name="END IF">
    <Type>201</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Blank Line">
    <Type>203</Type>
    <Function>2</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>EditField5=1</Condition>
    </Action>
    <Action name="Set Value">
    <Type>6</Type>
    <Function>0</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Variable>%Questions1Result%</Variable>
    <Value>%Questions1Result%+1</Value>
    <Evaluate>0</Evaluate>
    </Action>
    <Action name="END IF">
    <Type>201</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Blank Line">
    <Type>203</Type>
    <Function>2</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>EditField6=1</Condition>
    </Action>
    <Action name="Set Value">
    <Type>6</Type>
    <Function>0</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Variable>%Questions1Result%</Variable>
    <Value>%Questions1Result%+1</Value>
    <Evaluate>0</Evaluate>
    </Action>
    <Action name="END IF">
    <Type>201</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Message Box">
    <Type>5</Type>
    <Function>0</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <DialogTitle>Score</DialogTitle>
    <DialogMessage>Your Score Is %Questions1Result%</DialogMessage>
    <Icon>3</Icon>
    <Variable>%Result%</Variable>
    <DialogType>0</DialogType>
    <DefaultButton>0</DefaultButton>
    </Action>
    </IR_ACTIONS_LIST>


    Just previewed the post, sorry guys there's a LOT of stuff there, but I can't get it to appear as it appears in the text box....
    If you can read this, i have yet to write a witty and imaginative signature.... sorry...

  2. #2
    Join Date
    May 2001
    Location
    51.531249 | -0.610962
    Posts
    1,244

    Re: Trying to get a basic questions and answers bit on a page....

    Hi

    The problem is: you're not getting the text from the EditField Object. You need to add EditField.GetText at the beginning.
    <font color=green>
    %ObjectText% = EditFieldObject[EditField1].GetText</font color=green>

    Additionally, you need to evaluate the Action in your IF statement:

    <font color=green>%Questions1Result% = Evaluate (%Questions1Result%+1) </font color=green>
    ...instead of
    <font color=green>%Questions1Result% = (%Questions1Result%+1)</font color=green>


    [/quote]
    as for the pasting here ... highlight the actions you want to paste and select COPY AS DISPLAYED from the right-click menu
    -
    = Derek
    ["All glory comes from daring to begin" - fortune cookie]

  3. #3
    Join Date
    Jun 2003
    Location
    Dublin, Ireland
    Posts
    87

    Re: Trying to get a basic questions and answers bit on a page....

    Excellent!

    One quick question, do I have to declare %ObjectText1%, 2,3,4,5, and so on for each answer box? Or can I redeclare the same variable?

    %Questions1Result% = "0"
    %ObjectText% = EditFieldObject[EditField1].GetText

    If(EditField1=1)
    %Questions1Result% = EValuate (%Questions1Result% +1)
    end if

    %ObjectText% = EditFieldObject[EditField2].GetText

    If(EditField2=1)
    %Questions1Result% = EValuate (%Questions1Result% +1)
    end if


    And so on and so forth....

    I'm not at my computer to check the code but I'll give it a whirl when I get there!

    If you can read this, i have yet to write a witty and imaginative signature.... sorry...

  4. #4
    Join Date
    May 2001
    Location
    51.531249 | -0.610962
    Posts
    1,244

    Re: Trying to get a basic questions and answers bit on a page....

    I'll let you give it a whirl then [img]/ubbthreads/images/icons/wink.gif[/img]

    If you need more help after 'whirling it' give us a shout [img]/ubbthreads/images/icons/smile.gif[/img]
    -
    = Derek
    ["All glory comes from daring to begin" - fortune cookie]

  5. #5
    Join Date
    Jun 2003
    Location
    Dublin, Ireland
    Posts
    87

    Re: Trying to get a basic questions and answers bit on a page....

    I whirled, the programme whirled, then spat out the wrong results, so I rewhirled declaring each answer as a different variable, so once again we whirled together and this time it was in unison and harmony....

    Cheers!

    (I'm dizzy now)
    If you can read this, i have yet to write a witty and imaginative signature.... sorry...

  6. #6
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746

    Re: Trying to get a basic questions and answers bit on a page....

    It's a small whirled after all...

    Corey Milner
    Creative Director, Indigo Rose Software

  7. #7
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160

    Re: Trying to get a basic questions and answers bit on a page....

    Its a whirled of whonder a whirled of cheer. . .
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  8. #8
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014

    Re: Trying to get a basic questions and answers bit on a page....

    LOL [img]/ubbthreads/images/icons/laugh.gif[/img]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts