/**
* Init config parameter with default values for a new course node.
*/
@Override
public void updateModuleConfigDefaults(boolean isNewNode) {
ModuleConfiguration config = getModuleConfiguration();
if (isNewNode) {
// use defaults for new course building blocks
// dropbox defaults
config.set(CONF_DROPBOX_ENABLED, Boolean.TRUE);
config.set(CONF_DROPBOX_ENABLEMAIL, Boolean.FALSE);
config.set(CONF_DROPBOX_CONFIRMATION, "");
// scoring defaults
config.set(CONF_SCORING_ENABLED, Boolean.FALSE);
// returnbox defaults
config.set(CONF_RETURNBOX_ENABLED, Boolean.TRUE);
// New config parameter version 2
config.setBooleanEntry(CONF_TASK_PREVIEW, false);
MSCourseNode.initDefaultConfig(config);
config.setConfigurationVersion(CURRENT_CONFIG_VERSION);
} else {
int version = config.getConfigurationVersion();
if (version < CURRENT_CONFIG_VERSION) {
// Loaded config is older than current config version => migrate
if (version == 1) {
// migrate V1 => V2
// <XXX> add migration code here for futur update
//version = 2;
}
config.setConfigurationVersion(CURRENT_CONFIG_VERSION);
}
}
}