True Or False Game

Hi all
A total newbie to director and need some help as i'm really
stuck,
For part of my college work I am trying doing a True or False
game based on 10 questions but unsure how to script this, what game
involves is when a question has been answered correctly the user is
sent to a marker named "Right", showing an animation telling them
they have answered it correctly, if they have answered the question
incorrectly they get sent to another marker named "Wrong" again
showing an animation telling them they have answered incorrectly.
The way I have decided to do this is by importing the
questions from text file that hold 10 question, the current script
i have for Director to load the questions is.....
on mouseUp me
openAndReadText
end
but wanting to randomize them.
I also have 2 buttons named True and False, and because 5
questions are true and 5 are false, the only code i have so far in
different scripts is
on startMovie
Answer
end
on Answer
global gQuestions
gQuestions = True
end
global gQuestions
on mouseUp me
if gQuestions = True then
go to "Right"
else
go to "Wrong"
end if
end
and dont know what code i needs to be added to determine
which correct answer goes to the correct marker
Thanks ifor any help in advance
Chris

Consider the low tech aproach.
If you don't have a big library of questions that have to be
imported
dynamically, I would suggest going with a less programatic
intensive
approach, in which each question is contained in a predefined
text
member displayed in a separate score marker.
Again the simplest least programatic approach would have the
actions for
the True False answer buttons assigned separately for each
individual
question, that is in question number 3 you might have the
True button go
to the wrong marker.
You could avoid writing any lingo code by using the navigate
to marker
behavior from the library palette to access a marker from a
series you
already have setup in the score.
A hard coded series of markers might look like:
question1
right1
wrong1
question2
right2
wrong2
question3
right3
wrong3
They would all show up in the parameter popup menu in the
behavior.
A score script at the start of the right wrong markers could
increment
the global question tally
on exitFrame
global rightCount, totalCount
totalCount = totalCount + 1
rightCount = rightCount + 1 -- this line is only in the righ
marker
script
end

