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