nhocki / como_vamos

A place to share solutions to competitive programming problems.
http://www.comovamos.co
GNU General Public License v3.0
8 stars 3 forks source link

[WIP] Adding difficulty levels for problems #23

Closed nhocki closed 9 years ago

nhocki commented 9 years ago

@esbanarango moving the discussion here to keep it "next" to the code...

About your comment of showing the average, I like the idea of having the difficulty be "what most people think" but that'll make it more complex and I'm not sure is worth it for now...

Do you have an idea of making this super easy? Maybe we can use Redis for the scores instead of having the join table between difficulties and solutions? And what would happen when the user solves the problem twice? Can they vote twice? Or only once?

I'd like to get this out soonish and focus on other things before next year so it can be used in the training program at EAFIT...

From the things that I think are most important are (not necessarily in that order):

esbanarango commented 9 years ago

I don't think we actually need a join table between difficulties and solutions, instead we could save difficulty directly on the solutions table, and have a column on the problems table with the average (which could be re-calculated each time a solution is submitted). That column could be a float instead of integer and we could define some ranges. This way we can show a color-bar or simply the difficulty label, or even both. What do you think?

For the following things, do we want to build it from scratch or should we go with something like acts_as_follower. Same for the "wall" functionality, we could use something like public_activity.

Question...

Are you ok with models annotation (annotate_models)?

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.14%) to 91.56% when pulling c5555e5edc51b4767e95fe7b9d47e5e47fff8eae on difficulty_levels into a3ba626d2b2dced4f545f0ab007143bd9ee9afe9 on master.

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.25%) to 91.67% when pulling 5e7a47a4d04ec43c423fba5210efa88087d37875 on difficulty_levels into a3ba626d2b2dced4f545f0ab007143bd9ee9afe9 on master.

nhocki commented 9 years ago

@esbanarango I merged this just to get it out, we can update the logic later...