Similar Messages

  • True or false game problem

    hey all, its me, the java noob!
    i've been trying to make a true or false game in which the user has to do the obvious with two of the buttons and press go to start the whole thing.
    however, my program has seriusly gone fooba, it says the wrong wrong answere statements, it jumps to another question whe i give an answere and soemtimes says i'm wrong when i'm not. what am i doing wrong?
    i'm seriusly confused about what i did wrong. here's the code:
    import java.util.Random;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    import java.awt.FlowLayout;
    class TF extends JFrame implements ActionListener{
         public static void main(String args[]){
              new TF();
         int otherNum = 0;
         int TFnum = 1;
         JButton t = new JButton("true");
         JButton f = new JButton("false");
         JLabel tf = new JLabel();
         JButton BUtton = new JButton("go!");
         public TF(){
         setDefaultCloseOperation(EXIT_ON_CLOSE);
         setLayout(new FlowLayout()) ;
         add(tf);
         tf.setVisible(false);
         add(BUtton);
         BUtton.addActionListener(this);
         add(t);
         t.addActionListener(this);
         t.setEnabled(false);
         add(f);
         f.addActionListener(this);
         f.setEnabled(false);
        pack();
        setVisible(true);     
         public void actionPerformed(ActionEvent e){
         if(e.getSource() == BUtton){
              t.setEnabled(true);
              f.setEnabled(true);
              tf.setVisible(true);
              BUtton.setEnabled(false);
        int tfr = new Random().nextInt(10) + 1;
         switch (tfr) {
         case 1:
         TFnum = 2;
         otherNum = 1;
         tf.setText(" chess was first invented in India");
         break;
         case 2:
         otherNum = 2;
         TFnum = 0;
         tf.setText("Calvin and hobbes were both names of people in the past one was named Jhon Hobbes and the other named Thomas Calvin t/f");
         break;
         case 3:
         otherNum = 3;
         TFnum = 2;
         tf.setText("a microphone needs a windscreen which is usually made of polyster t/f");
         break;
         case 4:
         otherNum = 4;
         TFnum = 0;
         tf.setText("octopus's ink squirt is a good defense, however, the smell the ink lets off creats a direct path towards the octopus t/f");
         break;
         case 5:
         otherNum = 5;
         TFnum = 2;
         tf.setText("Monty Python and the holy grail planned to have a sequal in 1990, but that idea was posponed t/f");
         break;
         case 6:
         otherNum = 6;
         TFnum = 0;
         tf.setText("the molecules of water are structiored so that the o is in the middle and the 2 H's are either sides at 180 degrees. t/f");
         break;
         case 7:
         otherNum = 7;
         TFnum = 2;
         tf.setText("the famous series Doctor who first started in 23 November 1963 t/f");
         break;
         case 8:
         otherNum = 8;
         TFnum = 0;
         tf.setText("the oldest known dice is 5500 years old and was found in russia, it was made from the hoof of an animal t/f");
         break;
         case 9:
         otherNum = 9;
         TFnum = 2;
         tf.setText("the yumi longbow was designed to be easilly fired from horseback t/f");
         break;
         default:
         otherNum = 10;
         TFnum = 0;
         tf.setText("Albert Einstien invented the first laser, albeit only a maschine which caught and concentrated sunlight.");
         break;
         if(e.getSource() == t) {
              t.setEnabled(false);
                 f.setEnabled(false);
            if(TFnum == 0) {
                 t.setEnabled(false);
                 f.setEnabled(false);
                  if(otherNum == 2){
                   tf.setText("you lose, it was Jhon Calvin and Thomas Hobbes (I switch names around)");
                  if(otherNum == 4){
                   tf.setText("you lose, the ink blocks all sense of smell");
                   if(otherNum == 6){
                   tf.setText("you lose, the H's are at 104.45 degrees, so nearly a triangle shape");
                  if(otherNum == 8){
                   tf.setText("you lose, actually, its 5000 years old and was discovered in eastern Iran as part of a backgammon set");
                  if(otherNum == 10){
                   tf.setText("you lose, he set the principal but never invented it.");
             } else {
             tf.setText("you win!!!");
        if(e.getSource() == f) {
            t.setEnabled(false);
                 f.setEnabled(false);
        if(TFnum == 2){
          tf.setText("you lose");     
          } else {
          tf.setText("you win");
      }i get absolutely no error messages but everything does exactely what its NOT meant to do
    if you help me : THANK YOU VERY MUCH !!!!! :)

    well, it vary's, but the overall picture is that when i get
    A) the true button when its false, it gives a Random answere instead of the one i need e.g. when i say that Einstien did invent the first laser (which is bollucks) it says "you lose, the anlgles at which the H's stand to the o is 104.45 degrees" which is not whatits meant to do because that was the answer for a chemical question.
    B) when its false and i click false, it goes perfect!
    C) when i click true and it is true,it goes completely and uterly mad and tells me some sort of "you lose" statement.
    hope that helps

  • Applescript help with true or false script

    I'm in need of a applescript that will run two different scripts based on the outcome of an existing file.
    I have a folder called Status. Inside this folder is a simple text file called Good.rtf
    I would like a script that would run one or the other script base on the true or false output.  If file exists then:
    true will
    run script A
    false will
    run script B
    I have been searching the web for two days looking for something to help me get started on this and have not had much success.
    Please help me.   I really would appropriate any help or guidance. 
    Thanks....
    Ron

    Ron
    AppleScript calls this kind of script a "Conditional" = if this > then that
    Some templates are in MacintoshHD/Library/Scripts/Script Editor Scripts/Conditionals
    You don't need a value for "false" in binary as it is merely "not true" (else)
    if true then
        -- insert if actions here
    else
        -- insert else actions here
    end if
    If you already have your Scripts A & B working, copy>pastethem into the "insert actions here" part as appropriate
    ÇÇÇ

  • The case structure is not working well on comaring two strings using true or false string matching VI

    I need an execution of commands after the reply from the instrument matches with the string I provided for that i used true or false string match VI on which the true string the matching command and the string is the reply from the instrument. And I put the further executionable commands in frame after frame of sequence loop in the true of the case structure. Amd finally I given all the output strings to the concatenate string to get all the replies as one loop. But when I execute the program the desired result is not available. So kindly please help me to overcome this problem.  
    Attachments:
    basic serial with changes.vi ‏24 KB

    You VI makes absolutely no sense and I would recommend you start with a few simple LabVIEW tutorials before trying to tackle this.
    What is the point of the FOR loop with 1 iteration, it might as well not even be there, same difference.
    Why is there an abort primitive in the FOR loop, this mean the program will unconditionally stop abort before any downstream code will ever go into action. The program will never get past the FOR loop.
    You created a circular data dependency and LabVIEW inserted a feedback node automatically, making things even worse. (see also)
    You need to learn about dataflow, execution order, and data dependency.
    You need to learn about the various types of tunnels (plain, autoindexing, etc.)
    There is a tremendous amount of duplicate code. Large code sections are the same, differeing only by a string. You should only have one copy of that code inside a proper state machine. Have a look at the design templates and examples that ship with LabVIEW.
    LabVIEW Champion . Do more with less code and in less time .

  • Parameter Query for True or False values

    I have what seems like a painfully simple task and it has me stopped dead.  I reviewed a similar thread, and the answers there don't seem to apply. Working in Crystal 11.5 with an MS SQL database.
    I am pulling data from vwCommmittees.  There is a field in this view called IsActive.  I want to create a committee list report that will allow the user to select only the active committees or all committees.
    A SQL select statement that says where dbo.IsActive = '1' will return only the active committees.
    In Crystal reports, if I place the IsActive field on the report, it returns with "True" or "False."
    When I create a parameter for this field, I find that 1) I can't see the parameter in the report expert -- my only choices are Is any value, Is true, Is false or Formula.
    I've made several attempts to create a formula and nothing is working. It's not clear to me wheter I should be creating a static or a dynamic parameter.  When I choose boolean as the type, that doesn't seem to help.  I tried a dynamic parameter which gave me true and false values, but don't seem to work.
    Any pointers on dealing with this kind of parameter query would be greatly appreciated.
    Sincerely,
    Ridge (in New Joisey)

    Hi..
    Create a static parameter and give the default values like
    0 and 1
    In Record Selection check like..dbo.IsActive = {?parameter}
    If the above is not working for you, then create a formula
    like..
    If dbo.IsActive = '1' then
    "Active"
    Else "In Active"
    Place this formula on your report and create a static parameter with default values Active and In Active.
    In record selection filter the above.
    Thanks,
    Sastry

  • [Help plz]Can't set a boolean attribute to true or false

    Hello,
    I'm new in NWDS development. I need to develop a download functionality
    I used a FileDownload UIElement for that and I created a node context (ExcelExport) with 3 attributes :
    - ExcelFile
    - ExcelIcon
    - And ExcelEnabled (Boolean type)
    My problem is that everytime I try to set the attribute ExcelEnabled to true or false, it return me a java.lang.NullPointerException
    I'm binding this attribute with "Enabled" property of the UIElement.
    Have anyone got this error before? Thanks a lot for your help.
    Kind regards,
    Safae.

    Hello Safae,
    Have you tried to put true/false value for the enabled property? I mean without using a context attribute?
    Also try to create the attribute out of the node.
    Regards,
    ImaneA.

  • How to set render true or false in java class

    Use case:
    i have a page in which i have one inputListOfValues attributes and two LOV .initial the LOV render attribute value is false .it means it show only one attribute in run time .inputListOfValues is content two value .suppose if first value A then the first LOV have to show and is it value is B then Second LOV have to show .i bind my LOV to class .but i do not know how to set render attribute at java class.

    <af:inputListOfValues label="Branch Name"
    popupTitle="Search and Result Dialog"
    id="ilov1"
    model="#{pageFlowScope.organizationLOV.param['bindings.Organization'].listOfValuesModel}"
    converter="#{pageFlowScope.organizationLOV.param['bindings.Organization'].convert['latinDesc']}"
    valueChangeListener="#{viewScope.salaryBenefitsReportForm.branchChange}"
    binding="#{viewScope.salaryBenefitsReportForm.branchName}"
    rendered="true" visible="false"/>
    <af:inputListOfValues label="Department Name"
    popupTitle="Search and Result Dialog"
    id="ilov2"
    model="#{pageFlowScope.objectLOV.param['bindings.Department'].listOfValuesModel}"
    converter="#{pageFlowScope.objectLOV.param['bindings.Department'].convert['latinDesc']}"
    valueChangeListener="#{viewScope.salaryBenefitsReportForm.departmentChange}"
    binding="#{viewScope.salaryBenefitsReportForm.departmentName}"
    rendered="true" visible="false"/>
    this is code in jsff .
    and class code are following
    public void reportBy(ValueChangeEvent valueChangeEvent) {
    String value=(String)valueChangeEvent.getNewValue();
    System.out.println(value);
    if(value.equals("Branch")){
    branchName.setVisible(true);
    departmentName.setVisible(false);
    AdfFacesContext.getCurrentInstance().addPartialTarget(branchName);
    AdfFacesContext.getCurrentInstance().addPartialTarget(departmentName);
    if(value.equals("Department")){
    departmentName.setVisible(true);
    branchName.setVisible(false);
    AdfFacesContext.getCurrentInstance().addPartialTarget(departmentName);
    AdfFacesContext.getCurrentInstance().addPartialTarget(branchName);
    }

  • Is this TRUE or FALSE ?

    Hi all,
    Pls tell me whether this sentence is true or false.
    A transaction used by a BMT bean MUST have been started by the bean.
    In book this question is marked as false, but as far as I think it should be true.
    Pls update.
    Regards,
    Sanjeev

    As it's written I would say it's true as well.
    Bean-managed transactions are only allowed for session beans(stateful and stateless) and message-driven beans. Furthermore, if there is any client transaction context propagated on the call to the BMT bean, the container is required to suspend the client tx before calling the business method. So, BMT beans cannot inherit client transactions.
    For BMT stateless session beans and message-driven beans, there cannot be an active user transaction when the business method completes. If there is, the container is required to treat it as an error.
    The slightly more interesting case is for stateful session beans. For BMT SFSBs, it's o.k. for the transaction to still be active when the business method returns. In that case, the container suspends the tx and assoicates it with the SFSB. Whenever the SFSB is invoked again, the previously associated transaction is resumed before the business method is called. ( The same rule holds for client transactions. If there is one, it will be suspended and resumed when the business method completes. ) However, even if the container resumes a previously suspended transaction before invoking the SFSB, it can only be a transaction that was started by that bean.
    --ken

  • Can we save a True or False state in Labview?

    I'm using Labview 4.01 and I'm trying to control my testing process. In
    this case, I have 3 gas cylinders and every one of them can be turned on
    or off through the digital out lines. After one tank is empty, I can
    turn it off and turn on another one. My question is, how we can save
    this status either it's true or false so next time, we can open the
    other one instead of this empty one. After this one is turned off, I can
    show its state with an indicator, but the program can not read an
    indicator, so we still can not check the state of this tank. Any one
    have a solution for this problem?
    Thanks in advance,
    Guangde Wang

    Guangde Wang wrote:
    >
    > I'm using Labview 4.01 and I'm trying to control my testing process. In
    > this case, I have 3 gas cylinders and every one of them can be turned on
    > or off through the digital out lines. After one tank is empty, I can
    > turn it off and turn on another one. My question is, how we can save
    > this status either it's true or false so next time, we can open the
    > other one instead of this empty one. After this one is turned off, I can
    > show its state with an indicator, but the program can not read an
    > indicator, so we still can not check the state of this tank. Any one
    > have a solution for this problem?
    >
    > Thanks in advance,
    >
    > Guangde Wang
    Your version is too old. So I believe that saving data in any kind of
    configuration file will
    do the job (like .ini or .conf).
    It also depends on if you are closing application between your vi runs.
    If you don't remove the vi from memory, you have a chance to use global
    or functional global to store your state.
    In latest versions you can do it another way.
    Sergey Krasnishov
    Automated Control Systems
    National Instruments Alliance Member
    Moscow, Russia
    [email protected]
    http://acs.levsha.ru

  • DisAppointed news  Sun Solaris  forum ????????? True or False

    hello Friends ,
    I read some disappointed news on this forum
    that sun would not continue support for intel edition
    i donot know it is true of false
    Any tell me what is exact matter on
    following email :- [email protected]
    or reply this letter

    Cross-posted
    Sun Solaris 5.10 - SSH 1.1.3-Not able to connect to server with ssh -Urgent
    @O.P.
    Don't do that.
    In the future, pick the most appropriate forum and make your post.
    Cross-posting is considered to be the same as rude spamming.
    I'm not aware of any forum web-site-of-value that would encourage cross-posting in its etiquette guidelines.
    ... and as far as "Urgent" goes?
    This web site is for the end-user community to gather and discuss various topics in general conversations. Your self-imposed time pressures are irrelevant. If you need actual technical support for something, then log a support case and pay for a speedy answer.
    See the FAQ link at the top of the page.

  • Item Event - BeforeAction - true or false?

    Hi,
    Is there a basic rule for BeforeAction?
    I know you can play with BeforeAction for personal use; but it is there a basic rule like:
    et_CLICK: then it is BeforeAction == false
    I like to know for following event:
    et_CLICK
    et_COMBO_SELECT
    et_MATRIX_LINK_PRESSED
    et_MATRIX_LOAD
    et_CHOOSE_FROM_LIST
    et_MENU_CLICK
    Is there a Pattern for BeforeAction for ALL Item Events?
    Thank you,
    Rune

    Hi Rune,
    there's no real rule, because the events are different.
    but usual it is before/after displaying or before/after mouseup
    EventType | beforeaction = true | beforeaction = false
    et_CLICK | before you release the mouse button/Button is pressed | after you release the mousebutton
    et_ITEM_PRESSED | before you release the mouse button | after you release the mousebutton
    et_COMBO_SELECT | Selection has not changed | Selection has changed
    et_MATRIX_LINK_PRESSED | before you release the mouse button/Button is pressed | after you release
    et_MATRIX_LOAD | matrix is empty | matrix is loaded
    et_MENU_CLICK | Button is pressed/before release on menu item (without submenus)  | after release
    et_CHOOSE_FROM_LIST | before the Choose From List form is displayed | displayed
    any other questions ?
    greetings to montreal
    David

  • Is that True or False ?

    I recieved a message from e-mail told me that the nokia can Detect Radar on the road
    Nokia Speed Trap Detector
    The settings for radar speed traps detector.
    Your Nokia cell phone can be programmed to pick
    up radar speed traps, when programmed your cell
    phone picks up the radar and alerts you on the
    message alert tone. ( Doesn't work with Nokia
    7110! )
    1. Enter your menu
    2. Select settings
    3. Select security settings
    4. Select closed user group
    5. Select on
    6. Enter 00000
    7. Press ok
    8. Clear back to normal, within a few seconds
    your phone will display a radar sign with five
    zero's next to it. It is now activated.
    Unfortunately only Nokia phones have this
    function. Cell info display needs to be de-
    activated. Settings -> Phone Settings -> Cell
    Info display
    Each time you turn off your phone, or even each
    time you loose contact with your carrier, you'll
    have to activate it again... It is done by steps
    1 through 5, but the number (00000) will be
    already on the field as default.
    Is that True or False ?

    It is false.closed user group is an operator based service by which your phone can be made to make phone calls only to those numbers in that group id.it is service provides dependant.contact your operator.

  • Last parameter in the raise_application_error  (true or false)

    Hi everyone,
    I have a question reagrding the last parameter in the raise_application_error clause.
    The last parameter says
    true: purge error stack
    false: do not purge error stack.
    I raised an exception and captured it with both parameters.
    In the case of false(do not purge previous errors) I could see the exect error no and msg (like No data found).
    But in the case of true (purge previous errors) i got an exception, but not the exact error msg.
    Is this the difference.
    In the case of true, it should purge previous errors, why is it purging the most recent error also.
    Is there anything more to true and false. Please highlight.
    And is there a way i can see the error stack.
    I am so keen to see that.
    It always says error is placed on the stack of previous errors.
    I want to see the previous errors.
    Can I.
    Any ideas.
    meenakshi

    See:
    http://www.oracle.com/technetwork/issue-archive/2005/05-mar/o25plsql-093886.html
    DBMS_UTILITY.FORMAT_ERROR_BACKTRACE

  • Check True or False Condition

    All,
    In my Form_Load module, I use For Loop to get data from Microsoft Access database to the texbox and that works fine.  The problem I have is that there is one column with True/False condition in the access database and I would like to know how to check
    if it is set to True or False.
    In the For Loop I use something like this for the textbox:
    Textbox1.text = row.cells("columnname").value.tostring()
    How do I check the column with the True/False condition
    VS 2008
    OS: XP
    Thanks,
    LA_Bob
    

    Hello,
    Thank you for your post.
    I am afraid that the issue is out of support range of VS General Question forum which mainly discusses the usage issue of Visual Studio IDE such as
    WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
    and Visual Studio Editor.
    I am moving your question to the moderator forum ("Where is the forum for..?"). The owner of the forum will direct you to a right forum.
    If you are doing your code using visual basic, Visual Basic forum within Visual Studio Language Forums:
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=vslanguages may help you.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Display Yes / No instead of True or false for radio buttons in SSRS 2008R2

    Hi All,
    I have one report with two radio buttons as parameters. In the report display I see True / false beside the radio buttons. Is there a way where I can display it as
    YES instead of True and NO for False beside radio buttons?
    Thanks,
    RH
    sql

    Hi sql9,
    According to your description, you want to show "Yes" and "No" in Boolean parameter instead of "True" and "False". Right?
    In Reporting Services, it doesn't has any property for the text of radio button in a Boolean parameter. So we can't modify the "True" and "False" into "Yes" and "No". For your requirement, a workaround is changing the type into drop down
    list and put the "Yes" and "No" into values.
    Reference:
    SSRS boolean
    parameter Yes and NO instead of True and False in prompt area
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

Maybe you are looking for