Bug #1370 - Training backup tool: Adding possibility to process with this tool the test orphan questions. Orphan questions may be archieved, restored and *deleted*. Now it seems to me that the option "Delete everything" is real.
$sql = "INSERT INTO ".$table_qui." SET title = '".Database::escape_string($quiz->title)."', description = '".Database::escape_string($quiz->description)."', type = '".$quiz->quiz_type."', random = '".$quiz->random."', active = '".$quiz->active."', sound = '".Database::escape_string($doc)."', max_attempt = '".$quiz->attempts."' ";
api_sql_query($sql, __FILE__, __LINE__);
$new_id = Database::get_last_insert_id();
if ($id != -1) // $id = -1 identifies the fictionary test for collecting orphan questions. We do not store it in the database.
{
$sql = "INSERT INTO ".$table_qui." SET title = '".Database::escape_string($quiz->title)."', description = '".Database::escape_string($quiz->description)."', type = '".$quiz->quiz_type."', random = '".$quiz->random."', active = '".$quiz->active."', sound = '".Database::escape_string($doc)."', max_attempt = '".$quiz->attempts."' ";