Questions on extraction instructions in R3

Hello,
In LBWE (in R3) I need to check whether a datasource is in Active version/Modified version not, but I do not see those options. I only see Active or Inactive.
Is “Inactive” same as “Modified?
The instruction points that if it is in M version to go to RSA5 and select the data source and on Transfer.
If for example, it is not M version, how do I set it to M version?
I saw a couple of datasources which were “Inactive”, when I double click on it in the attempt to change I get “DataSource 2LIS_11_VAKON does not exist”
How do I fix this problem?
Thanks.

Hi ,
Check the tables ,
ROOSOURCE , Give u r data source name , Check content of field OLTP Source version . D will be available already . A will be there if you have activated .
Renjith Kumar

Similar Messages

  • I have a question about extracting pages.  When I do the function, adobe saves the individual files as " file name space page number ", so the files look like this "filename 1.pdf", "filename 2.pdf", "filename 3.pdf".  Without too many gory details, I a

    I have a question about extracting pages.  When I do the function, adobe saves the individual files as "<file name><space><page number>", so the files look like this "filename 1.pdf", "filename 2.pdf", "filename 3.pdf".  Without too many gory details, I am using excel to concatenate some data to dynamically build a hyperlink to these extraced files.  It casues me problems, however, for the space to be the the file name.  Is there any way to change the default behavoir of this function to perhaps use a dash or underscore instead of a space?

    No, you can't change the default naming scheme. You can do it yourself if you extract the pages using a script instead of using the built-in command.

  • Question about Extraction of master data from R/3 into BI 3.5

    Hi there,
    i want to extract master data, let's say customers or material, from an R/3 system into BI 3.5.
    Now I know that SAP delivers ready-to-go DataSources for certain SAP applications that can be used for this type of situation. These DataSources will map some R/3 table fields for example to the according Business Content objects in BI.
    My question is:
    Is there some ready-to-go DataSource for the master data i want to extract? Let it be customer data. Or "business partners" is the appropriate expression i think.
    When I use Tcode SBIW to activate the DataSource I need for the extraction, I kind of have problems finding the right one. But for some simple master data I assume there must be a standard DataSource that I can use without bothering to change anything.
    Or am I thinking the wrong way and it is easier than I think?
    Cheers,
    Stefan

    Hi Stefan,
    Some DataSources are 0MATERIAL_ATTR - 0ARTICLE_ATTR - 0MAT_PLANT_ATTR - 0ART_PLANT_ATTR - 0MAT_SALES_ATTR...
    Consider that in some cases (Retail for example) you can find Master Data with 50mln of records, in this case you need absolutely delta upload method, offered by these extractors.
    And above all you can always enhance these extractors.
    You can built your custom extractors, on MARA - MARC - MBEW - ..., but you will not have delta capabilities and support from SAP for maintenance.
    Ciao.
    Riccardo.

  • General question about Extraction

    Hi guys,
      Please bear with my very preliminary question, but I just wanna set my assumptions straight.
      Now, when we talk about extracting data from SAP R/3, do we have to use CO-PA and LO extraction ?
      In my scenario, we intend to pull data from SAP R/3 Finance and Controlling, so <b>do I HAVE</b> to use the CO-PA extractors ? or
      It`s a good practise to use the CO-PA extracters to get the data from my SAP R/3 Financial Accounting(FI) and Controlling(CO)
      It`s really confusing me because I cannot seem to relate why do I need to use CO-PA to pull the data from my SAP FI/CO when I can use generic extractors ?
      Humble apologies for the simplicity of my question !

    Hi John,
    As Ashwin pointed out COPA is for Profitability Analysis. You need to decide which FI data you wnat to pull from R/3. Based on that you decide on the SAP provided extractors.
    To know more about the SAP provided FI extractors refer the below link:
    Re: R/3 data (FICO, PS)  into BW
    Bye
    Dinesh

  • Question- page extraction

    Is there a way to do page extraction and replacement when using Adobe 9 ( the free version)?

    If by "Adobe" you mean the free Adobe Reader, the answer in no. You need a program that can edit PDF files, such as Adobe Acrobat.

  • Newbie question about extracting data from events

    HI
    i am sure there is a simple solution to this, but I am getting frsutrated  trying to extract useful data from an event:
    I have set up and event listner, whatching for CHANGE on a HorizontalList
    so far so good, event handler called when a list item is clicked, and the event is passed, but what is the syntax for getting the in particular the columnIndex, which can tantalising be seen as part of the event in debug.
        public function ShowGroupTab(event:Event):void{
                var a:Number =event.target.columnIndex;
    causes this runtime error:
    ReferenceError: Error #1069: Property columnIndex not found on mx.controls.HorizontalList and there is no default value.

    First it would be better to cast your event in the proper class. In this case the event is a ListEvent. ListEvent extends Event so your code will work but be harder to maintain.
    Your problem is that you're trying to access the columnIndex property on the event.target instead of the event itself. The event.target is the component on which the action was performed, here it's a HorizontalList, and the list does not have a columnIndex property.
    Try this :
    public function showGroupTab(event:ListEvent):void{
         var a:int= event.columnIndex;

  • Question regarding extract

    Hi,
    When we run incremental extract from 1 database to OBIEE database, let say we start the extract at 22:00, is there a way to control the date/time to which the extract has to spot, for example:
    Extract start at 22:00
    Data up to 20:00
    Thank you,
    F.

    Are you using DAC? then read the below else let me know.
    I would say you no need to bother about the data when you are using dac. If you look at the Prune days is always >=1
    This would extract the data last extract date-Prune days.
    Whatever you do changes those are no use.
    If helps mark

  • App Server Download/Extract Instruction for Unix needs Corrected

    On the following page - http://www.oracle.com/technology/software/products/ias/htdocs/1013.html
    the cpio command does not seem to be correct - it needs a -c flag for the checksum. Please correct.

    For which platform and which files?
    If memory serves me, cpio -imd (or imdv) have before worked on Linux and AIX.

  • Question about wiki instruction

    I'm planning on installing Arch to a USB.  I'm following this guide.  I'm going to use method #2. 
    Regarding ''CHROOT_DIR=archinstall-chroot Must Change First, or you might ruin your /etc/", I am not so sure what to change CHROOT_DIR to.  Could anyone help me out?  Thanks!

    I assume that when you say that it came with four primary partitions, you are sure that it is booting via bios mode and is formatted with MBR partitioning?  Because if it is GPT, then windows is booting via UEFI, and GPT can hold up to 128 primary partitions by default (this can be changed at the time you create the partition table).
    That is indeed the guide I was referring to.  Though if you are going to use UEFI, creating a UEFI bootable installer is a bit different than a simple dd.  Whatever you do, don't use unetbootin, as it is not worth the trouble.
    If you want to learn about Linux, and are aftraid to go about removing partitions, I would recommend using virtualbox instead.  It is very free, and it works quite well, and is fairly user friendly.  There are other virtualization options out there, but virtualbox tends to be the choice of Linux users since it is open source (or at least there is an open source version).  This way you can also still have a running system to view the wiki off of as well, while you learn how to set up your system.  With a bare metal installation of any kind, you are going to have to start with terminal/tty, in which you can access the wiki and whatnot with things like elinks or w3m, but it will be text only.
    I have never tried to make a system that gets loaded into RAM, so I am not sure about how to do this.  It sounds like you are new(ish) to linux.  I am not trying to discourage you, so don't take this that way, but maybe it might be better to start off with a simple normal installation before moving on to things like making a system that gets loaded into RAM.  That is learn about how the stuff works before moving to more advanced topics.  Also, if you are really really new to Linux, it might serve you better to start with a more user friendly distribution, where you can kind of get your feet wet before diving in to something like Arch Linux.  Arch Linux isn't all that hard, but it takes a strong desire to learn if you are totally new (or sometimes even a seasoned Linux user). 
    Oh and regarding the four primary partitions, wth MBR partitioning, you do indeed get four primary partitions, but you can also have as many extended partitions as you want.  So if the recovery and hp tools partitions are important to you, you would want to figure out how to back those up, and then zap them from the HDD.  Then adjust the C: partition to allow the size of you desired Linux, and go from there.  Just don't remove the C: or the system partitions and you will keep a bootable windows inatllation.

  • CRM employee (business partner) & org unit extraction question

    Hi all,
    I have a question regarding extracting business partner and org unit in CRM. Basically user wants to report on employee level and org unit level.
    When I looked at the org unit hierarchy datasource (0BBP_ORGUNIT_HR01_HIER), it does not include the employee. I also tried the DS 0BP_UNAME_ORGUNIT_ATTR, but that does not give me the org unit of an employee.
    Any hint is highly appreciated.
    Best regards,
    Ben

    HI
    Try this DS  0CRM_POSITION_ATTR,here u will get the org.unit,but u need to add the users (employees) in the data source.
    Sridath..

  • Extract Data from a View into multiple columns

    fairly new sql person here, I have a question on extracting data from a View that I have created and formatting it in a way that the user needs.
    My View has the following columns:
    Account
    Department
    Budget
    Spent
    Values would be such as:
    Account Department Budget Spent
    1 A 1.00 1.00
    1 B 2.50 1.45
    1 C 3.00 4.00
    2 A 4.00 1.00
    2 B 2.00 1.00
    What I'm wanting to do is extract the data out in the following format:
    <dept> <account> 1 <account> 2
    <budget> <spent> <budget> <spent>
    A 1.00 1.00 4.00 1.00
    B 2.50 1.45 2.00 1.00
    C 3.00 4.00
    basically dept as a column and then separate columns for each accounts budget and spent values going across
    thanks!

    Search for pivot queries in this forum.
    However, you need to have finite number of accounts in Account column, otherwise output will be, i must say, non-readable and the query to be written would be unrealistic.

  • HFM 9.3.1 Extract Data - adjustments?

    If I run an "extract task">extract data, will it extract adjustments I've entered as well?
    thanks!
    Edited by: user9213000 on 05-Sep-2011 08:42

    BTW,
    The "official" answer to your original question is --> No. It will only extract entity currency. You will have to extract Journals, etc., as well and bring those into the other application.
    A possible "answer" to your second question about extracting all of that data, would be perhaps to use rules and a metadata account to do this. I would create an account called something like boolExtractEntities. Create a rule that checks for that flag to be set to 1. If it is, have it grab everything for the current BASE entity and append to a file. Have it grab Entity Curr Total as that will have adjustments in it as opposed to Entity Currency.
    Depending on what you are looking to get, you could have the rules append to one big file so that if you kick off a consolidation at a parent level with the flag set to 1, it would drop all of the base entity data into this file.
    You're basically recreating the built in extract functionality..... If you are at all familiar with rules and writing to files, this isn't that hard really.

  • How to capture all the values(occurrence) using Extraction Rules(correlation) in VSTS web test?

    Hi,
      I am using VSTS 2010 for performance testing and have a question about Extraction Rules functionality.  Requirement below.
    Example :
    Server Response
    <a>1</a>
    <a>2</a>
     <a>3</a>
    <a>...</a>
    we need to capture all the values with same left and right boundary. Along with the number of occurrence from the response. We need pass a random value in the
    index where the index value will be between 0 - count of values with same left and right boundary.
    How to find out the count of values with same left and right boundary.

    Thanks for Adrian's help.
    Hi PChav,
    Based on your issue, I think that the Adrian's suggestion is useful for you, so I suggest you could refer the Adrian's suggestion to check your issue.
    In addition, I suggest you could also try the rogeorge's suggestion to create a custom extraction rule to do this.
    Reference:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/ccff9f7a-d5bc-45d5-80eb-c83f9fc0e103/how-to-capture-all-the-valuesoccurrence-using-extraction-rulescorrelation-in-web-test?forum=vstswebtest
    Hope it 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.

  • Extracting date in ADF 10g

    I have question in extracting in ADF 10g.
    I am working in a project, I am using ADF 10g, I am creating pages. One of this pages I need to make search by using the Month and the Year.
    The problem is I have the date in one column such as( Jan 16, 2009).
    The Questions is How can I extracting the Month and Year .
    thanx

    Hi,
    You can use this statement
    select DISTINCT EXTRACT(YEAR from A_DATE) from 'table Name'
    Thanks

  • Questions about a MasterQuize program

    Hi, everyone.
    I got a in-class case study program like this in the class:
    * This class stores/represents a question that has one of two
    * answers: True or False.
    * <p></p>
    * It needs to track the following information:
    * <ul>
    * <li>Question text</li>
    * <li>Correct answer</li>
    * <li>The user's answer to the question</li>
    * <li>Points value</li>
    * <li>Category</li>
    * <li>Difficulty rating</li>
    * </ul>
    // Our question should allow us to do the following:
    // - Create question (constructor) -- may be overloaded
    // - Print (display) question
    // - Check client's answer for correctness
    // - Get points value for question (0 or max)
    //   - Add "No-BS" grading option
    // - Getting client's answer
    // - Check to see if answered by client
    public class TrueFalseQuestion
        // Class constants (to simplify changes to common values)
        public static final int MIN_DIFFICULTY_LEVEL = 1;
        public static final int MAX_DIFFICULTY_LEVEL = 5;
        public static final int DEFAULT_DIFFICULTY_LEVEL = 1;
        public static final int DEFAULT_POINT_VALUE = 1;
        public static final String DEFAULT_CATEGORY_VALUE = "none";
        // Class instance variables
        private String questionText;
        private String correctAnswer;
        private String userAnswer;
        private int pointsValue;
        private String category;
        private int difficultyLevel; // TODO: Set a range for difficulty levels
         * @param text The literal wording of this question
         * @param answer The correct answer for this question
         * @param pts The total points available for this question
         * @param ctgry Category keyword for this question
         * @param level The perceived/intended difficulty level of this question
         * <p></p>
         * Defines a TrueFalseQuestion object.
        public TrueFalseQuestion (String text, String answer, int pts, String ctgry, int level)
            // Set starting values for all instance variables
            questionText = text.trim();
            correctAnswer = answer.trim();
            userAnswer = null; // No user answer supplied yet
            if (pts >= 1) // We assume that every problem is worth at least 1 point
                pointsValue = pts;
            else
                pointsValue = DEFAULT_POINT_VALUE;
            category = ctgry.trim();
            if (level >= MIN_DIFFICULTY_LEVEL && level <= MAX_DIFFICULTY_LEVEL) // within range
                difficultyLevel = level;
            else
                difficultyLevel = DEFAULT_DIFFICULTY_LEVEL;
        // Simplified (overloaded) constructors
         * @param text The literal wording of this question
         * @param answer The correct answer for this question
         * @param pts The total points available for this question
         * <p></p>
         * Defines a TrueFalseQuestion with default values for category and difficulty level.
        public TrueFalseQuestion (String text, String answer, int pts)
            // Call pre-existing constructor with default category and difficulty
            this(text, answer, pts, DEFAULT_CATEGORY_VALUE, DEFAULT_DIFFICULTY_LEVEL);
         * @param text The literal wording of this question
         * @param answer The correct answer for this question
         * <p></p>
         * Defines a TrueFalseQuestion with the default point value, default category,
         * and default difficulty level.
        public TrueFalseQuestion (String text, String answer)
            // Call pre-existing constructor with default points, category and difficulty
            this(text, answer, DEFAULT_POINT_VALUE, DEFAULT_CATEGORY_VALUE,
                 DEFAULT_DIFFICULTY_LEVEL);
         * @param text The literal wording of this question
         * @param answer The correct answer for this question
         * @param pts The total points available for this question
         * @param ctgry Category keyword for this question
         * <p></p>
         * Defines a TrueFalseQuestion with the default difficulty level.
        public TrueFalseQuestion (String text, String answer, int pts, String ctgry)
            // Call pre-existing constructor with default points, category and difficulty
            this(text, answer, pts, ctgry,
                 DEFAULT_DIFFICULTY_LEVEL);
         * @param text The literal wording of this question
         * @param answer The correct answer for this question
         * @param ctgry Category keyword for this question
         * <p></p>
         * Defines a TrueFalseQuestion with the default point value and the default
         * difficulty level.
        public TrueFalseQuestion (String text, String answer, String ctgry)
            // Use default points and difficulty
            this(text, answer, DEFAULT_POINT_VALUE, ctgry, DEFAULT_DIFFICULTY_LEVEL);
         * @param text The literal wording of this question
         * @param answer The correct answer for this question
         * @param pts The total points available for this question
         * @param level The perceived/intended difficulty level of this question
         * <p></p>
         * Defines a TrueFalseQuestion with the default value for the question category.
        public TrueFalseQuestion (String text, String answer, int pts, int level)
            // Use default category
            this(text, answer, pts, DEFAULT_CATEGORY_VALUE, level);
        // Clients can invoke this method to retrieve the text of the current question.
        // We chose to return the text instead of printing it; this allows the client
        // to decide how it should be presented (via a GUI, over a network, etc.)
        public String getQuestion ()
            return questionText;
        // This method allows the client to store the user's answer inside the
        // TrueFalseQuestion object for easy comparison
        public void submitAnswer (String ans)
            userAnswer = ans;
        // This method reports whether the submitted answer matches the correct answer
        public boolean answerIsCorrect(String userAns) // This version does all the work
            if (userAns == null) // No response from user (yet)
                return false;
            else
                // Normalize and compare answers
                char key = normalize(correctAnswer); // Get 't' or 'f'
                char ans = normalize(userAns); // Get 't' or 'f'
                return (key == ans);
        public boolean answerIsCorrect ()
            return answerIsCorrect(userAnswer); // Call previously-defined version
        public int getPointsValue()
            return pointsValue;
        // Return the points awarded for the user's answer. This method does
        // NOT support partial credit; answers are either correct or incorrect.
        // If the "No-BS" option is selected, blank (unanswered) questions receive
        // 1 point automatically; otherwise, the score will be either 0 or the
        // question's normal points value.
        public int getPointsEarned(boolean useNoBSRule)
    System.out.println("useNoBS: " + useNoBSRule + "\tuserAnswer: " + userAnswer + "\tcorrectAnswer: " + correctAnswer);
            if (useNoBSRule && (userAnswer == null))
                return 1;
            else if (userAnswer == null)
                return 0; // Without "No-BS", treat blank problems as incorrect
            if (answerIsCorrect() == false)
                return 0;
            else
                return pointsValue;
        // This method returns true if the user has submitted an answer
        // for this question (regardless of whether that answer is correct)
        public boolean hasBeenAnswered ()
            return (userAnswer != null);
        // Private helper method to convert all answers to single lowercase
        // letters (in this case, 't' for TRUE and 'f' for FALSE)
        private char normalize (String input)
             if (input != null)
                  input = input.trim(); // Remove leading whitespace
                  input = input.toLowerCase();
                  return input.charAt(0);
             else
                  return ' ';
    import java.util.*;
    * This class represents a complete test or quiz.
    * Data stored:
    * - List of questions
    * - Total score earned
    * - Total score possible
    * - Name/title of test
    * - Instructions
    *  - Category/class assignment
    *  - Student (test-taker) name
    *  - Date test is/was taken
    *  - Time started
    *  - Time completed
    *  - Maximum time allotted
    *  - (List of) Maximum attempts per question
    *  - List of attempts per question
    *  - List of difficulty ratings per question
    *  - Assignment weight
    * Methods:
    * - Constructor
    * - Add question
    * - Display question
    * - Display test
    * - Display instructions
    *      - Generate random exam
    * - Take/administer test
    * - Get score
    * STUFF TO DO:
    * - Add time/date restrictions
    * - Add network access restrictions
    * - Add other restrictions/allowances?
    * @author (your name)
    * @version (a version number or a date)
    public class Test
        // Class constant
        public static final int MAX_NUMBER_OF_QUESTIONS = 10;
        // Class instance variables
        private String testName;
        private int scoreEarned; // What the student earned on the exam
        private int scorePossible; // Total point values of all questions
        private String instructions; // Exam header text
        private ArrayList<TrueFalseQuestion> questions; // Create inside constructor
        // Methods
        public Test (String name, String instr)
            testName = name;
            scoreEarned = 0;
            scorePossible = 0;
            instructions = instr;
            questions = new ArrayList<TrueFalseQuestion>(); //[MAX_NUMBER_OF_QUESTIONS];
        public String getInstructions()
            return instructions;
        public int getScore()
            return scoreEarned;
        public void addQuestion (TrueFalseQuestion q)
            scorePossible += q.getPointsValue();
            questions.add(q); // Automatically append question to end of test
        public String displayQuestion (int position)
            if (position < questions.size())
                return (position+1) + ". " + questions.get(position).getQuestion();
            else
                return null;
        public String displayTest ()
            String result = "";
            for (int i = 0; i < questions.size(); i++)
                result += (i+1) + ". (";
                TrueFalseQuestion t = questions.get(i);
                result += t.getPointsValue();
                result += " points)\n\n" + displayQuestion(i);
                result += "\n\n";
            return result;
        // Get test length (number of questions)
        public int length ()
             return questions.size();
        // Submit answer to a specific question
        public boolean answer(int number, String a)
             // Question numbers run from 0-(max-1) -- THIS WAS AN OFF-BY-ONE ERROR AT FIRST
             if (number >= 0 && number < questions.size())
                  TrueFalseQuestion t = questions.get(number);
                  t.submitAnswer(a);
                  return true; // Question was answered
             else
                  return false; // Unable to answer (nonexistent) question
        // Score exam
        public void scoreExam (boolean useNoBS)
             scoreEarned = 0;
             for (int i = 0; i < questions.size(); i++) // For each question in exam
                  TrueFalseQuestion t = questions.get(i); // get current question
                  scoreEarned += t.getPointsEarned(useNoBS);
    }// Test harness for the Test and *Question classes
    import java.util.*;
    public class QuizDriver
         public static void main(String[] args)
              // Create a new Test object
              Test exam = new Test("Sample Exam", "Select the correct answer for each question");
              setUp(exam);
              Scanner sc = new Scanner(System.in);
              System.out.println(exam.getInstructions());
              // Administer exam
              for (int i = 0; i < exam.length(); i++)
                   // Print out current question
                   System.out.println(exam.displayQuestion(i));
                   // Get user answer
                   System.out.print("Your answer: ");
                   String ans = sc.nextLine();
                   if (ans.equals("")) // Handle blank responses for unanswered questions
                        ans = null;
                   exam.answer(i, ans);
              // Get exam results
              exam.scoreExam(true);
              System.out.println("Your final score was " + exam.getScore() + " points.");
         private static void setUp (Test t)
              TrueFalseQuestion x = new TrueFalseQuestion("The sky is blue.", "true", 2);
              t.addQuestion(x);
              x = new TrueFalseQuestion("The first FORTRAN compiler debuted in 1957", "true", 5);
              t.addQuestion(x);
              x = new TrueFalseQuestion("Spock was a Vulcan", "false", 3);
              t.addQuestion(x);
    }This program is far from finishing.
    I have many questions about this program, but let me ask this one first:
    In the TrueFalseQeustion class, why are there so many constructors? What is the purpose of setting some of the variables to default values?
    Thank you very much!!!
    Edited by: Terry001 on Apr 16, 2008 10:02 AM

    newark wrote:
    Stop ignoring the error messages. You seem to think that an error message means you're doing the assignment wrong. It's probably a simple fix. Post the exact error messages, as well as the code that corresponds to them. The error message will tell you exactly what line the problem occurs on, so you know right where to look.Hi,
    After some modifications, the program now gives me the result the assignment wants when I run it. But I still have trouble with the MultipleChoiceQuestion class
    Here is the complete program
    QuizDriver class
    // Test harness for the Test and *Question classes
    import java.util.*;
    public class QuizDriver
         public static void main(String[] args)
              // Create a new Test object
              Test exam = new Test("Sample Exam", "Select the correct answer for each question");
              setUp(exam);
              Scanner sc = new Scanner(System.in);
              System.out.println(exam.getInstructions());
              // Administer exam
              for (int i = 0; i < exam.length(); i++)
                   // Print out current question
                   System.out.println(exam.displayQuestion(i));
                   // Get user answer
                   System.out.print("Your answer: ");
                   String ans = sc.nextLine();
                   if (ans.equals("")) // Handle blank responses for unanswered questions
                        ans = null;
                   exam.answer(i, ans);
              // Get exam results
              exam.scoreExam(true);
              System.out.println("Your final score was " + exam.getScore() + " points.");
         private static void setUp (Test t)
                                   Question x;
              x = new TrueFalseQuestion("The sky is blue.", "true", 2);
              t.addQuestion(x);
              x = new TrueFalseQuestion("The first FORTRAN compiler debuted in 1957", "true", 5);
              t.addQuestion(x);
              x = new TrueFalseQuestion("Spock was a Vulcan", "false", 3);
              t.addQuestion(x);
              x = new MultipleChoiceQuestion("What is the color of the car\na.Red\nb.Green", "a. Red", 3);
              t.addQuestion(x);
              x = new MultipleChoiceQuestion("What is the name of this class\na.CSE110\nb.CSE114", "b, CSE114", 3);
              t.addQuestion(x);
    }Test
    public class Test
        // Class constant
        public static final int MAX_NUMBER_OF_QUESTIONS = 10;
        // Class instance variables
        private String testName;
        private int scoreEarned; // What the student earned on the exam
        private int scorePossible; // Total point values of all questions
        private String instructions; // Exam header text
        private ArrayList<Question> questions; // Create inside constructor
        // Methods
        public Test (String name, String instr)
            testName = name;
            scoreEarned = 0;
            scorePossible = 0;
            instructions = instr;
            questions = new ArrayList<Question>(); //[MAX_NUMBER_OF_QUESTIONS];
        public String getInstructions()
            return instructions;
        public int getScore()
            return scoreEarned;
        public void addQuestion (Question q)
            scorePossible += q.getPointsValue();
            questions.add(q); // Automatically append question to end of test
        public String displayQuestion (int position)
            if (position < questions.size())
                return (position+1) + ". " + questions.get(position).getQuestion();
            else
                return null;
        public String displayTest ()
            String result = "";
            for (int i = 0; i < questions.size(); i++)
                result += (i+1) + ". (";
                Question t = questions.get(i);
                result += t.getPointsValue();
                result += " points)\n\n" + displayQuestion(i);
                result += "\n\n";
            return result;
        // Get test length (number of questions)
        public int length ()
             return questions.size();
        // Submit answer to a specific question
        public boolean answer(int number, String a)
             // Question numbers run from 0-(max-1) -- THIS WAS AN OFF-BY-ONE ERROR AT FIRST
             if (number >= 0 && number < questions.size())
                  Question t = questions.get(number);
                  t.submitAnswer(a);
                  return true; // Question was answered
             else
                  return false; // Unable to answer (nonexistent) question
        // Score exam
        public void scoreExam (boolean useNoBS)
             scoreEarned = 0;
             for (int i = 0; i < questions.size(); i++) // For each question in exam
                  Question t = questions.get(i); // get current question
                  scoreEarned += t.getPointsEarned(useNoBS);
    }Question
    public class Question
    // Class constants
      public static final int MIN_DIFFICULTY_LEVEL = 1;
      public static final int MAX_DIFFICULTY_LEVEL = 5;
      public static final int DEFAULT_DIFFICULTY_LEVEL = 1;
      public static final int DEFAULT_POINT_VALUE = 1;
      public static final String DEFAULT_CATEGORY_VALUE = "none";
      // Class instance variables
      protected String questionText;
      protected String correctAnswer;
      protected String userAnswer;
      protected int pointsValue;
      protected String category;
      protected int difficultyLevel; //TODO: set a range for difficulty levels
      // Constructors
      public Question (String text, String answer, int pts, String ctgry, int level)
          questionText = text.trim();
          correctAnswer = answer.trim();
          userAnswer = null;
          if (pts >= 1)
              pointsValue = pts;
            else
                pointsValue = DEFAULT_POINT_VALUE;
            category = ctgry.trim();
            if (level >= MIN_DIFFICULTY_LEVEL && level <= MAX_DIFFICULTY_LEVEL)
                difficultyLevel = level;
            else
                difficultyLevel = DEFAULT_DIFFICULTY_LEVEL;
        // Overloaded (simplied) constructors
        public Question (String text, String answer, int pts)
            this(text, answer, pts, DEFAULT_CATEGORY_VALUE, DEFAULT_DIFFICULTY_LEVEL);
        public Question (String text, String answer, int pts, String ctgry)
            this(text, answer, pts, ctgry, DEFAULT_DIFFICULTY_LEVEL);
        public Question (String text, String answer, String ctgry)
            this(text, answer, DEFAULT_POINT_VALUE, ctgry, DEFAULT_DIFFICULTY_LEVEL);
        public Question (String text, String answer, int pts, int level)
            this(text, answer, pts, DEFAULT_CATEGORY_VALUE, level);
        // Methods
        public String getQuestion ()
            return questionText;
        // Use this method to store user answers
        public void submitAnswer (String ans)
            userAnswer = ans;
        public boolean answerIsCorrect (String userAns)
            if (userAns == null)
                return false;
            else
                // Normalize and compare answers
                char key = normalize (correctAnswer); //Get the first letter of an answer
                char ans = normalize (userAns); //Get the first letter of an answer
                return (key == ans);
        public boolean answerIsCorrect ()// Why do we need two answerisCorrect() methods?
            return answerIsCorrect (userAnswer);
        public int getPointsValue ()
            return pointsValue;
        public int getPointsEarned (boolean userNoBSRule)
            System.out.println ("useNoBS: " + userNoBSRule + "\tuseAnswer: " + userAnswer + "\tcorrectAnswer: " + correctAnswer);
            if (userNoBSRule && (userAnswer == null))
                return 1;
            else if (userAnswer == null)
                return 0;
            if (answerIsCorrect() == false)
                return 0;
            else
                return pointsValue;
        public String getCorrectAnswer ()
            return correctAnswer;
        public boolean hasBeenAnswered ()
            return (userAnswer != null);
        private char normalize (String input)
            if (input != null)
                input = input.trim();
                input = input.toLowerCase();
                return input.charAt(0);
            else
                return ' ';
           TrueFalseQuestion
    public class TrueFalseQuestion extends Question
      public TrueFalseQuestion (String text, String answer, int pts, String ctgry, int level)
          super(text, answer, pts, ctgry, level);
        public TrueFalseQuestion (String text, String answer, int pts)
            super(text, answer, pts, DEFAULT_CATEGORY_VALUE, DEFAULT_DIFFICULTY_LEVEL);
        public TrueFalseQuestion (String text, String answer, int pts, String ctgry)
            super(text, answer, pts, ctgry, DEFAULT_DIFFICULTY_LEVEL);
        public TrueFalseQuestion (String text, String answer, String ctgry)
            super(text, answer, DEFAULT_POINT_VALUE, ctgry, DEFAULT_DIFFICULTY_LEVEL);
        public TrueFalseQuestion (String text, String answer, int pts, int level)
            super(text, answer, pts, DEFAULT_CATEGORY_VALUE, level);
        // Methods
        public String[] getPossibleAnswerChoice ()
            String[] possibleAnswerChoice = {"true", "false"};
            return possibleAnswerChoice;
    } MultipleChoiceQuestion
    public class MultipleChoiceQuestion extends Question
       public MultipleChoiceQuestion (String text, String answer, int pts, String ctgry, int level)
           super(text, answer, pts, ctgry, level);
        public MultipleChoiceQuestion (String text, String answer, int pts)
            super(text, answer, pts, DEFAULT_CATEGORY_VALUE, DEFAULT_DIFFICULTY_LEVEL);
        public MultipleChoiceQuestion (String text, String answer, int pts, String ctgry)
            super(text, answer, pts, ctgry, DEFAULT_DIFFICULTY_LEVEL);
        public MultipleChoiceQuestion (String text, String answer, String ctgry)
            super(text, answer, DEFAULT_POINT_VALUE, ctgry, DEFAULT_DIFFICULTY_LEVEL);
        public MultipleChoiceQuestion (String text, String answer, int pts, int level)
            super(text, answer, pts, DEFAULT_CATEGORY_VALUE, level);
        // Methods
        String possibleAnswers;
        public String getPossibleAnswers ()
            return possibleAnswers;
        public void addAnswerChoice (String answerChoice)
            String ansChoice = answerChoice;
            questionText += "\nansChoice";
            possibleAnswers = answerChoice;
        public void printAnswerChoice ()
            System.out.println (questionText);
    } I don't understand why the assignment wants me to build a method in the MultpleChoiceQuestion class to store the potential answer choices, I can make the program display the potential answer choices by including them in the questionText as following in the QuizDriver class
    Question x;
    x = new MultipleChoiceQuestion("What is the color of the car\na.Red\nb.Green", "a. Red", 3);
    t.addQuestion(x); I don't know how to allow the client to construct the list of answer choices one at a time(add one potential answer choice by calling the addAsnwerChoices() method once)
    Here are a few original sentences of my assignment which describe what I should do with the MultipleChoiceQuestion class
    Using TrueFalseQuestion as a model, develop a new MultipleChoiceQuestion class that can be used to represent a problem where the user must select one of several answer choices (e.g., "Select answer (a), (b), (c), or (d)."). This new question type should have all of the same externally-visible functionality as TrueFalseQuestion, except that it must:
    maintain a list of potential answer choices
    provide a method that allows the client to construct the list of answer choices one at a time (i.e., the client should be able to call an addAnswerChoice() method to pass a new answer option to the MultipleChoiceQuestion.)
    display (as part of the question text) the list of answer choices with appropriate letters ("abcd" instead of "0123") I don't understand what these sentences mean.
    1. "Maintain a list of potential answer choices"-- this reminds me of the getPossibleAnswerChoice() method in the TrueFalseQuestion class
    public String[] getPossibleAnswerChoice ()
            String[] possibleAnswerChoice = {"true", "false"};
            return possibleAnswerChoice;
        }I wonder that if the potential answer choices I have to store in the MultipleChoiceQuestion class are only letters "a", "b", "c", "d", etc, or include the answer text coming after the letters(eg. a.Red, b.Green)
    2. "provide a method that allows the client to construct the list of answer choices one at a time". How do I achieve the functionality "one at a time"? Do I need to pass the input of the client (a potential answer choice) to the variable of the method which stores the list of potential answers?
    3. "display (as part of the question text) the list of answer choices with appropriate letters". My question here is that: When the client type in one possible answer, should I append it to the variable questionText? (So I use the questionText variable in the methods of the first and second steps)
    Thank you very much for your nice help!
    Edited by: Terry001 on Apr 21, 2008 8:01 AM

Maybe you are looking for

  • Some advice with some loops - I'm new to java!

    I am trying to make a game (text based) Where you have 1 of 3 weapons a dog (can tell if a person is a vampire and warn you) a map (allows you to find a place to hide) and a gun (allows you to shoot the vampires!) I want it to be a 50/50 chance of be

  • The Video check box in the Import Settings is greyed out, what have I done?

    I am using a Sony Handycam HDR-SR5E with final cut pro (v7.0l). When logging and transferring my recent files I found i only imported the sound. So returning to the log and transfer window, and checking on the import settings i notice the check boxes

  • Separating 1 library into 2 for 2 different pods

    Is there a way to take 1 large i tunes library and separate it into 2 for 2 different pods that share 1 computer?

  • Having an issue with event handling - sql & java

    HI all am trying to construct this hybrid of java and mysql. the data comes from a mysql database and I want it to display in the gui. this I have achieved thus far. However I have buttons that sort by surname, first name, ID tag etc....I need event

  • Change process chain...

    Hi Gurus, I have a process chain in dev which I transported to prod. Now I want to make changes to the process chain. Can you please explain the procedure that I should follow? Thanks NewBW