Cody: what are the criteria for being able to view all solutions?

4 views (last 30 days)
When solving problems over on Cody, I can almost always view all solutions to a problem after submitting a correct solution of my own. Very rarely, however, this is not the case, and I instead get the following message:
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
You may solve another problem from Community group to unlock all the solutions to this problem.
If this happens, then again, I can almost always rectify this by submitting a (correct) solution to a different problem (I take it that the Community group is the implicit group of all problems on Cody --- is it?). But sometimes that, too, fails.
So my question is, why? What are the criteria that determine when all solutions are, in fact, unlocked?
(There is a related question here, but I feel the posted answer does not answer the question.)

Accepted Answer

Arunika
Arunika on 9 Jan 2023
Hi Christian, thanks for taking the time to post this question.
In the Cody 'About' page, right-hand panel, the rules for unlocking solutions says the following:
Unlocking Solutions
Cody calculates a size for each solution. When you submit a correct solution to a problem, you can see other solutions of the same size (that is, the same length or longer), but not shorter solutions.
Each time you solve a new problem, you unlock all solutions to your previously solved problems in the same group.
You're right in your observation that the 'Community Group' is the implicit group that any problem belongs to, if it hasn't been added to any other groups. So I believe that the behavior you are observing might be that, whenever you solve another ungrouped problem, it is unlocking solutions to other ungrouped problems belonging to Community Group.
I agree this current way could be improved to be more straight-forward and transparent. We are planning to bring some changes into the rules of locking/unlocking solutions for players across Cody, and those changes will definitely be more transparent and streamlined than right now.
  5 Comments
Dyuman Joshi
Dyuman Joshi on 11 Jan 2023
Edited: Dyuman Joshi on 11 Jan 2023
For someone who has been active on Cody and Answers (more active on Cody) for quite awhile, I'll share my 2 cents -
Overwhelmingly, solutions on Cody do not prioritize efficient code writing practices. The priority (generally) is to get a lower solution size. That is the reason why so many cheats have been used till date and some cheats are still around.
Only a few players, out of 99k+ users write a "maintained" code - using proper variable naming and formatting, not using 'ans' as the output variable (I, myself, have been a culprit of this), etc. Comments on the solutions are even rarer (even I have only started to comment quite recently)
(maintained used synonymous to readebility)
I've learnt about good coding practices (pre-allocating, vectorization) through MATLAB Answers only.
Though if someone is trying to do their best on Cody, our goal is to give them a proper environment to do so, acknowledge it and encourage learning as best as they could, via the platoform.
Additionally, one can learn specific usage and functionalities of many functions through Cody. It is also a good place to see and learn how other users approach problems from another perspective. Paired with use of functions as mentioned above, one can learn to write more efficient code. There are also problems to learn applications of well known algorithms. And the intriguing nature of the problems being posted regularly drives you back to Cody.
Regarding your comments on cheat solutions, @Stephen23, most cheat solutions are not valid anymore, and admins (and some other helpful users) have also tried to let the Cody users and community know about them and avoid their use.
Cody now also has a 'flag a solution' functionality, where users can report cheat/hack solutions and admins take appropriate action. Test suites of old questions are frequently updated as well to prevent hard-coded solutions.
Cody is not meant to be nor should be used to learn MATLAB, rather a platform to test and enhance your skills.

Sign in to comment.

More Answers (1)

Arunika
Arunika on 30 Jan 2023
Updating this thread with some relevant info.
The criteria to view all solutions to a problem in Cody has been updated - now, you have to solve the problem once, and that is all that's needed to view all solutions to that problem.

Categories

Find more on Historical Contests in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!