
    Given a matrix where each row contains a student's scores across different learning modules, rearrange the student performance data in ascending order based on their total scores across all modules. The sorted matrix will help educators group students with similar achievement levels together for targeted instructional support.
    

    
def sort_matrix(M):
    """
    Given a matrix where each row contains a student's scores across different learning modules, rearrange the student performance data in ascending order based on their total scores across all modules. The sorted matrix will help educators group students with similar achievement levels together for targeted instructional support.
    

    """
def sort_matrix(M):
    """
    Given a matrix where each row contains a student's scores across different learning modules, rearrange the student performance data in ascending order based on their total scores across all modules. The sorted matrix will help educators group students with similar achievement levels together for targeted instructional support.
    

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