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

Merge OpenOLAT 9.3 to OpenOLAT default branch with 3d8d23ca7946323b7f05ad0fabc84dcfe9a6727f

parents 821a272a bafdb779
No related branches found
No related tags found
No related merge requests found
......@@ -64,28 +64,27 @@ public class SolutionController extends BasicController {
* @param wControl
* @param config
* @param node
* @param userCourseEnv
* @param courseEnv
* @param previewMode
*/
public SolutionController(UserRequest ureq, WindowControl wControl, CourseNode node, UserCourseEnvironment userCourseEnv, boolean previewMode) {
public SolutionController(UserRequest ureq, WindowControl wControl, CourseNode node, CourseEnvironment courseEnv, boolean previewMode) {
super(ureq, wControl);
myContent = createVelocityContainer("solutionRun");
// returnbox display
OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(
SolutionController.getSolutionPathRelToFolderRoot(userCourseEnv.getCourseEnvironment(), node), null);
String solutionPath = SolutionController.getSolutionPathRelToFolderRoot(courseEnv, node);
OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(solutionPath, null);
OlatNamedContainerImpl namedContainer = new OlatNamedContainerImpl("solutions", rootFolder);
namedContainer.setLocalSecurityCallback(new ReadOnlyCallback());
solutionFolderRunController = new FolderRunController(namedContainer, false, ureq, wControl);
solutionFolderRunController.addControllerListener(this);
myContent.put("solutionbox", solutionFolderRunController.getInitialComponent());
if ( !previewMode) {
if (!previewMode) {
// offer subscription, but not to guests
subsContext = SolutionFileUploadNotificationHandler.getSubscriptionContext(userCourseEnv, node);
subsContext = SolutionFileUploadNotificationHandler.getSubscriptionContext(courseEnv, node);
if (subsContext != null) {
contextualSubscriptionCtr = AbstractTaskNotificationHandler.createContextualSubscriptionController(ureq, wControl, getSolutionPathRelToFolderRoot(
userCourseEnv.getCourseEnvironment(), node), subsContext, SolutionController.class);
contextualSubscriptionCtr = AbstractTaskNotificationHandler.createContextualSubscriptionController(ureq, wControl, solutionPath, subsContext, SolutionController.class);
myContent.put("subscription", contextualSubscriptionCtr.getInitialComponent());
myContent.contextPut("hasNotification", Boolean.TRUE);
}
......
......@@ -32,7 +32,7 @@ import org.olat.core.logging.OLog;
import org.olat.core.logging.Tracing;
import org.olat.course.CourseModule;
import org.olat.course.nodes.CourseNode;
import org.olat.course.run.userview.UserCourseEnvironment;
import org.olat.course.run.environment.CourseEnvironment;
/**
* Description:<br>
......@@ -51,8 +51,8 @@ public class SolutionFileUploadNotificationHandler extends AbstractTaskNotificat
//empty block
}
protected static SubscriptionContext getSubscriptionContext(UserCourseEnvironment userCourseEnv, CourseNode node) {
return CourseModule.createSubscriptionContext(userCourseEnv.getCourseEnvironment(), node, "Solutionbox");
protected static SubscriptionContext getSubscriptionContext(CourseEnvironment courseEnv, CourseNode node) {
return CourseModule.createSubscriptionContext(courseEnv, node, "Solutionbox");
}
protected String getCssClassIcon() {
......
......@@ -257,7 +257,7 @@ public class TACourseNodeEditController extends ActivateableTabbableDefaultContr
editScoring.contextPut("isOverwriting", new Boolean(false));
// Solution-Tab
solutionVC = this.createVelocityContainer("editSolutionFolder");
solutionVC = createVelocityContainer("editSolutionFolder");
vfButton = LinkFactory.createButton("link.solutionFolder", solutionVC, this);
}
......@@ -292,10 +292,9 @@ public class TACourseNodeEditController extends ActivateableTabbableDefaultContr
} else {
// already assigned task => open dialog with warn
String[] args = new String[] { new Integer(assignedProps.size()).toString() };
dialogBoxController = this.activateOkCancelDialog(ureq, "", getTranslator().translate("taskfolder.overwriting.confirm", args), dialogBoxController);
dialogBoxController = activateOkCancelDialog(ureq, "", getTranslator().translate("taskfolder.overwriting.confirm", args), dialogBoxController);
}
} else if (source == vfButton) {
if (log.isDebug()) log.debug("Event for sampleVC");
} else if (source == vfButton) {
// switch to new dialog
OlatNamedContainerImpl namedContainer = TACourseNode.getNodeFolderContainer(node, course.getCourseEnvironment());
Quota quota = QuotaManager.getInstance().getCustomQuota(namedContainer.getRelPath());
......@@ -303,14 +302,12 @@ public class TACourseNodeEditController extends ActivateableTabbableDefaultContr
Quota defQuota = QuotaManager.getInstance().getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_NODES);
quota = QuotaManager.getInstance().createQuota(namedContainer.getRelPath(), defQuota.getQuotaKB(), defQuota.getUlLimitKB());
}
VFSSecurityCallback secCallback = new FullAccessWithQuotaCallback(quota);
SubscriptionContext subContext = SolutionFileUploadNotificationHandler.getSubscriptionContext(course.getCourseEnvironment(), node);
VFSSecurityCallback secCallback = new FullAccessWithQuotaCallback(quota, subContext);
namedContainer.setLocalSecurityCallback(secCallback);
CloseableModalController cmc = new CloseableModalController(getWindowControl(), translate("close"),
new FolderRunController(namedContainer, false, ureq, getWindowControl()).getInitialComponent());
FolderRunController folderCtrl = new FolderRunController(namedContainer, false, ureq, getWindowControl());
CloseableModalController cmc = new CloseableModalController(getWindowControl(), translate("close"), folderCtrl.getInitialComponent());
cmc.activate();
if (log.isDebug()) log.debug("Switch to sample folder dialog : DONE");
return;
} else if (source == editScoringConfigButton){
scoringController.setDisplayOnly(false);
editScoring.contextPut("isOverwriting", new Boolean(true));
......
......@@ -103,7 +103,7 @@ public class TACourseNodeRunController extends BasicController {
}
if (hasSolution) {
solutionController = new SolutionController(ureq, wControl, ne.getCourseNode(), userCourseEnv, previewMode);
solutionController = new SolutionController(ureq, wControl, ne.getCourseNode(), userCourseEnv.getCourseEnvironment(), previewMode);
content.put("solutionController", solutionController.getInitialComponent());
content.contextPut("hasSolution", Boolean.TRUE);
}
......
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