<?php include "functions.php"; session_start(); // -------------------- DELETE TOPIC ----------------------- if (isset($_POST['deleteID'])) { deleteTopic($_POST['deleteID']); } if (isset($_POST['newID']) && isset($_POST['subj']) && !isset($POST['topicID'])) { newTopic($_POST['newID'], $_POST['subj']); } if (isset($_POST['topicName']) && isset($_POST['subj']) && isset($_POST['topicID'])) { editTopic($_POST['topicName'], $_POST['subj'], $_POST['topicID']); } if (isset($_POST['drag_topic'])) { //die($_SESSION['user_ID']); getTableQuestionSingle($_POST['drag_topic'], $_SESSION['user_ID']); //echo "all good so far"; // showSelectTopic() } //edit question if (isset($_POST['ans']) && isset($_POST['ques']) && isset($_POST['diff']) && isset($_POST['question_ID'])) { editQuestion($_POST['question_ID'], $_POST['ques'], $_POST['ans'], $_POST['diff']); } //delete question if (isset($_POST['questionID']) && isset($_POST['questionConfirm'])) { deleteQuestionSingle($_POST['questionID']); } //save new question if (isset($_POST['ques']) && isset($_POST['topicID']) && isset($_POST['ans']) && isset($_POST['diff']) && isset($_POST['newQues'])) { //first, validate the data
case 'delete_topic': deleteTopic($course_id, $topic_id); break; case 'add_topic_element': $course = new JLMS_Course_HomePage($course_id, true); $course->listElements($topic_id); break; case 'add_submit_topic_element': addElement($course_id, $topic_id, $t_id); break; case 'publish_topic': publishTopic($course_id, $topic_id, mosGetParam($_REQUEST, 'state', 0)); break; case 'add_topic': case 'edit_topic': editTopic($course_id, $topic_id); break; case 'cancel_topic': JLMSRedirect(sefRelToAbs("index.php?option={$option}&task=details_course&id={$course_id}&Itemid={$Itemid}#topic_" . intval(mosGetParam($_REQUEST, 'id', 0)))); break; case 'save_topic': saveTopic($course_id); break; case 'orderup_element': JLMS_orderElement($topic_id, $course_id, -1, $element_ordering, $t_id); break; case 'orderdown_element': JLMS_orderElement($topic_id, $course_id, 1, $element_ordering, $t_id); break; case 'delete_topic_element': JLMS_deleteElement($topic_id, $course_id, $t_id);