@Return - Help with displaying error correctly

Hi,
I'm trying to use the @Return function to block users from entering a negative value in the 'FTE' member of the 'F T E' dimension.  When I run the below from Business Rules menu it displays the error correctly in a window.  However when I run when it's attached to a webform which I need, the error displays as:
Error Detected while attempting to run job:  AAA - Non Discretionary Allocation - Budget.
ADF_FACES-60097: For more information, please see the servers' error log for an entry beginning with:  ADF_FACES-60096:Server Exception during PPR, #3
So my question is why does it work perfectly from Business Rules menu but not from the Webforms?
Fix (  "No FTE" )
         "512100" (
         If(@ISMBR("8900"))
         If("FTE" < 0)
         @RETURN( @CONCATENATE(
                             @CONCATENATE("Negative values are not allowed as input into the dimension 'F T E' for member:[", @NAME(@CURRMBR("F T E"))),
                             "]. Please input a value greater or equal to zero to continue.")
         , ERROR);
        ELSE
         @Round("FTE" * "Avg School Principal Salary"->"No Dept"->"Preliminary (Rolled)"->"No Fund"->"No Program",-2);
         Endif Endif )

Is that your real script? If you are only looking at "No FTE" (assuming it is from "F T E" dimension) why currmbr?
What is 8900 and 512100 are they accounts? If so why are you opening 512100 and checking for 8900?
If I were you and trying something like this and hit and error, I would try to put a value and see if that works or not. So if FTE<0 put 1 else put the formula.
Regards
Celvin

