Skip to content
Snippets Groups Projects
Commit a57a6273 authored by srosse's avatar srosse
Browse files

Merge remote-tracking branch 'origin/OpenOLAT_14.1'

parents bcfd6ad7 9e30a974
No related branches found
No related tags found
No related merge requests found
...@@ -42,6 +42,8 @@ import org.olat.core.commons.persistence.PersistenceHelper; ...@@ -42,6 +42,8 @@ import org.olat.core.commons.persistence.PersistenceHelper;
import org.olat.core.commons.persistence.QueryBuilder; import org.olat.core.commons.persistence.QueryBuilder;
import org.olat.core.id.Identity; import org.olat.core.id.Identity;
import org.olat.core.util.StringHelper; import org.olat.core.util.StringHelper;
import org.olat.course.assessment.AssessmentMode;
import org.olat.course.assessment.manager.AssessmentModeDAO;
import org.olat.modules.curriculum.CurriculumElement; import org.olat.modules.curriculum.CurriculumElement;
import org.olat.modules.curriculum.CurriculumRoles; import org.olat.modules.curriculum.CurriculumRoles;
import org.olat.modules.lecture.LectureBlock; import org.olat.modules.lecture.LectureBlock;
...@@ -78,6 +80,8 @@ public class LectureBlockDAO { ...@@ -78,6 +80,8 @@ public class LectureBlockDAO {
private DB dbInstance; private DB dbInstance;
@Autowired @Autowired
private GroupDAO groupDao; private GroupDAO groupDao;
@Autowired
private AssessmentModeDAO assessmentModeDao;
public LectureBlock createLectureBlock(RepositoryEntry entry) { public LectureBlock createLectureBlock(RepositoryEntry entry) {
LectureBlockImpl block = new LectureBlockImpl(); LectureBlockImpl block = new LectureBlockImpl();
...@@ -126,6 +130,11 @@ public class LectureBlockDAO { ...@@ -126,6 +130,11 @@ public class LectureBlockDAO {
LectureBlock reloadedBlock = dbInstance.getCurrentEntityManager() LectureBlock reloadedBlock = dbInstance.getCurrentEntityManager()
.getReference(LectureBlockImpl.class, lectureBlock.getKey()); .getReference(LectureBlockImpl.class, lectureBlock.getKey());
AssessmentMode assessmentMode = assessmentModeDao.getAssessmentModeByLecture(reloadedBlock);
if(assessmentMode != null) {
assessmentModeDao.delete(assessmentMode);
}
//delete lecture block to group //delete lecture block to group
String deleteToGroup = "delete from lectureblocktogroup blocktogroup where blocktogroup.lectureBlock.key=:lectureBlockKey"; String deleteToGroup = "delete from lectureblocktogroup blocktogroup where blocktogroup.lectureBlock.key=:lectureBlockKey";
int rows = dbInstance.getCurrentEntityManager() int rows = dbInstance.getCurrentEntityManager()
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
package org.olat.user; package org.olat.user;
import java.util.Collections; import java.util.Collections;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors;
import org.olat.admin.user.tools.UserToolExtension; import org.olat.admin.user.tools.UserToolExtension;
import org.olat.admin.user.tools.UserToolsModule; import org.olat.admin.user.tools.UserToolsModule;
...@@ -71,15 +71,10 @@ public class ToolsPrefsController extends FormBasicController { ...@@ -71,15 +71,10 @@ public class ToolsPrefsController extends FormBasicController {
if(enabled) { if(enabled) {
Set<String> aToolSet = userToolsModule.getAvailableUserToolSet(); Set<String> aToolSet = userToolsModule.getAvailableUserToolSet();
userTools = userToolsModule.getAllUserToolExtensions(ureq); List<UserToolExtension> userToolList = userToolsModule.getAllUserToolExtensions(ureq);
if(!aToolSet.isEmpty()) { userTools = userToolList.stream()
for(Iterator<UserToolExtension> it=userTools.iterator(); it.hasNext(); ) { .filter(tool -> (!tool.isShortCutOnly() && (aToolSet.isEmpty() || aToolSet.contains(tool.getUniqueExtensionID()))))
UserToolExtension userToolExt = it.next(); .collect(Collectors.toList());
if(!aToolSet.contains(userToolExt.getUniqueExtensionID()) || userToolExt.isShortCutOnly()) {
it.remove();
}
}
}
} else { } else {
userTools = Collections.emptyList(); userTools = Collections.emptyList();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment