HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux vmi1674223.contaboserver.net 5.4.0-182-generic #202-Ubuntu SMP Fri Apr 26 12:29:36 UTC 2024 x86_64
User: root (0)
PHP: 7.4.3-4ubuntu2.22
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/unitime/Documentation/Scripts/Create Same Days-Time-Weeks Constraint.xml
<?xml version="1.0" encoding="UTF-8"?>

<script name="Distribution Types: Create Same Days-Time-Weeks Constraint" permission="Distribution Types" engine="ECMAScript" created="June 23, 2023">
  <description><![CDATA[Same Days-Time-Weeks: Given classes must be taught at the same time of day, on the same days and on the same weeks (i.e., must have the same date pattern).<br>
It is the combination of Same Days, Same Time, and Same Weeks distribution preferences.<br>
When prohibited or (strongly) discouraged: Any pair of classes classes cannot be taught on the same days during the same time and during overlapping date patterns.<br>
In other words, the given classes cannot overlap.]]></description>
  <body><![CDATA[var reqId = hibSession.createQuery('select max(requirementId) from DistributionType').uniqueResult();
var type = hibSession.createQuery('from DistributionType where reference = :reference').setParameter('reference', 'SAME_DTW').uniqueResult();
if (type == null) {
  log.info('Creating Same Days-Time-Weeks constraint...');
  type = new org.unitime.timetable.model.DistributionType();
  type.setReference('SAME_DTW');
} else {
  log.warn('Constraint Same Days-Time-Weeks already exists.');
}
type.setLabel('Same Days-Time-Weeks');
type.setSequencingRequired(false);
type.setRequirementId(++reqId);
type.setAllowedPref('P43210R');
type.setDescr('Given classes must be taught at the same time of day, on the same days and on the same weeks (i.e., must have the same date pattern).<br>It is the combination of Same Days, Same Time, and Same Weeks distribution preferences.<br>When prohibited or (strongly) discouraged: Any pair of classes classes cannot be taught on the same days during the same time and during overlapping date patterns.<br>In other words, the given classes cannot overlap.');
type.setAbbreviation('Same Days-Time-Weeks');
type.setInstructorPref(false);
type.setExamPref(false);
type.setVisible(true);
hibSession.saveOrUpdate(type);]]></body>
</script>