
    In an adaptive learning module focused on pattern recognition, determine if a student's completed number puzzle qualifies as valid by verifying whether each row, column, and diagonal in the square grid sums to the same value. The puzzle grid represents a mathematical exercise where students must arrange numbers to create equal sums in all directions, testing their understanding of numerical relationships and strategic thinking.
    

    
def magic_square_test(my_matrix):
    """
    In an adaptive learning module focused on pattern recognition, determine if a student's completed number puzzle qualifies as valid by verifying whether each row, column, and diagonal in the square grid sums to the same value. The puzzle grid represents a mathematical exercise where students must arrange numbers to create equal sums in all directions, testing their understanding of numerical relationships and strategic thinking.
    

    """
def magic_square_test(my_matrix):
    """
    In an adaptive learning module focused on pattern recognition, determine if a student's completed number puzzle qualifies as valid by verifying whether each row, column, and diagonal in the square grid sums to the same value. The puzzle grid represents a mathematical exercise where students must arrange numbers to create equal sums in all directions, testing their understanding of numerical relationships and strategic thinking.
    

    """
    iSize = len(my_matrix[0])
    sum_list = []
    sum_list.extend([sum(lines) for lines in my_matrix])
    for col in range(iSize):
        sum_list.append(sum((row[col] for row in my_matrix)))
    result1 = 0
    for i in range(0, iSize):
        result1 += my_matrix[i][i]
    sum_list.append(result1)
    result2 = 0
    for i in range(iSize - 1, -1, -1):
        result2 += my_matrix[i][i]
    sum_list.append(result2)
    if len(set(sum_list)) > 1:
        return False
    return True