Skip to content

Cool Exercise Secrets

spicyj edited this page Jun 6, 2012 · 9 revisions

Setting multiple variables at once (destructuring assignment)

Inside <var> tags, you can set more than one variable at once, by putting commas between them, and having an array inside the tag. For example:

<var id="A, B, C">[1, 2, 3]</var>

will set A to 1, B to 2, and C to 3.

data-weight

If you add a data-weight variable inside your problem types, you can choose how often a certain problem type is chosen.

Example:

<div class="problems">
    <div id="cool-problem" data-weight="14.7">
      ...
    <div id="not-as-cool-problem" data-weight="1">
      ...
</div>

Here, cool-problem will be chosen 14.7 times as often as not-as-cool-problem will.