def delete_question(): if not request.is_json: return jsonify({ "status":"Body must be json" }) data = request.data question_id = json.loads(data)['id'] return jsonify(Question().delete_question(question_id))
def update_multiple_choice_question(): if not request.is_json: return jsonify({ "status":"Body must be json" }) post_data = request.data data = json.loads(post_data) return jsonify(Question().update_question(data))
def add_question(): if not request.is_json: return jsonify({ "status":"Body must be json" }) post_data = request.data data = json.loads(post_data) return jsonify(Question().add_question(data))
def create_question(): if not request.is_json: return jsonify({ "status": "failure", "reason": "Body must be json" }), 400 post_data = request.data data = json.loads(post_data) return Question().create_question(data)
def show_question(question_id): return jsonify(Question().show_question(question_id))
def show_all_question(): return jsonify(Question().show_all_question())
def get_all_questions_for_quizid(quiz_id): return Question().get_all_questions_for_quizid(quiz_id)
def get_question(question_id): return Question().show_question(question_id)
def show_categories(): return jsonify(Question().show_categories())