def is_xblock_an_assignment(xblock):
    """
    Takes in a leaf xblock and returns a boolean if the xblock is an assignment.
    """
    graded = getattr(xblock, 'graded', False)
    has_score = getattr(xblock, 'has_score', False)
    weight = getattr(xblock, 'weight', 1)
    scored = has_score and (weight is None or weight > 0)
    return graded and scored