Package net.sf.esims.model.entity

Examples of net.sf.esims.model.entity.Exam


    Standard standard = new Standard("5th standard",academicYear);
    standardService.save(standard);
   
    List<IndividualExam> listOfIndExams = new ArrayList<IndividualExam>();
    listOfIndExams.add(UtilsForTestCases.createValidIndExam());
    Exam exam = new Exam(academicYear,standard,"1st Termly exam",startDate,endDate,listOfIndExams);
   
    //testing save
    this.examService.save(exam);
   
    //testing update
    exam.setDescription("2nd termly exam");
    this.examService.save(exam);
   
    //testing gets
    assertEquals(1, this.examService.getAll().size());
    Exam exam2 = this.examService.getAll().get(0);
    assertNotNull(this.examService.getById(exam2.getExamId()));
    assertNotNull(this.examService.getByDescription(exam2.getDescription()));
   
   
    //testing delete
    this.examService.delete(exam);
   
View Full Code Here


   
    String message = EsimsConstants._BLANK_STRING;
      AcademicYear academicYear = this.examService
          .getActiveAcademicYear();
      Standard standard = this.standardService.getById(this.standardId);
      Exam examToCreate = new Exam(academicYear, standard,
          this.description, this.startDate, this.endDate,
          this.individualExams);
      // Check if the exam already exists in the system
      if (this.examService.checkIfExamIsPresent(examToCreate)) {
        message = EsimsUtils.createWarnMessage(this.getContext()
View Full Code Here

          listOfStandards);
      String buttonName = "updateFirstPageAndShowSecond";
      String buttonValue = "Continue";
      this.getContext().setAttributeToSession("buttonName", buttonName);
      this.getContext().setAttributeToSession("buttonValue", buttonValue);
      Exam examToBeEdited = this.examService.getExamById(new Long(this
          .getContext().getRequest().getParameter("examId")));
      this.getContext().setAttributeToSession("exam", examToBeEdited);

      return new ForwardResolution("/WEB-INF/pages/examDetails.jsp");
  }
View Full Code Here

   *
   * @return
   */
  @HandlesEvent("updateFirstPageAndShowSecond")
  public Resolution updateFirstPageAndShowSecond() {
    Exam examBeingEdited = (Exam) this.getContext()
        .getAttributeFromSession("exam");
    examBeingEdited.setStandard(this.standardService
        .getById(this.standardId));
    examBeingEdited.setDescription(this.description);
    examBeingEdited.setStartDate(this.startDate);
    examBeingEdited.setEndDate(this.endDate);
    this.getContext().setAttributeToSession("exam", examBeingEdited);
    String buttonName = "performUpdate";
    String buttonValue = "Update exam";
    this.getContext().setAttributeToSession("buttonName", buttonName);
    this.getContext().setAttributeToSession("buttonValue", buttonValue);
View Full Code Here

   *
   */
  @HandlesEvent("performUpdate")
  public Resolution performUpdate() {
    String message = EsimsConstants._BLANK_STRING;
    Exam examBeingEdited = (Exam) this.getContext()
        .getAttributeFromSession("exam");
    examBeingEdited.setIndividualExams(new HashSet<IndividualExam>(
        this.individualExams));
    this.examService.save(examBeingEdited);
    message = EsimsUtils.createInfoMessage(this.getContext()
        .getContextPath(), "Exam named<strong> "
        + examBeingEdited.getDescription() + "</strong> for "
        + examBeingEdited.getAcademicYear().getDescription()
        + " was updated succesfully");
    this.getContext().removeAttributeFromSession("exam");
    this.getContext().removeAttributeFromSession("listOfStandards");
    this.getContext().removeAttributeFromSession("subjectsTaughtInStd");
    this.getContext().removeAttributeFromSession("startDate");
View Full Code Here

   *
   */
  @HandlesEvent("deleteExam")
  public Resolution deleteExam() {
    try {
      Exam examToBeDeleted = this.examService.getExamById(new Long(this
          .getContext().getRequest().getParameter("examId")));
      this.examService.delete(examToBeDeleted);
      // refreshing the list of exams
      this.getContext().setAttributeToRequest(
          "searchResultsForExams",
View Full Code Here

   * format page, which can also be exported to PDF XLS CSV etc
   *
   */
  @HandlesEvent("showTimeTable")
  public Resolution showTimeTable() {
      Exam examToBeDisplayed = this.examService.getExamById(new Long(this
          .getContext().getRequest().getParameter("examId")));
      List<IndividualExam> listOfIndividualExams = new ArrayList<IndividualExam>(
          examToBeDisplayed.getIndividualExams());
      this.getContext().setAttributeToRequest("timeTable",
          listOfIndividualExams);
      this.getContext().setAttributeToRequest("standardName",
          examToBeDisplayed.getStandard().getName());
      this.getContext().setAttributeToRequest("examName",
          examToBeDisplayed.getDescription());
      this.getContext().setAttributeToRequest("academicYear",
          examToBeDisplayed.getAcademicYear().getDescription());
      return new ForwardResolution("/WEB-INF/pages/showExamTimeTable.jsp");
   
  }
View Full Code Here

    List<IndividualExam> listOfIndExams = new ArrayList<IndividualExam>();
    listOfIndExams.add(UtilsForTestCases.createValidIndExam());
   
    Standard standard = new Standard("5th standard",academicYear);
    standardDAO.save(standard);
    Exam exam = new Exam(academicYear,standard,"Test exam",startDate1,endDate1,listOfIndExams);
    examDAO.save(exam)
   
    List<Exam> listOfExams= examDAO.getAll();
    assertEquals(1, listOfExams.size());
   
View Full Code Here

    Standard standard = new Standard("5th standard",academicYear);
    standardDAO.save(standard);
   
    List<IndividualExam> listOfIndExams = new ArrayList<IndividualExam>();
    listOfIndExams.add(UtilsForTestCases.createValidIndExam());
    Exam exam = new Exam(academicYear,standard,"Test exam",startDate1,endDate1,listOfIndExams);
    examDAO.save(exam)
   
    List<Exam> listOfExams= examDAO.getAll();
    assertEquals(1, listOfExams.size());
   
View Full Code Here

    academicYearDAO.save(academicYear);
    Standard standard = new Standard("5th standard",academicYear);
    standardDAO.save(standard);
    List<IndividualExam> listOfIndExams = new ArrayList<IndividualExam>();
    listOfIndExams.add(UtilsForTestCases.createValidIndExam());
    Exam exam = new Exam(academicYear,standard,"Test exam",startDate1,endDate1,listOfIndExams);
    examDAO.save(exam)
   
    List<Exam> listOfExams= examDAO.getAll();
    assertEquals(1, listOfExams.size());
   
View Full Code Here

TOP

Related Classes of net.sf.esims.model.entity.Exam

Copyright © 2018 www.massapicom. 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.