コード例 #1
0
 public List<AssessmentQuestion> getAllDataOfQuestions(
     SearchResultContainer collectionResultContainer) {
   if (collectionResultContainer.getSearchResults() != null) {
     String assessmentGooruOid = "";
     int count = 0;
     for (SearchResult srContainer : collectionResultContainer.getSearchResults()) {
       if (count > 0) {
         assessmentGooruOid += ",";
       }
       assessmentGooruOid += "'" + srContainer.getId().toString() + "'";
       count++;
     }
     return assessmentRepository.getAssessmentQuestionsByAssessmentGooruOids(assessmentGooruOid);
   }
   return null;
 }
コード例 #2
0
 public void enrichCollectionWithTaxonomyMap(SearchResultContainer collectionResultContainer) {
   if (collectionResultContainer.getSearchResults() != null) {
     for (SearchResult srContainer : collectionResultContainer.getSearchResults()) {
       Content findByContent =
           this.getContentRepository().findContentByGooruId(srContainer.getId());
       if (findByContent != null) {
         Map<Integer, List<Code>> taxonomyMapByCode =
             TaxonomyUtil.getTaxonomyMapByCode(findByContent.getTaxonomySet(), taxonomyService);
         srContainer.setTaxonomyMapByCode(taxonomyMapByCode);
         Integer numberOfQuestions =
             assessmentRepository.getAssessmentQuestionsCount(findByContent.getContentId());
         srContainer.setNumberOfResources(numberOfQuestions);
       }
     }
   }
 }
コード例 #3
0
  private void sendMailToCollabrators(List<User> users, Resource resource, User apiCaller) {
    try {
      String flag = "";
      String collectionOrQuizTitle = "";
      Learnguide learnguide = learnguideRepository.findByContent(resource.getGooruOid());
      Assessment assessment = assessmentRepository.findQuizContent(resource.getGooruOid());
      if (resource
              .getResourceType()
              .getName()
              .equalsIgnoreCase(ResourceType.Type.CLASSPLAN.getType())
          || resource
              .getResourceType()
              .getName()
              .equalsIgnoreCase(ResourceType.Type.CLASSBOOK.getType())) {
        collectionOrQuizTitle = learnguide.getLesson();
        if (collectionOrQuizTitle == null) {
          collectionOrQuizTitle = learnguide.getTitle();
        }
        flag = COLLECTION;
      } else if (resource
              .getResourceType()
              .getName()
              .equalsIgnoreCase(ResourceType.Type.ASSESSMENT_QUIZ.getType())
          || resource
              .getResourceType()
              .getName()
              .equalsIgnoreCase(ResourceType.Type.ASSESSMENT_EXAM.getType())) {
        collectionOrQuizTitle = assessment.getName();
        if (collectionOrQuizTitle == null) {
          collectionOrQuizTitle = assessment.getTitle();
        }
        flag = "quiz";
      }
      for (User user : users) {

        mailHandler.sendMailForCollaborator(
            user.getPartyUid(),
            apiCaller.getUsername(),
            resource.getGooruOid(),
            collectionOrQuizTitle,
            flag);
      }

    } catch (Exception e) {
      e.printStackTrace();
    }
  }