Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v3] Add prerequisites to Practice Exercises #583

Merged
merged 132 commits into from
Mar 1, 2021

Conversation

angelikatyborska
Copy link
Member

@angelikatyborska angelikatyborska commented Jan 31, 2021

closes #567 , closes #457

To launch v3, all practice exercises need to define which concepts are necessary for solving the exercise. The "topics" key becomes obsolete. Two new keys are added:

  • prerequisites - a list of concepts that they students need to learn before they are able to solve the exercise well. It doesn't mean that they need to use all of those concepts while solving the exercise, but they need to know them to be able to choose the right one for the job. This key will be used to block students from solving an exercise too early.
  • practices - one or two concepts on which this exercise focuses. Those concepts should be used to solve this exercise well. This key will be used to suggest to users which exercises to do in order to practice a concept they're interested in.

Ideally every concept would have at least one exercise that practices it.

Approach

When assigning concepts to exercises, I used this approach:

  • Analyze the example solution, mentoring notes, and maybe some popular community solutions (not marked as old) for each exercise.
  • A long prerequisites list can be used to steer students away from difficult exercises too early.
  • If there are two or more equally valid approaches to a specific problems, all concepts necessary to use those multiple approaches are considered prerequisites (e.g. recursion vs enum, case vs multiple-clause-fuctions, agent vs genserver). For this reason, a lot of exercises list cond, case, if, multiple-clause-functions, pattern-matching and so on as necessary concepts, when only one or two of those is actually needed, because there is no single objective answer to which one is better :).
  • If a more complex concept is a prerequisite for a given exercise, simpler concepts that are prerequisites to the more complex concept do not need to be listed. For example, if I need to know about erlang-libraries to solve an exercise, we don't need to explicitly list atoms or basics as a prerequisite. I only listed the very simple concepts like atoms, integers, or tuples for exercises where they played a bigger role.
  • Use "topics" as a hint.
  • Some of the concepts could be considered more "stylistic" than substantive, like the pipe operator and using module attribute as constants. I would avoid using those as prerequisites at all, except for the few exercises chosen to also list them as practices.
  • Ideally every concept would be practiced by a few practice exercises.

During this process, it might become apparent that some concepts are missing. Adding, or planning for adding, new concepts is definitely possible, and even welcome! However, removing existing concepts or modifying them (changing their scope) might be difficult and hopefully we can avoid it.

Existing concepts

Concept tree: https://exercism.lol/tracks/elixir/concepts

slug link 1 link 2
access-behaviour introduction.md about.md
agent introduction.md about.md
anonymous-functions introduction.md about.md
atoms introduction.md about.md
basics introduction.md about.md
binaries introduction.md about.md
bit-manipulation introduction.md about.md
bitstrings introduction.md about.md
booleans introduction.md about.md
case introduction.md about.md
charlists introduction.md about.md
closures introduction.md about.md
cond introduction.md about.md
dates-and-time introduction.md about.md
default-arguments introduction.md about.md
dynamic-dispatch introduction.md about.md
enum introduction.md about.md
erlang-libraries introduction.md about.md
errors introduction.md about.md
exceptions introduction.md about.md
file introduction.md about.md
floating-point-numbers introduction.md about.md
guards introduction.md about.md
if introduction.md about.md
integers introduction.md about.md
io introduction.md about.md
keyword-lists introduction.md about.md
list-comprehensions introduction.md about.md
lists introduction.md about.md
maps introduction.md about.md
module-attributes-as-constants introduction.md about.md
multiple-clause-functions introduction.md about.md
nil introduction.md about.md
pattern-matching introduction.md about.md
pids introduction.md about.md
pipe-operator introduction.md about.md
processes introduction.md about.md
protocols introduction.md about.md
randomness introduction.md about.md
ranges introduction.md about.md
recursion introduction.md about.md
regular-expressions introduction.md about.md
streams introduction.md about.md
strings introduction.md about.md
structs introduction.md about.md
tail-call-recursion introduction.md about.md
try-rescue introduction.md about.md
try-rescue-else-after introduction.md about.md
tuples introduction.md about.md

