public function save($quiz)
 {
     // first off, sanitize the whole submitted thang
     self::$quiz = $this->sanitize_array($quiz);
     // flatten it out to make it easier to work with
     self::$quiz = $this->flatten_quiz_array(self::$quiz);
     // Open a new response object
     self::$response_obj = new Enp_quiz_Save_quiz_Response();
     // setup the user_action response
     self::$response_obj->set_user_action_response(self::$quiz);
     // these are referenced a lot, so lets set a quick link up for them
     self::$user_action_action = self::$response_obj->get_user_action_action();
     self::$user_action_element = self::$response_obj->get_user_action_element();
     self::$user_action_details = self::$response_obj->get_user_action_details();
     // create our object
     self::$quiz_obj = new Enp_quiz_Quiz(self::$quiz['quiz_id']);
     // fill the quiz with all the values
     $this->prepare_submitted_quiz();
     // process questions
     $this->prepare_submitted_questions();
     // Check if we're allowed to save. If any glaring errors, return the errors here
     // TODO: Check to make sure we can save. If there are errors, just return to page!
     // Alrighty!
     // actually save the quiz
     $this->save_quiz();
     // if we are trying to move to preview, check
     // for error messages (like, not enough mc_options, no correct option set, no questions, etc...)
     if (self::$user_action_action === 'next') {
         // builds error messages if trying to preview quiz
         $quiz_obj_validate = new Enp_quiz_Quiz(self::$quiz['quiz_id']);
         $validate = self::$response_obj->validate_quiz_and_questions($quiz_obj_validate);
         // see if they're trying to publish the quiz
         if (self::$user_action_element === 'publish') {
             if ($validate === 'valid') {
                 // is the quiz already published?
                 if (self::$quiz_obj->get_quiz_status() !== 'published') {
                     // OK, it's good! Publish it!
                     $this->pdo_publish_quiz();
                     // now let's reset the data and responses on that quiz as well
                     // delete all the responses & reset the stats for the quiz and questions
                     $quiz_data = new Enp_quiz_Save_quiz_take_Quiz_data(self::$quiz_obj);
                     $quiz_data->delete_quiz_responses(self::$quiz_obj);
                 } else {
                     // don't worry about it, probably just clicked on the "embed" on the quiz preview/settings page
                 }
             }
         }
     }
     // check to see if we need to trigger a rescrape from Facebook to update the OG Tags
     $this->facebook_api_rescrape();
     // return the response to the user
     return self::$response_obj;
 }