Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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]

    Comment


    • #3
      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...

      Comment


      • #4
        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]

        Comment


        • #5
          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...

          Comment


          • #6
            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

            Comment


            • #7
              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

              Comment


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

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

                Comment

                Working...
                X