go icon indicating copy to clipboard operation
go copied to clipboard

Add "prerequisites" and "practices" to Practice Exercises

Open ErikSchierboom opened this issue 4 years ago • 6 comments

This issue is part of the migration to v3. You can read full details about the various changes here.

Exercism v3 introduces a new type of exercise: Concept Exercises. All existing (V2) exercises will become Practice Exercises.

Concept Exercises and Practice Exercises are linked to each other via Concepts. Concepts are taught by Concept Exercises and practiced in Practice Exercises. Each Exercise (Concept or Practice) has prerequisites, which must be met to unlock an Exercise - once all the prerequisite Concepts have been "taught" by a Concept Exercise, the exercise itself becomes unlocked.

For example, in some languages completing the Concept Exercises that teach the "String Interpolation" and "Optional Parameters" concepts might then unlock the two-fer Practice Exercise.

Each Practice Exercise has two fields containing concepts: a practices field and a prerequisites field.

Practices

The practices key should list the slugs of Concepts that this Practice Exercise actively allows a student to practice.

  • These show up in the UI as "Practice this Concept in: TwoFer, Leap, etc"
  • Try and choose 3 - 8 Exercises that practice each Concept.
  • Try and choose at least two Exercises that allow someone to practice the basics of a Concept.
  • Some Concepts are very common (for example strings). In those cases we recommend choosing a few good exercises that make people think about those Concepts in interesting ways. For example, exercises that require UTF-8, string concatenation, char enumeration, etc, would all be good examples.
  • There should be one or more Concepts to practice per exercise.

Prerequisites

The prerequisites key lists the Concept Exercises that a student must have completed in order to access this Practice Exercise.

  • These show up in the UI as "Learn Strings to unlock TwoFer"
  • It should include all Concepts that a student needs to have covered to be able to complete the exercise in at least one idiomatic way. For example, for the TwoFer exercise in Ruby, prerequisites might include strings, optional-params, implicit-return.
  • For Exercises that can be completed using alternative Concepts (e.g. an Exercise solvable by loops or recursion), the maintainer should choose the one approach that they would like to unlock the Exercise, considering the student's journey through the track. For example, the loops/recursion example, they might think this exercise is a good early practice of loops or that they might like to leave it later to teach recursion. They can also make use of an analyzer to prompt the student to try an alternative approach: "Nice work on solving this via loops. You might also like to try solving this using Recursion."
  • There should be one or more prerequisites Concepts per exercise.

Although ideally all Concepts should be taught by Concept Exercises, we recognise that it will take time for tracks to achieve that. Any Practice Exercises that have prerequisites which are not taught by Concept Exercises, will become unlocked once the final Concept Exercise has been completed.

Goal

Practices

The "practices" field of each element in the "exercises.practice" field in the config.json file should be updated to contain the practice concepts. See the spec.

To help with identifying the practice concepts, the "topics" field can be used (if it has any contents). Once prerequisites have been defined for a Practice Exercise, the "topics" field should be removed.

Each practice concept should have its own entry in the top-level "concepts" array. See the spec.

Prerequisites

The "prerequisites" field of each element in the "exercises.practice" field in the config.json file should be updated to contain the prerequisite concepts. See the spec.

To help with identifying the prerequisites, the "topics" field can be used (if it has any contents). Once prerequisites have been defined for a Practice Exercise, the "topics" field should be removed.

Each prerequisite concept should have its own entry in the top-level "concepts" array. See the spec.

Example

{
  "exercises": {
    "practice": [
      {
        "uuid": "8ba15933-29a2-49b1-a9ce-70474bad3007",
        "slug": "leap",
        "name": "Leap",
        "practices": ["if-statements", "numbers", "operator-precedence"],
        "prerequisites": ["if-statements", "numbers"],
        "difficulty": 1
      }
    ]
  }
}

Tracking

https://github.com/exercism/v3-launch/issues/6

ErikSchierboom avatar Jan 29 '21 13:01 ErikSchierboom

⚠ The spec for Practice Exercises has changed. Besides having a prerequisites field, each Practice Exercise should now also have a practices field, which should list the slugs of Concepts that this Practice Exercise actively allows a student to practice. See the spec for more information.

The issue's text has been updated to reflect the updated spec.

ErikSchierboom avatar Feb 10 '21 09:02 ErikSchierboom

A recommendation from the maintainers of other tracks (who already completed this task) was to fill all prerequisites first. Then a small script can report a list of concepts and their related exercises. That list can be used as a starting point to think about which concepts to set in "practices". For example, there might be 20 exercises that have "strings" as prerequisite but only max. 8 should have strings in "practices". That means we need to pick the 8 exercises, that seem the best fit for practicing strings.

junedev avatar Dec 12 '21 16:12 junedev

I‘d like to work on this issue.

TristanAppDev avatar Apr 08 '22 08:04 TristanAppDev

@TristanAppDev Thanks for the interest in contributing.

Some additional thoughts on this task:

  • Not all concepts will be well covered by practice exercises, hence we won't probably be able to follow the Try and choose 3 - 8 Exercises that practice each Concept rule of thumb for all concepts. But it's important to identify what those concepts are at this stage. We can then think on how we can have more exercises practicing that concept, either by creating new exercises or adjusting existing ones. As part of this task, if you can identify those concepts without enough practice exercises, that would be a great help already.
  • Not all practice exercises will have concepts. The example that comes to mind is the "Parallel Letter Frequency" exercise, that is great to practice channels, waitgroups and goroutines. The problem is we don't have the channels, waitgroups and the goroutines concepts yet. The "Error Handling" exercise is also great to practice panic and recover - concepts we also don't have yet. As part of this issue, one thing that would be a great help if you could do, is to take a look at the roadmap and check the future concepts that are planned. If you see exercises that would be great to practice concepts that don't exist yet, make note of it and post that list on this issue. We can then take your list and add practice exercises to those future concepts as we create the concepts.

andrerfcsantos avatar Apr 10 '22 01:04 andrerfcsantos

@TristanAppDev I don't want to discourage you from working on this but I want you to be aware what is involved here as this task might sound easier than it actually is.

To define a set of prerequisites for a practice exercise you need to have a good understanding of the existing concepts and the content they cover. Then you need to form an idea in your head about the minimal set of concepts that is needed to write a reasonable solution to the given exercise. What helps with that is looking at your own solution to the exercise (if you have one), the example solution for the exercise in the repo (however keep in mind that one can be really bad because it only exists for CI purposes) and the community solutions on the website (since stars aren't used much, there is often no way to filter for the good ones tough). @andrerfcsantos Maybe you can recommend some Exercism users with good public solutions to lots of exercises. That helps a lot with this task. (That includes mentioning yourself if this applies to you. :wink: )

If you use some existing solution as reference, it would be great if you could provide the respective link in the PR description. Those are very valuable for the reviewer to check your proposal and later on when we want to create/improve more mentor notes.

Please don't include more than ~8 exercises per PR (and prerequisites only for now is fine). Reviewing those couple of additional words means repeating parts of the thought process described above.

junedev avatar Apr 12 '22 20:04 junedev

Thanks @junedev after reading your explanation I trink it‘s too soon for me to work on this issue.

TristanAppDev avatar Apr 13 '22 05:04 TristanAppDev