CodeYourFuture / fundamentals-blockly

CYF PRODUCT
https://blocks.codeyourfuture.io
5 stars 4 forks source link

Deploy

Copy the whole folder to netlify - the entry point is index.html and all js is "packaged" manually through script tags (this needs improving upon)

Run locally

Load index.html from a live server (also needs improving upon)

Principles

Notes

Design patterns for implementing projects

Troubleshooting

Contributing exercises

Some conventions are set up to interact with the app, to facilitate testing and markup of block names and starting html.

Naming

By convention (not currently necessary, but possibly useful in future):

Referring to blocks

All blocks should have consistent names and be marked up consistently (for easy renaming, or improved rendering), using either

<span class="blockname">"at the start"</span> block

in html or

"`at the start`" block

in markdown.

Providing initial html

Each exercise includes its default/starting html. It should be either marked as

<code class="start_code"
  >&lt;p&gt;The &lt;u id="noun1"&gt;dog&lt;/u&gt; &lt;u
  id="verb"&gt;saw&lt;/u&gt; the &lt;u id="adjective"&gt;white&lt;/u&gt; &lt;u
  id="noun2"&gt;cat&lt;/u&gt;&lt;/p&gt;</code
>

in html or be the first html code block in markdown:

<ul>
  <li id="banana">Banana</li>
  <li id="apple">Apple</li>
  <li id="strawberry">Strawberry</li>
</ul>

Placeholder for placing a pass/fail testmark for a test

In html, write the id of the test ("") in the corresponding li element classname

<li id="exercise_set_colours_3">
  <!-- linked to BlocklyTest.registerTest("exercise_set_colours") ... BlocklyTest.expect(3)-->
</li>

In markdown, write an empty html span out. BlocklyTest.expect will be lined up by order of appearance

<span class="test-checkbox"></span>

Registering tests

The test for an exercise is registered

The callback is executed when the run button has been pressed, after the html has been rendered, but before the code is executed. It sets up expectations of the things that should happen after the code is executed.

BlocklyTest.expect has

BlocklyTest.expectAfterClick has