
    Given a matrix of student performance metrics where each row represents a student's scores across various learning activities, rearrange the students' data rows in ascending order based on their total performance scores. The sorted matrix will help identify students with similar learning patterns and facilitate the creation of targeted learning groups.
    

    
def sort_matrix(M):
    """
    Given a matrix of student performance metrics where each row represents a student's scores across various learning activities, rearrange the students' data rows in ascending order based on their total performance scores. The sorted matrix will help identify students with similar learning patterns and facilitate the creation of targeted learning groups.
    

    """
def sort_matrix(M):
    """
    Given a matrix of student performance metrics where each row represents a student's scores across various learning activities, rearrange the students' data rows in ascending order based on their total performance scores. The sorted matrix will help identify students with similar learning patterns and facilitate the creation of targeted learning groups.
    

    """
    result = sorted(M, key=sum)
    return result