Commit 76ebf76b authored by Adrian Greeve's avatar Adrian Greeve
Browse files

MDL-51259 mod_data: ratings of items not activated.

When selecting a rating method, the restrict rating
to items with dates would be automatically enabled if
not checked. This code brings the data module inline
with forum and glossary.
parent a91caeef
......@@ -899,6 +899,11 @@ function data_add_instance($data, $mform = null) {
$data->assessed = 0;
}
if (empty($data->ratingtime) || empty($data->assessed)) {
$data->assesstimestart = 0;
$data->assesstimefinish = 0;
}
$data->timemodified = time();
$data->id = $DB->insert_record('data', $data);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment