There are two immediate possibilities that can cause this.
The first is if your javascript and css files are not generated correctly. To fix that run `npm install` in /opt/webwork/webwork2/htdocs and in /opt/webwork/pg/htdocs.
The second (which will occur in the first case as well), is that you have run `npm install`, but after doing so have not restarted the server. To fix this run `sudo systemctl restart apache2`.
This should fix the problem, but if not post here, and we can troubleshoot further.