Skillsoft Corp. has agreed to acquire rival U.S.-based educational technology company Codecademy for $525 million in cash and stock, the companies said Wednesday, the latest bet on consolidation in the online learning market. Closely held Codecademy offers free, basic online computer coding classes in areas such as programming, data science and cybersecurity. The New York-based startup’s services also include more in-depth paid offerings. In February, Codecademy raised $40 million in new funding, seeking to expand into markets such as India where a high percentage of people are pursuing engineering degrees.