SciMed/rubeque — pull request #140 by reprah (2013-10-16 23:25:49+00:00)
Title: Give users the option to view solutions before they've solved a problem

Hi,

This is my implementation of the "view solutions for no points" feature. Summary of it:

- If a user is stuck on a problem, they can click 'View Solutions'. They're warned that they will forfeit their automatic points by doing this, and are led to a small set of lowest-voted solutions. They're prevented from seeing the solutions of the people they follow
- When this same user finally does solve the problem, they won't receive an automatic vote, but they can now view the top solutions/followed solutions

Summary of the added code:

- Cucumber scenarios to test this feature
- A service object to handle which solutions to display in the SolutionsController
- Rspec specs for the service object
- Made the SolutionsController#index html view more generic so it can display both top and bottom solutions
- Gave the User model a skipped_problems field
- But no fancy warning for the user like I thought I might add

I'm ready for discussion and can offer explanations about the changes I made. Thanks for reviewing this and for answering my questions!