Showing posts with label fork starting-points. Show all posts
Showing posts with label fork starting-points. Show all posts

how do I create and share a cyber-dojo customized practice session?

Suppose you want to create your own tailored starting point. For example, you might want to create a practice exercise where the tests are already written. Or some legacy code to practice refactoring.

Without Automation

Prepare your files in a practice session. When you think you have your files how you want them, click the [test] button. If everything is as expected make a note of...
  • the 6 character id (from the URL); suppose it is k5ZTk0
  • the last traffic light's number; in this case 10


Click on the latest (right-most) traffic light. This will switch to review/diff mode. By the big [resume] button there is a smaller [fork] button.


Click the [fork] button. This will open a dialog box asking if you want to create a new group-exercise or a new individual-exercise.


Click the [group] button. This will open the group practice session landing page, displaying its id. In this example rZf7z6 is a new group practice session id which is good for one practice session only.



With Automation

The following HTML will create a submit button which forks from the 10th traffic light of k5ZTk0, creating a brand new group exercise with its own unique id, each time it is clicked:
  <form action="https://cyber-dojo.org/forker/fork_group?id=k5ZTk0&index=10" method="POST">
    <input type="submit" value="Fork a new Group Exercise from id=k5ZTk0 index=10">
  </form>

The following HTML will create a link which forks from the 10th traffic light of k5ZTk0, creating a brand new individual exercise with its own unique id, each time it is clicked:
  <form action="https://cyber-dojo.org/forker/fork_individual?id=k5ZTk0&index=10" method="POST">
    <input type="submit" value="Fork a new Individual Exercise from id=k5ZTk0 index=10">
  </form>

Note that you can also use index=-1 to specify the most recent traffic-light.