reworking how active class is set

more expressive variables
fix for getting learning objective image with regex