示例#1
0
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))
示例#2
0
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))
示例#3
0
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))
示例#4
0
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)
示例#5
0
def show_question(question_id):
	return jsonify(Question().show_question(question_id))
示例#6
0
def show_all_question():
	return jsonify(Question().show_all_question())
示例#7
0
def get_all_questions_for_quizid(quiz_id):
    return Question().get_all_questions_for_quizid(quiz_id)
示例#8
0
def get_question(question_id):
    return Question().show_question(question_id)
示例#9
0
def show_categories():
    return jsonify(Question().show_categories())