Hello everyone,
I might be wrong using this thread, since I haven't got the solution I am coming back to you.
I am still working on this code, any one who can tell me what is wrong, I really appreciate it. My block plugin is to take the time selected from datetimeselector and insert into the database assignment table, So that the duedate for assignments will be changed using the block.
The code below is in my edit.php
if ($fromform =$mform->get_data()) {
$mytime = $fromform->selecttime;
$record = new stdClass();
$record->duedate = $mytime;
$record=$attempt->id;
$record->id = $attemptid;
$record->course = $courseid ;
$record->duedate = $mform;
$record->intro = get_string('databasename', 'block_daterollover');
$record->allowsubmissionsfromdate = $mform;
$record->timemodified = time();
$DB->update_record('assign', $record);
}
else
{
$mform->display();
}