pcottle / learnGitBranching

An interactive git visualization and tutorial. Aspiring students of git can use this app to educate and challenge themselves towards mastery of git!
https://pcottle.github.io/learnGitBranching/
MIT License
30.54k stars 5.75k forks source link

How can I specify the best number of commands for a level I built? #284

Closed Lia-C closed 9 years ago

Lia-C commented 9 years ago

I created a new level with the level builder, took the JSON, stored it in a mylevel.js file in src/levels/mylevels. I also added this mylevel.js to src/levels/index.js, so now mylevel appears in the modal when you type levels. However, when I test my level, after I complete it, I get the the modal that says

You solved the level in 2 command(s); our solution uses 1.
See if you can whittle it down to 1 :D

Mylevel actually takes 2 commands, but where do I specify this? I know that in src/js/dialogs/nextLevel.js there is the line 'our solution uses {best}"-- but where do I specify {best} for mylevel?

Lia-C commented 9 years ago

Also is there a way to make a new tab in levels, so that we have three tabs: Main, Remote, and MyLevels?

Lia-C commented 9 years ago

I figured out my first question: you can specify the number of commands right in the level's json: "solutionCommand": "git rebase dev; git commit". The number of commands you put here is what is used as the "best" number of commands.

Still trying to figure out how to create a new tab, though...

Lia-C commented 9 years ago

Figured out how to create a new tab! You add a new tab in src/js/views/levelDropdownView.js. AFter making a level, you can add your level to your tab in src/levels/index.js by putting tab: 'yourtabname' in your level's part of the JSON.

pcottle commented 9 years ago

Yep @Lia-C ! The tabs part is fairly mainly since we only have two tabs

For the solutionCommand stuff, we automatically record the commands you used to solve the level -- but if you have a more efficient solution, youll need to re-record the level or just edit the json manually

also notice that grunt test should test the new level automatically!