Simply opening a link will not install Ransomware, it could have been a link to a web page that displayed in full screen that appeared to lock the Mac unless a number was called. In this case, you can Force Quit Safari by pressing Option-Command-ESC. Then to open Safari again, hold the Shift key while launching Safari. This will clear the previous screen.
If the link did download software, then it would have to be installed by your Mother-In-Law by double clicking it and most likely enter the login credentials of the computer to put anything in your System Files that would launch on startup. The link provided by hcsitas to reset to factory settings is the quick fix, but you also would be able to remove any files installed by first starting up in Safe Mode, then download the free EtreCheck program and post the report here using the Additional Text option when posting. There is no personal information provided in the report.
Start up your Mac in safe mode - Apple Support
How to use the Add Text Feature When Post… - Apple Community
As for affecting other devices, that would depend on if your Mother-In-Law provided her Apple ID and Password to the scammers. If any financial data was given, then appropriate action would also be needed to secure those accounts.