Search in sources :

Example 11 with ReminderRuleImpl

use of org.olat.modules.reminder.model.ReminderRuleImpl in project OpenOLAT by OpenOLAT.

the class ReminderRuleEngineTest method getRules.

private List<ReminderRule> getRules(String propertyName, String value) {
    ReminderRuleImpl rule = new ReminderRuleImpl();
    rule.setType(UserPropertyRuleSPI.class.getSimpleName());
    rule.setLeftOperand(propertyName);
    rule.setOperator("=");
    rule.setRightOperand(value);
    List<ReminderRule> rules = new ArrayList<>(1);
    rules.add(rule);
    return rules;
}
Also used : ReminderRule(org.olat.modules.reminder.ReminderRule) ReminderRuleImpl(org.olat.modules.reminder.model.ReminderRuleImpl) UserPropertyRuleSPI(org.olat.modules.reminder.rule.UserPropertyRuleSPI) ArrayList(java.util.ArrayList)

Example 12 with ReminderRuleImpl

use of org.olat.modules.reminder.model.ReminderRuleImpl in project OpenOLAT by OpenOLAT.

the class ReminderRuleEngineTest method getRules.

private List<ReminderRule> getRules(RepositoryEntryRoleRuleSPI.Roles option) {
    ReminderRuleImpl rule = new ReminderRuleImpl();
    rule.setType(RepositoryEntryRoleRuleSPI.class.getSimpleName());
    rule.setOperator("=");
    rule.setRightOperand(option.name());
    List<ReminderRule> rules = new ArrayList<>(1);
    rules.add(rule);
    return rules;
}
Also used : ReminderRule(org.olat.modules.reminder.ReminderRule) ReminderRuleImpl(org.olat.modules.reminder.model.ReminderRuleImpl) ArrayList(java.util.ArrayList) RepositoryEntryRoleRuleSPI(org.olat.modules.reminder.rule.RepositoryEntryRoleRuleSPI)

Example 13 with ReminderRuleImpl

use of org.olat.modules.reminder.model.ReminderRuleImpl in project OpenOLAT by OpenOLAT.

the class ReminderRuleEngineTest method getCourseEnrollmentDateRules.

private List<ReminderRule> getCourseEnrollmentDateRules(int amount, LaunchUnit unit) {
    ReminderRuleImpl rule = new ReminderRuleImpl();
    rule.setType(CourseEnrollmentDateRuleSPI.class.getSimpleName());
    rule.setOperator(">");
    rule.setRightOperand(Integer.toString(amount));
    rule.setRightUnit(unit.name());
    List<ReminderRule> rules = new ArrayList<>(1);
    rules.add(rule);
    return rules;
}
Also used : ReminderRule(org.olat.modules.reminder.ReminderRule) ReminderRuleImpl(org.olat.modules.reminder.model.ReminderRuleImpl) CourseEnrollmentDateRuleSPI(org.olat.modules.reminder.rule.CourseEnrollmentDateRuleSPI) ArrayList(java.util.ArrayList)

Example 14 with ReminderRuleImpl

use of org.olat.modules.reminder.model.ReminderRuleImpl in project OpenOLAT by OpenOLAT.

the class ReminderRuleEngineTest method getInitialLaunchRules.

private List<ReminderRule> getInitialLaunchRules(int amount, LaunchUnit unit) {
    ReminderRuleImpl rule = new ReminderRuleImpl();
    rule.setType(InitialCourseLaunchRuleSPI.class.getSimpleName());
    rule.setOperator(">");
    rule.setRightOperand(Integer.toString(amount));
    rule.setRightUnit(unit.name());
    List<ReminderRule> rules = new ArrayList<>(1);
    rules.add(rule);
    return rules;
}
Also used : InitialCourseLaunchRuleSPI(org.olat.modules.reminder.rule.InitialCourseLaunchRuleSPI) ReminderRule(org.olat.modules.reminder.ReminderRule) ReminderRuleImpl(org.olat.modules.reminder.model.ReminderRuleImpl) ArrayList(java.util.ArrayList)

Example 15 with ReminderRuleImpl

use of org.olat.modules.reminder.model.ReminderRuleImpl in project OpenOLAT by OpenOLAT.

the class ReminderRuleEngineTest method getScoreRules.

private List<ReminderRule> getScoreRules(String operator, float value, String nodeIdent) {
    ReminderRuleImpl rule = new ReminderRuleImpl();
    rule.setType(ScoreRuleSPI.class.getSimpleName());
    rule.setLeftOperand(nodeIdent);
    rule.setOperator(operator);
    rule.setRightOperand(Float.toString(value));
    List<ReminderRule> rules = new ArrayList<>(1);
    rules.add(rule);
    return rules;
}
Also used : ReminderRule(org.olat.modules.reminder.ReminderRule) ReminderRuleImpl(org.olat.modules.reminder.model.ReminderRuleImpl) ScoreRuleSPI(org.olat.course.reminder.rule.ScoreRuleSPI) ArrayList(java.util.ArrayList)

Aggregations

ReminderRuleImpl (org.olat.modules.reminder.model.ReminderRuleImpl)114 ArrayList (java.util.ArrayList)46 Identity (org.olat.core.id.Identity)26 ReminderRule (org.olat.modules.reminder.ReminderRule)26 ICourse (org.olat.course.ICourse)22 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)20 CourseNode (org.olat.course.nodes.CourseNode)20 Test (org.junit.Test)16 Date (java.util.Date)14 Translator (org.olat.core.gui.translator.Translator)14 GTACourseNode (org.olat.course.nodes.GTACourseNode)14 List (java.util.List)12 RepositoryEntry (org.olat.repository.RepositoryEntry)12 TaskList (org.olat.course.nodes.gta.TaskList)10 Calendar (java.util.Calendar)8 AssessableCourseNode (org.olat.course.nodes.AssessableCourseNode)8 ParseException (java.text.ParseException)6 InitialAttemptsRuleSPI (org.olat.course.reminder.rule.InitialAttemptsRuleSPI)6 ScoreRuleSPI (org.olat.course.reminder.rule.ScoreRuleSPI)6 File (java.io.File)4