diff --git a/src/main/java/org/olat/course/assessment/manager/CourseAssessmentServiceImpl.java b/src/main/java/org/olat/course/assessment/manager/CourseAssessmentServiceImpl.java index 5d8cb39fb323c322f3de31ca6032cdf0fdbe7baf..dc86656a66b3b7a9b27587811041d416c29e1532 100644 --- a/src/main/java/org/olat/course/assessment/manager/CourseAssessmentServiceImpl.java +++ b/src/main/java/org/olat/course/assessment/manager/CourseAssessmentServiceImpl.java @@ -321,7 +321,7 @@ public class CourseAssessmentServiceImpl implements CourseAssessmentService, Nod @Override public void updateLastModifications(CourseNode courseNode, UserCourseEnvironment userCourseEnvironment, - Identity identity, Role by) { + Identity identity2, Role by) { if (!userCourseEnvironment.isParticipant()) return; AssessmentManager am = userCourseEnvironment.getCourseEnvironment().getAssessmentManager(); diff --git a/src/main/java/org/olat/course/nodes/gta/GTAManager.java b/src/main/java/org/olat/course/nodes/gta/GTAManager.java index 3f076ecb29b66cf9d53e06619755286f0b8baaf8..bfa91c7734aaabfc36c4723a8a564af041fe7f93 100644 --- a/src/main/java/org/olat/course/nodes/gta/GTAManager.java +++ b/src/main/java/org/olat/course/nodes/gta/GTAManager.java @@ -345,7 +345,7 @@ public interface GTAManager { * @param doerIdentity The user which does the operation * @return */ - public AssignmentResponse selectTask(Identity identity, TaskList taskList, GTACourseNode cNode, File task, Identity doerIdentity); + public AssignmentResponse selectTask(Identity identity, TaskList taskList, GTACourseNode cNode, File task); public AssignmentResponse selectTask(BusinessGroup group, TaskList taskList, GTACourseNode cNode, File task, Identity doerIdentity); @@ -353,7 +353,7 @@ public interface GTAManager { GTACourseNode cNode, Identity doerIdentity); public AssignmentResponse assignTaskAutomatically(TaskList taskList, Identity assessedIdentity, CourseEnvironment courseEnv, - GTACourseNode cNode, Identity doerIdentity); + GTACourseNode cNode); public boolean isDueDateEnabled(GTACourseNode cNode); diff --git a/src/main/java/org/olat/course/nodes/gta/manager/GTAManagerImpl.java b/src/main/java/org/olat/course/nodes/gta/manager/GTAManagerImpl.java index 2e9deb516b102edc80a933f190e2ca3efda2c652..4b9cdb0de41a194d09d43366419f30d911ad84b9 100644 --- a/src/main/java/org/olat/course/nodes/gta/manager/GTAManagerImpl.java +++ b/src/main/java/org/olat/course/nodes/gta/manager/GTAManagerImpl.java @@ -89,6 +89,7 @@ import org.olat.course.nodes.gta.model.TaskRevisionDateImpl; import org.olat.course.nodes.gta.model.TaskRevisionImpl; import org.olat.course.nodes.gta.ui.events.SubmitEvent; import org.olat.course.run.environment.CourseEnvironment; +import org.olat.course.run.scoring.AssessmentEvaluation; import org.olat.course.run.userview.UserCourseEnvironment; import org.olat.group.BusinessGroup; import org.olat.group.BusinessGroupRef; @@ -97,7 +98,6 @@ import org.olat.group.area.BGAreaManager; import org.olat.group.manager.BusinessGroupRelationDAO; import org.olat.group.model.BusinessGroupRefImpl; import org.olat.modules.ModuleConfiguration; -import org.olat.modules.assessment.AssessmentService; import org.olat.modules.assessment.Role; import org.olat.modules.assessment.model.AssessmentEntryStatus; import org.olat.modules.edusharing.EdusharingService; @@ -138,8 +138,6 @@ public class GTAManagerImpl implements GTAManager { @Autowired private CourseAssessmentService courseAssessmentService; @Autowired - private AssessmentService assessmentService; - @Autowired private EdusharingService edusharingService; @Autowired private RepositoryService repositoryService; @@ -988,8 +986,8 @@ public class GTAManagerImpl implements GTAManager { } @Override - public AssignmentResponse assignTaskAutomatically(TaskList taskList, Identity assessedIdentity, CourseEnvironment courseEnv, GTACourseNode cNode, Identity doerIdentity) { - return assignTaskAutomatically(taskList, null, assessedIdentity, courseEnv, cNode, doerIdentity); + public AssignmentResponse assignTaskAutomatically(TaskList taskList, Identity assessedIdentity, CourseEnvironment courseEnv, GTACourseNode cNode) { + return assignTaskAutomatically(taskList, null, assessedIdentity, courseEnv, cNode, assessedIdentity); } private AssignmentResponse assignTaskAutomatically(TaskList tasks, BusinessGroup businessGroup, Identity identity, @@ -1034,7 +1032,7 @@ public class GTAManagerImpl implements GTAManager { task = dbInstance.getCurrentEntityManager().merge(task); } dbInstance.commit(); - syncAssessmentEntry(task, cNode, Role.user); + syncAssessmentEntry(task, cNode, doerIdentity, Role.user); response = new AssignmentResponse(task, Status.ok); } } else { @@ -1042,7 +1040,7 @@ public class GTAManagerImpl implements GTAManager { ((TaskImpl)currentTask).setTaskStatus(TaskProcess.submit); } currentTask = dbInstance.getCurrentEntityManager().merge(currentTask); - syncAssessmentEntry((TaskImpl)currentTask, cNode, Role.user); + syncAssessmentEntry((TaskImpl)currentTask, cNode, doerIdentity, Role.user); response = new AssignmentResponse(currentTask, Status.ok); } @@ -1129,11 +1127,11 @@ public class GTAManagerImpl implements GTAManager { } @Override - public AssignmentResponse selectTask(Identity identity, TaskList tasks, GTACourseNode cNode, File taskFile, Identity doerIdentity) { + public AssignmentResponse selectTask(Identity identity, TaskList tasks, GTACourseNode cNode, File taskFile) { if(!GTAType.individual.name().equals(cNode.getModuleConfiguration().getStringValue(GTACourseNode.GTASK_TYPE))) { return AssignmentResponse.ERROR; } - return selectTask(identity, null, tasks, cNode, taskFile, doerIdentity); + return selectTask(identity, null, tasks, cNode, taskFile, identity); } @Override @@ -1165,7 +1163,7 @@ public class GTAManagerImpl implements GTAManager { TaskImpl task = createTask(taskName, reloadedTasks, nextStep, businessGroup, identity, cNode); task.setAssignmentDate(new Date()); dbInstance.getCurrentEntityManager().persist(task); - syncAssessmentEntry(task, cNode, Role.user); + syncAssessmentEntry(task, cNode, doerIdentity, Role.user); response = new AssignmentResponse(task, Status.ok); } dbInstance.commit(); @@ -1178,7 +1176,7 @@ public class GTAManagerImpl implements GTAManager { } } currentTask = dbInstance.getCurrentEntityManager().merge(currentTask); - syncAssessmentEntry((TaskImpl)currentTask, cNode, Role.user); + syncAssessmentEntry((TaskImpl)currentTask, cNode, doerIdentity, Role.user); response = new AssignmentResponse(currentTask, Status.ok); } return response; @@ -1258,7 +1256,6 @@ public class GTAManagerImpl implements GTAManager { @Override public boolean isDueDateEnabled(GTACourseNode cNode) { if(cNode.getModuleConfiguration().getBooleanSafe(GTACourseNode.GTASK_RELATIVE_DATES, false) - || cNode.getModuleConfiguration().getBooleanSafe(GTACourseNode.GTASK_RELATIVE_DATES, false) || cNode.getModuleConfiguration().getBooleanSafe(GTACourseNode.GTASK_RELATIVE_DATES, false) || cNode.getModuleConfiguration().getBooleanSafe(GTACourseNode.GTASK_REVISION_PERIOD, false)) { return true; @@ -1430,8 +1427,8 @@ public class GTAManagerImpl implements GTAManager { TaskProcess nextStep = nextStep(currentStep, cNode); taskImpl.setTaskStatus(nextStep); TaskImpl mergedTask = dbInstance.getCurrentEntityManager().merge(taskImpl); - dbInstance.commit();//make the thing definitiv - syncAssessmentEntry(mergedTask, cNode, by); + dbInstance.commit();//make the thing definitive + syncAssessmentEntry(mergedTask, cNode, doerIdentity, by); return mergedTask; } @@ -1660,7 +1657,7 @@ public class GTAManagerImpl implements GTAManager { taskImpl.setTaskStatus(newStatus); syncDates(taskImpl, newStatus); taskImpl = dbInstance.getCurrentEntityManager().merge(taskImpl); - syncAssessmentEntry(taskImpl, cNode, by); + syncAssessmentEntry(taskImpl, cNode, doerIdentity, by); // mark the publishers OLATResource resource = taskImpl.getTaskList().getEntry().getOlatResource(); @@ -1711,7 +1708,7 @@ public class GTAManagerImpl implements GTAManager { taskImpl = dbInstance.getCurrentEntityManager().merge(taskImpl); //log date createAndPersistTaskRevisionDate(taskImpl, iteration, newStatus); - syncAssessmentEntry(taskImpl, cNode, by); + syncAssessmentEntry(taskImpl, cNode, doerIdentity, by); return taskImpl; } @@ -1761,7 +1758,7 @@ public class GTAManagerImpl implements GTAManager { return assessmentStatus; } - private void syncAssessmentEntry(TaskImpl taskImpl, GTACourseNode cNode, Role by) { + private void syncAssessmentEntry(TaskImpl taskImpl, GTACourseNode cNode, Identity doerIdentity, Role by) { if(taskImpl == null || taskImpl.getTaskStatus() == null || cNode == null) return; TaskList taskList = getTaskList(taskImpl); @@ -1769,21 +1766,19 @@ public class GTAManagerImpl implements GTAManager { ICourse course = CourseFactory.loadCourse(courseRepoEntry); AssessmentEntryStatus assessmentStatus = convertToAssessmentEntrystatus(taskImpl, cNode); if(GTAType.group.name().equals(cNode.getModuleConfiguration().getStringValue(GTACourseNode.GTASK_TYPE))) { - assessmentService.updateAssessmentEntries(taskImpl.getBusinessGroup(), courseRepoEntry, cNode.getIdent(), Boolean.FALSE, null, assessmentStatus); - dbInstance.commit(); - List<Identity> assessedIdentities = businessGroupRelationDao.getMembers(taskImpl.getBusinessGroup(), GroupRoles.participant.name()); for(Identity assessedIdentity:assessedIdentities) { UserCourseEnvironment userCourseEnv = AssessmentHelper.createAndInitUserCourseEnvironment(assessedIdentity, course); - courseAssessmentService.updateLastModifications(cNode, userCourseEnv, taskImpl.getIdentity(), by); + AssessmentEvaluation scoreEvaluation = courseAssessmentService.getAssessmentEvaluation(cNode, userCourseEnv); + AssessmentEvaluation newScoreEvaluation = new AssessmentEvaluation(scoreEvaluation, assessmentStatus); + courseAssessmentService.saveScoreEvaluation(cNode, doerIdentity, newScoreEvaluation, userCourseEnv, false, by); } } else { Identity assessedIdentity = taskImpl.getIdentity(); - assessmentService.updateAssessmentEntry(assessedIdentity, courseRepoEntry, cNode.getIdent(), Boolean.FALSE, null, assessmentStatus); - dbInstance.commit(); - UserCourseEnvironment userCourseEnv = AssessmentHelper.createAndInitUserCourseEnvironment(assessedIdentity, course); - courseAssessmentService.updateLastModifications(cNode, userCourseEnv, taskImpl.getIdentity(), by); + AssessmentEvaluation scoreEvaluation = courseAssessmentService.getAssessmentEvaluation(cNode, userCourseEnv); + AssessmentEvaluation newScoreEvaluation = new AssessmentEvaluation(scoreEvaluation, assessmentStatus); + courseAssessmentService.saveScoreEvaluation(cNode, doerIdentity, newScoreEvaluation, userCourseEnv, false, by); } } @@ -1805,7 +1800,7 @@ public class GTAManagerImpl implements GTAManager { String taskName = taskToString(assignedTask); String msg = step + " of " + taskName + ": " + operation; if(GTAType.group.name().equals(cNode.getModuleConfiguration().getStringValue(GTACourseNode.GTASK_TYPE))) { - log.info(Tracing.M_AUDIT, msg + " to business group: " + assessedGroup.getName()); + log.info(Tracing.M_AUDIT, "{} to business group: {}", msg, assessedGroup.getName()); courseEnv.getAuditManager() .appendToUserNodeLog(cNode, actor, assessedGroup, msg, by); } else { @@ -1824,7 +1819,7 @@ public class GTAManagerImpl implements GTAManager { String taskName = taskToString(assignedTask); String msg = step + " of " + taskName + ": " + operation + " " + file; if(GTAType.group.name().equals(cNode.getModuleConfiguration().getStringValue(GTACourseNode.GTASK_TYPE))) { - log.info(Tracing.M_AUDIT, msg + " to business group: " + assessedGroup.getName()); + log.info(Tracing.M_AUDIT, "{} to business group: {}",msg , assessedGroup.getName()); courseEnv.getAuditManager() .appendToUserNodeLog(cNode, actor, assessedGroup, msg, by); } else { diff --git a/src/main/java/org/olat/course/nodes/gta/ui/GTAAbstractController.java b/src/main/java/org/olat/course/nodes/gta/ui/GTAAbstractController.java index 88bc66f72c14c3279deeaf23f675af36d182903f..516e5451d2e88ccbe4042ab364893e61d2ad7edb 100644 --- a/src/main/java/org/olat/course/nodes/gta/ui/GTAAbstractController.java +++ b/src/main/java/org/olat/course/nodes/gta/ui/GTAAbstractController.java @@ -253,6 +253,11 @@ public abstract class GTAAbstractController extends BasicController implements G nodeLog(task); collapsedContents(task); + + if(userCourseEnv != null && getIdentity().equals(userCourseEnv.getIdentityEnvironment().getIdentity())) { + // recalculate potential changes in status + userCourseEnv.getScoreAccounting().evaluateAll(); + } } protected abstract void resetTask(UserRequest ureq, Task task); diff --git a/src/main/java/org/olat/course/nodes/gta/ui/GTAAvailableTaskController.java b/src/main/java/org/olat/course/nodes/gta/ui/GTAAvailableTaskController.java index 87fdd23ac436e4ac514e028722596f51f3a55a29..88de7b590d0a9a47ed72ee32b610cf7dd61cd040 100644 --- a/src/main/java/org/olat/course/nodes/gta/ui/GTAAvailableTaskController.java +++ b/src/main/java/org/olat/course/nodes/gta/ui/GTAAvailableTaskController.java @@ -261,7 +261,7 @@ public class GTAAvailableTaskController extends FormBasicController { if(businessGroupTask) { response = gtaManager.selectTask(assessedGroup, taskList, gtaNode, task, getIdentity()); } else { - response = gtaManager.selectTask(assessedIdentity, taskList, gtaNode, task, getIdentity()); + response = gtaManager.selectTask(assessedIdentity, taskList, gtaNode, task); } if(response == null || response.getStatus() == AssignmentResponse.Status.error) { diff --git a/src/main/java/org/olat/course/nodes/gta/ui/GTAParticipantController.java b/src/main/java/org/olat/course/nodes/gta/ui/GTAParticipantController.java index 5943cba958292623f4b24428c076c3a54bb5d366..1e70e45ecda6e17adc1fe40c02b8e39f8d8894ff 100644 --- a/src/main/java/org/olat/course/nodes/gta/ui/GTAParticipantController.java +++ b/src/main/java/org/olat/course/nodes/gta/ui/GTAParticipantController.java @@ -228,7 +228,7 @@ public class GTAParticipantController extends GTAAbstractController implements A if(GTAType.group.name().equals(config.getStringValue(GTACourseNode.GTASK_TYPE))) { response = gtaManager.assignTaskAutomatically(taskList, assessedGroup, courseEnv, gtaNode, getIdentity()); } else { - response = gtaManager.assignTaskAutomatically(taskList, assessedIdentity, courseEnv, gtaNode, getIdentity()); + response = gtaManager.assignTaskAutomatically(taskList, assessedIdentity, courseEnv, gtaNode); } if(response == null || response.getStatus() == AssignmentResponse.Status.error) { @@ -856,6 +856,7 @@ public class GTAParticipantController extends GTAAbstractController implements A cleanUpProcess(); resetDueDates(); process(ureq); + fireEvent(ureq, Event.CHANGED_EVENT); } } else if(revisionDocumentsCtrl == source) { if(event == Event.DONE_EVENT) { @@ -906,6 +907,7 @@ public class GTAParticipantController extends GTAAbstractController implements A assignTaskAutomatically(ureq, confirmOptionalAssignmentCtrl.getTask()); cleanUpProcess(); process(ureq); + fireEvent(ureq, Event.CHANGED_EVENT); } else { optionalTaskRefused = true; cleanUpProcess(); diff --git a/src/main/java/org/olat/course/nodes/gta/ui/GTARunController.java b/src/main/java/org/olat/course/nodes/gta/ui/GTARunController.java index 2b5e344e73408632fa8d3182ef70d432106ef40d..355efcc89281ad0fb97480ad0e522f1da44e71c1 100644 --- a/src/main/java/org/olat/course/nodes/gta/ui/GTARunController.java +++ b/src/main/java/org/olat/course/nodes/gta/ui/GTARunController.java @@ -59,7 +59,10 @@ public class GTARunController extends BasicController implements Activateable2 { private GTACoachSelectionController markedCtrl; private GTACoachManagementController manageCtrl; - private Link runLink, coachLink, markedLink, manageLink; + private Link runLink; + private Link coachLink; + private Link markedLink; + private Link manageLink; private VelocityContainer mainVC; private SegmentViewComponent segmentView; @@ -161,6 +164,16 @@ public class GTARunController extends BasicController implements Activateable2 { } } + @Override + protected void event(UserRequest ureq, Controller source, Event event) { + if(runCtrl == source) { + if(event == Event.CHANGED_EVENT) { + fireEvent(ureq, event); + } + } + super.event(ureq, source, event); + } + @Override protected void event(UserRequest ureq, Component source, Event event) { if(source == segmentView) { diff --git a/src/main/java/org/olat/course/nodes/ta/ConvertToGTACourseNode.java b/src/main/java/org/olat/course/nodes/ta/ConvertToGTACourseNode.java index 6bf5e26961e4280318e0dc4cd06f3c0e5bd687ad..3e99bbd62e4b20e21bb4006d28039fa42875999f 100644 --- a/src/main/java/org/olat/course/nodes/ta/ConvertToGTACourseNode.java +++ b/src/main/java/org/olat/course/nodes/ta/ConvertToGTACourseNode.java @@ -155,7 +155,7 @@ public class ConvertToGTACourseNode { for(Property sample:samples) { File taskFile = new File(gtaskDirectory, sample.getStringValue()); Identity id = securityManager.loadIdentityByKey(sample.getIdentity().getKey()); - gtaManager.selectTask(id, taskList, gtaNode, taskFile, id); + gtaManager.selectTask(id, taskList, gtaNode, taskFile); } } diff --git a/src/main/java/org/olat/modules/assessment/AssessmentService.java b/src/main/java/org/olat/modules/assessment/AssessmentService.java index 686812fefb12fe2278fb72f8226bd474cdf3708c..2df6be832043ea5149616648a14ab91b10433769 100644 --- a/src/main/java/org/olat/modules/assessment/AssessmentService.java +++ b/src/main/java/org/olat/modules/assessment/AssessmentService.java @@ -93,26 +93,4 @@ public interface AssessmentService { public void setLastVisit(AssessmentEntry nodeAssessment, Date lastVisit); - /** - * Update the status for a user, create the assessment entries if it doesn't exist. - * exist. - * @param entryRoot - * @param status - * @param group - * @return - */ - public AssessmentEntry updateAssessmentEntry(Identity assessedIdentity, RepositoryEntry entry, String subIdent, - Boolean entryRoot, RepositoryEntry referenceEntry, AssessmentEntryStatus status); - - /** - * Update the status for a whole group of users, create the assessment entries if they don't - * exist. - * @param group - * @param entryRoot - * @param status - * @return - */ - public List<AssessmentEntry> updateAssessmentEntries(BusinessGroup group, RepositoryEntry entry, String subIdent, - Boolean entryRoot, RepositoryEntry referenceEntry, AssessmentEntryStatus status); - } diff --git a/src/main/java/org/olat/modules/assessment/manager/AssessmentServiceImpl.java b/src/main/java/org/olat/modules/assessment/manager/AssessmentServiceImpl.java index 3775bec9c3db28e35f57e5b50b243e8ab2131491..a89af06ccc9646e8d4240119aeab57ba722d7768 100644 --- a/src/main/java/org/olat/modules/assessment/manager/AssessmentServiceImpl.java +++ b/src/main/java/org/olat/modules/assessment/manager/AssessmentServiceImpl.java @@ -19,7 +19,6 @@ */ package org.olat.modules.assessment.manager; -import java.util.ArrayList; import java.util.Collection; import java.util.Date; import java.util.List; @@ -28,12 +27,10 @@ import javax.persistence.PersistenceException; import org.apache.logging.log4j.Logger; import org.hibernate.exception.ConstraintViolationException; -import org.olat.basesecurity.GroupRoles; import org.olat.core.commons.persistence.DB; import org.olat.core.id.Identity; import org.olat.core.logging.Tracing; import org.olat.group.BusinessGroup; -import org.olat.group.manager.BusinessGroupRelationDAO; import org.olat.modules.assessment.AssessmentEntry; import org.olat.modules.assessment.AssessmentEntryCompletion; import org.olat.modules.assessment.AssessmentService; @@ -60,8 +57,6 @@ public class AssessmentServiceImpl implements AssessmentService, UserDataDeletab private DB dbInstance; @Autowired private AssessmentEntryDAO assessmentEntryDao; - @Autowired - private BusinessGroupRelationDAO businessGroupRelationDao; @Override public AssessmentEntry getOrCreateAssessmentEntry(Identity assessedIdentity, String anonymousIdentifier, @@ -155,29 +150,6 @@ public class AssessmentServiceImpl implements AssessmentService, UserDataDeletab assessmentEntryDao.setLastVisit(nodeAssessment, lastVisit); } - @Override - public AssessmentEntry updateAssessmentEntry(Identity assessedIdentity, RepositoryEntry entry, String subIdent, - Boolean entryRoot, RepositoryEntry referenceEntry, AssessmentEntryStatus status) { - AssessmentEntry assessmentEntry = getOrCreateAssessmentEntry(assessedIdentity, null, entry, subIdent, entryRoot, referenceEntry); - assessmentEntry.setAssessmentStatus(status); - return assessmentEntryDao.updateAssessmentEntry(assessmentEntry); - } - - @Override - public List<AssessmentEntry> updateAssessmentEntries(BusinessGroup group, RepositoryEntry entry, String subIdent, - Boolean entryRoot, RepositoryEntry referenceEntry, AssessmentEntryStatus status) { - List<AssessmentEntry> assessmentEntries = new ArrayList<>(); - List<Identity> groupParticipants = businessGroupRelationDao.getMembers(group, GroupRoles.participant.name()); - for(Identity groupParticipant:groupParticipants) { - AssessmentEntry assessmentEntry = getOrCreateAssessmentEntry(groupParticipant, null, entry, subIdent, entryRoot, referenceEntry); - assessmentEntry.setAssessmentStatus(status); - assessmentEntry = assessmentEntryDao.updateAssessmentEntry(assessmentEntry); - assessmentEntries.add(assessmentEntry); - } - - return assessmentEntries; - } - @Override public void deleteUserData(Identity identity, String newDeletedUserName) { assessmentEntryDao.deleteEntryForIdentity(identity); diff --git a/src/main/java/org/olat/portfolio/manager/EPFrontendManager.java b/src/main/java/org/olat/portfolio/manager/EPFrontendManager.java index 1640f326ecf16f29c2661b345e1954364c94adfb..ac99bbfeec1d32a2e52404f81a20e927ebc628fc 100755 --- a/src/main/java/org/olat/portfolio/manager/EPFrontendManager.java +++ b/src/main/java/org/olat/portfolio/manager/EPFrontendManager.java @@ -53,9 +53,7 @@ import org.olat.course.run.userview.UserCourseEnvironment; import org.olat.course.run.userview.UserCourseEnvironmentImpl; import org.olat.group.BusinessGroup; import org.olat.group.DeletableGroupData; -import org.olat.modules.assessment.AssessmentService; import org.olat.modules.assessment.Role; -import org.olat.modules.assessment.model.AssessmentEntryStatus; import org.olat.modules.webFeed.portfolio.LiveBlogArtefactHandler; import org.olat.portfolio.PortfolioModule; import org.olat.portfolio.model.EPFilterSettings; @@ -72,7 +70,6 @@ import org.olat.portfolio.model.structel.PortfolioStructureRef; import org.olat.properties.NarrowedPropertyManager; import org.olat.properties.Property; import org.olat.repository.RepositoryEntry; -import org.olat.repository.manager.RepositoryEntryDAO; import org.olat.resource.OLATResource; import org.olat.search.SearchResults; import org.olat.search.model.AbstractOlatDocument; @@ -123,10 +120,6 @@ public class EPFrontendManager implements UserDataDeletable, DeletableGroupData private UserManager userManager; @Autowired private PortfolioModule portfolioModule; - @Autowired - private RepositoryEntryDAO repositoryEntryDao; - @Autowired - private AssessmentService assessmentService; /** * Check if a user has any kind of EP v1 resources: artefacts, a owned map or a shared map @@ -677,8 +670,8 @@ public class EPFrontendManager implements UserDataDeletable, DeletableGroupData } structureManager.copyStructureRecursively(template, copy, true); - RepositoryEntry referenceEntry = repositoryEntryDao.loadByResourceKey(template.getOlatResource().getKey()); - assessmentService.updateAssessmentEntry(identity, courseEntry, targetSubPath, Boolean.FALSE, referenceEntry, AssessmentEntryStatus.inProgress); + //RepositoryEntry referenceEntry = repositoryEntryDao.loadByResourceKey(template.getOlatResource().getKey()); + //assessmentService.updateAssessmentEntry(identity, courseEntry, targetSubPath, Boolean.FALSE, referenceEntry, AssessmentEntryStatus.inProgress); return copy; } }); @@ -1177,9 +1170,9 @@ public class EPFrontendManager implements UserDataDeletable, DeletableGroupData am.incrementNodeAttemptsInBackground(courseNode, owner, uce); } - RepositoryEntry referenceEntry = courseNode.getReferencedRepositoryEntry(); - RepositoryEntry courseEntry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry(); - assessmentService.updateAssessmentEntry(owner, courseEntry, courseNode.getIdent(), Boolean.FALSE, referenceEntry, AssessmentEntryStatus.inReview); + //RepositoryEntry referenceEntry = courseNode.getReferencedRepositoryEntry(); + //RepositoryEntry courseEntry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry(); + //assessmentService.updateAssessmentEntry(owner, courseEntry, courseNode.getIdent(), Boolean.FALSE, referenceEntry, AssessmentEntryStatus.inReview); } assessmentNotificationsHandler.markPublisherNews(owner, course.getResourceableId()); log.info(Tracing.M_AUDIT, "Map " + map + " from " + owner.getKey() + " has been submitted."); diff --git a/src/test/java/org/olat/course/nodes/gta/manager/GTAManagerTest.java b/src/test/java/org/olat/course/nodes/gta/manager/GTAManagerTest.java index 87da8190b411dc5419709c721e845abf06a68940..4006abd7bf47ae033303418ef117c3d9314703f0 100644 --- a/src/test/java/org/olat/course/nodes/gta/manager/GTAManagerTest.java +++ b/src/test/java/org/olat/course/nodes/gta/manager/GTAManagerTest.java @@ -120,7 +120,7 @@ public class GTAManagerTest extends OlatTestCase { dbInstance.commit(); //select - AssignmentResponse response = gtaManager.selectTask(participant, tasks, node, taskFile, participant); + AssignmentResponse response = gtaManager.selectTask(participant, tasks, node, taskFile); dbInstance.commitAndCloseSession(); //check Assert.assertNotNull(response); @@ -245,7 +245,7 @@ public class GTAManagerTest extends OlatTestCase { //select File taskFile = new File("bg.txt"); - AssignmentResponse response = gtaManager.selectTask(participant, tasks, node, taskFile, participant); + AssignmentResponse response = gtaManager.selectTask(participant, tasks, node, taskFile); Assert.assertNotNull(response); Assert.assertEquals(Status.ok, response.getStatus()); @@ -269,7 +269,7 @@ public class GTAManagerTest extends OlatTestCase { dbInstance.commit(); //select - AssignmentResponse response = gtaManager.selectTask(participant, tasks, node, taskFile, participant); + AssignmentResponse response = gtaManager.selectTask(participant, tasks, node, taskFile); dbInstance.commitAndCloseSession(); Assert.assertNotNull(response); Assert.assertNotNull(response.getTask()); @@ -296,7 +296,7 @@ public class GTAManagerTest extends OlatTestCase { dbInstance.commit(); //select - AssignmentResponse response = gtaManager.selectTask(participant, tasks, node, taskFile, participant); + AssignmentResponse response = gtaManager.selectTask(participant, tasks, node, taskFile); dbInstance.commitAndCloseSession(); Assert.assertNotNull(response); Assert.assertNotNull(response.getTask()); @@ -334,8 +334,8 @@ public class GTAManagerTest extends OlatTestCase { Assert.assertNotNull(taskList); //select - gtaManager.selectTask(id1, taskList, node, new File("work_1.txt"), id1); - gtaManager.selectTask(id2, taskList, node, new File("work_2.txt"), id2); + gtaManager.selectTask(id1, taskList, node, new File("work_1.txt")); + gtaManager.selectTask(id2, taskList, node, new File("work_2.txt")); //get assigned tasks List<String> assigned = gtaManager.getAssignedTasks(taskList); @@ -358,8 +358,8 @@ public class GTAManagerTest extends OlatTestCase { Assert.assertNotNull(taskList); //select - gtaManager.selectTask(id1, taskList, node, new File("work_1.txt"), id1); - gtaManager.selectTask(id2, taskList, node, new File("work_2.txt"), id2); + gtaManager.selectTask(id1, taskList, node, new File("work_1.txt")); + gtaManager.selectTask(id2, taskList, node, new File("work_2.txt")); dbInstance.commit(); //change a name @@ -398,9 +398,9 @@ public class GTAManagerTest extends OlatTestCase { Assert.assertNotNull(taskListRef); //select - gtaManager.selectTask(id1, taskList, node, new File("work_1.txt"), id1); - gtaManager.selectTask(id1, taskListRef, nodeRef, new File("work_1.txt"), id1); - gtaManager.selectTask(id2, taskList, node, new File("work_2.txt"), id2); + gtaManager.selectTask(id1, taskList, node, new File("work_1.txt")); + gtaManager.selectTask(id1, taskListRef, nodeRef, new File("work_1.txt")); + gtaManager.selectTask(id2, taskList, node, new File("work_2.txt")); dbInstance.commit(); //change a name @@ -617,7 +617,7 @@ public class GTAManagerTest extends OlatTestCase { dbInstance.commit(); //select - AssignmentResponse response = gtaManager.selectTask(participant, tasks, node, taskFile, participant); + AssignmentResponse response = gtaManager.selectTask(participant, tasks, node, taskFile); dbInstance.commitAndCloseSession(); Assert.assertNotNull(response); @@ -673,14 +673,14 @@ public class GTAManagerTest extends OlatTestCase { dbInstance.commit(); //participant 1 and 2 select course 1 - AssignmentResponse response1_1 = gtaManager.selectTask(participant1, tasks1, node1, taskFile, participant1); - AssignmentResponse response1_2 = gtaManager.selectTask(participant2, tasks1, node1, taskFile, participant2); + AssignmentResponse response1_1 = gtaManager.selectTask(participant1, tasks1, node1, taskFile); + AssignmentResponse response1_2 = gtaManager.selectTask(participant2, tasks1, node1, taskFile); dbInstance.commitAndCloseSession(); Assert.assertNotNull(response1_1); Assert.assertNotNull(response1_2); //participant 2 select node 2 - AssignmentResponse response2_2 = gtaManager.selectTask(participant2, tasks2, node2, taskFile, participant2); + AssignmentResponse response2_2 = gtaManager.selectTask(participant2, tasks2, node2, taskFile); dbInstance.commitAndCloseSession(); Assert.assertNotNull(response2_2); diff --git a/src/test/java/org/olat/course/nodes/gta/manager/GTATaskRevisionDAOTest.java b/src/test/java/org/olat/course/nodes/gta/manager/GTATaskRevisionDAOTest.java index 67485180064c1b5d4b4a99f935f39af06c879c31..7b4a60f22bca2c4a5513b66435d15b0a2d2ade9c 100644 --- a/src/test/java/org/olat/course/nodes/gta/manager/GTATaskRevisionDAOTest.java +++ b/src/test/java/org/olat/course/nodes/gta/manager/GTATaskRevisionDAOTest.java @@ -68,7 +68,7 @@ public class GTATaskRevisionDAOTest extends OlatTestCase { // participant select a task File taskFile = new File("task.txt"); - AssignmentResponse response = gtaManager.selectTask(participant, tasks, node, taskFile, participant); + AssignmentResponse response = gtaManager.selectTask(participant, tasks, node, taskFile); Task task = response.getTask(); Assert.assertNotNull(task); @@ -102,7 +102,7 @@ public class GTATaskRevisionDAOTest extends OlatTestCase { // participant select a task File taskFile = new File("tasked.txt"); - AssignmentResponse response = gtaManager.selectTask(participant, tasks, node, taskFile, participant); + AssignmentResponse response = gtaManager.selectTask(participant, tasks, node, taskFile); Task task = response.getTask(); Assert.assertNotNull(task); @@ -145,7 +145,7 @@ public class GTATaskRevisionDAOTest extends OlatTestCase { // participant select a task File taskFile = new File("tasked.txt"); - AssignmentResponse response = gtaManager.selectTask(participant, tasks, node, taskFile, participant); + AssignmentResponse response = gtaManager.selectTask(participant, tasks, node, taskFile); Task task = response.getTask(); Assert.assertNotNull(task); diff --git a/src/test/java/org/olat/course/nodes/gta/rule/GTAReminderRuleTest.java b/src/test/java/org/olat/course/nodes/gta/rule/GTAReminderRuleTest.java index 32f246ee9a3c1b75dd697ed569c51069d2fc854b..52bf9ba3623a2a56048d947774613df263c8a659 100644 --- a/src/test/java/org/olat/course/nodes/gta/rule/GTAReminderRuleTest.java +++ b/src/test/java/org/olat/course/nodes/gta/rule/GTAReminderRuleTest.java @@ -118,7 +118,7 @@ public class GTAReminderRuleTest extends OlatTestCase { dbInstance.commit(); //select a task - AssignmentResponse response = gtaManager.selectTask(participant1, tasks, node, taskFile, participant1); + AssignmentResponse response = gtaManager.selectTask(participant1, tasks, node, taskFile); dbInstance.commitAndCloseSession(); Assert.assertEquals(AssignmentResponse.Status.ok, response.getStatus()); @@ -226,7 +226,7 @@ public class GTAReminderRuleTest extends OlatTestCase { dbInstance.commit(); // group 1 select a task - AssignmentResponse response = gtaManager.selectTask(businessGroup1, tasks, node, taskFile, participant1); + AssignmentResponse response = gtaManager.selectTask(businessGroup1, tasks, node, taskFile, participant2); dbInstance.commitAndCloseSession(); Assert.assertEquals(AssignmentResponse.Status.ok, response.getStatus()); @@ -432,7 +432,7 @@ public class GTAReminderRuleTest extends OlatTestCase { dbInstance.commit(); //select a task - AssignmentResponse response = gtaManager.selectTask(participant1, tasks, node, taskFile, participant1); + AssignmentResponse response = gtaManager.selectTask(participant1, tasks, node, taskFile); dbInstance.commitAndCloseSession(); Assert.assertEquals(AssignmentResponse.Status.ok, response.getStatus());