error_log(__FUNCTION__ . " : Problem to update the resource on the database", TRUE); redirection($redirectionUrl . '&error=problem_bd'); } $messageType = $params['type'] . 'Updated'; } else { wimba_add_log(WIMBA_ERROR, voicepresentation_LOGS, "manageAction : Problem to add the resource into the database"); redirection($redirectionUrl . '&error=problem_vt'); } } elseif ($params['action'] == 'delete') { /* Bug 28439 - We need to check if the resource has a grade book associated with it before we try and delete it */ $resourceDb = get_record("voicepresentation_resources", "rid", $params["resource_id"]); if ($resourceDb->gradeid != -1) { voicepresentation_delete_grade_column($params["resource_id"], $params["enc_course_id"]); } $result = $vtAction->deleteResource($params["resource_id"]); if ($result != NULL) { //if no error during the creation if (!voicepresentation_delete_all_instance_of_resource($params["resource_id"])) { notify("Could not delete the activities for the voicetools:" . $params["resource_id"]); } $messageType = 'delete' . $param["type"]; $messageAction = "deleted"; $messageProduct = $params["type"]; } } elseif ($params['action'] == 'submitGrade') { voicepresentation_add_grades($params["resource_id"], $params["enc_course_id"], $params["grades"]); $messageAction = "updated_grades"; $messageProduct = "grades"; } redirection($redirectionUrl . '&messageAction=' . $messageAction . '&messageProduct=' . $messageProduct);