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