Planned concepts

For planned concepts, we can only add them as prerequisites after they were implemented. Their corresponding issues should list which practice exercises need them.

slug link
genserver issue
with issue
task issue
macros issue

Exercise reference

slug link 1 link 2 link 3
hello-world example.ex community solutions
rna-transcription example.ex community solutions mentoring notes
word-count example.ex community solutions mentoring notes
roman-numerals example.ex community solutions mentoring notes
bob example.ex community solutions mentoring notes
beer-song example.ex community solutions mentoring notes
robot-simulator example.ex community solutions mentoring notes
list-ops example.ex community solutions mentoring notes
markdown example.ex community solutions
bank-account example.ex community solutions mentoring notes
zipper example.ex community solutions
bowling example.ex community solutions
forth example.ex community solutions
resistor-color example.ex community solutions
two-fer example.ex community solutions
nucleotide-count example.ex community solutions
pig-latin example.ex community solutions
protein-translation example.ex community solutions
rotational-cipher example.ex community solutions
secret-handshake example.ex community solutions
space-age example.ex community solutions
strain example.ex community solutions
accumulate example.ex community solutions
acronym example.ex community solutions
raindrops example.ex community solutions
run-length-encoding example.ex community solutions
series example.ex community solutions
dnd-character example.ex community solutions
pangram example.ex community solutions
scrabble-score example.ex community solutions
sum-of-multiples example.ex community solutions
grade-school example.ex community solutions
isogram example.ex community solutions
twelve-days example.ex community solutions
collatz-conjecture example.ex community solutions
sublist example.ex community solutions
triangle example.ex community solutions
flatten-array example.ex community solutions
matching-brackets example.ex community solutions
anagram example.ex community solutions
hamming example.ex community solutions
matrix example.ex community solutions
phone-number example.ex community solutions
say example.ex community solutions
nth-prime example.ex community solutions
binary-search example.ex community solutions mentoring notes
isbn-verifier example.ex community solutions
leap example.ex community solutions
tournament example.ex community solutions
all-your-base example.ex community solutions
binary-search-tree example.ex community solutions
grains example.ex community solutions
meetup example.ex community solutions
simple-linked-list example.ex community solutions
etl example.ex community solutions
binary example.ex community solutions
change example.ex community solutions
transpose example.ex community solutions
ocr-numbers example.ex community solutions
kindergarten-garden example.ex community solutions
diamond example.ex community solutions
luhn example.ex community solutions
scale-generator example.ex community solutions
rail-fence-cipher example.ex community solutions
gigasecond example.ex community solutions
hexadecimal example.ex community solutions
perfect-numbers example.ex community solutions
prime-factors example.ex community solutions
diffie-hellman example.ex community solutions
parallel-letter-frequency example.ex community solutions
palindrome-products example.ex community solutions
pascals-triangle example.ex community solutions
spiral-matrix example.ex community solutions
custom-set example.ex community solutions
saddle-points example.ex community solutions
connect example.ex community solutions
minesweeper example.ex community solutions
queen-attack example.ex community solutions
armstrong-numbers example.ex community solutions
simple-cipher example.ex community solutions
allergies example.ex community solutions
crypto-square example.ex community solutions
largest-series-product example.ex community solutions
clock example.ex community solutions
sieve example.ex community solutions
poker example.ex community solutions
atbash-cipher example.ex community solutions
grep example.ex community solutions
difference-of-squares example.ex community solutions
dominoes example.ex community solutions
alphametics example.ex community solutions
pythagorean-triplet example.ex community solutions
wordy example.ex community solutions
dot-dsl example.ex community solutions

