Beispiel #1
0
def remove_group(lti=lti):
    assignment_group_id = request.values.get('assignment_group_id', None)
    if assignment_group_id is None:
        return jsonify(success=False, message="No assignment group id")
    user, roles, course = ensure_canvas_arguments()
    if not User.is_lti_instructor(roles):
        return jsonify(success=False, message="You are not an instructor in this course.")
    AssignmentGroup.remove(assignment_group_id)
    return jsonify(success=True)
Beispiel #2
0
def remove_group(lti=lti):
    assignment_group_id = request.values.get('assignment_group_id', None)
    if assignment_group_id is None:
        return jsonify(success=False, message="No assignment group id")
    user, roles, course = ensure_canvas_arguments()
    if not User.is_lti_instructor(roles):
        return jsonify(success=False,
                       message="You are not an instructor in this course.")
    AssignmentGroup.remove(assignment_group_id)
    return jsonify(success=True)
def remove_group(lti=lti):
    ''' Removes a group from a course'''
    assignment_group_id = request.values.get('assignment_group_id', None)
    if assignment_group_id is None:
        return jsonify(success=False, message="No assignment group id")
    assignment_group = AssignmentGroup.by_id(int(assignment_group_id))
    # Verify permissions
    if not g.user.is_instructor(assignment_group.course_id):
        return jsonify(success=False, message="You are not an instructor in this course.")
    # Perform action
    AssignmentGroup.remove(assignment_group.id)
    # Result
    return jsonify(success=True)
Beispiel #4
0
def remove_group(lti=lti):
    ''' Removes a group from a course'''
    assignment_group_id = request.values.get('assignment_group_id', None)
    if assignment_group_id is None:
        return jsonify(success=False, message="No assignment group id")
    assignment_group = AssignmentGroup.by_id(int(assignment_group_id))
    # Verify permissions
    if not g.user.is_instructor(assignment_group.course_id):
        return jsonify(success=False,
                       message="You are not an instructor in this course.")
    # Perform action
    AssignmentGroup.remove(assignment_group.id)
    # Result
    return jsonify(success=True)