Beispiel #1
0
def delete_multiple_choice_question():
	if not request.is_json:
		return jsonify({
			"status":"Body must be json"
		})
	data = request.data
	question_id = json.loads(data)['id']
	return jsonify(MultipleChoiceQuestion().delete_question(question_id))
Beispiel #2
0
def add_multiple_choice_question():
    if not request.is_json:
        return jsonify({"status": "Body must be json"})
    post_data = request.data
    data = json.loads(post_data)
    if "choice" not in data:
        return jsonify({"status": "you must specify a list of choice"})
    return jsonify(MultipleChoiceQuestion().add_question(data))
Beispiel #3
0
def show_multiple_choice_question(question_id):
	return jsonify(MultipleChoiceQuestion().show_question(question_id))
Beispiel #4
0
def show_all_multiple_choice_question():
	return jsonify(MultipleChoiceQuestion().show_all_question())
Beispiel #5
0
def show_categories_multiple_choice():
    return jsonify(MultipleChoiceQuestion().show_categories())