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