MDL-56370 mod_feedback: allow to restore values from last attempt
This commit is contained in:
@@ -401,6 +401,21 @@ class mod_feedback_completion extends mod_feedback_structure {
|
||||
return $this->completedtmp;
|
||||
}
|
||||
|
||||
/**
|
||||
* If user has already completed the feedback, create the temproray values from last completed attempt
|
||||
*
|
||||
* @return stdClass record from feedback_completedtmp or false if not found
|
||||
*/
|
||||
public function create_completed_tmp_from_last_completed() {
|
||||
if (!$this->get_current_completed_tmp()) {
|
||||
$lastcompleted = $this->find_last_completed();
|
||||
if ($lastcompleted) {
|
||||
$this->completedtmp = feedback_set_tmp_values($lastcompleted);
|
||||
}
|
||||
}
|
||||
return $this->completedtmp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves unfinished response to the temporary table
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user