Similar Messages

  • Help with displaying errors in jsp using html:errors/

    Here is my problem.
    In my overridden ActionForm.validate() method, i am returning ActionErrors (as required). When there are input errors in my form submission, the control goes back to the JSP page i used to read user input (so far so good). The JSP page is rendered fine for taking input for the second time but no errors are displayed although i am using the tag <html:errors/>
    I tried to find the org.apache.struts.action.ERROR in my request attributes and it is there with the size of 1 (because i am reporting one error, in my sample run). Any idea why <html:errors/> won't display the errors even though they are there??? Here is what i am doing in my ActionForm class:
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    ActionErrors errors = new ActionErrors();
    if (this.email == null || this.email.length() < 1) {
    errors.add("username", new ActionError
    ("error.username.required"));
    return errors;
    Any help is appreciated.

    First of all, thanks for taking time to look at my message. Here is how my message-resources tag look like in struts-config.xml file:
    <message-resources parameter="ApplicationResources"/>
    The "ApplicationResources.properties" file exist in the WEB-INF folder of my application and following are the entries in that file that i think are relevant:
    errors.header=<h3><font color="red">Validation Error</font></h3>You must correct the following error(s) before proceeding:<ul>
    errors.footer=</ul><hr>
    error.username.required=<li>Username is required</li>
    Is there anything else needed to go into resource file? Or should i put my resource file somewhere else?

  • Help with SIGSEGV error, please?

    Greetings,
    I have no idea what this error log means. It only happens on one computer, so it isn't the program. Something in the system is messed up. Can anyone tell what from this?
    # A fatal error has been detected by the Java Runtime Environment:
    #  SIGSEGV (0xb) at pc=0x00007fff840542db, pid=533, tid=36871
    # JRE version: 7.0_10-b18
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (23.6-b04 mixed mode bsd-amd64 compressed oops)
    # Problematic frame:
    # C  [libGL.dylib+0x22db]  glGetString+0xf
    # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
    http://pastie.org/8138651
    And where do I type "ulimit -c unlimited"? I typed it in Terminal, but nothing happened.
    Thanks

    Hi, I�m currently writing some code that requires me
    to read in a list of names and prices from a txt file
    then sort them, I have so far successfully created a
    menu and the code to read in my txt file "cars.txt"
    however it is returning me with an error, I need to
    sort this part out before I can move on to the
    sorting section, any help would be much appreciated,
    James
    C:\Documents and Settings\James\Desktop\lateast
    java\carprogramjames.java:54: unreported exception
    java.io.FileNotFoundException; must be caught or
    declared to be thrown
              Scanner scan = new Scanner (myFile);
              ^
    1 error
    Tool completed with exit code 1Do it like this:
    public void ReadCarsAndPricesFromFile() throws FileNotFoundException {
    }orpublic void ReadCarsAndPricesFromFile() {
        try {
            Scanner scan = new Scanner (myFile);
        } catch(FileNotFoundException  fnfe) {
            fnfe.printStackTrace();
    }Details:
    http://java.sun.com/docs/books/tutorial/essential/exceptions/
    And also take the time to read this:
    http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html
    Good luck.

  • Please help with compiling error

    Hello, I am currently taking a class in Java Programming and need help with an error. I am working on a Mortgage Calculator and when I compile the code I get this error. I have no idea how to fix this. Can anyone help? Thank you.
    '{' expected public class MortgageCalculator
    1 error
    Tool completed with exit code 1
    Here is my code
    import java.io.*;//*java input output
    import java.util.Date;//Date Utility
    import java.util.Formatter;//format Utility
    import java.text.NumberFormat;//*format numbers
    //class MortgageCalculator
    public class MortgageCalculator
    public static void main(String[]args);{
    Date currentDate=newDate();
    DecimalFormat decimalPlaces=newDecimalFormat("0.00");
    //declare Variables
    final double principalBalance=200000;//*$200,000 Loan
    final double monthlyInterest=.06;//*6% interest rate
    final double Term=12*30;//*monthly interest rate
    final double monthlyInterest=((principalBalance*(monthlyInterest/12))/(1-Math.pow(1+(monthlyInterest/12))-(Term)));
    //Display Output
    System.out.println("\t\t" + currentDate);
    System.out.println("\t\tLoan Amount" + principalBalance);
    System.out.println("\t\tInterest Rate" + monthlyInterest);
    System.out.println("\t\tTerm of Loan" + Term);
    System.out.println("\t\tThe Payment will be:" + monthlyInterest);
    System.out.println(decimalPlaces.format(mothlyInterest));
    }

    You need to enclose your class body in { }. You're missing at least one of them

  • Help with the error message that ADE is not allowed to copy a book onto my Nook. I have tried authorizing and unauthorizing many times--at wits end with this issue.

    Help with the error message that ADE is not allowed to copy a book onto my Nook. I have tried authorizing and unauthorizing many times--at wits end with this issue.

    I too am having the same problem. I have a new hard drive that was imaged from the old one and I'm trying to side load a book to my Nook Simple Touch.. I first installed ADE 4 then borrowed and downloaded a book from Overdrive. I tried a few times to delete and reauthorize both the computer and the Nook and each time I get an authorization error when I try to side load the book. I then found on the Nook forum that the Simple Touch and ADE 4 don't get along. So I uninstalled ADE 4 and installed ADE 3.
    I then followed this recommended procedure found on the forum: I deleted the Digital Editions folder from my Nook, launched ADE 3 and authorized the computer, then connected the Nook. For a few seconds, hovering the mouse over the setting icon for the Nook displayed everything on the context menu grayed out. But then it showed the context menu and I was able to display the Nook's authorization, which was the same as the computer's. Still get the same error side loading the book. Deleting and reauthorizing doesn't help.  And the Digital Editions folder is still missing from the Nook.

  • Need a little help with some errors.

    Receiving some errors..
    btn2.addActionListener(new ActionListener() {
    and also
    frame.setLocation(400,400);
    frame.setVisible(true);
    }<<~~has 2 errors here...
    Both above have class or interface expected errors..clueless on what i'm missing at the moment.
    Anyone mind pointing out what {'s and }'s i'm missing?
         btn1.addActionListener(new ActionListener() {
                             public void actionPerformed(ActionEvent evt) {
                                  btn1actions();
              private void btn1actions() {
                   if (radio1.isSelected()) System.out.println("Radio Button 1 is selected.");
                   if (radio2.isSelected()) System.out.println("Radio Button 2 is selected.");
         btn2.addActionListener(new ActionListener() {
                                       public void actionPerformed(ActionEvent evt) {
                                            btn2actions();
                        private void btn2actions() {
                             if (radio1.isSelected()) System.out.println("Radio Button 1 is selected.");
                             if (radio2.isSelected()) System.out.println("Radio Button 2 is selected.");
                   btn3.addActionListener(new ActionListener() {
                                       public void actionPerformed(ActionEvent evt) {
                                            btn1actions();
                        private void btn3actions() {
                             txt1.setText("");
                             txt1.requestFocus();
    public static void main(String[] args) {
        Test2 frame = new Test2();
        frame.setTitle("Test Frame");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(400, 300);
        frame.setLocation(400,400);
        frame.setVisible(true);
    }

    All my code..finally posted...just need help with more errors.
    F:\DocumentsTest2.java:169: ';' expected
              btn1.addActionListener(new ActionListener()) {
    ^
    F:\Documents\Test2.java:176: illegal start of expression
              private void btn1actions() {
    ^
    F:\Documents\Test2.java:191: illegal start of expression
              private void btn2actions() {
    ^
    F:\Documents\.java:202: illegal start of expression
              private void btn3actions() {
    ^
    4 errors
    Tool completed with exit code 1
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Test2 extends JFrame{
         static JButton btn1,btn2,btn3;
         static JTextField txt1;
         static JRadioButton radio1,radio2;
           public Test2() {
             Container container = getContentPane();
             container.setLayout(new BorderLayout());
              //Create Panels
                JPanel Panel1 = new JPanel();
                JPanel Panel2 = new JPanel();
                JPanel Panel3 = new JPanel();
                JPanel Panel4 = new JPanel();
                JPanel Panel5 = new JPanel();
                JPanel Panel6 = new JPanel();
                JPanel Panel7 = new JPanel();
                JPanel Panel8 = new JPanel();
                JPanel Panel9 = new JPanel();
                JPanel Panel10 = new JPanel();
              //Set Layout for Panels
              Panel3.setLayout(new BorderLayout());
              Panel4.setLayout(new BorderLayout());
              Panel5.setLayout(new BorderLayout());
              Panel6.setLayout(new BorderLayout());
              Panel10.setLayout(new BorderLayout());
              //Create the Various Fonts and Colors for this GUI
              Font font1 = new Font("SansSerif", Font.BOLD, 20);
              Font font2 = new Font("Serif", Font.PLAIN, 15);
              Color color1 = new Color(3,15,125);//A Dark Blue Color
              Color color2 = new Color(201,29,10);//A Red Color
              Color color3 = new Color(127,127,127);//A Grey Color
              //Create Buttons and Labels
             btn1 = new JButton("Submit");
             btn2 = new JButton("Display Schedule");
             btn3 = new JButton("Enter New Name");
             JLabel label1 = new JLabel("Student Name");
             JLabel label2 = new JLabel("Course Number");
              JLabel label3 = new JLabel("Welcome to the Java Community College");
              JLabel label4 = new JLabel("Registration System!");
              //Declare Text Field For Entering Student Names
              txt1 = new JTextField(15);
              //"Put Course Number from another Method Here"
              String[] courseStrings = { "CISM2230 A", "CISM2230 B", "CISM1110 A", "CISM1110 B", "CISM1120 A", "CISM1120 B" };
              JComboBox Combo1 = new JComboBox(courseStrings);
              //Declare Radio Buttons for Add and Drop Course
              radio1 = new JRadioButton("Add a Course", false);
              radio2 = new JRadioButton("Drop a Course", false);
              ButtonGroup radioButtons = new ButtonGroup();
              radioButtons.add(radio1);
              radioButtons.add(radio2);
              //Panel 10 is the Main Displaying Panel
              Panel10.add(Panel3, BorderLayout.NORTH);
              Panel10.add(Panel4, BorderLayout.CENTER);
              Panel10.add(Panel8, BorderLayout.SOUTH);
              //Panel 3 Used to Display Label 3 and 4 using Panels 1 and 2
              Panel3.add(Panel1, BorderLayout.NORTH);
              Panel3.add(Panel2, BorderLayout.CENTER);
              Panel1.add(label3);
             Panel2.add(label4);
              //Panel 4 Used to Display Student Name, Txt1, Course Number, Combo Box and Radio Buttons
             Panel5.add(label1, BorderLayout.NORTH);
             Panel5.add(txt1, BorderLayout.CENTER);
             Panel6.add(label2, BorderLayout.NORTH);
              Panel6.add(Combo1, BorderLayout.CENTER);
              Panel7.add(radio1, BorderLayout.NORTH);
              Panel7.add(radio2, BorderLayout.CENTER);
              Panel4.add(Panel5, BorderLayout.NORTH);
              Panel4.add(Panel6, BorderLayout.CENTER);
              Panel4.add(Panel7, BorderLayout.SOUTH);
              //Panel 8 Used to Display the Buttons
              Panel9.add(btn1, BorderLayout.CENTER);
              Panel9.add(btn2, BorderLayout.CENTER);
              Panel9.add(btn3, BorderLayout.SOUTH);
              Panel8.add(Panel9, BorderLayout.CENTER);
              //Setting Background, ForeGround and Font of all Text.
             Panel1.setBackground(color3);
             Panel2.setBackground(color3);
             Panel3.setBackground(color3);
             Panel4.setBackground(color3);
             Panel5.setBackground(color3);
             Panel6.setBackground(color3);
             Panel7.setBackground(color3);
             Panel8.setBackground(color3);
             Panel9.setBackground(color3);
             Panel10.setBackground(color3);
             btn1.setBackground(color3);
             btn2.setBackground(color3);
             btn3.setBackground(color3);
             radio1.setBackground(color3);
             radio2.setBackground(color3);
             btn1.setFont(font2);
             btn2.setFont(font2);
             btn3.setFont(font2);
             Combo1.setFont(font2);
             Combo1.setBackground(color3);
             Combo1.setForeground(color1);
             label1.setFont(font2);
             label2.setFont(font2);
             label3.setFont(font1);
             label4.setFont(font1);
             label1.setForeground(color2);
             label2.setForeground(color2);
             label3.setForeground(color1);
             label4.setForeground(color1);
             container.add(Panel10);
              //Setting Keyboard Shortcuts to Radio Buttons and Regular Buttons
              btn1.setMnemonic('S');
              btn2.setMnemonic('D');
              btn3.setMnemonic('E');
              radio1.setMnemonic('A');
              radio2.setMnemonic('C');
              //ActionListener
              btn1.addActionListener(new ActionListener()) {
                   public void actionPerformed(ActionEvent evt) {
                        btn1actions();
              private void btn1actions() {
                   if (radio1.isSelected()){ System.out.println("Radio Button 1 is selected. Button 1")};
                   if (radio2.isSelected()){ System.out.println("Radio Button 2 is selected. Button 1")};
              btn2.addActionListener(new ActionListener()) {
                   public void actionPerformed(ActionEvent evt) {
                                            btn2actions();
              private void btn2actions() {
                   if (radio1.isSelected()) System.out.println("Radio Button 1 is selected(Button 2).");
                   if (radio2.isSelected()) System.out.println("Radio Button 2 is selected.Button 2");
              btn3.addActionListener(new ActionListener()) {
                   public void actionPerformed(ActionEvent evt) {
                        btn1actions();
              private void btn3actions() {
                   txt1.setText("");
                   txt1.requestFocus();
         public static void main(String[] args) {
             JavaCollegeTest2 frame = new JavaCollegeTest2();
             frame.setTitle("Project 4");
             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             frame.setSize(400, 300);
             frame.setLocation(400,400);
             frame.setVisible(true);
    }

  • Installing Elements 11 on Mac. Need help with install error "Setup wants to make changes."

    Installing Elements 11 on Mac 10.8.2. Need help with install error:  Setup wants to make changes. Type your password to allow this."  After entering Adobe password, nothing happens.  Locked from further installation.  Any ideas?  Adobe phone support could not help.

    Just before letting changes (installation in this case) be made on the system, Mac OS prompts for password & this has to be the Mac system password. This password prompt is the system's own native prompt & would accept the system password only. Please make sure it is the right system password (all/admin rights) and the installaion should run.

  • Can anyone help with this error? ;At line 102 of file"C:/Program files (x86)/Macromedia/Dreamweaver

    Can anyone help with this error please?;At line 102 of file"C:/Program files (x86)/Macromedia/Dreamweaver 8/Configuration/Objects/Common/Images.js"; TypeError: cmdDOM.parentWindow.setFormItem is not a function

    If Dreamweaver shows a message saying "the following JavaScript error(s) occurred",  it's usually a sign of a corrupt cache file. The first thing you should always be to delete the file cache. If that doesn't work, delete your personal Configuration folder. Please go through the steps mentioned in thread Deleting a corrupted cache file.

  • Help with CreateDefaultDomain error

    hello guy,
    Please i need help with this errors
    "*ERROR: An error occurred while building the default domain.*
    *Please see this log file for more details:*
    *C:\oracle\Middleware\jdeveloper\system\system11.1.1.0.31.52.05\o.j2ee.adrs\CreateDefaultDomain.log*"
    This is the content of the log.
    *"Default domain will be created:*
    *C:\oracle\Middleware\jdeveloper\system\system11.1.1.0.31.52.05\DefaultDomain*
    *C:\oracle\Middleware\wlserver_10.3\common\bin\wlst.cmd "C:\oracle\Middleware\jdeveloper\system\system11.1.1.0.31.52.05\o.j2ee.adrs\CreateDefaultDomain.py"*
    *Process started*
    *wlst > 'C:\WINDOWS\system32\QTJava.zip' is not recognized as an internal or external command,*
    *wlst > operable program or batch file.*
    *Elapsed time: 609 ms".*
    this error is effecting the applications i built.
    thank
    kolly

    just check your parameter... it means that the parameter on showInputDialog on the API dont match with the parameter with your showInputDialog code

  • Help with code errors

    Can somebody help me get rid of the following compile errors:
    coreservlets/OrderPage.java:61: setNumOrdereed(int, int) in coreservlets.ShoppingCart
    cannont be applied to (java.lang.String,int)
    cart.setNumOrdered(recordingid, numItems);
    .\coreservlets\shoppingCart.java:44 cannot resolve symbol
    symbol : variable recordingid
    location: class coreservlets.ShoppingCart
    if (order.getrecordingid() == (recordingid)) {
    .\coreservlets\ShoppingCart.java:49: cannot resolve symbol
    symbol : variable recordingid
    location: class coreservlets.ShoppingCart
    itemOrder new order = new ItemOrder(Catalog.getItem(recordingid));I know that not very helpful with out the code but the code is very big so if anyone wants me to post extracts from the code please tell me.

    Thank you i put that code in but now get the following:
    coreservlets/OrderPage.java:40:  incompatible types
    found : java.lang.strgin
    required: int int recordingid = request.getParameter("recordingid")!=null?request.getParameter("recordingid"):1;
    ^/code]
    coreservlets/OrderPage.java:48: addItem(java.lang.String) in coreservlets.ShoppingCart cannot be applied to (int)
    cart.additem(recordingid);
    .\coreservlets\AhoppingCart.java:44: cannot resolve symbol
    symbol: variable recordingid
    location: class coreservlets.ShoppingCart
    if (order.getrecordingid() == (recordingid)) {
    .\coreservlets\AhoppingCart.java:49: cannot resolve symbol
    symbol: variable recordingid
    location: class coreservlets.ShoppingCart
    ItemOrder newOrder = new ItemOrder(Catalog.getItem(recordingid));
    4 errors.
    Also could you explain what the line you added to the code means:
    !=null?request.getParameter("recordingid"):1;
    !=null?request.getParameter("numItems"):"1";and how come you got rid of if (recordingid != null) {Thanks for any help with these errors
    OK I HAVE GOT RID OF ALL THE ERRORS APART FROM THE TOP ONE:
    code]coreservlets/OrderPage.java:40: incompatible types
    found : java.lang.strgin
    required: int
    int recordingid = request.getParameter("recordingid")!=null?request.getParameter("recordingid"):1;
                                            /code]
    Message was edited by:
            ajrobson                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Help with display of numbers

    First of all I have to say the tutorials on this site are extremely helpful. My instructor wants all our java code written as Object Oriented and when I did a search on here for Object Oriented it totally helped out. Now I just need help with the display of numbers, my code works perfectly fine except that the number has wayyyyyyyyyyy to many decimal points after it. I only wanted two.
    public class Mortgage
         double mtgAmount;
         double mtgTerm;
         double mtgRate;
         double monthPymt;
              public void Amount(double newValue)
                     mtgAmount = newValue;
              public double Amount()
                   return mtgAmount;
              public void Term(double newValue)
                     mtgTerm = newValue;
              public double Term()
                   return mtgTerm;
              public void Rate(double newValue)
                     mtgRate = newValue;
              public double Rate()
                   return mtgRate;
              public void calcmonthPymt(double newValue)                            //(LoanAmt * Rate) / (1- Math.pow(1+Rate,-Term));
                     monthPymt = (newValue);
              public void display()
              System.out.println ("The Mortgage Amount is:" +(Amount( ) * Rate( )) / (1- Math.pow(1+Rate( ),-Term( ))));
         public static void main (String[] args)
                     Mortgage Mortgage1=new Mortgage();
                     Mortgage1.Amount(200000);
                     Mortgage1.Term(360);
                     Mortgage1.Rate(.0575);
                     Mortgage1.display();
    }

    I figured it out, the math is wrong I think but I got everything to display correctly
    import java.io.*;
    import java.text.*;
    import java.text.DecimalFormat;
    public class Mortgage
         double mtgAmount;
         double mtgTerm;
         double mtgRate;
         double monthPymt;
         DecimalFormat money = new DecimalFormat("$0.00");
              public void Amount(double newValue)
                     mtgAmount = newValue;
              public double Amount()
                   return mtgAmount;
              public void Term(double newValue)
                     mtgTerm = newValue;
              public double Term()
                   return mtgTerm;
              public void Rate(double newValue)
                     mtgRate = newValue;
              public double Rate()
                   return mtgRate;
              public void calcmonthPymt(double newValue)                            //(LoanAmt * Rate) / (1- Math.pow(1+Rate,-Term));
                     monthPymt = (newValue);
              public void display()
              monthPymt = (Amount( ) * Rate( )) / (1- Math.pow(1+Rate( ),-Term( )));
              System.out.printf("The payment amount is:$%.2f", monthPymt);
              System.out.println();
         public static void main (String[] args)
                     Mortgage Mortgage1=new Mortgage();
                     Mortgage1.Amount(200000);
                     Mortgage1.Term(360);
                     Mortgage1.Rate(.0575);
                     Mortgage1.display();
    }

  • Help with compilation error

    Hello
    I have a problem with my jsp developement. When i create a jsp (with no beans) i test it and it runs fine (not good but fine), then when I test it with multiple users at time, it generate a jsp compilation error ie. "missing term }" and I can not figure out why it is getting that error, it has been compilated before! so it should not generate a compilation error, becouse i'm not editing the jsp source. I think that every time the jsp is requested the virtual machine is re-compiling it, but is only what i thing and i don't know why... can any body help me? please.
    I apologize for my bad english
    Thank you for your time reading this.

    Sorry becouse i can't be more espesific with the error that i get, that error is complete apears in a complete randomic way, I mean taht it apears when nerver is expected or doesn't apear when is expected, only thing that i got of that error is that the compiler some time says that are mising semi-colon (;), some time says that are mising quotation marks (") or are mising }, the error is no the same allways no mater the situation, I can run the jsp in my pc but the error doesn't apear, thats very strange becouse the compilation error apear after the jsp was executed with no errors.
    this is my jsp:
    <%@ page import="java.util.Calendar,java.text.SimpleDateFormat,java.util.Date,java.util.Stack,java.util.Enumeration, java.util.Hashtable,java.sql.*, java.util.Vector" %>
    <%@ include file="../incs/dbpool_inc.jsp" %>
    <%@ include file="funciones.jsp"%><html>
    <head>
    <title>Resolver preguntas</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="../css/0001.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <% //to get user data from the session.
         String userid = session.getAttribute("idu") != null ? (String)session.getAttribute("idu") : "";
         String asign = session.getAttribute("idHomeAssignatura") != null ? (String)session.getAttribute("idHomeAssignatura"): "";
         String idcuest = session.getAttribute("idcuest") != null ? (String)session.getAttribute("idcuest") : "";
         String secuenc = session.getAttribute("secuenc") != null ? (String)session.getAttribute("secuenc") : "";     
         String secuens = request.getParameter("secuens") != null ? request.getParameter("secuens") : "0";
         //to know if it's aloww to save cahnges in the database
         boolean guardar = request.getParameter("guardar") != null ? (request.getParameter("guardar")).equals("si")? true: false :false;
         if(userid.equals("")|| asign.equals("")){//if 1          
              out.println("</head><body><font face=\"Arial\" size=\"2\" color=\"#000000\"><b>El tiempo de conexi&oacute;n ha expirado. Para ingresar de nuevo al sistema haga click aqu&iacute;.</b></font></body></html>");
         }//fin if 1
         else{//else de if 1          
              try{// try 1
                   Connection conn = dbpool.getConnection();
                   Statement stmtt = conn.createStatement();
                   Statement stmtmod = conn.createStatement();
                   Statement stmtresp = conn.createStatement();
                   ResultSet rsmodul = stmtmod.executeQuery("select id_modulo from eit_cuestxmat where id_cuestionario="+idcuest);
                   String modulo = rsmodul.next()? rsmodul.getString("id_modulo"): "";
                   rsmodul.close();
                   stmtmod.close();
                   int secuencia1 = Integer.parseInt(secuens);
                   int secuencia2 = Integer.parseInt(secuenc)+1;
                   secuenc = (secuencia1 == secuencia2)? String.valueOf((Integer.parseInt(secuenc)+1)): secuenc;
                   session.setAttribute("secuenc", secuenc);               
                   if(esAlumno(userid, stmtt, asign)){//if 2
                   if(guardar){//if 2.0
                             String idpreg1 = request.getParameter("idpregunta") != null ? request.getParameter("idpregunta") : "";
                             ResultSet rstipop = stmtt.executeQuery("select tipo from eit_pregunta where id_pregunta="+idpreg1);                         
                             String tipop1 = rstipop.next()? rstipop.getString("tipo") : "";
                             rstipop.close();
                             String respuesta = "N/A", correspondencia ="";                         
                             String restado="n";
                             String rcorrecta = "n";
                             if(tipop1.equals("selec")){
                                  correspondencia = request.getParameter("rprevia") != null? request.getParameter("rprevia") : "-1";
                                  ResultSet rscorrecta = stmtt.executeQuery("select escorrecta from eit_opciones where id_pregunta="+
                                                           idpreg1+" and id_opcion="+correspondencia+" and escorrecta like 's'");
                                  if(rscorrecta.next()){
                                       rcorrecta = "s";
                                  rscorrecta.close();
                             else{
                                  if(tipop1.equals("empar")){
                                       ResultSet rsempar = stmtt.executeQuery("select escorrecta from eit_opciones where id_pregunta="+
                                                                idpreg1+ "order by orden");
                                       int corres = 0;
                                       int correctas = 0;
                                       while(rsempar.next()){                                   
                                                 String resp = request.getParameter("selopc"+String.valueOf(corres+1)) != null? request.getParameter("selopc"+String.valueOf(corres+1)) : "";
                                                 correspondencia=correspondencia+((corres == 0)? "":",")+resp;
                                                 correctas = correctas + (resp.equals(rsempar.getString("escorrecta"))? 1 : 0);
                                                 corres++;
                                       rcorrecta = String.valueOf(correctas);
                                       rsempar.close();
                                  else{
                                       if(tipop1.equals("complet")){
                                            ResultSet rscomplet= stmtt.executeQuery("select correspondencia from eit_opciones where id_pregunta="+idpreg1);
                                            String complet = rscomplet.next()? rscomplet.getString("correspondencia"):"";
                                            rscomplet.close();
                                            String complet1 = "";
                                            int idxcar = complet.indexOf("$");
                                            respuesta = request.getParameter("comp0") != null ? request.getParameter("comp0") : "";
                                            correspondencia = request.getParameter("comp1") != null ? request.getParameter("comp1") : "";
                                            int corrc =0;
                                            if(idxcar>=0){
                                                 complet1 = complet.substring((idxcar+1),complet.length());
                                                 complet = complet.substring(0, idxcar);
                                                 corrc = (respuesta.equalsIgnoreCase(complet))? 1 : 0;
                                                 corrc = (correspondencia.equalsIgnoreCase(complet1))? (corrc+1) : corrc;
                                                 rcorrecta = (corrc==2)? "s": (corrc==1)? "m": "n";
                                            }else{
                                                 corrc=(respuesta.equalsIgnoreCase(complet))? 1 : 0;
                                                 rcorrecta = (corrc==1)? "s": "n";
                                       else{
                                            if(tipop1.equals("abierta")){
                                                 respuesta = request.getParameter("respuesta") != null? request.getParameter("respuesta") : "";
                             String guardarResp = "insert into eit_respuesta(id_pregunta, id_cuestionario, id_materia, id_modulo"+
                                                      ", respuesta, correspondencia, rcorrecta, restado, sec_pregunta, codest)"+
                                                      " values ("+idpreg1+", "+idcuest+", '"+asign+"', "+modulo+", '"+respuesta+"', '"+correspondencia+"', '"+rcorrecta+"', '"+restado+"', "+
                                                      String.valueOf((Integer.parseInt(secuenc)-1))+", "+userid+")";
                             String sqlexistencia = "select id_pregunta from eit_respuesta where codest ="+userid+" and id_cuestionario="+idcuest+" and id_materia="+
                                                           asign+" and id_modulo="+modulo+" and id_pregunta="+idpreg1;                         
                             boolean existeResp = (stmtt.executeQuery(sqlexistencia)).next();
                             String editarResp = "update eit_respuesta set respuesta='"+respuesta+"', correspondencia='"+correspondencia+"', "+
                                                      "rcorrecta='"+rcorrecta+"', restado='"+restado+
                                                      "' where codest ="+userid+" and id_cuestionario="+idcuest+" and id_materia like '"+
                                                      asign+"' and id_modulo="+modulo+" and id_pregunta="+idpreg1;
                             //if the page is editing execute string editarResp else execute string guardarResp
                             stmtt.executeUpdate(existeResp? editarResp:guardarResp);
                        String sqlbpu="select p.enunciado, p.tipo, p.titulo, p.id_pregunta from eit_pregunta p, eit_prexcuest pxc where pxc.id_cuestionario="+idcuest+" and pxc.id_pregunta = p.id_pregunta and pxc.secuenc= "+String.valueOf(secuenc);//bupu: buscar pregunta cuestionario
                        //System.out.println("resolvpreg.jsp "+sqlbpu);
                        ResultSet rsbpu = stmtt.executeQuery(sqlbpu);
                        if(rsbpu.next()){ // if 2.1
                             String enunciado = rsbpu.getString("enunciado");
                             String tipo = rsbpu.getString("tipo");
                             String titulo = rsbpu.getString("titulo");
                             String idpreg = rsbpu.getString("id_pregunta");
    %>
    <h1 align="center"><font color="#0033CC" face="Arial, Helvetica, sans-serif"><%=titulo%></font></h1><br>
    <p align="left"><font face="Arial, Helvetica, sans-serif">
    <strong>Enunciado:</strong> <%=enunciado%>. </font><br>
    <%
         String sqlrespuesta = "select respuesta, correspondencia from eit_respuesta where id_pregunta="+idpreg+
    " and id_cuestionario = "+idcuest+" and id_materia like '"+asign+"' and id_modulo="+modulo+" and codest= "+userid;     
         ResultSet rsrespuesta = stmtresp.executeQuery(sqlrespuesta);     
         String sqlopcs= "select opcion, escorrecta, correspondencia, orden from eit_opciones where id_pregunta ="+idpreg+"order by orden";
         ResultSet rsops = stmtt.executeQuery(sqlopcs);          
    %>
    <%String letras = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
         Vector opciones = new Vector();
         Object obj[] = new Object[4];
         while(rsops.next()){
              obj[0] = rsops.getString("opcion");
              obj[1] = "";
              obj[2] = rsops.getString("correspondencia");
              obj[3] = rsops.getString("orden");
              opciones.addElement(obj.clone());
         rsops.close();
    %>
    <form action="resolverpreg.jsp" method="post" name="Correspondencias">
    <%
         String respEmpar = "";
         String respuestap="";
         String respcorres[] = {"",""};
         if(rsrespuesta.next()){     
              respuestap = rsrespuesta.getString("respuesta");
              respEmpar = rsrespuesta.getString("correspondencia");
              respcorres[0]= respuestap;
              respcorres[1]= respEmpar;
         rsrespuesta.close();
         if (tipo.equals("empar")){
    %>
    <%@ include file="resolvempar.jsp"%>
    <%}//fin if tipoPreg = 'emapar'
         else{
         if(tipo.equals("selec")){
    %> <%@ include file="reslovselec.jsp"%>
         <%}//fin if tipopreg = 'select'
         else{
              if(tipo.equals("complet")){%>
              <%@include file="resolvcomplet.jsp"%>
         <%}//fin if tipopreg='complet'
         else{
              if(tipo.equals("abierta")){%>
              <%@include file="resolvabierta.html"%>
              <%}//fin if tipopreg='abierta'
              else{%>
                   <span class="titolForum">Error: no se ingres&oacute; ning&uacute;n tipo de pregunta
                   o se est� accediendo en forma err&oacute;nea a este sitio.</span>
              <%}//fin else de tipopregunta = 'abierta'%>          
         <%}//fin else tipopreg='complet'%>                    
         <%}// fin else de tipopreg = 'select'%>     
    <%}//fin else de tipoPreg = 'emapar'%>
    <br>
    <input name="idpregunta" type="hidden" value="<%=idpreg%>">
    <input name="guardar" type="hidden" value="si">
    <input name="secuens" type="hidden" value="<%=(1+(Integer.parseInt(secuenc)))%>">
    <input type="submit" name="continuar" value="Continuar">
    </form>
    <%                    rsbpu.close();
                        }//fin 2.1                    
                        else{%>
    Ha terminado de realizar la prueba<br>
    <a href="elejCuestion.jsp">Continuar</a>
    <%}
                   }// fin if 2
                   stmtt.close();
                   stmtresp.close();
                   conn.close();
              }// fin try 1
              catch(Exception expt){
                   out.println("Error: "+expt);
         }//fin eles de if 1
    %>
    </body>
    </html>

  • Help with ical error:

    Hi! For sometime my ical account has been showing the following error: "the server responded with an error. The Server did not recognise your user name or password for account (my email address). Make sure you enter them correctly." How do I make sure the server has my uptodate user name and password. I have done all system updates tonight and changed my password and email address sometime ago when I suspect this error first appeared. itunes etc all seem to be aware of the changes and are working fine. How do I update 'the server'?? many thanks, Kate.

    Greetings Kate,
    Go to iCal > Preferences > Accounts.
    Go to the accounts on the left and re-enter their passwords.
    Close the window and then go to iCal > Quit iCal
    Reopen iCal and test.
    If the issue persists:
    Go to iCal > Preferences > Accounts.
    Go to the accounts on the left and remove all the accounts with the minus sign "-" at the bottom.
    Close the window and then go to iCal > Quit iCal
    Reopen iCal and Go to iCal > Preferences > Accounts and add whatever accounts back in you want.
    Hope that helps!

  • Help with MuseJSEssert error in safari

    Hi
    My site is working correctly in google chrome, firefox, on android, but won't load on my mac in safari, or on an iphone...
    Suggests its an issue with safari, rather than with my site?
    I get this error...
    MuseJSAssert: Error calling selector function:TypeError: undefined is not a function (evaluating '$(elem).museMenu()')
    Anyone got any thoughts?
    Thanks in advance

    You may want to refer to these threads :
    MuseJSAssert: Error Calling Selector Function:[Object Error]
    Need help with MuseJSAssert Error

  • Help with display glith using JList

    Hi, first post so bit of background - I'm teaching Java at the moment, am fine with command line but am dabbling more with Swing, despite certain glitches I always get ( e.g. the 7-segment display last year) but anyway....
    I've been trying to develop a little app that picks random boxers for a computer game. My current problem is that i am trying to add custom boxers and then update the JList and repaint the frame. When I add a boxer i can see it adding to the list, however it is unreadable and displayed too small.
    Forgive any bad coding etiquettes - its very much a work in progress from a relatively poor programmer ;)
    theBoxers is a JPanel containing the JLists, aWindow is the JFrame, customButton is a button to add a custom fighter - this gets a name from a field, and a weight from a combo box, adds it to an array and then attempts to add it to an array, then re-generate the lists
    customButton.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                        addCustom(customCombo.getSelectedIndex(),addCustomName.getText());
                             System.out.println(customCombo.getSelectedIndex() + addCustomName.getText());
                             theBoxers.repaint();
                             aWindow.repaint();
    public void addCustom(int theWeight, String theName)
              switch(theWeight)
                   case 0:          featherCustoms[featherCustomsSize]=theName;
                                  featherFighters = new JList(featherCustoms);
                                  featherCustomsSize++;
                                  break;
                   case 1:          lightCustoms[lightCustomsSize]=theName;
                                  lightFighters = new JList(lightCustoms);
                                  lightCustomsSize++;
                                  break;
                   case 2:          welterCustoms[welterCustomsSize]=theName;
                                  welterFighters = new JList(welterCustoms);
                                  welterCustomsSize++;
                                  break;
                   case 3:          middleCustoms[middleCustomsSize]=theName;
                                  middleFighters = new JList(middleCustoms);
                                  middleCustomsSize++;
                                  break;
                   case 4:          lightHeavyCustoms[lightHeavyCustomsSize]=theName;
                                  lightHeavyFighters = new JList(lightHeavyCustoms);
                                  lightHeavyCustomsSize++;
                                  break;
                   case 5:          heavyCustoms[featherCustomsSize]=theName;
                                  heavyFighters = new JList(heavyCustoms);
                                  heavyCustomsSize++;
                                  break;
                   default:     System.out.println("Not Added");
                                  break;
         }

    Awww, its nice that DB has someone to comeback and carry on a discussion.....long after its over.
    The problem here seems to be your lack of understanding between what a teacher or what an 'instructor' is.
    From the way you speak, an instructor appears to be someone who is technically skilled in both coding and teaching Java as a programming language, designed for people who wish to code in Java.
    A Teacher is someone who must deliver a wide range of subject knowledge to a wide range of abilities, including those who were unable to pass High-School exams. They are responsible for pitching the subject at the correct level for the student, whilst also teaching towards passing the exam, and ultimately gaining a qualification.
    The computing course i am currently teaching does not require OOP, but as Java is the language i was taught at University, and is still often used in our University's, I chose it. I don't pretend to be the best programmer in the world. But I do know that I am teaching the pupils the correct basics, at a higher level than is probably required, to give them the right approach at university. also, this is whilst teaching a large amount of theory.
    Whether you agree, or disagree, matters not to me as I think you would be unfamilier with the specification I am currently teaching to, or what area's of study need to be taught. The exam board appears happy, as do past students who are now well into their university course, as did my marker when i achieved my degree.
    The code posted in the OP (as stated earlier) had nothing to do with displaying my coding abilities, nor did it display the technique's I use when teaching students. It was a small sample of a program which included a JList which was not displaying properly. I tried to include the whole code but it was too big, therefore it was cut down.
    It was a work in progress which i now have working. So now i can look at it again in terms of programming structure. It appears I have made a mistake asking for assistance on here, as instead I got a lecture, with very little insight on your part as to my situation or the nature of the problem/solution.
    At the end of the day, each to his/her own opinion. What I will say is that when someone requests help, positive feedback/criticism is well recieved along with instructions/guidance on how the problem can be solved. I feel that I received none of this on here, but this is what I will always provide to the students I teach.
    Not everyone is a full-time Java programmer or has the time to hit the highest expectations.

Maybe you are looking for

  • I just had to get a new hard drive for my mac book pro and I have the old one saved onto a hard drive, how do I get all my saved info back onto the new hard drive?

    My hard drive on my mac book pro went so I had to get a new one. I had everything saved onto my external hard drive and I don't know how to resynch it to the new hard drive so my computer will have everything on it that it used to. does anyone know h

  • Planning Information in SAP R/3 and BW

    Hi all, How to Establish clear understanding of what planning information is stored and used in SAP R/3 and which should be extracted to SAP BW for use in reporting in one particular client. Thanks in advance S VR

  • ROCANCEL - Reversal Indicator Issue

    Hello, I created a desing using the extractor 2lis_11_vaitm to manage the change documents from R/3. The documents are flowing in to the DSO correctly except in the cases of Reversal Indicator = X.  All the values for the Characteristics are blank ex

  • Scanner flashing

    When in standby my machine scanner LED flashes on the glass platen continuously. I end up turning my unit off when not in use. I bought this unit so I could leave it on and family members could print whenever they wished. Now we need to go to the pri

  • Help with folder permissions issue

    Hello, I'm new to BI and I'm having issues with folder permissions. Here is what we are trying to do: We have two folders, lets say Folder A and Folder B. We have two application roles, Role1 and Role2. Folder A should have full control for Role1, Fo