@angelikatyborska angelikatyborska marked this pull request as draft January 31, 2021 07:35
@angelikatyborska angelikatyborska changed the title rna-transcription [v3] Add prerequisites to Practice Exercises Jan 31, 2021
"prerequisites": [
"recursion",
"structs",
"protocols",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think protocols are necessary to solve this exercise, but the boilerplate code includes a protocol implementation (https://github.com/exercism/elixir/blob/main/exercises/practice/zipper/lib/bin_tree.ex#L15-L33) so I added it here to avoid students being confused by the boilerplate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Zipper used to appear after Clock, so they were introduced to protocols by that point. I don't think students that I have encountered have been confused by this at this point with Clock having been removed from the core pathway.

@angelikatyborska angelikatyborska force-pushed the add-prerequisites-to-practice-exercises branch from 2c889ec to f94c12d Compare January 31, 2021 10:46
"case",
"pattern-matching",
"strings",
"binaries",
Copy link
Member Author

@angelikatyborska angelikatyborska Jan 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of solutions chose binary pattern-matching for splitting the string into three-letter substrings.

"binaries",
"regular-expressions",
"errors"
],
Copy link
Member Author

@angelikatyborska angelikatyborska Jan 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example solution for this exercise uses metaprogramming like this:
https://github.com/exercism/elixir/blob/main/exercises/practice/protein-translation/.meta/example.ex#L49-L52

I wonder if this should become a concepts of its own? How would it be called, which parts of metaprogramming would it cover?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it could cover quote and unquote so that those are not new concepts when macros are introduced?

@angelikatyborska angelikatyborska marked this pull request as ready for review February 14, 2021 10:57
@angelikatyborska
Copy link
Member Author

I'll keep this PR open, waiting for feedback, for at least 2 more weeks (28.02.2021).

@neenjaw
Copy link
Contributor

neenjaw commented Feb 14, 2021

Prettier attacked your formatting. 😬

I added a few here and there. I also added task to parallel-letter-frequencies and macros to dot-dsl. I think non-existent concepts are ignored by the system so that should be safe, but maybe that needs a confirm from @iHiD / @ErikSchierboom.

I think for the most part, most concepts are covered somewhere, I don't think there is a perfect coverage to have everything covered evenly and maybe once we can see it visually that one concept is disproportionately high/low we can make further adjustments.

@neenjaw neenjaw force-pushed the add-prerequisites-to-practice-exercises branch from c53ebd3 to 6bd38a0 Compare February 14, 2021 16:55
"nil",
"macros"
],
"practices": ["keyword-lists", "structs", "macros"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be that I misunderstood the structure of this file -- but it seems to me that there is no such concept as macros (yet?).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not yet, but there should be. @angelikatyborska had a list of concepts that likely should be implemented at some point in one of her comments ☝🏻 up there. Concepts that don't exist, shouldn't affect things (afaik), but then this way we can be planning for their hopeful addition someday

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll see what Jeremy or Erik say about this. I think I would personally prefer configlet to trip over non-existing concepts in prerequisites to warn me about typos. If we have to remove the non-existing concepts, they already have corresponding Github issues that list to which exercises it needs to be added.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is definitely good to list concepts that are not there yet, as the v3 website will just ignore them but you'll have them defined for when the concept is added later. configlet should indeed warn about using concepts in Practice Exercises that are not yet defined. For Concept Exercises, I feel like it should error if the concept is not specified.

config.json Outdated Show resolved Hide resolved
@angelikatyborska
Copy link
Member Author

I will merge this PR on 01.03.2021, in 3 days.

@iHiD
Copy link
Member

iHiD commented Feb 26, 2021

I will merge this PR on 01.03.2021, in 3 days.

EXCITING.

@angelikatyborska angelikatyborska merged commit 7305a9e into main Mar 1, 2021
@angelikatyborska angelikatyborska deleted the add-prerequisites-to-practice-exercises branch March 1, 2021 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[v3] Add prerequisites to Practice Exercises zipper: fix struct syntax in stub file docs
5 participants