broke some lines in the code for readability, and altered the wording a little removing 'you may want to contact instructor'. In these scenarios there isn't anything special for the instructor to do. They could give the solution sure, but that is not special to SMA
fixed one instance where an emptry string from an uninitialized database entry was numerically compared to -1 by changing the comparison to a string comparison; maybe not the best solution. Also, when the environment varialbes were moved to pg earlier, this change should have been reflected in ProblemSetDetail.pm where it decides to remove SMA if it is not enabled