Examples of QuestionList


Examples of com.centraview.support.faq.QuestionList

     
      SupportFacadeHome supFacade = (SupportFacadeHome)CVUtility.getHomeObject("com.centraview.support.supportfacade.SupportFacadeHome", "SupportFacade");
      SupportFacade supRemote = supFacade.create();
      supRemote.setDataSource(dataSource);
     
      QuestionList questionList = supRemote.getQuestionList(individualID, faqID);

      ArrayList qList = new ArrayList();
     
      Set listkey = questionList.keySet();
      Iterator iter = listkey.iterator();
      while (iter.hasNext()) {
        String key = (String)iter.next();
        ListElement row = (ListElement)questionList.get(key);

        HashMap questionInfo = new HashMap();
       
        StringMember questionField = (StringMember)row.get("Question");
        StringMember answerField = (StringMember)row.get("Answer");
View Full Code Here

Examples of com.centraview.support.faq.QuestionList

    return threadlist;
  }

  public QuestionList getQuestionList(int userID, int curFaqID)
  {
    QuestionList questionList = null;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      SupportListLocalHome home = (SupportListLocalHome) ic.lookup("local/SupportList");
      SupportListLocal remote = home.create();
      remote.setDataSource(this.dataSource);
View Full Code Here

Examples of com.centraview.support.faq.QuestionList

    return vecDDNameValue;
  }

  public QuestionList getQuestionList(int userID, int curFaqID)
  {
    QuestionList questionList = new QuestionList();

    CVDal cvdl = new CVDal(dataSource);

    Collection colList = null;

    cvdl.setSql("support.faq.getquestionforfaq");

    cvdl.setInt(1, curFaqID);
    colList = cvdl.executeQuery();
    cvdl.clearParameters();

    cvdl.destroy();

    if (colList.size() > 0)
    {
      Iterator it = colList.iterator();
      int i = 0;

      while (it.hasNext())
      {
        i++;
        HashMap hm = (HashMap)it.next();
        int questionID = ((Long)hm.get("questionid")).intValue();

        try
        {
          IntMember intQuestionID = new IntMember("QuestionID", questionID, 10, "", 'T', false, 10);

          StringMember strQuestion = null;

          if ((hm.get("question") != null))
            strQuestion = new StringMember("Question", (String)hm.get("question"), 10, "", 'T', true);
          else
            strQuestion = new StringMember("Question", null, 10, "", 'T', true);

          StringMember strAnswer = null;

          if ((hm.get("answer") != null))
            strAnswer = new StringMember("Answer", (String)hm.get("answer"), 10, "", 'T', true);
          else
            strAnswer = new StringMember("Answer", null, 10, "", 'T', true);

          QuestionListElement questionListElement = new QuestionListElement(questionID);

          questionListElement.put("QuestionID", intQuestionID);
          questionListElement.put("Question", strQuestion);
          questionListElement.put("Answer", strAnswer);

          StringBuffer stringbuffer = new StringBuffer("00000000000");
          stringbuffer.setLength(11);
          String s3 = (new Integer(i)).toString();
          stringbuffer.replace(stringbuffer.length() - s3.length(), stringbuffer.length(), s3);
          String s4 = stringbuffer.toString();

          questionList.put(s4, questionListElement);
        } catch (Exception e) {
          logger.debug(" [Exception] SupportListEJB.getQuestionList " + e);
          e.printStackTrace();
        }
      }
View Full Code Here

Examples of data.QuestionList

     * @param args the command line arguments
     * @throws java.io.IOException
     * @throws java.lang.ClassNotFoundException
     */
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        QuestionList questionList = new QuestionList();
        Context context = null;
        int attempt = 0;
        int rightAnswers = 0;
        String result;

        ServerSocket server = new ServerSocket(24891);
        System.out.println("Server Started");
        Socket socket = server.accept();
        System.out.println("New client on port" + socket.getPort());
        ObjectOutputStream output = new ObjectOutputStream(socket.getOutputStream());
        ObjectInputStream input = new ObjectInputStream(socket.getInputStream());
       
        while (true) {

            if (questionList.next() != null) {
                context = readQuestion(questionList.next());
            }
            output.writeObject(context);
            output.flush();
            context = (Context) input.readObject();

            attempt++;
            if (questionList.isRight(context.getVariant())) {
                result = "Congratulations! It is the right answer";
                rightAnswers++;
            } else {
                result = "It is the wrong answer";
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.