/**
  * Handles showing the section.
  *
  * @since 2.0
  */
 public function showSection()
 {
     global $wpdb;
     $quizName = $_SESSION["wpsqt"]["current_id"];
     $sectionKey = $this->_key;
     if (isset($_POST['wpsqt-save-state']) && isset($_SESSION['wpsqt'][$quizName]['details']['save_resume']) && $_SESSION['wpsqt'][$quizName]['details']['save_resume'] == 'yes') {
         Wpsqt_Core::saveCurrentState($sectionKey);
         _e('Saved the current state. You can resume by revisiting the quiz.', 'wp-survey-and-quiz-tool');
         $sectionKey--;
         $show = false;
     } else {
         $show = true;
     }
     $section = $_SESSION["wpsqt"][$quizName]["sections"][$sectionKey];
     $orderBy = $section["order"] == "random" ? "RAND()" : "`order` " . strtoupper($section["order"]);
     $_SESSION["wpsqt"][$quizName]["sections"][$sectionKey]["questions"] = array();
     if (!empty($_SESSION["wpsqt"][$quizName]["sections"][$sectionKey]['limit'])) {
         $end = " LIMIT 0," . $_SESSION["wpsqt"][$quizName]["sections"][$sectionKey]['limit'];
     } else {
         $end = '';
     }
     $rawQuestions = $wpdb->get_results($wpdb->prepare("SELECT * FROM `" . WPSQT_TABLE_QUESTIONS . "` WHERE section_id = %d ORDER BY " . $orderBy . $end, array($section["id"])), ARRAY_A);
     foreach ($rawQuestions as $rawQuestion) {
         $_SESSION["wpsqt"][$quizName]["sections"][$sectionKey]["questions"][] = Wpsqt_System::unserializeQuestion($rawQuestion, $this->_type);
     }
     if ($show) {
         require Wpsqt_Core::pageView('site/' . $this->_type . '/section.php');
     }
 }