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

OO-4901: make the project broker a non-assessable course element

parent b1cb93b1
No related branches found
No related tags found
No related merge requests found
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Initial code contributed and copyrighted by<br>
* frentix GmbH, http://www.frentix.com
* <p>
*/
package org.olat.course.nodes.projectbroker;
import org.olat.course.assessment.handler.ModuleAssessmentConfig;
import org.olat.course.nodes.ProjectBrokerCourseNode;
import org.olat.modules.ModuleConfiguration;
/**
*
* Initial date: 19 Aug 2019<br>
* @author uhensler, urs.hensler@frentix.com, http://www.frentix.com
*
*/
public class ProjectBrokerAssessmentConfig extends ModuleAssessmentConfig {
public ProjectBrokerAssessmentConfig(ModuleConfiguration config) {
super(config);
}
@Override
public boolean isAssessable() {
return true;
}
@Override
public Mode getScoreMode() {
return Mode.none;
}
@Override
public Mode getPassedMode() {
return Mode.none;
}
@Override
public boolean hasAttempts() {
return false;
}
@Override
public boolean hasComment() {
return false;
}
@Override
public boolean hasIndividualAsssessmentDocuments() {
return false;
}
@Override
public boolean hasStatus() {
return false; // Project broker Course node has no status-field
}
@Override
public boolean isEditable() {
return false;
}
@Override
public boolean isBulkEditable() {
return false;
}
@Override
public boolean hasEditableDetails() {
return config.getBooleanSafe(ProjectBrokerCourseNode.CONF_DROPBOX_ENABLED);
}
}
......@@ -19,29 +19,8 @@
*/
package org.olat.course.nodes.projectbroker;
import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.stack.BreadcrumbPanel;
import org.olat.core.gui.components.stack.TooledStackedPanel;
import org.olat.core.gui.control.Controller;
import org.olat.core.gui.control.WindowControl;
import org.olat.core.id.Identity;
import org.olat.course.assessment.AssessmentManager;
import org.olat.course.assessment.handler.AssessmentConfig;
import org.olat.course.assessment.handler.AssessmentHandler;
import org.olat.course.assessment.ui.tool.AssessmentCourseNodeController;
import org.olat.course.config.CourseConfig;
import org.olat.course.learningpath.evaluation.LearningPathEvaluatorBuilder;
import org.olat.course.learningpath.manager.LearningPathNodeAccessProvider;
import org.olat.course.nodes.CourseNode;
import org.olat.course.learningpath.LearningPathOnlyAssessmentHandler;
import org.olat.course.nodes.ProjectBrokerCourseNode;
import org.olat.course.run.scoring.AccountingEvaluators;
import org.olat.course.run.scoring.AccountingEvaluatorsBuilder;
import org.olat.course.run.userview.UserCourseEnvironment;
import org.olat.group.BusinessGroup;
import org.olat.modules.assessment.AssessmentEntry;
import org.olat.modules.assessment.ui.AssessmentToolContainer;
import org.olat.modules.assessment.ui.AssessmentToolSecurityCallback;
import org.olat.repository.RepositoryEntry;
import org.springframework.stereotype.Service;
/**
......@@ -51,51 +30,11 @@ import org.springframework.stereotype.Service;
*
*/
@Service
public class ProjectBrokerAssessmentHandler implements AssessmentHandler {
public class ProjectBrokerAssessmentHandler extends LearningPathOnlyAssessmentHandler {
@Override
public String acceptCourseNodeType() {
return ProjectBrokerCourseNode.TYPE;
}
@Override
public AssessmentConfig getAssessmentConfig(CourseNode courseNode) {
return new ProjectBrokerAssessmentConfig(courseNode.getModuleConfiguration());
}
@Override
public AssessmentEntry getAssessmentEntry(CourseNode courseNode, UserCourseEnvironment userCourseEnvironment) {
AssessmentManager am = userCourseEnvironment.getCourseEnvironment().getAssessmentManager();
Identity assessedIdentity = userCourseEnvironment.getIdentityEnvironment().getIdentity();
return am.getAssessmentEntry(courseNode, assessedIdentity);
}
@Override
public AccountingEvaluators getEvaluators(CourseNode courseNode, CourseConfig courseConfig) {
if (LearningPathNodeAccessProvider.TYPE.equals(courseConfig.getNodeAccessType().getType())) {
return LearningPathEvaluatorBuilder.buildDefault();
}
return AccountingEvaluatorsBuilder.defaultConventional();
}
@Override
public Controller getDetailsEditController(UserRequest ureq, WindowControl wControl, BreadcrumbPanel stackPanel,
CourseNode courseNode, UserCourseEnvironment coachCourseEnv, UserCourseEnvironment assessedUserCourseEnv) {
return null;
}
@Override
public boolean hasCustomIdentityList() {
return true;
}
@Override
public AssessmentCourseNodeController getIdentityListController(UserRequest ureq, WindowControl wControl,
TooledStackedPanel stackPanel, CourseNode courseNode, RepositoryEntry courseEntry, BusinessGroup group,
UserCourseEnvironment coachCourseEnv, AssessmentToolContainer toolContainer,
AssessmentToolSecurityCallback assessmentCallback) {
return new ProjectBrokerIdentityListCourseNodeController(ureq, wControl, stackPanel, courseEntry, group,
courseNode, coachCourseEnv, toolContainer, assessmentCallback);
}
}
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Initial code contributed and copyrighted by<br>
* frentix GmbH, http://www.frentix.com
* <p>
*/
package org.olat.course.nodes.projectbroker;
import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer;
import org.olat.core.gui.components.stack.TooledStackedPanel;
import org.olat.core.gui.control.WindowControl;
import org.olat.course.assessment.bulk.BulkAssessmentToolController;
import org.olat.course.assessment.ui.tool.IdentityListCourseNodeController;
import org.olat.course.nodes.CourseNode;
import org.olat.course.run.userview.UserCourseEnvironment;
import org.olat.group.BusinessGroup;
import org.olat.modules.assessment.ui.AssessmentToolContainer;
import org.olat.modules.assessment.ui.AssessmentToolSecurityCallback;
import org.olat.repository.RepositoryEntry;
/**
*
* This view is not used. The project broker is excluded from
* the assessment tool.
*
* Initial date: 18 déc. 2017<br>
* @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
*
*/
public class ProjectBrokerIdentityListCourseNodeController extends IdentityListCourseNodeController {
public ProjectBrokerIdentityListCourseNodeController(UserRequest ureq, WindowControl wControl, TooledStackedPanel stackPanel,
RepositoryEntry courseEntry, BusinessGroup group, CourseNode courseNode, UserCourseEnvironment coachCourseEnv,
AssessmentToolContainer toolContainer, AssessmentToolSecurityCallback assessmentCallback) {
super(ureq, wControl, stackPanel, courseEntry, group, courseNode, coachCourseEnv, toolContainer, assessmentCallback);
}
@Override
protected void initMultiSelectionTools(UserRequest ureq, FormLayoutContainer formLayout) {
if(!coachCourseEnv.isCourseReadOnly()) {
BulkAssessmentToolController bulkAssessmentTollCtrl = new BulkAssessmentToolController(ureq, getWindowControl(),
getCourseEnvironment(), courseNode);
listenTo(bulkAssessmentTollCtrl);
formLayout.put("bulk.assessment", bulkAssessmentTollCtrl.getInitialComponent());
}
//no other batch functions
tableEl.setMultiSelect(false);
tableEl.setSelectAllEnable(false);
}
}
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