Skip to content
Snippets Groups Projects
Commit 749bcad8 authored by uhensler's avatar uhensler
Browse files

OO-4206: Scorm course elements can be fully assessed if passed

parent 6e6c09ba
No related branches found
No related tags found
No related merge requests found
Showing
with 150 additions and 25 deletions
...@@ -528,6 +528,11 @@ public class CourseAssessmentManagerImpl implements AssessmentManager { ...@@ -528,6 +528,11 @@ public class CourseAssessmentManagerImpl implements AssessmentManager {
} }
assessmentEntry = assessmentService.updateAssessmentEntry(assessmentEntry); assessmentEntry = assessmentService.updateAssessmentEntry(assessmentEntry);
DBFactory.getInstance().commit();//commit before sending events DBFactory.getInstance().commit();//commit before sending events
if (Boolean.TRUE.equals(passed)) {
nodeAccessService.onPassed(courseNode, userCourseEnv , Role.auto);
}
//reevalute the tree //reevalute the tree
ScoreAccounting scoreAccounting = userCourseEnv.getScoreAccounting(); ScoreAccounting scoreAccounting = userCourseEnv.getScoreAccounting();
scoreAccounting.evaluateAll(true); scoreAccounting.evaluateAll(true);
......
...@@ -104,4 +104,9 @@ public class ConditionNodeAccessProvider implements NodeAccessProvider { ...@@ -104,4 +104,9 @@ public class ConditionNodeAccessProvider implements NodeAccessProvider {
// nothing to do // nothing to do
} }
@Override
public void onPassed(CourseNode courseNode, UserCourseEnvironment userCourseEnv, Role by) {
// nothing to do
}
} }
...@@ -40,6 +40,8 @@ public interface LearningPathConfigs { ...@@ -40,6 +40,8 @@ public interface LearningPathConfigs {
public FullyAssessedResult isFullyAssessedOnConfirmation(); public FullyAssessedResult isFullyAssessedOnConfirmation();
public FullyAssessedResult isFullyAssessedOnPassed();
public FullyAssessedResult isFullyAssessedOnCompletion(Double completion); public FullyAssessedResult isFullyAssessedOnCompletion(Double completion);
public FullyAssessedResult isFullyAssessedOnStatus(AssessmentEntryStatus status); public FullyAssessedResult isFullyAssessedOnStatus(AssessmentEntryStatus status);
......
...@@ -124,6 +124,16 @@ public class LearningPathNodeAccessProvider implements NodeAccessProvider { ...@@ -124,6 +124,16 @@ public class LearningPathNodeAccessProvider implements NodeAccessProvider {
} }
} }
@Override
public void onPassed(CourseNode courseNode, UserCourseEnvironment userCourseEnv, Role by) {
FullyAssessedResult result = getConfigs(courseNode).isFullyAssessedOnPassed();
boolean participant = userCourseEnv.isParticipant();
if (participant && result.isFullyAssessed()) {
AssessmentEntryStatus status = getStatus(courseNode, userCourseEnv, result.isDone());
courseAssessmentService.updateFullyAssessed(courseNode, userCourseEnv, Boolean.TRUE, status, by);
}
}
@Override @Override
public void onCompletionUpdate(CourseNode courseNode, UserCourseEnvironment userCourseEnv, public void onCompletionUpdate(CourseNode courseNode, UserCourseEnvironment userCourseEnv,
Double completion, AssessmentEntryStatus status, Role by) { Double completion, AssessmentEntryStatus status, Role by) {
......
...@@ -26,6 +26,7 @@ import static org.olat.course.learningpath.ui.LearningPathNodeConfigController.C ...@@ -26,6 +26,7 @@ import static org.olat.course.learningpath.ui.LearningPathNodeConfigController.C
import static org.olat.course.learningpath.ui.LearningPathNodeConfigController.CONFIG_KEY_TRIGGER; import static org.olat.course.learningpath.ui.LearningPathNodeConfigController.CONFIG_KEY_TRIGGER;
import static org.olat.course.learningpath.ui.LearningPathNodeConfigController.CONFIG_VALUE_TRIGGER_CONFIRMED; import static org.olat.course.learningpath.ui.LearningPathNodeConfigController.CONFIG_VALUE_TRIGGER_CONFIRMED;
import static org.olat.course.learningpath.ui.LearningPathNodeConfigController.CONFIG_VALUE_TRIGGER_NODE_VISITED; import static org.olat.course.learningpath.ui.LearningPathNodeConfigController.CONFIG_VALUE_TRIGGER_NODE_VISITED;
import static org.olat.course.learningpath.ui.LearningPathNodeConfigController.CONFIG_VALUE_TRIGGER_PASSED;
import static org.olat.course.learningpath.ui.LearningPathNodeConfigController.CONFIG_VALUE_TRIGGER_STATUS_DONE; import static org.olat.course.learningpath.ui.LearningPathNodeConfigController.CONFIG_VALUE_TRIGGER_STATUS_DONE;
import org.olat.core.util.StringHelper; import org.olat.core.util.StringHelper;
...@@ -94,6 +95,15 @@ public class ModuleLearningPathConfigs implements LearningPathConfigs { ...@@ -94,6 +95,15 @@ public class ModuleLearningPathConfigs implements LearningPathConfigs {
return LearningPathConfigs.notFullyAssessed(); return LearningPathConfigs.notFullyAssessed();
} }
@Override
public FullyAssessedResult isFullyAssessedOnPassed() {
String doneTriggerName = getDoneTriggerName();
if (CONFIG_VALUE_TRIGGER_PASSED.equals(doneTriggerName)) {
return LearningPathConfigs.fullyAssessed(true, true);
}
return LearningPathConfigs.notFullyAssessed();
}
private String getDoneTriggerName() { private String getDoneTriggerName() {
return moduleConfiguration.getStringValue(CONFIG_KEY_TRIGGER, CONFIG_DEFAULT_TRIGGER); return moduleConfiguration.getStringValue(CONFIG_KEY_TRIGGER, CONFIG_DEFAULT_TRIGGER);
} }
......
...@@ -56,6 +56,11 @@ public class UnsupportedLearningPathConfigs implements LearningPathConfigs { ...@@ -56,6 +56,11 @@ public class UnsupportedLearningPathConfigs implements LearningPathConfigs {
return LearningPathConfigs.notFullyAssessed(); return LearningPathConfigs.notFullyAssessed();
} }
@Override
public FullyAssessedResult isFullyAssessedOnPassed() {
return LearningPathConfigs.notFullyAssessed();
}
@Override @Override
public FullyAssessedResult isFullyAssessedOnCompletion(Double completion) { public FullyAssessedResult isFullyAssessedOnCompletion(Double completion) {
return LearningPathConfigs.notFullyAssessed(); return LearningPathConfigs.notFullyAssessed();
......
...@@ -58,6 +58,7 @@ public class LearningPathNodeConfigController extends FormBasicController { ...@@ -58,6 +58,7 @@ public class LearningPathNodeConfigController extends FormBasicController {
public static final String CONFIG_VALUE_TRIGGER_NODE_VISITED = "nodeVisited"; public static final String CONFIG_VALUE_TRIGGER_NODE_VISITED = "nodeVisited";
public static final String CONFIG_VALUE_TRIGGER_CONFIRMED = "confirmed"; public static final String CONFIG_VALUE_TRIGGER_CONFIRMED = "confirmed";
public static final String CONFIG_VALUE_TRIGGER_STATUS_DONE = "statusDone"; public static final String CONFIG_VALUE_TRIGGER_STATUS_DONE = "statusDone";
public static final String CONFIG_VALUE_TRIGGER_PASSED = "passed";
public static final String CONFIG_DEFAULT_TRIGGER = CONFIG_VALUE_TRIGGER_NONE; public static final String CONFIG_DEFAULT_TRIGGER = CONFIG_VALUE_TRIGGER_NONE;
private TextElement durationEl; private TextElement durationEl;
...@@ -115,6 +116,9 @@ public class LearningPathNodeConfigController extends FormBasicController { ...@@ -115,6 +116,9 @@ public class LearningPathNodeConfigController extends FormBasicController {
if (ctrlConfig.isTriggerConfirmed()) { if (ctrlConfig.isTriggerConfirmed()) {
triggerKV.add(entry(CONFIG_VALUE_TRIGGER_CONFIRMED, translate("config.trigger.confirmed"))); triggerKV.add(entry(CONFIG_VALUE_TRIGGER_CONFIRMED, translate("config.trigger.confirmed")));
} }
if (ctrlConfig.isTriggerPassed()) {
triggerKV.add(entry(CONFIG_VALUE_TRIGGER_PASSED, translate("config.trigger.passed")));
}
TranslateableBoolean triggerStatusDone = ctrlConfig.getTriggerStatusDone(); TranslateableBoolean triggerStatusDone = ctrlConfig.getTriggerStatusDone();
if (triggerStatusDone.isTrue()) { if (triggerStatusDone.isTrue()) {
triggerKV.add(entry(CONFIG_VALUE_TRIGGER_STATUS_DONE, triggerKV.add(entry(CONFIG_VALUE_TRIGGER_STATUS_DONE,
...@@ -211,6 +215,8 @@ public class LearningPathNodeConfigController extends FormBasicController { ...@@ -211,6 +215,8 @@ public class LearningPathNodeConfigController extends FormBasicController {
public boolean isTriggerConfirmed(); public boolean isTriggerConfirmed();
public boolean isTriggerPassed();
public TranslateableBoolean getTriggerStatusDone(); public TranslateableBoolean getTriggerStatusDone();
} }
...@@ -223,6 +229,7 @@ public class LearningPathNodeConfigController extends FormBasicController { ...@@ -223,6 +229,7 @@ public class LearningPathNodeConfigController extends FormBasicController {
private boolean triggerNodeVisited; private boolean triggerNodeVisited;
private boolean triggerConfirmed; private boolean triggerConfirmed;
private boolean triggerPassed;
private TranslateableBoolean triggerStatusDone; private TranslateableBoolean triggerStatusDone;
private ControllerConfigBuilder() { private ControllerConfigBuilder() {
...@@ -238,6 +245,11 @@ public class LearningPathNodeConfigController extends FormBasicController { ...@@ -238,6 +245,11 @@ public class LearningPathNodeConfigController extends FormBasicController {
return this; return this;
} }
public ControllerConfigBuilder enablePassed() {
triggerPassed = true;
return this;
}
public ControllerConfigBuilder enableStatusDone() { public ControllerConfigBuilder enableStatusDone() {
triggerStatusDone = TranslateableBoolean.untranslatedTrue(); triggerStatusDone = TranslateableBoolean.untranslatedTrue();
return this; return this;
...@@ -256,11 +268,13 @@ public class LearningPathNodeConfigController extends FormBasicController { ...@@ -256,11 +268,13 @@ public class LearningPathNodeConfigController extends FormBasicController {
public final boolean triggerNodeVisited; public final boolean triggerNodeVisited;
public final boolean triggerConfirmed; public final boolean triggerConfirmed;
public final boolean triggerPassed;
public final TranslateableBoolean triggerStatusDone; public final TranslateableBoolean triggerStatusDone;
public ControllerConfigImpl(ControllerConfigBuilder builder) { public ControllerConfigImpl(ControllerConfigBuilder builder) {
this.triggerNodeVisited = builder.triggerNodeVisited; this.triggerNodeVisited = builder.triggerNodeVisited;
this.triggerConfirmed = builder.triggerConfirmed; this.triggerConfirmed = builder.triggerConfirmed;
this.triggerPassed = builder.triggerPassed;
this.triggerStatusDone = falseIfNull(builder.triggerStatusDone); this.triggerStatusDone = falseIfNull(builder.triggerStatusDone);
} }
...@@ -280,6 +294,11 @@ public class LearningPathNodeConfigController extends FormBasicController { ...@@ -280,6 +294,11 @@ public class LearningPathNodeConfigController extends FormBasicController {
return triggerConfirmed; return triggerConfirmed;
} }
@Override
public boolean isTriggerPassed() {
return triggerPassed;
}
@Override @Override
public TranslateableBoolean getTriggerStatusDone() { public TranslateableBoolean getTriggerStatusDone() {
return triggerStatusDone; return triggerStatusDone;
......
...@@ -36,7 +36,7 @@ import org.olat.course.editor.NodeEditController; ...@@ -36,7 +36,7 @@ import org.olat.course.editor.NodeEditController;
*/ */
public class TabbableLeaningPathNodeConfigController extends ActivateableTabbableDefaultController { public class TabbableLeaningPathNodeConfigController extends ActivateableTabbableDefaultController {
private static final String PANE_TAB_LEARNIN_PATH = "pane.tab.learning.path"; public static final String PANE_TAB_LEARNIN_PATH = "pane.tab.learning.path";
private final static String[] paneKeys = { PANE_TAB_LEARNIN_PATH }; private final static String[] paneKeys = { PANE_TAB_LEARNIN_PATH };
private final Controller configCtrl; private final Controller configCtrl;
......
...@@ -7,8 +7,10 @@ config.obligation.optional=Freiwillig ...@@ -7,8 +7,10 @@ config.obligation.optional=Freiwillig
config.trigger=Abschluss config.trigger=Abschluss
config.trigger.confirmed=Best\u00E4tigt config.trigger.confirmed=Best\u00E4tigt
config.trigger.none=Ohne Abschluss config.trigger.none=Ohne Abschluss
config.trigger.passed=Bestanden
config.trigger.status.done=Durchf\u00FChrung erledigt config.trigger.status.done=Durchf\u00FChrung erledigt
config.trigger.visited=Kursbaustein ge\u00F6ffnet config.trigger.visited=Kursbaustein ge\u00F6ffnet
error.fully.assessed.passed=Der Abschluss des Kurselementes kann nicht auf "erledigt" gesetzt sein, wenn im Kursbaustein nicht erledigt werden kann.
no.configurations=In diesen Kursbaustein stehen keine Konfigurationen zum Lernpfad zu Verf\u00FCgung. no.configurations=In diesen Kursbaustein stehen keine Konfigurationen zum Lernpfad zu Verf\u00FCgung.
pane.tab.learning.path=Lernpfad pane.tab.learning.path=Lernpfad
reset.all.status=ALLE Stati zur\u00FCcksetzen reset.all.status=ALLE Stati zur\u00FCcksetzen
......
...@@ -7,8 +7,10 @@ config.obligation.optional=Optional ...@@ -7,8 +7,10 @@ config.obligation.optional=Optional
config.trigger=Completion config.trigger=Completion
config.trigger.confirmed=Confirmed config.trigger.confirmed=Confirmed
config.trigger.none=No completion config.trigger.none=No completion
config.trigger.passed=Passed
config.trigger.status.done=Run done config.trigger.status.done=Run done
config.trigger.visited=Course element visited config.trigger.visited=Course element visited
error.fully.assessed.passed=The completion of the course element can't be set to "passed", if the course element can't be passed.
no.configuration=No configurations for the learning path are available in this course element. no.configuration=No configurations for the learning path are available in this course element.
pane.tab.learning.path=Learning path pane.tab.learning.path=Learning path
reset.all.status=Reset ALL status reset.all.status=Reset ALL status
......
...@@ -50,6 +50,8 @@ public interface NodeAccessProvider extends NodeAccessProviderIdentifier { ...@@ -50,6 +50,8 @@ public interface NodeAccessProvider extends NodeAccessProviderIdentifier {
public void onAssessmentConfirmed(CourseNode courseNode, UserCourseEnvironment userCourseEnv); public void onAssessmentConfirmed(CourseNode courseNode, UserCourseEnvironment userCourseEnv);
public void onPassed(CourseNode courseNode, UserCourseEnvironment userCourseEnv, Role by);
public void onCompletionUpdate(CourseNode courseNode, UserCourseEnvironment userCourseEnv, public void onCompletionUpdate(CourseNode courseNode, UserCourseEnvironment userCourseEnv,
Double completion, AssessmentEntryStatus status, Role by); Double completion, AssessmentEntryStatus status, Role by);
......
...@@ -69,7 +69,7 @@ public interface NodeAccessService { ...@@ -69,7 +69,7 @@ public interface NodeAccessService {
public CourseTreeModelBuilder getCourseTreeModelBuilder(UserCourseEnvironment userCourseEnv); public CourseTreeModelBuilder getCourseTreeModelBuilder(UserCourseEnvironment userCourseEnv);
/** /**
* Returns if a user can confirm the execution of a assessemnt * Returns if a user can confirm the execution of an assessment.
* *
* @param courseNode * @param courseNode
* @param userCourseEnv * @param userCourseEnv
...@@ -85,6 +85,15 @@ public interface NodeAccessService { ...@@ -85,6 +85,15 @@ public interface NodeAccessService {
*/ */
public void onAssessmentConfirmed(CourseNode courseNode, UserCourseEnvironment userCourseEnv); public void onAssessmentConfirmed(CourseNode courseNode, UserCourseEnvironment userCourseEnv);
/**
* Hook after the user has passed an assessment.
*
* @param courseNode
* @param userCourseEnv
* @param by
*/
public void onPassed(CourseNode courseNode, UserCourseEnvironment userCourseEnv, Role by);
/** /**
* Hook after the completion and the run status is updated. * Hook after the completion and the run status is updated.
* *
......
...@@ -103,6 +103,12 @@ public class NodeAccessServiceImpl implements NodeAccessService, NodeVisitedList ...@@ -103,6 +103,12 @@ public class NodeAccessServiceImpl implements NodeAccessService, NodeVisitedList
getNodeAccessProvider(type).onAssessmentConfirmed(courseNode, userCourseEnv); getNodeAccessProvider(type).onAssessmentConfirmed(courseNode, userCourseEnv);
} }
@Override
public void onPassed(CourseNode courseNode, UserCourseEnvironment userCourseEnv, Role by) {
NodeAccessType type = NodeAccessType.of(userCourseEnv);
getNodeAccessProvider(type).onPassed(courseNode, userCourseEnv, by);
}
@Override @Override
public void onCompletionUpdate(CourseNode courseNode, UserCourseEnvironment userCourseEnv, public void onCompletionUpdate(CourseNode courseNode, UserCourseEnvironment userCourseEnv,
Double completion, AssessmentEntryStatus status, Role by) { Double completion, AssessmentEntryStatus status, Role by) {
...@@ -111,9 +117,9 @@ public class NodeAccessServiceImpl implements NodeAccessService, NodeVisitedList ...@@ -111,9 +117,9 @@ public class NodeAccessServiceImpl implements NodeAccessService, NodeVisitedList
} }
@Override @Override
public boolean onNodeVisited(CourseNode courseNode, UserCourseEnvironment userCourseEnvironment) { public boolean onNodeVisited(CourseNode courseNode, UserCourseEnvironment userCourseEnv) {
NodeAccessType type = NodeAccessType.of(userCourseEnvironment); NodeAccessType type = NodeAccessType.of(userCourseEnv);
return getNodeAccessProvider(type).onNodeVisited(courseNode, userCourseEnvironment); return getNodeAccessProvider(type).onNodeVisited(courseNode, userCourseEnv);
} }
} }
...@@ -27,6 +27,7 @@ package org.olat.course.nodes; ...@@ -27,6 +27,7 @@ package org.olat.course.nodes;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
...@@ -55,8 +56,11 @@ import org.olat.course.editor.ConditionAccessEditConfig; ...@@ -55,8 +56,11 @@ import org.olat.course.editor.ConditionAccessEditConfig;
import org.olat.course.editor.CourseEditorEnv; import org.olat.course.editor.CourseEditorEnv;
import org.olat.course.editor.NodeEditController; import org.olat.course.editor.NodeEditController;
import org.olat.course.editor.StatusDescription; import org.olat.course.editor.StatusDescription;
import org.olat.course.learningpath.ui.TabbableLeaningPathNodeConfigController;
import org.olat.course.nodes.cp.CPEditController; import org.olat.course.nodes.cp.CPEditController;
import org.olat.course.nodes.scorm.ScormAssessmentConfig;
import org.olat.course.nodes.scorm.ScormEditController; import org.olat.course.nodes.scorm.ScormEditController;
import org.olat.course.nodes.scorm.ScormLearningPathNodeHandler;
import org.olat.course.nodes.scorm.ScormRunController; import org.olat.course.nodes.scorm.ScormRunController;
import org.olat.course.properties.CoursePropertyManager; import org.olat.course.properties.CoursePropertyManager;
import org.olat.course.run.navigation.NodeRunConstructionResult; import org.olat.course.run.navigation.NodeRunConstructionResult;
...@@ -81,6 +85,9 @@ public class ScormCourseNode extends AbstractAccessableCourseNode { ...@@ -81,6 +85,9 @@ public class ScormCourseNode extends AbstractAccessableCourseNode {
private static final Logger log = Tracing.createLoggerFor(ScormCourseNode.class); private static final Logger log = Tracing.createLoggerFor(ScormCourseNode.class);
private static final long serialVersionUID = 2970594874787761801L; private static final long serialVersionUID = 2970594874787761801L;
@SuppressWarnings("deprecation")
private static final String TRANSLATOR_PACKAGE = Util.getPackageName(ScormEditController.class);
public static final String TYPE = "scorm"; public static final String TYPE = "scorm";
private static final int CURRENT_CONFIG_VERSION = 5; private static final int CURRENT_CONFIG_VERSION = 5;
...@@ -125,33 +132,66 @@ public class ScormCourseNode extends AbstractAccessableCourseNode { ...@@ -125,33 +132,66 @@ public class ScormCourseNode extends AbstractAccessableCourseNode {
@Override @Override
public StatusDescription isConfigValid() { public StatusDescription isConfigValid() {
if (oneClickStatusCache != null) { return oneClickStatusCache[0]; } if (oneClickStatusCache != null && oneClickStatusCache.length > 0) {
return oneClickStatusCache[0];
StatusDescription sd = StatusDescription.NOERROR;
boolean isValid = ScormEditController.isModuleConfigValid(getModuleConfiguration());
if (!isValid) {
String shortKey = "error.noreference.short";
String longKey = "error.noreference.long";
String[] params = new String[] { this.getShortTitle() };
String translPackage = Util.getPackageName(ScormEditController.class);
sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, translPackage);
sd.setDescriptionForUnit(getIdent());
// set which pane is affected by error
sd.setActivateableViewIdentifier(ScormEditController.PANE_TAB_CPCONFIG);
} }
return sd;
List<StatusDescription> statusDescs = validateInternalConfiguration();
if(statusDescs.isEmpty()) {
statusDescs.add(StatusDescription.NOERROR);
}
oneClickStatusCache = StatusDescriptionHelper.sort(statusDescs);
return oneClickStatusCache[0];
} }
@Override @Override
public StatusDescription[] isConfigValid(CourseEditorEnv cev) { public StatusDescription[] isConfigValid(CourseEditorEnv cev) {
oneClickStatusCache = null; oneClickStatusCache = null;
// only here we know which translator to take for translating condition
// error messages List<StatusDescription> sds = isConfigValidWithTranslator(cev, TRANSLATOR_PACKAGE, getConditionExpressions());
String translatorStr = Util.getPackageName(ScormEditController.class); if(oneClickStatusCache != null && oneClickStatusCache.length > 0) {
List<StatusDescription> sds = isConfigValidWithTranslator(cev, translatorStr, getConditionExpressions()); //isConfigValidWithTranslator add first
sds.remove(oneClickStatusCache[0]);
}
sds.addAll(validateInternalConfiguration());
oneClickStatusCache = StatusDescriptionHelper.sort(sds); oneClickStatusCache = StatusDescriptionHelper.sort(sds);
return oneClickStatusCache; return oneClickStatusCache;
} }
private List<StatusDescription> validateInternalConfiguration() {
List<StatusDescription> sdList = new ArrayList<>(2);
boolean hasScormReference = ScormEditController.hasScormReference(getModuleConfiguration());
if (!hasScormReference) {
addStatusErrorDescription("error.noreference.short", "error.noreference.long", ScormEditController.PANE_TAB_CPCONFIG, sdList);
}
if (isFullyAssessedPassedConfigError()) {
addStatusErrorDescription("error.fully.assessed.passed", "error.fully.assessed.passed",
TabbableLeaningPathNodeConfigController.PANE_TAB_LEARNIN_PATH, sdList);
}
return sdList;
}
private boolean isFullyAssessedPassedConfigError() {
boolean hasPassed = new ScormAssessmentConfig(getModuleConfiguration()).hasPassed();
boolean isPassedTrigger = CoreSpringFactory.getImpl(ScormLearningPathNodeHandler.class)
.getConfigs(this)
.isFullyAssessedOnPassed()
.isFullyAssessed();
return isPassedTrigger && !hasPassed;
}
private void addStatusErrorDescription(String shortDescKey, String longDescKey, String pane,
List<StatusDescription> status) {
String[] params = new String[] { getShortTitle() };
StatusDescription sd = new StatusDescription(StatusDescription.ERROR, shortDescKey, longDescKey, params,
TRANSLATOR_PACKAGE);
sd.setDescriptionForUnit(getIdent());
sd.setActivateableViewIdentifier(pane);
status.add(sd);
}
@Override @Override
public RepositoryEntry getReferencedRepositoryEntry() { public RepositoryEntry getReferencedRepositoryEntry() {
......
...@@ -357,7 +357,7 @@ public class ScormEditController extends ActivateableTabbableDefaultController i ...@@ -357,7 +357,7 @@ public class ScormEditController extends ActivateableTabbableDefaultController i
moduleConfiguration.set(CONFIG_KEY_REPOSITORY_SOFTKEY, re.getSoftkey()); moduleConfiguration.set(CONFIG_KEY_REPOSITORY_SOFTKEY, re.getSoftkey());
} }
public static boolean isModuleConfigValid(ModuleConfiguration moduleConfiguration) { public static boolean hasScormReference(ModuleConfiguration moduleConfiguration) {
return (moduleConfiguration.get(CONFIG_KEY_REPOSITORY_SOFTKEY) != null); return (moduleConfiguration.get(CONFIG_KEY_REPOSITORY_SOFTKEY) != null);
} }
......
...@@ -62,6 +62,7 @@ public class ScormLearningPathNodeHandler implements LearningPathNodeHandler { ...@@ -62,6 +62,7 @@ public class ScormLearningPathNodeHandler implements LearningPathNodeHandler {
LearningPathControllerConfig ctrlConfig = LearningPathNodeConfigController.builder() LearningPathControllerConfig ctrlConfig = LearningPathNodeConfigController.builder()
.enableNodeVisited() .enableNodeVisited()
.enableConfirmed() .enableConfirmed()
.enablePassed()
.build(); .build();
return new LearningPathNodeConfigController(ureq, wControl, courseEntry, courseNode.getModuleConfiguration(), ctrlConfig); return new LearningPathNodeConfigController(ureq, wControl, courseEntry, courseNode.getModuleConfiguration(), ctrlConfig);
} }
......
...@@ -124,7 +124,7 @@ public class ScormRunController extends BasicController implements ScormAPICallb ...@@ -124,7 +124,7 @@ public class ScormRunController extends BasicController implements ScormAPICallb
ScormCourseNode scormNode, boolean isPreview) { ScormCourseNode scormNode, boolean isPreview) {
super(ureq, wControl, Util.createPackageTranslator(CourseNode.class, ureq.getLocale())); super(ureq, wControl, Util.createPackageTranslator(CourseNode.class, ureq.getLocale()));
// assertion to make sure the moduleconfig is valid // assertion to make sure the moduleconfig is valid
if (!ScormEditController.isModuleConfigValid(config)) if (!ScormEditController.hasScormReference(config))
throw new AssertException("scorm run controller had an invalid module config:" + config.toString()); throw new AssertException("scorm run controller had an invalid module config:" + config.toString());
this.isPreview = isPreview || userCourseEnv.isCourseReadOnly() || !userCourseEnv.isParticipant(); this.isPreview = isPreview || userCourseEnv.isCourseReadOnly() || !userCourseEnv.isParticipant();
this.userCourseEnv = userCourseEnv; this.userCourseEnv = userCourseEnv;
......
...@@ -37,6 +37,7 @@ cutvalue.label=Notwendige Punktzahl f\u00FCr 'bestanden' ...@@ -37,6 +37,7 @@ cutvalue.label=Notwendige Punktzahl f\u00FCr 'bestanden'
cutvalue.validation=Geben Sie eine Ganzzahl ein cutvalue.validation=Geben Sie eine Ganzzahl ein
error.cprepoentrymissing=Der SCORM-Lerninhalt, den Sie anzeigen m\u00F6chten, wurde in der Zwischenzeit in der Ablage der Lernressourcen gel\u00F6scht error.cprepoentrymissing=Der SCORM-Lerninhalt, den Sie anzeigen m\u00F6chten, wurde in der Zwischenzeit in der Ablage der Lernressourcen gel\u00F6scht
error.cprepoentrymissing.user=Der SCORM-Lerninhalt den Sie anzeigen m\u00F6chten existiert nicht mehr. Bitte kontaktieren Sie ihren Kursbetreuer. error.cprepoentrymissing.user=Der SCORM-Lerninhalt den Sie anzeigen m\u00F6chten existiert nicht mehr. Bitte kontaktieren Sie ihren Kursbetreuer.
error.fully.assessed.passed=$org.olat.course.learningpath.ui:\error.fully.assessed.passed
error.launch=SCORM-Lerninhalt konnte nicht gestartet werden. error.launch=SCORM-Lerninhalt konnte nicht gestartet werden.
error.noreference.long=F\u00FCr "{0}" muss in der Konfiguration ein SCORM-Lerninhalt im Tab "Lerninhalt" ausgew\u00E4hlt werden. error.noreference.long=F\u00FCr "{0}" muss in der Konfiguration ein SCORM-Lerninhalt im Tab "Lerninhalt" ausgew\u00E4hlt werden.
error.noreference.short=Es ist noch kein SCORM-Lerninhalt f\u00FCr "{0}" ausgew\u00E4hlt. error.noreference.short=Es ist noch kein SCORM-Lerninhalt f\u00FCr "{0}" ausgew\u00E4hlt.
......
...@@ -43,6 +43,7 @@ cutvalue.label=Score needed to pass ...@@ -43,6 +43,7 @@ cutvalue.label=Score needed to pass
cutvalue.validation=Please enter an integer cutvalue.validation=Please enter an integer
error.cprepoentrymissing=This SCORM learning content was deleted in the meantime within the storage folder of learning resources. error.cprepoentrymissing=This SCORM learning content was deleted in the meantime within the storage folder of learning resources.
error.cprepoentrymissing.user=The SCORM learning content you were trying to access doesn't exist anymore. Please contact your course coach. error.cprepoentrymissing.user=The SCORM learning content you were trying to access doesn't exist anymore. Please contact your course coach.
error.fully.assessed.passed=$org.olat.course.learningpath.ui:\error.fully.assessed.passed
error.launch=Unable to start SCORM learning content. error.launch=Unable to start SCORM learning content.
error.noreference.long=For "{0}" you have to select a SCORM learning content in the tab "Learning content" within the configuration section. error.noreference.long=For "{0}" you have to select a SCORM learning content in the tab "Learning content" within the configuration section.
error.noreference.short=No SCORM learning content selected for "{0}" yet. error.noreference.short=No SCORM learning content selected for "{0}" yet.
......
...@@ -56,6 +56,11 @@ public class STLearningPathConfigs implements LearningPathConfigs { ...@@ -56,6 +56,11 @@ public class STLearningPathConfigs implements LearningPathConfigs {
return LearningPathConfigs.notFullyAssessed(); return LearningPathConfigs.notFullyAssessed();
} }
@Override
public FullyAssessedResult isFullyAssessedOnPassed() {
return LearningPathConfigs.notFullyAssessed();
}
@Override @Override
public FullyAssessedResult isFullyAssessedOnStatus(AssessmentEntryStatus status) { public FullyAssessedResult isFullyAssessedOnStatus(AssessmentEntryStatus status) {
return LearningPathConfigs.notFullyAssessed(); return LearningPathConfigs.notFullyAssessed();
......
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