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.

17 comments:

  1. I was experimenting on this with my test room without success. Could you help me figure out what's wrong.
    I've forked new room 74A037 from 638B0525DD.

    So I've made such link:
    Gane of Life

    But it doesn't work as expected.

    ReplyDelete
  2. Hi Unknown.
    Taking 638B0525DD as the room to fork from...
    Looking at that room I see there is a deer (no traffic-lights) and a flamingo (lots of traffic-lights).
    Your link is http://cyber-dojo.org/forker/fork/638B0525DD?avatar=snake&tag=1
    But there is no snake in that room.
    You don't specify the animal you "want".
    You specify the animal (and traffic-light) you are forking _from_,
    If you want to fork from flamingo's 57th traffic-light you'll need...
    http://cyber-dojo.org/forker/fork/638B0525DD?avatar=flamingo&tag=57
    Hope this helps.
    Cheers
    Jon

    ReplyDelete
  3. Hi Jon,
    Unlike what we saw over the weekend, the custom start points does work! Here's a link to a gist which explains how to quickstart Python/PyTest/FizzBuzz on CyberDojo.

    ReplyDelete
    Replies
    1. Awesome! Thank you so much for doing this. Sorry I fouled it up over the weekend.

      Delete
    2. This comment has been removed by the author.

      Delete
    3. No problem! And here's the actual URL shortener http://j.mp/cdPython

      Delete
    4. However, the fork doesn't work is when we use the `&tag=-1` to pick up the latest iteration.

      Delete
    5. Which is a bug. Sorry about that. I will look at it as soon as I can.

      Delete
  4. Meanwhile, I've managed to create a Javascript bookmarklet for sharing a customized cyber-dojo session. Click this link to review the instructions in a gist file

    ReplyDelete
    Replies
    1. I've added forking from -1
      If, on your server, you do
      $ cyber-dojo update
      then it will understand forking from -1
      Cheers

      Delete
    2. ...and a demo video of the bookmarklet in action! - http://j.mp/bookmarkCDVideo

      Delete
    3. http://cyber-dojo.org/forker/fork/4E8C8A7B0C?avatar=rhino&tag=-1 still doesn't cut it. Am I doing something wrong?

      The avatar link is http://cyber-dojo.org/kata/edit/4E8C8A7B0C?avatar=rhino

      Delete
    4. Sorry I was not clear. I have made the change to the web-service image but have not upgraded the main server yet (just landed). I was assuming you would be creating URLs with a tag=-1 for your own server.

      Delete
    5. This comment has been removed by the author.

      Delete
    6. Got it! I will check on my server after it has been updated. BTW, the bookmarklet will work on cyber-dojo.org as well! Thanks again!

      Delete
  5. "-1" works now after the local "update". Love that color is default now! It would be nice to have the brighter background when displaying on projector. Is that toggle-color kyeboard shortcut still available?

    ReplyDelete