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

New practice exercise book-store #764

Closed
angelikatyborska opened this issue Jun 14, 2021 · 2 comments
Closed

New practice exercise book-store #764

angelikatyborska opened this issue Jun 14, 2021 · 2 comments
Labels
enhancement ⭐️ A nice-to-have help wanted 🤝 x:action/create Work on something from scratch x:knowledge/elementary Little Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:size/large Large amount of work x:status/claimed Someone is working on this issue x:type/content Work on content (e.g. exercises, concepts)

Comments

@angelikatyborska
Copy link
Member

angelikatyborska commented Jun 14, 2021

New practice exercise: book-store

Implement the book-store practice Exercise in the Elixir track as it is defined in: problem-specifications/exercises/book-store

How to implement a new practice exercise?

1. New mix project

Create a new mix project in exercises/practice/<exercise-slug> and configure it in the same way as other exercises (with regard to Elixir version, .formatter.exs, test/test_helper.exs etc.). The easiest way to achieve this is to copy an existing exercise.

2. Instructions

Copy description.md from problem specifications into .docs/instructions.md of the new exercise. Do not edit it.

What to do if you need to add Elixir specific instructions.

3. Exercise config

Create .meta/config.json. The fields blurb, source, and source_url should be copied from problem specifications, from the file metadata.yml. Each field can be skipped if it doesn't exist in metadata.yml.

More details about the exercise config.

Make sure to give yourself credit for being the author 💪.

4. Tests

Create a test suite.

  • The test suite should implement all test cases as described in canonical-data.json in the problem specifications repository for this exercise. Remember that this file describes the exercise for all tracks. You will need to interpret in a way that makes sense for Elixir.
  • See instructions here about how to read canonial-data.json
  • Avoid omitting any test cases from canonial-data.json unless there is a good Elixir-specific reason to do so.
  • You can come up with more test cases than canonial-data.json describes, especially if there's something Elixir-specific that needs to be tested.
  • Create a .meta/tests.toml file that documents which tests from canonial-data.json were implemented. This can be done automatically with configlet sync.

5. Example solution

Write an example solution in .meta/example.ex. It needs to pass all tests added in the previous step. It doesn't have to be beautiful, it only has to prove that the Exercise can be solved in all supported Elixir versions.

6. Solution stub

Write a solution stub in lib/<exercise_name>.ex. It should probably include empty function definitions for all the functions required by the test suite, each with a @doc and a @spec.

7. Optionally, document your decisions

If there is something unusual about this exercise, you can create a .meta/design.md file and describe the problem there.

8. Add exercise to track config

Open up the file config.json at the root of this repository. Find the list under the key exercises.practice and add your new exercise at the end of that list. A unique id can be generated with uuidgenerator.net/version4. You will need to decide how difficult the exercise is on the scale from 1 to 9, but also which concepts must be known by the student to solve this exercise well. Leave this field empty if you're not sure. A track maintainer can help you with that.

More about this config.

Stuck? Questions?

Do not hesitate to tag @angelikatyborska (me) and ask for help.

@angelikatyborska angelikatyborska added enhancement ⭐️ A nice-to-have help wanted 🤝 x:action/create Work on something from scratch x:knowledge/elementary Little Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:size/large Large amount of work x:type/content Work on content (e.g. exercises, concepts) labels Jun 14, 2021
jiegillet added a commit to jiegillet/elixir that referenced this issue Jun 24, 2021
@angelikatyborska angelikatyborska added the x:status/claimed Someone is working on this issue label Jun 24, 2021
angelikatyborska added a commit that referenced this issue Jun 26, 2021
Co-authored-by: Angelika Tyborska <angelikatyborska@fastmail.com>
@angelikatyborska
Copy link
Member Author

Closed in #778

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ⭐️ A nice-to-have help wanted 🤝 x:action/create Work on something from scratch x:knowledge/elementary Little Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:size/large Large amount of work x:status/claimed Someone is working on this issue x:type/content Work on content (e.g. exercises, concepts)
Projects
None yet
Development

No branches or pull requests

1 participant