Allowing for Alternate Correct "Answers"

Don't know which forum this falls under, sorry:
I want to create a training simulation (and actually, an
assessment simulation too) where the user can select one of a
variety of correct methods for accomplishing a task. How do I
program the multiple correct options into my simulations in case
one user wants to use keystrokes, another wants to use menus...?
Thanks!
Terry

Hi Terry
No need to apologize. You did fine by posting here. What we
normally frown upon is when someone isn't sure, they are anxious
and just begin saturating each forum category with post after post
asking the same question.
One thing you may wish to consider is that in a simulation,
Click Box objects are normally used and positioned where your user
should click to make the simulation work. The good news here is
that in addition to a mouse click, the Click Box object can be
programmed to accept a Shortcut Key. For example, let's say you
have a simulation where the user should click the File menu. You
insert a Click Box object over the image of the File menu. You
could then also program the Click Box object so that the Windows
equivalent of Alt+F would perform the same action as clicking the
Click Box with the mouse.
One possible issue crops up if the Captivate output file
playing in the browser doesn't have focus. Normally you can ensure
it has focus by inserting a simple Button object on the first slide
that instructs your user to click it to continue. Once they do
this, focus is placed on the Captivate movie and things should work
fine.
Hopefully this helps... Rick

Similar Messages

  • How do you give someone credit for a correct answer?

    How do you give someone credit for answering a question correctly?

    Provided you're the person who posted the original question, click on the blue "Mark as :Correct" or "Helpful" links on the left below the reply.

  • What is the best approach for a short answer quiz that has a number range as the correct answer?

    Client does not want to use multiple choice questions, so I am trying to figure out the best way to put in a range of numbers for the correct answer.

    I'm doing my best to figure this out, but not finding success in my advanced action. Below is the quiz question and how I setup the advanced action.
    Question: Determine the total heat load for test house 1.
    Answer: 32,120
    Acceptable Answer Range: 30,514 - 33,726
    Created TEB - Validate User Input; Numbers; Variable Name: Value1; Correct Entries box blank; Reporting: Include in Quiz; Points 10; add to total; report answers
         On Focus Lost: Execute Advanced Actions
              Conditional Action
                   If
                        Value1 is greater or equal to 30514 AND
                        Value 1 is lesser or equal to 33726
                   Then
                        Show SmartShape_1 (Correct feedback prompt)
                        Expression Value1=cpQuizInfoTotalQuizPoints+10  (I have also tried cpQuizInfoTotalProjectPoints and got same results)
                   Else
                        Show SmartShape_2 (Incorrect feedback prompt)
    I have quiz reporting turned on and I am testing this by including a second slide that is a standard multiple choice question so I can check results on the Quiz Results page at the end of the project showing the total score. I have not been successful yet in getting the system to add the points in appropriately. Is there another system variable I should be using to add the points to the quiz for reporting to the LMS or am i going about this completely wrong?

  • Multiple possible correct answers

    I have 2 correct answers to a multiple choice question.  Both are correct and only one needs to be selected.  I have selected muliple answers and partial scores so that only one needs to be selected instead of both.  But, the total points for the question is now locked at the sum of the partial points for the correct answers.  Since I don't require both answers, this results in an incorrect total to the quiz.  Is there any way to overcome this?

    I would not use a default MCQ in that case, but create a custom question. If you have to report to a LMS, the mastery widget of InfoSemantics is the easiest way to solve this problem. Another approach for a custom question is to attach the score to a button, that you make visible if one of the correct answers have been chosen. If another answer was chosen, you make another button visible that has no score attached. I explained the principle for another use case in this blog post:
    http://blog.lilybiri.com/report-custom-questions-part-2
    Lilybiri

  • I'm tying to make a payment for photoshop but the fields on the payment form won't allow me to enter the correct card information.  Im based in Japan but my card is registered to a UK address.  the fields only allow for a Japanese style address and postco

    I'm tying to make a payment for photoshop but the fields on the payment form won't allow me to enter the correct card information.  Im based in Japan but my card is registered to a UK address.  the fields only allow for a Japanese style address and postcode.  What can i do to complete the payment and get photoshop!

    As far as I know, your registered location and your credit card information must match... but,
    This is an open forum, not Adobe support... you need Adobe staff to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"
    -or by telephone http://helpx.adobe.com/x-productkb/global/phone-support-orders.html

  • Input Text will not allow me to access the correct answer!

    Hi All
    i am trying to create a simple quiz in school. I have one test question which requires the answer to be -1.
    I have created Input text and assigned the variable answer for this question.
    I have a button with the following AS2 script:
    on (press, keyPress "<Enter>") {
        if(answer eq "-1" or answer eq "minus 1"
           or answer eq "Minus 1" or answer eq "Minus one" or answer eq "minus one")
        {_root.gotoAndStop(2)
        } else
        {_root.gotoAndStop(3)
    Firstly whatever you type the numerical keys are immobilised on the keyboard when the .SWF file is built
    Secondly I cannot enter the correct answer!! If I type in Minus 1 etc it goes to frame 3.
    I have tried flags rather than frame numbers - same problem.
    i have tried remaking the quiz as a  separate file.
    using CS4 and CS5 flash - windows 7 PC.
    Please help!!
    teacheRuss

A: Input Text will not allow me to access the correct answer!

Ned
Thanks for the reply. I had instances for all elements but had code on teh but (Instance Enter). I have tried your code with my instance names. The button is Q1 (I was going to add more if it worked). The vaiable name for the Insert text box is ans1 so I used the code below. I added the code to frame 1 in teh timeline. I think this is what you meant so a frame script as opposed to a buton script. i have always scriped buttons (very simple). I have played around with the trace(); function but i am not sure where to run it from. I have added it to the script below. I tried Q1 which is the button and ans1 (variable). It must be wrong as I cannot see any output. Last thing. Is it not right ot use eq and or?? I am using Actionscript 2.
The disabled keys is the same running the code on my mac and pc!
Q1.onRelease = function() {
    if(ans1.text == "-1" || ans1.text == "minus 1" || ans1.text == "Minus 1" || ans1.text == "Minus one" || ans1.text == "minus one") {
         _root.gotoAndStop(2)
     } else  {
         _root.gotoAndStop(3)
trace(Q1);

Ned
Thanks for the reply. I had instances for all elements but had code on teh but (Instance Enter). I have tried your code with my instance names. The button is Q1 (I was going to add more if it worked). The vaiable name for the Insert text box is ans1 so I used the code below. I added the code to frame 1 in teh timeline. I think this is what you meant so a frame script as opposed to a buton script. i have always scriped buttons (very simple). I have played around with the trace(); function but i am not sure where to run it from. I have added it to the script below. I tried Q1 which is the button and ans1 (variable). It must be wrong as I cannot see any output. Last thing. Is it not right ot use eq and or?? I am using Actionscript 2.
The disabled keys is the same running the code on my mac and pc!
Q1.onRelease = function() {
    if(ans1.text == "-1" || ans1.text == "minus 1" || ans1.text == "Minus 1" || ans1.text == "Minus one" || ans1.text == "minus one") {
         _root.gotoAndStop(2)
     } else  {
         _root.gotoAndStop(3)
trace(Q1);

  • Is it OK to duplicate quiz slides for the sake of allowing multiple attempts to answer the question?

    I am using Captivate 4 and have several quiz slides interpersed throughout my project. The user MUST get the answer correct so I am allowing them mulitple attempts to answer the question. The problem I run into is that when the question is answered incorrectly, the user is automatically brought to the next slide and is not able to re-answer the question. How can the user re-answer the question before moving on with the content? Is it OK to duplicate the question slide?
    Example:
    Memorial day always falls on a:
    A) Monday
    B)Sunday
    C)Friday
    D)Saturday
    If the user selects either B, C, D I want them to see feedback that says they are incorrect and to please select a different answer. Of course, if the user selects A, the correct answer, the captivate just moves on.
    (NOTE: I have already added advanced actions to the multiple choice questions showing customized feedback for the incorrect answer...I just need to let the user try the question again!)
    It seems like I will get into some complex branching by duplicating the slide for incorrect response...I just need to know if this is OK to do and will it work?
    OR - is there a better solution
    Please help. Thanks in advance.

    Hello,
    Sorry, but apparently we do live in different time zones, morning over here, have to teach in a few minutes.
    Will try to answer this afternoon. To give differentiated feedback, depending on answers, you'll need to construct your question slides instead of using the default Question slides. That means: using Text captions, interactive objects, user variables and advanced actions.
    Lilybiri

  • I seem to not enter the correct answers to my security questions for itunes to buy an in-app purchase and also cannot answer the questions exactly like i answered them when creating the account for my ipod, how do i find out what answers i put

    I seem to not enter the correct answers to my security questions for itunes to buy an in-app purchase and also cannot answer the questions exactly like i answered them when creating the account for my ipod, how do i find out what answers i put for my ipod touch and itunes?

    Try these previous discusssions:
    recover answers to security questions: Apple Support Communities
    how do i change apple ID security...: Apple Support Communities

  • How can I allow a learner to review a created Drag and Drop Quiz to show the learner their incorrect/correct answers?

    Captivate 8: I have created an assessment with two multiple choice question slides and eight drag and drop question slides. After the learner views their score, I would like them to be able to review all of their answers to see where errors were made. Currently, the review quiz only shows their answers and the correct answers for Multiple choice question slides. Ideally, I would like a review of the drag and drop question slides where the incorrect choices are outlined in red or something to this effect. I appreciate any insight and suggestions!

    Sorry, D&D is not a normal question slide and I can only recommend logging a feature request. I would really like to be able to choose whether an interaction is reset or not, because this problem doesn't exist only for D&D but for all learning interactions as well.

  • [svn] 4241: A collection of minor fixes for FXG transcoding to SWF: matrix attribute name correction; allowing for 0x prefix for hexadecimal colors; allowing for an id attribute on FXG nodes; fixing blur filter quality encoding; fixing the order in which

    Revision: 4241
    Author: [email protected]
    Date: 2008-12-05 11:00:45 -0800 (Fri, 05 Dec 2008)
    Log Message:
    A collection of minor fixes for FXG transcoding to SWF: matrix attribute name correction; allowing for 0x prefix for hexadecimal colors; allowing for an id attribute on FXG nodes; fixing blur filter quality encoding; fixing the order in which bevel filter colors are encoding - the SWF specification appears to have the wrong order specified; updating SwfxPrinter to display a linestyle's fillstyle (if present).
    Temporarily removing generated id attribute emitted in FXG to SWF optimization as this attribute is not present in the AS impl.
    Also updating compiler error base types to allow a rootcause to be specified for additional detail to a compiler message exception.
    QE: No
    Doc: No
    Checkintests: Pass
    Reviewer: Discussed compiler base error change with Paul.
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilerException.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/EmbedEvaluator.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/CompilerMessage.java
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/FXGConstants.java
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/dom/AbstractFXGNode.java
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/dom/TextGraphicNode.java
    flex/sdk/trunk/modules/swfutils/src/java/flash/fxg/swf/AbstractFXGGraphics.java
    flex/sdk/trunk/modules/swfutils/src/java/flash/swf/TagDecoder.java
    flex/sdk/trunk/modules/swfutils/src/java/flash/swf/TagEncoder.java
    flex/sdk/trunk/modules/swfutils/src/java/flash/swf/tools/SwfxPrinter.java

  • When i type in the correct answer for my security question it always comes up as incorrect I have the answer written down but there not working can someone help

    hello
    when i type in the correct answer for my security question it always comes up as incorrect I have the answer written down but there not working can someone help

    Hi, Corinneact. 
    Thank you for visiting Apple Support Communities. 
    The usual cause for errors is that the security question responses are case sensitive.  If case sensitivity is not an issue with your answers, see the last step in the attached section of the article below. 
    Navigate to My Apple ID using your web browser.
    Click "Manage your account"
    When prompted, sign in using your Apple ID and password.
    Click Password & Security
    You'll be asked to answer 2 of your 3 security questions before you can make any modifications. If you are unable to remember your answers, you can choose to send an email to your rescue email to reset your security questions.
    Note: The option to send an email to reset your security questions and answers will not be available if a rescue email address is not provided. You will need to contact iTunes Store support in order to do so. 
    Rescue email address and how to reset Apple ID security questions
    http://support.apple.com/kb/HT5312
    Cheers,
    Jason H. 

  • Have searched Forums for quite some time now. Cannot find a correct answer to: how do I prevent my old email address from appearing as the "from:" address

    Have searched Forums for quite some time now. Cannot find a correct answer to: how do I prevent my old email address from appearing as the "from:" address when I use a "send this" link on a webpage/news article. The email window opens and automatically inserts my old Hotmail address instead of the Yahoo address I've used for a long time. (The drop-down won't let me change it or delete it.) Thanks.

    Do you get a drop down list with suggestions if you clear that "from" field and click elsewhere on that page to move the focus off that field and then double-click again in that field or start typing the first letters of that unwanted email address?
    Use these steps to remove saved (form) data from a drop down list:
    #Click the (empty) input field on the web page to open the drop down list
    #Highlight an entry in the drop down list
    #Press the Delete key (on Mac: Shift+Delete) to remove it.
    *Form History Control: https://addons.mozilla.org/firefox/addon/form-history-control/
    *Tahoe Data Manager: https://addons.mozilla.org/firefox/addon/data-manager/

  • Review Widget: "drag the correct answer to the target" - not working for me?

    Ive read the (very limited) help on this problem, and I must be doing something wrong
    I simply want to indicate the right answer A or B - couldnt be simpler.
    Apple says:
    "To indicate the correct answer: Select it or drag the label or image to the target. To have more than one correct answer, hold down the Command key while you select the answers."
    Its just not working. I assume it means drag the CHOICE A button OR CHOICE A text (thats all there is) to some target on the inspector but that doesnt work nothing happens. (And where is "the target" what target? Where? I cant find a "drop" green plus appearing anywhere..
    So I then, instead I try dragging the QUESTION TEXT (eg is the sky blue or red) to somewhere and that DOES show a draggable obkect but again where is this "target"? If that means the  Answer a or Answer B back in the widget it self then No, that doesnt do anything, no drop zone is saying "hey drop me here"
    So, like I say, I must be missing somethign really obvious. But Ive no idea. Please help.
    TP

    Hi Andy,
    I am trying to investigate this issue but I havent been able to reproduce it. It would be great if you could give me a few inputs.
    1) Are you able to Publish Comments in the review?
    2) Is there any internet traffic monitoring tool running on your machine?
    3) Close Acrobat and then try killing the AdobeCollabSync.exe from task manager. Now open the review file again and try to sync the comments. Does this work?
    4) Try downloading a fresh copy of this file from Acrobat.com server and replacing your local copy with it.
    If all these things do not work then maybe we can analyze the traffic (using fiddler) on your machine to investigate the problem.
    Thanks,
    Abhilasha

  • What are the correct answers ?

    after doing one sample swing application, i assumed the exam will be easy. when i took the exam, i couldn't do anything...
    what are the correct answers ??/
      Which one of the following converts the Image i into the BufferedImage bi? 
    Choice 1  
    bi = new BufferedImage(0, 0, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = (Graphics2D)bi.createGraphics();
    g.drawImage(i,i.getHeight(this),i.getWidth(this)); 
    Choice 2  
    bi = new BufferedImage(i.getWidth(this), i.getHeight(this), 1);
    bi.drawImage(i,0,0,this); 
    Choice 3  
    bi = new BufferedImage(i.getWidth(this), i.getHeight(this), 1);
    Graphics2D g = (Graphics2D)bi.createGraphics();
    g.drawImage(i,0,0,this); 
    Choice 4  
    bi = new BufferedImage(i, i.getWidth(this), i.getHeight(this), BufferedImage.TYPE_INT_RGB); 
    Choice 5  
    bi = new BufferedImage(i, i.getWidth(this), i.getHeight(this)); 
    CardLayout
    BorderLayout
    FlowLayout
    GridBagLayout
    GridLayout 
      Which one of the following indicates all of the layout managers (from the list above) that allow you to set the space between the components from an instance of the LayoutManager itself? 
    Choice 1  
    CardLayout, FlowLayout, GridBagLayout, GridLayout 
    Choice 2  
    GridBagLayout 
    Choice 3  
    BorderLayout, GridLayout 
    Choice 4  
    BorderLayout, FlowLayout, GridLayout 
    Choice 5  
    BorderLayout, CardLayout, FlowLayout, GridBagLayout, GridLayout 
    JFrame jf = new JFrame();
    jf.setSize(400,400);
    JTextField jtf = new JTextField("JTextField");
    JButton jb = new JButton("JButton");
    jf.getContentPane().setLayout(
                          new FlowLayout(FlowLayout.LEFT,1,2));
    jf.getContentPane().add(jtf);
    jf.getContentPane().add(jb); 
      Which one of the following indicates the positions of the JTextField jtf and JButton jb relative to the JFrame and each other? 
    Choice 1  
    jtf and jb are in the top-center of the Jframe; jtf is to the left of jb, 2 pixels apart. 
    Choice 2  
    jb is in the top-right corner of the JFrame with jtf 1 pixel to the left of it. 
    Choice 3  
    jtf is in the top-left corner of the JFrame with jb 1 pixel to the right of it. 
    Choice 4  
    jb is in the top-right corner of the JFrame with jtf 2 pixels to the left of it. 
    Choice 5  
    jtf is in the top-left corner of the JFrame with jb 2 pixels to the right of it
    public void drawText(Graphics2D g, String text){
      Font f = new Font("Century Gothic", Font.BOLD, 10);
      g.setFont(f);
      g.drawString(text, 20, 20);
      Given the above sample code, what happens if the "Century Gothic" font is NOT available? 
    Choice 1  
    The Font() constructor fails, causing "f" to be null, and the setFont() method throws a NullPointerException. 
    Choice 2  
    "Century Gothic" is a built in Java font, which always exists within the Java runtime environment. 
    Choice 3  
    The code does not compile because only the following "logical" font names are supported in Java: Dialog, DialogInput, Monospaced, Serif, SansSerif, and Symbol. 
    Choice 4  
    The Font() constructor throws an IllegalArgumentException. 
    Choice 5  
    A default Font object is returned and is used
    Sample Code 
    public void drawText(Graphics2D g, String text){
      Font f = new Font("Century Gothic", Font.BOLD, 10);
      g.setFont(f);
      g.drawString(text, 20, 20);
      Given the above sample code, what happens if the "Century Gothic" font is NOT available? 
    Choice 1  
    The Font() constructor fails, causing "f" to be null, and the setFont() method throws a NullPointerException. 
    Choice 2  
    "Century Gothic" is a built in Java font, which always exists within the Java runtime environment. 
    Choice 3  
    The code does not compile because only the following "logical" font names are supported in Java: Dialog, DialogInput, Monospaced, Serif, SansSerif, and Symbol. 
    Choice 4  
    The Font() constructor throws an IllegalArgumentException. 
    Choice 5  
    A default Font object is returned and is used. 
    How must do you interact with a JTextField in order to generate an ActionEvent? 
    Choice 1  
    Tab into the JTextField from another Component. 
    Choice 2  
    Type in the JTextField. 
    Choice 3  
    Activate the cursor in the JTextField. 
    Choice 4  
    Hit <RETURN> while the cursor is in the JTextField. 
    Choice 5  
    Hit the spacebar while typing in the JTextField. 
    double-buffering
    public class TimerTest implements ActionListener{
      public static void main(String[] args){
        TimerTest test = new TimerTest();
        javax.swing.Timer timer = new javax.swing.Timer(100,test);
      public void actionPerformed(ActionEvent ev){
        System.out.println("Timer ticked.");
      Given the above sample code, what is the result when the code is run? 
    Choice 1  
    The words "Timer ticked." are printed to the console once after 100 milliseconds. 
    Choice 2  
    The words "Timer ticked." are printed to the console every 100 microseconds. 
    Choice 3  
    The words "Timer ticked." are printed to the console every 100 seconds. 
    Choice 4  
    The words "Timer ticked." are printed to the console every 100 milliseconds. 
    Choice 5  
    Nothing, the Timer is not started. 
    1. JSlider slider1 = new JSlider (JSlider.VERTICAL, 0, 100, 50);
    2. slider1.setPaintTicks(false);
    3. slider1.setMajorTickSpacing(10);
    4. slider1.setMinorTickSpacing(2); 
      What changes do you have to make to the above Sample code so that there are six Major Ticks and four Minor ticks between each Major Tick? 
    Choice 1  
    Replace line 3 with slider1.setMajorTickSpacing(17); 
    Choice 2  
    Replace line 2 with slider1.setPaintTicks(true);
    Replace line 3 with slider1.setMajorTickSpacing(17);
    Replace line 4 with slider1.setMinorTickSpacing(5); 
    Choice 3  
    Replace line 3 with slider1.setMajorTickSpacing(5);
    Replace line 4 with slider1.setMinorTickSpacing(4); 
    Choice 4  
    Replace line 2 with slider1.setPaintTicks(true);
    Replace line 3 with slider1.setMajorTickSpacing(20);
    Replace line 4 with slider1.setMinorTickSpacing(4); 
    Choice 5  
    Replace line 4 with slider1.setMinorTickSpacing(6); 
       Which one of the following defines a set of three JRadioButtons (b1, b2, and b3) so that only one JRadioButton can be selected at a time? 
    Choice 1  
    ButtonGroup g = new ButtonGroup();
    g.add(b1); g.add(b2); g.add(b3); 
    Choice 2  
    b1.group(true); b2.group(true); b3.group(true); 
    Choice 3  
    JRadioButton jbs[] = {b1, b2, b3};
    ButtonGroup g = new ButtonGroup(jbs); 
    Choice 4  
    The default behavior of JRadioButtons is such that only one can be selected at a time as long as they are in the same Container. 
    Choice 5  
    ButtonGroup g = new ButtonGroup(b1, b2, b3); 
    Sample Code 
    public static void main(String args[]){
      What is the role of the method in the code above? 
    Choice 1  
    To provide a place for initialization code when instantiating the current class. 
    Choice 2  
    It is the first method run when a class is run with the Java Interpreter. 
    Choice 3  
    It serves no specific function. It is a residual method from Java 1.0. 
    Choice 4  
    It is the first method that the Java Compiler converts to bytecode when creating a .class file. 
    Choice 5  
    To process command-line parameters when running the Java Interpreter 
    How do you create a menu item, Save, with a shortcut key of Ctrl+S? 
    Choice 1  
    You have to override the KeyPressed event of the top level Frame and handle the Ctrl+S to call the menu item's actionPerformed. 
    Choice 2  
    JMenuItem save = new JMenuItem("Save");
    save.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,Event.CTRL_MASK)); 
    Choice 3  
    JMenuItem save = new JMenuItem("Save");
    save.enableShortcut(KeyEvent.CTRL_KEY + KeyEvent.S); 
    Choice 4  
    JMenuItem save = new JMenuItem("Save");
    save.setMnemonic("Ctrl+S"); 
    Choice 5  
    JMenuItem save = new JMenuItem("Save");
    save.addShortcutKey( new KeyStroke(KeyStroke.S | KeyStroke.CTRL_KEY) ); 
    GridBagConstraints gbc1 = new GridBagConstraints(1,1,2,1,1,3,10,1,new Insets(5,5,5,5),1,1);
    gbl.addLayoutComponent(jb,gbc1); 
      In regards to the above code, which one of the following indicates jb's grid position? 
    Choice 1  
    Grid position 2,1 
    Choice 2  
    Grid position 1,2 
    Choice 3  
    Grid position 1, 1 
    Choice 4  
    Grid position 10, 1 
    Choice 5  
    Grid position 1, 3 
    GridBagConstraints gbc1 = new GridBagConstraints(1,1,2,1,1,3,10,1,new Insets(5,5,5,5),1,1);
    gbl.addLayoutComponent(jb,gbc1); 
      In regards to the above code, which one of the following indicates jb's grid position? 
    Choice 1  
    Grid position 2,1 
    Choice 2  
    Grid position 1,2 
    Choice 3  
    Grid position 1, 1 
    Choice 4  
    Grid position 10, 1 
    Choice 5  
    Grid position 1, 3 
    Which one of the following is necessary when changing an Applet to a standalone application? 
    Choice 1  
    Add a no-argument constructor. 
    Choice 2  
    Remove the init(), start() and stop() methods. 
    Choice 3  
    Remove "extends JApplet" or "extends Applet". 
    Choice 4  
    Add a main() method. 
    Choice 5  
    Change the import statement so that it imports an Application container rather than Applet or JApplet. 
    Which one of the following adds the String "Java" to the JComboBox jcb? 
    Choice 1  
    ComboBoxModel cbm = jcb.getModel();
    cbm.addItem("Java"); 
    Choice 2  
    jcb.setText("Java"); 
    Choice 3  
    ComboBoxModel cbm = jcb.getModel();
    cbm.add("Java"); 
    Choice 4  
    jcb.add("Java"); 
    Choice 5  
    jcb.addItem("Java");

    I'll have a go but I am not saying they are all correct...
    Question 1.
    Which one of the following converts the Image i into the BufferedImage bi?
    Choice 3 (assuming this implements the imageobserver interface)
    bi = new BufferedImage(i.getWidth(this), i.getHeight(this), 1);  //1 is BufferedImage.TYPE_INT_RGB
    Graphics2D g = (Graphics2D)  
    bi.createGraphics();
    g.drawImage(i,0,0,this);Good luck with your homework...
    nes
    Question 2.
    CardLayout
    BorderLayout
    FlowLayout
    GridBagLayout
    GridLayout
    Which one of the following indicates all of the layout managers (from the list above) that allow you to set the space between the components from an instance of the LayoutManager itself?
    Choice 4
    BorderLayout,
    FlowLayout,
    GridLayout
    (GridBagLayout uses GridBagConstraints to decide component spacing, card layout does not provided component spacing due to the deck nature used)
    Question 3.
    JFrame jf = new JFrame();
    jf.setSize(400,400);
    JTextField jtf = new JTextField("JTextField");
    JButton jb = new JButton("JButton");
    jf.getContentPane().setLayout( new FlowLayout(FlowLayout.LEFT,1,2));
    jf.getContentPane().add(jtf);
    jf.getContentPane().add(jb);    Which one of the following indicates the positions of the JTextField jtf and JButton jb relative to the JFrame and each other?
    Choice 3 jtf is in the top-left corner of the JFrame with jb 1 pixel to the right of it.
    Question 4
    public void drawText(Graphics2D g, String text)
         Font f = new Font("Century Gothic", Font.BOLD, 10);  
         g.setFont(f);  
         g.drawString(text, 20, 20);
    }    Given the above sample code, what happens if the "Century Gothic" font is NOT available?
    Choice 5 A default Font object is returned and is used
    Question 5.
    How must do you interact with a JTextField in order to generate an ActionEvent?
    Choice 4 Hit <RETURN> while the cursor is in the JTextField.
    Question 6.
    public class TimerTest implements ActionListener
         public static void main(String[] args)
               TimerTest test = new TimerTest();    
               javax.swing.Timer timer = new javax.swing.Timer(100,test);  
         public void actionPerformed(ActionEvent ev)
              System.out.println("Timer ticked.");  
    }    Given the above sample code, what is the result when the code is run?
    Choice 5 Nothing, the Timer is not started.
    Question 7.
    1. JSlider slider1 = new JSlider (JSlider.VERTICAL, 0, 100, 50);
    2. slider1.setPaintTicks(false);
    3. slider1.setMajorTickSpacing(10);
    4. slider1.setMinorTickSpacing(2);    What changes do you have to make to the above Sample code so that there are six Major Ticks and four Minor ticks between each Major Tick?
    Choice 4 Replace line 2 with slider1.setPaintTicks(true); Replace line 3 with slider1.setMajorTickSpacing(20); Replace line 4 with slider1.setMinorTickSpacing(4);
    Question 8.
    Which one of the following defines a set of three JRadioButtons (b1, b2, and b3) so that only one JRadioButton can be selected at a time?
    Choice 1 ButtonGroup g = new ButtonGroup(); g.add(b1); g.add(b2); g.add(b3);
    Question 9.
    Sample Code
    public static void main(String args[]){ }
    TYPO - should be public static void main(String[] args){ }
    What is the role of the method in the code above?
    Choice 2 It is the first method run when a class is run with the Java Interpreter.
    Question 10.
    How do you create a menu item, Save, with a shortcut key of Ctrl+S?
    Choice 2 JMenuItem save = new JMenuItem("Save");
    save.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,Event.CTRL_MASK));
    Question 11.
    GridBagConstraints gbc1 = new GridBagConstraints(1,1,2,1,1,3,10,1,new Insets(5,5,5,5),1,1); gbl.addLayoutComponent(jb,gbc1);
    In regards to the above code, which one of the following indicates jb's grid position?
    Choice 3 Grid position 1, 1
    Question 12
    Which one of the following is necessary when changing an Applet to a standalone application?
    Choice 1 Add a no-argument constructor.
    Choice 2 Remove the init(), start() and stop() methods.
    Choice 3 Remove "extends JApplet" or "extends Applet".
    Choice 4 Add a main() method.
    Choice 5 Change the import statement so that it imports an Application container rather than Applet or JApplet.
    mmm. not a good choice of answers. look at the following link...
    http://forum.java.sun.com/thread.jsp?forum=57&thread=218096
    Question 13.
    Which one of the following adds the String "Java" to the JComboBox jcb?
    Choice 5 jcb.addItem("Java");

  • Setting XML based exam to where there are two correct answers in a question

    I have an exam which pulls in questions from an XML file and to indicate what the correct answer is you would indicate in the XML as such:
    PROBLEM id="1">
                    <QUESTION>What is the State Capital of California:</QUESTION>
                    <CHOICE letter="a">San Fransisco.</CHOICE>
                    <CHOICE letter="b">San Diego.</CHOICE>
                    <CHOICE letter="c">Los Angelas.</CHOICE>
                    <CHOICE letter="d" correct="true">Sacremento.</CHOICE>
                </PROBLEM>
    There is one question, that is structured so there are two right answers, but when I add correct="true" to both answers I want as right only one is calculated correctly in the scoring. I thinking I need to make an adjustment in the code that pulls in the XML, but not sure where. Hoping someone can help.
    Here is the AS code.
    package exam {
        import flash.net.* //to create URLRequest and load XML file
        import flash.events.* //for Load events
        //import flash.display.* //for testing purposes - remove when testing complete
        //This class downloads the XML document, and then inserts info into arrays and variables.
        //Also provides text of questions and correct answers when requested.
        internal class XaMLDiplomat extends EventDispatcher {
            //VARIABLES:
            //for loaded XML doc
            private var myXML:XML;
            //for loading in XML
            private var examLoader:URLLoader;
            private var numQstns:Number; //count of total questions in a section
            private var sectStart:Number;
            //contains exam questions - ALL ARRAYS ARE ZERO RELATIVE -> actual question numbers = array index + 1
            private var questions:Array;
            //contain associated answer choices
            private var choiceA:Array;
            private var choiceB:Array;
            private var choiceC:Array;
            private var choiceD:Array;
            private var choiceE:Array;
            private var choiceF:Array;
            //array of the correct answers
            private var answers:Array;
            //use custom Mixer class to randomize order
            private var myMixer:Mixer;
            private var isRandom:Boolean;
            //CONSTRUCTOR
            public function XaMLDiplomat () { //NEED TO ADD ARGUMENTS (docLocation)
                //create URLRequest from argument
                var examSite:URLRequest = new URLRequest("protected/exam.xml");
                //create a loader for the XML
                examLoader = new URLLoader();
                //add listener for load completion
                examLoader.addEventListener(Event.COMPLETE, fullyLoaded);
                examLoader.load(examSite);
                //var ugly:Mixer = new Mixer(25);
            //Load listener - creates XML object, and checks it for multiple sections. If multiple, it asks users
            //which section they want - FIRST it needs to check database for any completed sections.
            //If single, it goes ahead and starts array creation for first (& only) section
            private function fullyLoaded (e:Event):void {
                myXML = new XML(examLoader.data);
                //myXML.prettyPrinting = false;
                //still need to pull out SYSTEM data and pass it along...
                var system:XMLList = myXML..SYSTEM;
                var sysObj:Object = new Object();
                sysObj.examTitle = system.TITLE.toString();
                sysObj.totalMin = system.MINUTES.toString();
                sysObj.retakePW = system.RETAKEPW.toString();
                var numSections:Number = myXML..SECTION.length();
                if (numSections == 1) {
                    generateArrays(1);
                dispatchEvent(new MultiSectEvent(MultiSectEvent.SECTIONS, numSections, sysObj));
            //Assigns arrays to instance variables for the selected section
            internal function generateArrays (sectn:Number):void {
                var whichSection:XMLList = myXML..SECTION.(@id == String(sectn));
                var probList:XMLList = whichSection.PROBLEM;
                numQstns = probList.length();
                sectStart = Number(probList[0].@id);
                questions = new Array();
                choiceA = new Array();
                choiceB = new Array();
                choiceC = new Array();
                choiceD = new Array();
                choiceE = new Array();
                choiceF = new Array();
                answers = new Array();
                for (var i:Number=0; i<numQstns; i++) {
                    var curProb:XMLList = probList.(@id == String(i+1));
                    if (curProb.QUESTION.hasSimpleContent()) {
                        questions[i] = curProb.QUESTION.toString();
                    }else {
                        //trace(curProb.QUESTION.toXMLString());
                        questions[i] = dropTags(curProb.QUESTION[0]);
                    choiceA[i] = curProb.CHOICE.(@letter == "a").toString();
                    choiceB[i] = curProb.CHOICE.(@letter == "b").toString();
                    choiceC[i] = curProb.CHOICE.(@letter == "c").toString();
                    choiceD[i] = curProb.CHOICE.(@letter == "d").toString();
                    choiceE[i] = curProb.CHOICE.(@letter == "e").toString();
                    choiceF[i] = curProb.CHOICE.(@letter == "f").toString();
                    answers[i] = curProb.CHOICE.(hasOwnProperty("@correct") && @correct == "true")[email protected]();
                //randomizing test
                //var makeRandom:Boolean;
                //system.RANDOM.toString() ==  'true' ? makeRandom = true : makeRandom = false;
                //myMixer = new Mixer(numQstns,makeRandom);
                trace("Question: "+questions[3]);
                trace("a: "+choiceA[3]);
                trace("b: "+choiceB[3]);
                trace("c: "+choiceC[3]);
                trace("d: "+choiceD[3]);
                trace("\r\n answer: "+answers[3]); */
            //method for external classes to acquire text of current exam question
            internal function getQuestion (qnum:Number):Object {
                var returnObj:Object = new Object();
                var randomQ:Number = myMixer.getRandomNumber(qnum-1);
                returnObj.q = questions[randomQ];
                returnObj.ca = choiceA[randomQ];
                returnObj.cb = choiceB[randomQ];
                returnObj.cc = choiceC[randomQ];
                returnObj.cd = choiceD[randomQ];
                returnObj.ce = choiceE[randomQ];
                returnObj.cf = choiceF[randomQ];
                returnObj.num = qnum;
                //trace(randomQ);
                return returnObj;
            private function dropTags (txt:XML):String {
                var txtString:String = "";
                for each (var child:XML in txt.*) {
                    if (child.nodeKind == "text") {
                        txtString += child.toString();
                    }else {
                        txtString += " " + child.toXMLString();
                //trace(txtString);
                return txtString;
            private function dropTags (txt:String):String {
                var sliceStart:Number = txt.indexOf(">");
                var sliceStop:Number = txt.lastIndexOf("<");
                return txt.slice((sliceStart+1), sliceStop);
            internal function getAnswer (num:Number):String {
                return answers[num];
            internal function getQCount ():Number {
                return numQstns;
            internal function getSectStart():Number {
                return sectStart;
            internal function getRealNum (num:Number):Number {
                return myMixer.getRandomNumber(num-1);

    this may or may not be the probel, but as it stands right now, when you select and anser it becomes hi-lighted and when you click off and select another answer the previous answer is deselected and the current answer is hi-lighted. I need to allow for multiple selections. This code is what is doing to current select/de-select functionality.
    package exam {
        import flash.display.*;
        import flash.events.*;
        import flash.text.*;
        //This class displays the current question, and contains the Choices for the question
        public class QMachine extends Sprite {
            //VARIABLES
            private var QObject:Object; //object from XaMLDiplomat, containing necessary text
            private var limit:Number;
            private var QNumTxt:TextField;
            private var QTxt:TextField;
            private var txtStyle:StyleSheet;
            private var choiceA:Choice;
            private var choiceB:Choice;
            private var choiceC:Choice;
            private var choiceD:Choice;
            private var choiceE:Choice;
            private var choiceF:Choice;
            //CONSTRUCTOR
            public function QMachine (hite:Number) {
                limit = hite;
                var style:Object = new Object();
                style.fontFamily = "Arial";
                //style.fontWeight = "bold";
                style.fontSize = "16";
                style.color = "#333333";
                txtStyle = new StyleSheet();
                txtStyle.setStyle("p",style);
                QNumTxt = new TextField();
                QNumTxt.styleSheet = txtStyle;
                //QNumTxt.embedFonts = true;
                QNumTxt.htmlText = "<p>1) </p>";
                QNumTxt.autoSize = TextFieldAutoSize.RIGHT;
                QNumTxt.x = 10;
                QNumTxt.mouseEnabled = false;
                QTxt = new TextField();
                QTxt.styleSheet = txtStyle;
                //QTxt.embedFonts = true;
                QTxt.width = 300;
                QTxt.multiline = true;
                QTxt.wordWrap = true;
                QTxt.autoSize = TextFieldAutoSize.LEFT;
                QTxt.htmlText = "<p>Question 1</p>";
                QTxt.x = 35;
                QTxt.mouseEnabled = false;
                addChild(QNumTxt);
                addChild(QTxt);
                choiceA = new Choice("a");
                choiceA.x = 350;
                addChild(choiceA);
                choiceB = new Choice("b");
                choiceB.x = 350;
                addChild(choiceB);
                choiceC = new Choice("c");
                choiceC.x = 350;
                addChild(choiceC);
                choiceD = new Choice("d");
                choiceD.x = 350;
                addChild(choiceD);
                choiceE = new Choice("e");
                choiceE.x = 350;
                addChild(choiceE);
                choiceF = new Choice("f");
                choiceF.x = 350;
                addChild(choiceF);
                addEventListener(MouseEvent.MOUSE_UP, selectResponse, true);
            internal function newQuestion (obj:Object, prior:String = ""):void {
                //trace(obj.num);
                QNumTxt.htmlText = "<p>"+ obj.num + ".</p>";
                QTxt.htmlText = "<p>"+ obj.q + "</p>";
                choiceA.deselect();
                choiceB.deselect();
                choiceC.deselect();
                choiceD.deselect();
                choiceE.deselect();
                choiceF.deselect();
                choiceA.resetSize();
                choiceB.resetSize();
                choiceC.resetSize();
                choiceD.resetSize();
                choiceE.resetSize();
                choiceF.resetSize();
                choiceA.changeTxt(obj.ca);
                choiceB.changeTxt(obj.cb);
                choiceB.y = choiceA.height + 5;
                if (obj.cc == undefined || String(obj.cc) == "") {
                    choiceC.visible = false;
                }else {
                    choiceC.changeTxt(obj.cc);
                    choiceC.y = choiceB.y + choiceB.height + 5;
                    choiceC.visible = true;
                if (obj.cd == undefined || String(obj.cd) == "") {
                    choiceD.visible = false;
                }else {
                    choiceD.changeTxt(obj.cd);
                    choiceD.y = choiceC.y + choiceC.height + 5;
                    choiceD.visible = true;
                if (obj.ce == undefined || String(obj.ce) == "") {
                    choiceE.visible = false;
                }else {
                    choiceE.changeTxt(obj.ce);
                    choiceE.y = choiceD.y + choiceD.height + 5;
                    choiceE.visible = true;
                if (obj.cf == undefined || String(obj.cf) == "") {
                    choiceF.visible = false;
                }else {
                    choiceF.changeTxt(obj.cf);
                    choiceF.y = choiceE.y + choiceE.height + 5;
                    choiceF.visible = true;
                var curHite:Number;
                if (choiceF.visible) {
                    curHite = choiceF.y + choiceF.height + 5;
                }else if (choiceE.visible) {
                    curHite = choiceE.y + choiceE.height + 5;
                }else if (choiceD.visible) {
                    curHite = choiceD.y + choiceD.height + 5;
                }else {
                    curHite = choiceC.y + choiceC.height + 5;
                if (curHite > (limit-150)) {
                    shrinkText();
                if (prior != "") {
                    if (prior == "a") {
                        choiceA.nowSelected();
                    }else if (prior == "b") {
                        choiceB.nowSelected();
                    }else if (prior == "c") {
                        choiceC.nowSelected();
                    }else if (prior == "d") {
                        choiceD.nowSelected();
                    }else if (prior == "e") {
                        choiceE.nowSelected();
                    }else if (prior == "f") {
                        choiceF.nowSelected();
            private function shrinkText() {
                choiceA.dropSize();
                choiceB.dropSize();
                choiceC.dropSize();
                choiceD.dropSize();
                choiceE.dropSize();
                choiceF.dropSize();
                choiceB.y = choiceA.y + choiceA.height + 5;
                choiceC.y = choiceB.y + choiceB.height + 5;
                choiceD.y = choiceC.y + choiceC.height + 5;
                choiceE.y = choiceD.y + choiceD.height + 5;
                choiceF.y = choiceE.y + choiceE.height + 5;
                var curHite:Number = 0;
                if (choiceF.visible) {
                    curHite = choiceF.y + choiceF.height + 5;
                }else if (choiceE.visible) {
                    curHite = choiceE.y + choiceE.height + 5;
                }else if (choiceD.visible) {
                    curHite = choiceD.y + choiceD.height + 5;
                }else {
                    curHite = choiceC.y + choiceC.height + 5;
                if (curHite > (limit-150)) {
                    shrinkText();
            private function selectResponse (e:MouseEvent):void {
                choiceA.deselect();
                choiceB.deselect();
                choiceC.deselect();
                choiceD.deselect();
                choiceE.deselect();
                choiceF.deselect();
                var letter:String = e.target.parent.getLetter();
                dispatchEvent(new ResponseEvent(ResponseEvent.SELECTION, letter));
            internal function setPriorResponse() {
                choiceA.deselect();
                choiceB.deselect();
                choiceC.deselect();
                choiceD.deselect();
                choiceE.deselect();
                choiceF.deselect();

  • Maybe you are looking for