public GroupAssessmentController(
      UserRequest ureq,
      WindowControl wControl,
      CourseEnvironment courseEnv,
      GTACourseNode courseNode,
      BusinessGroup assessedGroup) {
    super(ureq, wControl, "assessment_per_group");
    this.gtaNode = courseNode;
    this.courseEnv = courseEnv;
    this.assessedGroup = assessedGroup;

    withScore = courseNode.hasScoreConfigured();
    withPassed = courseNode.hasPassedConfigured();
    if (withPassed) {
      cutValue = courseNode.getCutValueConfiguration();
    }
    withComment = courseNode.hasCommentConfigured();

    Roles roles = ureq.getUserSession().getRoles();
    isAdministrativeUser = securityModule.isUserAllowedAdminProps(roles);
    userPropertyHandlers =
        userManager.getUserPropertyHandlersFor(
            GTACoachedGroupGradingController.USER_PROPS_ID, isAdministrativeUser);
    setTranslator(userManager.getPropertyHandlerTranslator(getTranslator()));

    List<IdentityRef> duplicates = gtaManager.getDuplicatedMemberships(courseNode);
    duplicateMemberKeys = new ArrayList<>(duplicates.size());
    for (IdentityRef duplicate : duplicates) {
      duplicateMemberKeys.add(duplicate.getKey());
    }

    initForm(ureq);
    ModelInfos modelInfos = loadModel();
    updateGUI(modelInfos);
  }
Esempio n. 2
0
 /**
  * Return the target folder of the assessed identity. This is a factory method which take care of
  * the type of the course node.
  *
  * @param uce
  * @param courseNode
  * @param identity
  * @return
  */
 private VFSContainer getReturnBox(
     UserCourseEnvironment uce, CourseNode courseNode, Identity identity) {
   VFSContainer returnContainer = null;
   if (courseNode instanceof GTACourseNode) {
     final GTAManager gtaManager = CoreSpringFactory.getImpl(GTAManager.class);
     CourseEnvironment courseEnv = uce.getCourseEnvironment();
     returnContainer =
         gtaManager.getCorrectionContainer(courseEnv, (GTACourseNode) courseNode, identity);
   } else {
     String returnPath =
         ReturnboxController.getReturnboxPathRelToFolderRoot(
             uce.getCourseEnvironment(), courseNode);
     OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(returnPath, null);
     VFSItem assessedItem = rootFolder.resolve(identity.getName());
     if (assessedItem == null) {
       returnContainer = rootFolder.createChildContainer(identity.getName());
     } else if (assessedItem instanceof VFSContainer) {
       returnContainer = (VFSContainer) assessedItem;
     }
   }
   return returnContainer;
 }
Esempio n. 3
0
  private void updateTasksState(
      GTACourseNode courseNode, UserCourseEnvironment uce, TaskProcess status) {
    final GTAManager gtaManager = CoreSpringFactory.getImpl(GTAManager.class);
    Identity identity = uce.getIdentityEnvironment().getIdentity();
    RepositoryEntry entry = uce.getCourseEnvironment().getCourseGroupManager().getCourseEntry();

    org.olat.course.nodes.gta.Task gtaTask;
    TaskList taskList = gtaManager.getTaskList(entry, courseNode);
    if (taskList == null) {
      taskList = gtaManager.createIfNotExists(entry, courseNode);
      gtaTask = gtaManager.createTask(null, taskList, status, null, identity, courseNode);
    } else {
      gtaTask = gtaManager.getTask(identity, taskList);
      if (gtaTask == null) {
        gtaManager.createTask(null, taskList, status, null, identity, courseNode);
      }
    }

    gtaManager.nextStep(status, courseNode);
  }