Search in sources :

Example 1 with CreditDAO

use of fi.otavanopisto.pyramus.dao.grading.CreditDAO in project pyramus by otavanopisto.

the class GradingService method getCreditVariable.

public String getCreditVariable(@WebParam(name = "creditId") Long creditId, @WebParam(name = "key") String key) {
    CreditDAO creditDAO = DAOFactory.getInstance().getCreditDAO();
    CreditVariableDAO creditVariableDAO = DAOFactory.getInstance().getCreditVariableDAO();
    Credit credit = creditDAO.findById(creditId);
    return creditVariableDAO.findByCreditAndKey(credit, key);
}
Also used : CreditVariableDAO(fi.otavanopisto.pyramus.dao.grading.CreditVariableDAO) Credit(fi.otavanopisto.pyramus.domainmodel.grading.Credit) TransferCredit(fi.otavanopisto.pyramus.domainmodel.grading.TransferCredit) TransferCreditDAO(fi.otavanopisto.pyramus.dao.grading.TransferCreditDAO) CreditDAO(fi.otavanopisto.pyramus.dao.grading.CreditDAO)

Example 2 with CreditDAO

use of fi.otavanopisto.pyramus.dao.grading.CreditDAO in project pyramus by otavanopisto.

the class EditVerbalAssessmentViewController method process.

/**
 * Processes the page request by including the corresponding JSP page to the response.
 *
 * @param pageRequestContext Page request context
 */
public void process(PageRequestContext pageRequestContext) {
    CreditDAO creditDAO = DAOFactory.getInstance().getCreditDAO();
    Long creditId = pageRequestContext.getLong("creditId");
    Credit credit = creditId != null ? creditDAO.findById(creditId) : null;
    if (credit != null)
        pageRequestContext.getRequest().setAttribute("verbalAssessment", credit.getVerbalAssessment());
    pageRequestContext.setIncludeJSP("/templates/courses/editverbalassessment.jsp");
}
Also used : Credit(fi.otavanopisto.pyramus.domainmodel.grading.Credit) CreditDAO(fi.otavanopisto.pyramus.dao.grading.CreditDAO)

Example 3 with CreditDAO

use of fi.otavanopisto.pyramus.dao.grading.CreditDAO in project pyramus by otavanopisto.

the class GradingService method setCreditVariable.

public void setCreditVariable(@WebParam(name = "creditId") Long creditId, @WebParam(name = "key") String key, @WebParam(name = "value") String value) {
    CreditDAO creditDAO = DAOFactory.getInstance().getCreditDAO();
    CreditVariableDAO creditVariableDAO = DAOFactory.getInstance().getCreditVariableDAO();
    Credit credit = creditDAO.findById(creditId);
    creditVariableDAO.setCreditVariable(credit, key, value);
}
Also used : CreditVariableDAO(fi.otavanopisto.pyramus.dao.grading.CreditVariableDAO) Credit(fi.otavanopisto.pyramus.domainmodel.grading.Credit) TransferCredit(fi.otavanopisto.pyramus.domainmodel.grading.TransferCredit) TransferCreditDAO(fi.otavanopisto.pyramus.dao.grading.TransferCreditDAO) CreditDAO(fi.otavanopisto.pyramus.dao.grading.CreditDAO)

Aggregations

CreditDAO (fi.otavanopisto.pyramus.dao.grading.CreditDAO)3 Credit (fi.otavanopisto.pyramus.domainmodel.grading.Credit)3 CreditVariableDAO (fi.otavanopisto.pyramus.dao.grading.CreditVariableDAO)2 TransferCreditDAO (fi.otavanopisto.pyramus.dao.grading.TransferCreditDAO)2 TransferCredit (fi.otavanopisto.pyramus.domainmodel.grading.TransferCredit)2