}
}
+ // Conditions: Don't let them set dates which make no sense
+ if (array_key_exists('availablefrom', $data) &&
+ $data['availablefrom'] && $data['availableuntil'] &&
+ $data['availablefrom']>=$data['availableuntil']) {
+ $errors['availablefrom'] = get_string('badavailabledates', 'condition');
+ }
+
return $errors;
}
$string['availabilityconditions']='Restrict availability';
$string['availablefrom']='Only available from';
$string['availableuntil']='Only available until';
+$string['badavailabledates']='Invalid dates. If you set both dates, the \'available from\' date should be before the \'until\' date.';
$string['completion_complete']=' must be marked complete';
$string['completion_incomplete']=' must not be marked complete';
$string['completion_pass']=' must be complete with pass grade';