$exam_id = $_POST["postExam"]; $item_result = $conn_ategory->getItemList($jitem); $subject_id = $item_result[0]["subject_id"] . "-" . $item_result[0]["sub_id"]; if ($_POST["postPart"] != $item_result[0]["part_id"]) { $returnMesg = "小節錯誤!請選擇正確小節!"; } else { if ($_POST["postSection"] != $item_result[0]["section_id"]) { $returnMesg = "節錯誤!請選擇正確節!"; } else { if ($_POST["postChapter"] != $item_result[0]["chapter_id"]) { $returnMesg = "章錯誤!請選擇正確章!"; } else { if ($_POST["postSubject"] != $subject_id) { $returnMesg = "學科錯誤!請選擇正確學科!"; } else { $conn_ategory->addQuestion($question, $answer, $resolution, $keyword, $exam_id, $year, $jitem); $returnMesg = "題目輸入成功"; } } } } } else { $returnMesg = "項目錯誤!請選擇正確項目!"; } } else { if ($_POST["submitType"] == "editQuestion") { if (!empty($_POST["postQ"])) { $question_id = $_POST["postQ"]; $jitem = $_POST["postItem"]; $year = $_POST["postYear"]; $keyword = $_POST["postKeyword"];