java icon indicating copy to clipboard operation
java copied to clipboard

Add prerequisites to Practice Exercises

Open ErikSchierboom opened this issue 4 years ago • 10 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

The four the spec links in the issue above appear to have moved. Are you able to direct me to the new docs locations?

ericbalawejder avatar Apr 01 '21 20:04 ericbalawejder

@ericbalawejder maybe is the spec file this ? @ErikSchierboom is it right ?

mirkoperillo avatar Apr 02 '21 05:04 mirkoperillo

@mirkoperillo Yes that is correct! Sorry for the broken links.

ErikSchierboom avatar Apr 02 '21 07:04 ErikSchierboom

This issue has been automatically marked as action/stale because it has not had recent activity. Please update if there are new updates to provide.

github-actions[bot] avatar Nov 17 '21 03:11 github-actions[bot]

Anyone at least interested in breaking this down into a number of smaller tasks? Each practice exercise needs to be analyzed then add the prereqs (and practices) for that exercise.

jmrunkle avatar Dec 06 '21 03:12 jmrunkle

I'd like to help! I plan to solve this in small steps of 5~10 practice exercises each PR, since I am a bit short on time, if that's ok.

One doubt: there are currently only 17 concepts in the config.json file. For some practice exercises, I feel the need for other concepts, e.g. Exceptions. Can I add new concepts in the concepts key? If so, how are uuids generated ?

cdpaiva avatar Dec 13 '21 12:12 cdpaiva

I'd like to help! I plan to solve this in small steps of 5~10 practice exercises each PR, since I am a bit short on time, if that's ok.

That sounds fantastic! In fact, you could even do one at a time to keep your PRs really focused. Or maybe go alphabetically (A-C, ...), whatever floats your boat.

For some practice exercises, I feel the need for other concepts, e.g. Exceptions. Can I add new concepts in the concepts key?

Yes, we can definitely add new concepts, but I do not think we should add any concepts without adding concept exercises to accompany them. I am not sure if configlet linting will complain about concepts without exercises or not, but it may. In those cases, you can make an issue for making the new concept with a task in there to add it as a prerequisite to whatever exercise you are looking into (which can be another issue if that works best for you).

If so, how are uuids generated ?

Using the configlet tool. You can use "bin/fetch-configlet" to fetch the current version of the configlet binary. Then "bin/configlet uuid" will generate a new UUID for you.

$ bin/fetch-configlet
$ bin/configlet uuid

jmrunkle avatar Dec 21 '21 04:12 jmrunkle

Awesome @jmrunkle, thanks a lot for the detailed guidelines. I will start working on this and submit a PR anytime soon.

cdpaiva avatar Dec 22 '21 16:12 cdpaiva

This issue has been automatically marked as action/stale because it has not had recent activity. Please update if there are new updates to provide.

github-actions[bot] avatar Mar 23 '22 03:03 github-actions[bot]