Fixed bugs with exercise buttons and ungraded

Ungraded was showing on all lessons even if there were no ungraded
exercises.  The exercise buttons were not working.  It all works now.