Upgrade webpack.

Summary:
I previously got this:

> npm ERR! peerinvalid The package webpack does not satisfy its siblings'
> peerDependencies requirements!
> npm ERR! peerinvalid Peer webpack-dev-server@1.4.7 wants webpack@1.x

The newest versions seem to work.

Test Plan: `make server` succeeds, the test page looks good at first glance

Reviewers: aria

Differential Revision: http://phabricator.khanacademy.org/D13519
Two or more characters you should never type in a comment def

Summary:
Well, any two characters, to be specific. I forgot a `+` in a
regex and defs only ignored trailing defs if the trailing def
had exactly one characer in the [definition name].

I also changed a `+` to a `*` so that links to `<>` go to ""
instead of "<".

Test Plan:
`make test`

Auditors: emily
Fix multiple-updating-of-numeric-inputs

Summary: Fixes T3257, in which we were inadvertently updating props by not-cloning when we should have. Also removed whitespace and called out some potentially deletable code.

Test Plan: Add multiple numeric inputs and notice that they don't all party-update anymore.

Reviewers: aria

Reviewed By: aria

Maniphest Tasks: T3257

Differential Revision: http://phabricator.khanacademy.org/D13736
Fix table widget grading that was broken in 216dbf3

Switching to using this.state.widgetInfo in the renderer exposed a bug where the table's propTransform was mutating the editor props, resulting in the "correct" answer being blank and therefore unanswerable.

Test Plan:
Answer [[ http://localhost:9000/test.html#content=%7B%22question%22%3A%7B%22content%22%3A%22You%20are%20given%20the%20following%20starting%20numbers%20and%20rules%20for%20two%20sequences%20of%20numbers%3A%5Cn%5CnSequence%20%24x%24%3A%20Starting%20number%3A%20%241%24%2C%20Rule%3A%20add%20%242%24%5Cn%5CnSequence%20%24y%24%3A%20Starting%20number%3A%20%244%24%2C%20Rule%3A%20add%20%248%24%5Cn%5Cn**Fill%20in%20the%20table%20with%20the%20first%20%243%24%20terms%20of%20%24x%24%20and%20%24y%24.%20Then%20plot%20the%20ordered%20pairs%20%24(x%2Cy)%24%20on%20the%20graph%20below%20by%20dragging%20the%20orange%20dots%20to%20the%20correct%20locations.**%20%20%5Cn%20%20%5Cn%5Cn%5B%5B%E2%98%83%20table%201%5D%5D%5Cn%5Cn%5B%5B%E2%98%83%20interactive-graph%201%5D%5D%5Cn%22%2C%22images%22%3A%7B%7D%2C%22widgets%22%3A%7B%22table%201%22%3A%7B%22type%22%3A%22table%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22rows%22%3A3%2C%22columns%22%3A2%2C%22answers%22%3A%5B%5B%221%22%2C%224%22%5D%2C%5B%223%22%2C%2212%22%5D%2C%5B%225%22%2C%2220%22%5D%5D%2C%22headers%22%3A%5B%22%24x%24%22%2C%22%24y%24%22%5D%7D%2C%22version%22%3A%7B%22major%22%3A0%2C%22minor%22%3A0%7D%7D%2C%22interactive-graph%201%22%3A%7B%22type%22%3A%22interactive-graph%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22step%22%3A%5B2%2C2%5D%2C%22backgroundImage%22%3A%7B%22url%22%3Anull%2C%22scale%22%3A1%2C%22bottom%22%3A0%2C%22left%22%3A0%7D%2C%22markings%22%3A%22graph%22%2C%22labels%22%3A%5B%22x%22%2C%22y%22%5D%2C%22showProtractor%22%3Afalse%2C%22showRuler%22%3Afalse%2C%22rulerLabel%22%3A%22%22%2C%22rulerTicks%22%3A10%2C%22range%22%3A%5B%5B-2%2C21%5D%2C%5B-2%2C21%5D%5D%2C%22gridStep%22%3A%5B1%2C1%5D%2C%22snapStep%22%3A%5B0.5%2C0.5%5D%2C%22graph%22%3A%7B%22type%22%3A%22point%22%2C%22numPoints%22%3A3%7D%2C%22correct%22%3A%7B%22type%22%3A%22point%22%2C%22numPoints%22%3A3%2C%22coords%22%3A%5B%5B1%2C4%5D%2C%5B3%2C12%5D%2C%5B5%2C20%5D%5D%7D%7D%2C%22version%22%3A%7B%22major%22%3A0%2C%22minor%22%3A0%7D%7D%7D%7D%2C%22answerArea%22%3A%7B%22type%22%3A%22multiple%22%2C%22options%22%3A%7B%22content%22%3A%22The%20terms%20in%20sequence%20%24y%24%20are%20%5B%5B%E2%98%83%20input-number%201%5D%5D%20times%20the%20terms%20in%20sequence%20%24x%24.%5Cn%5Cn%22%2C%22images%22%3A%7B%7D%2C%22widgets%22%3A%7B%22input-number%201%22%3A%7B%22type%22%3A%22input-number%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22value%22%3A%224%22%2C%22simplify%22%3A%22required%22%2C%22size%22%3A%22normal%22%2C%22inexact%22%3Afalse%2C%22maxError%22%3A0.1%2C%22answerType%22%3A%22number%22%7D%2C%22version%22%3A%7B%22major%22%3A0%2C%22minor%22%3A0%7D%7D%7D%7D%2C%22calculator%22%3Afalse%7D%2C%22itemDataVersion%22%3A%7B%22major%22%3A0%2C%22minor%22%3A1%7D%2C%22hints%22%3A%5B%7B%22content%22%3A%22Sequence%20%24x%24%3A%20Add%20%24%5C%5Cgreen2%24%5Cn%5Cn%24%5C%5Cqquad%5C%5Cbegin%7Balign%7D%5C%5Ctext%7BStarting%20term%7D%26%3A%20%5C%5Cblue1%5C%5C%5C%5C%5Cn%5C%5Ctext%7BTerm%202%7D%26%3A%5C%5Cblue1%2B%5C%5Cgreen2%3D%5C%5Cpink3%5C%5C%5C%5C%5Cn%5C%5Ctext%7BTerm%203%7D%26%3A%5C%5Cpink3%2B%5C%5Cgreen2%3D%5C%5Cpurple5%5C%5Cend%7Balign%7D%24%5Cn%5CnSequence%20%24y%24%3A%20Add%20%24%5C%5Cgray8%24%5Cn%5Cn%24%5C%5Cqquad%5C%5Cbegin%7Balign%7D%5C%5Ctext%7BStarting%20term%7D%26%3A%20%5C%5Cblue4%5C%5C%5C%5C%5Cn%5C%5Ctext%7BTerm%202%7D%26%3A%5C%5Cblue4%2B%5C%5Cgray8%3D%5C%5Cpink%7B12%7D%5C%5C%5C%5C%5Cn%5C%5Ctext%7BTerm%203%7D%26%3A%5C%5Cpink%7B12%7D%2B%5C%5Cgray8%3D%5C%5Cpurple%7B20%7D%5C%5Cend%7Balign%7D%24%5Cn%5Cn%5Cn%5Cn%22%2C%22images%22%3A%7B%7D%2C%22widgets%22%3A%7B%7D%7D%2C%7B%22content%22%3A%22The%20%20ordered%20pairs%20we%20want%20to%20plot%20are%20%24(%5C%5Cblue1%2C%5C%5Cblue4)%2C%20(%5C%5Cpink3%2C%5C%5Cpink%7B12%7D)%2C%20(%5C%5Cpurple5%2C%5C%5Cpurple%7B20%7D)%24.%20%5Cn%5Cn%24%5C%5Cbegin%7Balign%7D%5C%5Cblue1%5C%5Ctimes%5C%5Cgreen4%26%3D%5C%5Cblue4%5C%5C%5C%5C%5Cn%5C%5Cpink3%5C%5Ctimes%5C%5Cgreen4%26%3D%5C%5Cpink%7B12%7D%5C%5C%5C%5C%5Cn%5C%5Cpurple5%5C%5Ctimes%5C%5Cgreen4%26%3D%5C%5Cpurple%7B20%7D%5C%5Cend%7Balign%7D%24%5Cn%5CnSo%20the%20terms%20in%20sequence%20%24y%24%20are%20%24%5C%5Cgreen4%24%20times%20the%20terms%20in%20sequence%20%24x%24.%5Cn%22%2C%22images%22%3A%7B%7D%2C%22widgets%22%3A%7B%7D%7D%2C%7B%22content%22%3A%22Our%20table%20of%20values%20should%20look%20like%20this%3A%5Cn%5Cn%24x%24%20%7C%20%24y%24%20%5Cn-%20%7C%20-%20%7C%20-%5Cn%241%24%20%7C%20%244%24%20%5Cn%243%24%20%7C%20%2412%24%20%5Cn%245%24%20%7C%20%2420%24%5Cn%24%24%5Cn%5CnOur%20graph%20should%20look%20like%20this%3A%5Cn%5Cn!%5B%5D(https%3A%2F%2Fka-perseus-graphie.s3.amazonaws.com%2F577a4d31d20b2356e02accd0cef97710da966c90.png)%5Cn%5CnThe%20terms%20in%20sequence%20%24y%24%20are%20%244%24%20times%20the%20terms%20in%20sequence%20%24x%24.%22%2C%22images%22%3A%7B%22https%3A%2F%2Fka-perseus-graphie.s3.amazonaws.com%2F577a4d31d20b2356e02accd0cef97710da966c90.png%22%3A%7B%22width%22%3A416%2C%22height%22%3A416%7D%7D%2C%22widgets%22%3A%7B%7D%7D%5D%7D | this item ]], score it and see it's graded correctly.

Auditors: aria, michelle
Complete the mobile API for the current widgets.

Summary:
Add a markdown file documenting the mobile API. Ensure that all widgets
implement the API, and add support for the mobile API to the matrix and
number-line widgets.

Some involved changes:
 - I split the `focus` function with an optional path into the `focus` function
   (which should focus something in the element) and the `focusInputPath`
   function (which focuses the given path).
 - Removed the `getAcceptableFormatsForInputPath` function, because it isn't
   used by the mobile team, and it isn't clear exactly what it is supposed to
   return (`expression` returned null, `input-number` returned a list of stuff,
   some widgets didn't implement).
 - Messed with matrix's handling of focus and blur events, so that their calls
   to `this.props.onChange` work correctly regardless of the order they come in,
   and so that they don't trigger the focus being changed in weird places.

Test Plan:
 - Make sure `ack getAcceptableFormats` returns nothing
 - Set `staticRender: true` in test.html
 - Open a perseus test page, and add `expression`, `input-number`,
   `numeric-input`, `table`, `matrix`, `number-line`, `transformer`, and
   `simulator` widgets
   - Click the "show tick controller" checkbox on the number-line editor
   - Choose "formal without movement" for the transformer, and add a
     translation, rotation, reflection, and dilation on the transformer widget
   - Choose "percentage" for the simulator (so that we can set the value to
     something more than 1 and see it change)
 - Ensure that the APIOptions are followed by making sure all of the inputs are
   using `MathOutput` widgets
 - Ensure that all the API paths work:
   - Ensure `getInputPaths` works by running `itemRenderer.getInputPaths()`, and
     ensuring the returned list has the same length as the number of inputs on
     the page (should be 31 with the default values)
   - Ensure focus and blur events work by clicking on all inputs, and seeing
     that the `onFocusChange` events in the console get called with appropriate
     paths for all inputs
   - Ensure `focusInputPath` and `blurInputPath` works for all inputs by running:
```
var i = 0;
var focus = function() {
    var paths = itemRenderer.getInputPaths();
    if (i < paths.length) {
        var path = paths[i];
        itemRenderer.focusPath(path);
        setTimeout(unfocus, 500);
    }
};
var unfocus = function() {
    var path = itemRenderer.getInputPaths()[i];
    itemRenderer.blurPath(path);
    i++;
    setTimeout(focus, 500);
};
setTimeout(focus, 2000);
```
      - All the inputs should be focused and then unfocused in order (there
        isn't any visible change ATM, but the `onFocusChange` event should
        trigger for all events.
      - The matrix selection box should move appropriately according to which
        input is focused.
    - Ensure that `setInputValue` works for all inputs by running:
```
var paths = itemRenderer.getInputPaths();
for (var i = 0; i < paths.length; i++) {
    itemRenderer.setInputValue(paths[i], "" + i, false);
}
```
      - All of the inputs should have a different number in them.
      - No `onFocusChange` events should have been called.
    - Ensure that `getDOMNodeForPath` works for all inputs by running:
```
var paths = itemRenderer.getInputPaths();
for (var i = 0; i < paths.length; i++) {
    console.log(itemRenderer.getDOMNodeForPath(paths[i]));
}
```
      - 31 things should be printed to the console
      - Hovering over them in the chrome console should highlight all of the
        inputs in the exercise

Reviewers: michelle, aria, charlie

Reviewed By: aria

Subscribers: charlie

Differential Revision: http://phabricator.khanacademy.org/D13664
Pass width to the embed script

Summary:
We were only using width for the iframe style but not telling
the program about it. This tells the program about it.

Test Plan:
- Create a program that has println(width)
- Embed that program with Perseus widget with custom width
- See the println() show the correct width

Reviewers: aria

Reviewed By: aria

Subscribers: #perseus, #cs

Differential Revision: http://phabricator.khanacademy.org/D13844
Allow serialization of question state.

Summary:
This is needed by the SAT code to allow users to move forward and
backward through an exercise without losing their progress.

Test Plan:
Tested with my current SAT changes to allow forward and backward
navigation. Only tested with multiple choice questions at this time.

Reviewers: aria

Reviewed By: aria

Subscribers: dylan, #sat

Differential Revision: http://phabricator.khanacademy.org/D13740
You wouldn't believe what this commit put inside a widget

Summary:
Adds `Group` widgets, which group other widgets together
for the purposes of grading. This widget basically
consists of a renderer.

Test Plan:
 * Overall:
    * Make a group widget
    * Make an input-number in it
    * Try grading for different values
 * Mobile API:
    * Make an input-number outside the group
    * try switching focus between the inputs
    * verify that the onFocusChange results in the console make sense
    * set test.html's staticRender to true
    * call itemRenderer.focusInputPath on the command line and see
      that the onFocusChange output makes sense
    * call itemRenderer.setInputValue and see that the input inside
      the group has the new value
    * I didn't get getAcceptableFormatsForPath() or blur()
    * call itemRenderer.getInputPaths() and verify the result

Reviewers: emily

Reviewed By: emily

Subscribers: dylan

Differential Revision: http://phabricator.khanacademy.org/D13562
Widgets Exposed! See the renderer's revealing refactor

Summary:
Expose methods on Renderer and ItemRenderer for
returning a map of widget ids to scores.

Test Plan:
 * Make a renderer
 * add an input-number
 * try various types of grading
 * run `itemRenderer.scoreWidgets()["input-number 1"] in the console
 * `make test`

Reviewers: alex

Reviewed By: alex

Subscribers: johnsullivan, dylan

Differential Revision: http://phabricator.khanacademy.org/D13763
Can you figure out what this strange method does?

Summary:
Add the ability to intercept interWidgets calls in a renderer.
This allows parents of a renderer, such as the group widget,
to customize how interWidget communication happens within
their renderers.

The group widget here forwards interwidget communication
to the outer renderer if no matching widgets are found
inside the group widget.

Test Plan:
Visit [this
item](http://localhost:9000/test.html#content=%7B%22question%22%3A%7B%22content%22%3A%22%5B%5B%E2%98%83%20passage%202%5D%5D%5Cn%5Cn%5B%5B%E2%98%83%20group%201%5D%5D%22%2C%22images%22%3A%7B%22https%3A%2F%2Fka-perseus-graphie.s3.amazonaws.com%2Fda8df81c78b22f5c69d477d8eabfb583968eaf84.png%22%3A%7B%22width%22%3A400%2C%22height%22%3A70%7D%2C%22https%3A%2F%2Fka-perseus-graphie.s3.amazonaws.com%2Fb59fc02ca1aae800977b8793ed22f647a1aa75ee.png%22%3A%7B%22width%22%3A425%2C%22height%22%3A150%7D%7D%2C%22widgets%22%3A%7B%22passage%202%22%3A%7B%22type%22%3A%22passage%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22passageTitle%22%3A%22%22%2C%22passageText%22%3A%22Lorem%20Ipsum%20is%20%7B%7B__simply%20dummy%20text%20of%20the%20printing%20and%20typesetting%20industry.%20Lorem%20Ipsum%20has%20been%20the%20industry%27s%20standard%20dummy%20text%20ever%20since%20the%201500s__%7D%7D%2C%20when%20an%20unknown%20printer%20took%20a%20galley%20of%20type%20and%20scrambled%20it%20to%20make%20a%20type%20specimen%20book.%20It%20has%20survived%20not%20only%20five%20centuries%2C%20but%20also%20the%20leap%20into%20electronic%20typesetting%2C%20remaining%20essentially%20unchanged.%20It%20was%20popularised%20in%20the%201960s%20with%20the%20release%20of%20Letraset%20sheets%20containing%20Lorem%20Ipsum%20passages%2C%20and%20more%20recently%20with%20desktop%20publishing%20software%20like%20Aldus%20PageMaker%20including%20versions%20of%20Lorem%20Ipsum.%22%2C%22footnotes%22%3A%22%22%2C%22showLineNumbers%22%3Atrue%7D%2C%22version%22%3A%7B%22major%22%3A0%2C%22minor%22%3A0%7D%7D%2C%22group%201%22%3A%7B%22type%22%3A%22group%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22content%22%3A%22%5B%5B%E2%98%83%20passage-ref%201%5D%5D%22%2C%22images%22%3A%7B%7D%2C%22widgets%22%3A%7B%22passage-ref%201%22%3A%7B%22type%22%3A%22passage-ref%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22passageNumber%22%3A2%2C%22referenceNumber%22%3A1%7D%2C%22version%22%3A%7B%22major%22%3A0%2C%22minor%22%3A0%7D%7D%7D%7D%2C%22version%22%3A%7B%22major%22%3A0%2C%22minor%22%3A0%7D%7D%7D%7D%2C%22answerArea%22%3A%7B%22type%22%3A%22multiple%22%2C%22options%22%3A%7B%22content%22%3A%22%22%2C%22images%22%3A%7B%7D%2C%22widgets%22%3A%7B%7D%7D%2C%22calculator%22%3Afalse%7D%2C%22itemDataVersion%22%3A%7B%22major%22%3A0%2C%22minor%22%3A1%7D%2C%22hints%22%3A%5B%5D%7D),
which has a passage, a group, and a passage-ref inside the group,
and see that the passage-ref is working (which requires interWidgets
access to the passage widget).

Reviewers: alex

Reviewed By: alex

Subscribers: dylan

Differential Revision: http://phabricator.khanacademy.org/D13765
Add getGrammarTypeForPath mobile API

Summary:
Add an API endpoint for getting the grammar type that a widget should use on the
mobile app. Add documentation for how it works. Also, improve the documentation
for `getDOMNodeForPath` to match what we currently do (there's a fallback if it
isn't implemented).

Test Plan:
 - Enable staticRender on the testing perseus page
 - Make an item with all of the widgets that implement the mobile API
 - Turn on the tick controller on number-line, enable 'formal with movement' on
   the transformer and add one of each of the transformations.
 - Run
```
itemRenderer.getInputPaths().map(function(x) { return itemRenderer.getGrammarTypeForPath(x); })
```
   - See that it doesn't break
   - See that every item in the list that it returns is either `"expression"` or
     `"number"` (in particular, everything should be `"number"` except for the
     expression widget).

Reviewers: aria, charlie

Reviewed By: aria, charlie

Subscribers: charlie

Differential Revision: http://phabricator.khanacademy.org/D13846
Two shapes you never expected to see in a paragraph

Summary:
Add square and circle denotation marks to the passage widget.
This allows you to write `[[1]]` or `((2))` to get a square
or a circle marker in a passage

Test Plan:
Add a square and a circle marker to a passage widget in
localhost

Auditors: michelle
Three facts you probably knew about perseus grading

Summary:
Add documentation to some Renderer and ItemRenderer
functions.

Test Plan:
`#yolo`

Auditors: alex
This is bad but I'm shipping it anyways

Summary:
Add column support to perseus. Right now the output of this
is pretty atrocious, because we don't have reasonable CSS
for styling things and such.

Test Plan:
Type `=====` in test.html and put content in both columns
Inspect the elements to see that they were created correctly
(also try this before commenting out the css)

Auditors: johnsullivan
No one knew this insane widget existed. Now they don't know what it does.

Summary:
Add group widget to the widget dropdown.

Test Plan:
`#yolo`

okay actually i clicked the dropdown and added a group widget.
okay that didn't actually work.
but i restarted my server and then it did.
`#webpack`
5 catch phrases that are revolutionizing industry productivity

Summary:
Add titles and captions to the image widget.

Also change the css classNames from

    "perseus-image-widget" for the widget and
    "perseus-widget-image" for the editor

to

    "perseus-image-widget" for the widget and
    "perseus-image-editor" for the editor

Test Plan:
Add a title and a caption to the image:
[sample item](http://localhost:9000/test.html#content=%7B%22question%22%3A%7B%22content%22%3A%22%5B%5B%E2%98%83%20image%202%5D%5D%22%2C%22images%22%3A%7B%22https%3A%2F%2Fka-perseus-graphie.s3.amazonaws.com%2Fda8df81c78b22f5c69d477d8eabfb583968eaf84.png%22%3A%7B%22width%22%3A400%2C%22height%22%3A70%7D%2C%22https%3A%2F%2Fka-perseus-graphie.s3.amazonaws.com%2Fb59fc02ca1aae800977b8793ed22f647a1aa75ee.png%22%3A%7B%22width%22%3A425%2C%22height%22%3A150%7D%7D%2C%22widgets%22%3A%7B%22image%202%22%3A%7B%22type%22%3A%22image%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22range%22%3A%5B%5B0%2C10%5D%2C%5B0%2C10%5D%5D%2C%22box%22%3A%5B483%2C244%5D%2C%22backgroundImage%22%3A%7B%22url%22%3A%22https%3A%2F%2Fka-perseus-images.s3.amazonaws.com%2F2e21c4e47e946e0c7120fa2a94ade03c28ec3fb7.png%22%2C%22width%22%3A483%2C%22height%22%3A244%7D%2C%22labels%22%3A%5B%5D%2C%22title%22%3A%22Urban%20and%20Regional%20Planners%20%20%5CnPercent%20Increase%20in%20Employment%2C%20Projected%202010-2020%22%2C%22caption%22%3A%22Adapted%20from%20United%20States%20Bureau%20of%20Labor%20Statistics%2C%20Employment%20%5CnProjections%20Program.%20%E2%80%9CAll%20occupations%E2%80%9D%20includes%20all%20occupations%20in%20the%20%5CnUnited%20States%20economy.%22%7D%2C%22version%22%3A%7B%22major%22%3A0%2C%22minor%22%3A0%7D%7D%7D%7D%2C%22answerArea%22%3A%7B%22type%22%3A%22multiple%22%2C%22options%22%3A%7B%22content%22%3A%22%22%2C%22images%22%3A%7B%7D%2C%22widgets%22%3A%7B%7D%7D%2C%22calculator%22%3Afalse%7D%2C%22itemDataVersion%22%3A%7B%22major%22%3A0%2C%22minor%22%3A1%7D%2C%22hints%22%3A%5B%5D%7D)
I reloaded this item to test that those props got saved in the json

Auditors: michelle
One string that is definitely not a tag! probably.

Summary:
Adds an ApiOption for a "group metadata editor" which will
allow us to embed a tagger widget to tag groups inside
perseus items.

Specifying a custom `apiOption.GroupMetadataEditor` will allow
clients to supply a full React class that can handle rendering
and editing the metadata for a group in whatever way it
would like. We'll build a GroupTagEditor in webapp and inject
that into our perseus editor there so that content creators
can edit tags.

To do this I had to add threading of the apiOptions prop through
the various editors we have on the editor side of the page in
addition to the renderer side of the page.

Test Plan:
 * typed "hi" in the metadata field in test.html
 * used developer json mode to see that this string was
   persisted as the metadata.

Auditors: alex
Add Cam's extra buttons.

Summary:
1. This adds basic relations: =, <, >
2. And advanced relations: <>, <=, >=, ~
3. And the option to show a \div button in the basic button set.

Reviewers: alex

Reviewed By: alex

Subscribers: cameron, aria

Differential Revision: http://phabricator.khanacademy.org/D13786
Continue line numbers between passages

Summary:
We made it so that when you have multiple passages in a question the
line numbers in the second passage will start where the line numbers
in the first passage left off.

Test Plan:
Open this [item](http://localhost:9000/test.html#content=%7B%22question%22%3A%7B%22content%22%3A%22%5B%5B%E2%98%83%20passage%201%5D%5D%5Cn%5CnPassage%21%21%21%5Cn%5Cn%5B%5B%E2%98%83%20number-line%201%5D%5D%5Cn%5Cn%5Cn%5B%5B%E2%98%83%20passage%202%5D%5D%22%2C%22images%22%3A%7B%22https%3A%2F%2Fka-perseus-graphie.s3.amazonaws.com%2Fda8df81c78b22f5c69d477d8eabfb583968eaf84.png%22%3A%7B%22width%22%3A400%2C%22height%22%3A70%7D%2C%22https%3A%2F%2Fka-perseus-graphie.s3.amazonaws.com%2Fb59fc02ca1aae800977b8793ed22f647a1aa75ee.png%22%3A%7B%22width%22%3A425%2C%22height%22%3A150%7D%7D%2C%22widgets%22%3A%7B%22passage%201%22%3A%7B%22type%22%3A%22passage%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22passageTitle%22%3A%22%22%2C%22passageText%22%3A%22stry.%20Lorem%20Ipsum%20has%20been%20the%20industry%27s%20standard%20dummy%20text%20ever%20since%20the%201500s%2C%20when%20an%20unknown%20printer%20took%20a%20galley%20of%20type%20and%20scrambled%20it%20to%20make%20a%20type%20specimen%20book.%20It%20has%20survived%20not%20only%20five%20centuries%2C%20but%20also%20the%20leap%20into%20electronic%20typesetting%2C%20remaining%20essentially%20unchanged.%20It%20was%20popularised%20in%20the%201960s%20with%20the%20release%20of%20Letraset%20sheets%20containing%20Lorem%20Ipsum%20passages%2C%20and%20more%20recently%20with%20desktop%20publishing%20software%20like%20Aldus%20PageMaker%20including%20versions%20of%20Lorem%20Ipsum.%20asdmnad%2Casas%20a%20kjdsafdskjf%20kshfd%20askjdahfs%20ds%20sdkhfksj%20hs%20dfj%20hsfs%20dfkshdf%20s%5Cn%5CnIt%20is%20a%20long%20established%20fact%20that%20a%20reader%20will%20be%20distracted%20by%20the%20readable%20content%20of%20a%20page%20when%20looking%20at%20its%20layout.%20The%20point%20of%20using%20Lorem%20Ipsum%20is%20that%20it%20has%20a%20more-or-less%20normal%20distribution%20of%20letters%2C%20as%20opposed%20to%20using%20%27Content%20here%2C%20content%20here%27%2C%20making%20it%20look%20like%20readable%20English.%20Many%20desktop%20publishing%20packages%20and%20web%20page%20editors%20now%20use%20Lorem%20Ipsum%20as%20their%20default%20model%20text%2C%20and%20a%20search%20for%20%27lorem%20ipsum%27%20will%20uncover%20many%20web%20sites%20still%20in%20their%20infancy.%20Various%20versions%20have%20evolved%20over%20the%20years%2C%20sometimes%20by%20accident%2C%20sometimes%20on%20purpose%20%28injected%20humour%20and%20the%20like%29.%5Cn%22%2C%22footnotes%22%3A%22%22%2C%22showLineNumbers%22%3Atrue%7D%2C%22version%22%3A%7B%22major%22%3A0%2C%22minor%22%3A0%7D%7D%2C%22number-line%201%22%3A%7B%22type%22%3A%22number-line%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22range%22%3A%5B0%2C10%5D%2C%22labelRange%22%3A%5Bnull%2Cnull%5D%2C%22divisionRange%22%3A%5B1%2C12%5D%2C%22labelStyle%22%3A%22decimal%22%2C%22labelTicks%22%3Atrue%2C%22numDivisions%22%3A5%2C%22tickStep%22%3Anull%2C%22snapDivisions%22%3A2%2C%22correctRel%22%3A%22eq%22%2C%22correctX%22%3Anull%2C%22initialX%22%3Anull%7D%2C%22version%22%3A%7B%22major%22%3A0%2C%22minor%22%3A0%7D%7D%2C%22passage%202%22%3A%7B%22type%22%3A%22passage%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22passageTitle%22%3A%22%22%2C%22passageText%22%3A%22%5Cn%20%5CnContrary%20to%20popular%20belief%2C%20Lorem%20Ipsum%20is%20not%20simply%20random%20text.%20It%20has%20roots%20in%20a%20piece%20of%20classical%20Latin%20literature%20from%2045%20BC%2C%20making%20it%20over%202000%20years%20old.%20Richard%20McClintock%2C%20a%20Latin%20professor%20at%20Hampden-Sydney%20College%20in%20Virginia%2C%20looked%20up%20one%20of%20the%20more%20obscure%20Latin%20words%2C%20consectetur%2C%20from%20a%20Lorem%20Ipsum%20passage%2C%20and%20going%20through%20the%20cites%20of%20the%20word%20in%20classical%20literature%2C%20discovered%20the%20undoubtable%20source.%20Lorem%20Ipsum%20comes%20from%20sections%201.10.32%20and%201.10.33%20of%20%5C%22de%20Finibus%20Bonorum%20et%20Malorum%5C%22%20%28The%20Extremes%20of%20Good%20and%20Evil%29%20by%20Cicero%2C%20written%20in%2045%20BC.%20This%20book%20is%20a%20treatise%20on%20the%20theory%20of%20ethics%2C%20very%20popular%20during%22%2C%22footnotes%22%3A%22%22%2C%22showLineNumbers%22%3Atrue%7D%2C%22version%22%3A%7B%22major%22%3A0%2C%22minor%22%3A0%7D%7D%7D%7D%2C%22answerArea%22%3A%7B%22type%22%3A%22multiple%22%2C%22options%22%3A%7B%22content%22%3A%22%22%2C%22images%22%3A%7B%7D%2C%22widgets%22%3A%7B%7D%7D%2C%22calculator%22%3Afalse%7D%2C%22itemDataVersion%22%3A%7B%22major%22%3A0%2C%22minor%22%3A1%7D%2C%22hints%22%3A%5B%5D%7D)
Note that the line numbers update when you update the passages, and
that you are able to add widgets and other content in between passages.

Reviewers: aria

Reviewed By: aria

Differential Revision: http://phabricator.khanacademy.org/D13918
No one thought we could create widgets this way. Then this happened.

Summary:
Adds a silly shorthand syntax for passage-refs in radios, and
adds the appropriate interwidget communication so that they
work.

This is a hacky way to do this. There are potentially better
ways to do this but they involve a large amount of renderer
refactoring, and while I would like to do them I don't have
time yet. The syntax can be the same later. But I think it's
more valuable to get this out and change it later if
necessary :(.

Test Plan:
Visit [this item](http://localhost:9000/test.html#content=%7B%22question%22%3A%7B%22content%22%3A%22%5B%5B%E2%98%83%20passage%202%5D%5D%5Cn%5Cn%5B%5B%E2%98%83%20group%201%5D%5D%22%2C%22images%22%3A%7B%22https%3A%2F%2Fka-perseus-graphie.s3.amazonaws.com%2Fda8df81c78b22f5c69d477d8eabfb583968eaf84.png%22%3A%7B%22width%22%3A400%2C%22height%22%3A70%7D%2C%22https%3A%2F%2Fka-perseus-graphie.s3.amazonaws.com%2Fb59fc02ca1aae800977b8793ed22f647a1aa75ee.png%22%3A%7B%22width%22%3A425%2C%22height%22%3A150%7D%7D%2C%22widgets%22%3A%7B%22passage%202%22%3A%7B%22type%22%3A%22passage%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22passageTitle%22%3A%22%22%2C%22passageText%22%3A%22Lorem%20Ipsum%20is%20%7B%7B__simply%20dummy%20text%20of%20the%20printing%20and%20typesetting%20industry.%20Lorem%20Ipsum%20has%20been%20the%20industry%27s%20standard%20dummy%20text%20ever%20since%20the%201500s__%7D%7D%2C%20when%20an%20unknown%20printer%20took%20a%20galley%20of%20type%20and%20scrambled%20it%20to%20make%20a%20type%20specimen%20book.%20It%20has%20survived%20not%20only%20five%20centuries%2C%20but%20also%20the%20leap%20into%20electronic%20typesetting%2C%20remaining%20essentially%20unchanged.%20It%20was%20popularised%20in%20the%201960s%20with%20the%20release%20of%20Letraset%20sheets%20containing%20Lorem%20Ipsum%20passages%2C%20and%20more%20recently%20with%20desktop%20publishing%20software%20like%20Aldus%20PageMaker%20including%20versions%20of%20Lorem%20Ipsum.%22%2C%22footnotes%22%3A%22%22%2C%22showLineNumbers%22%3Atrue%7D%2C%22version%22%3A%7B%22major%22%3A0%2C%22minor%22%3A0%7D%7D%2C%22group%201%22%3A%7B%22type%22%3A%22group%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22content%22%3A%22%5B%5B%E2%98%83%20radio%201%5D%5D%22%2C%22images%22%3A%7B%7D%2C%22widgets%22%3A%7B%22radio%201%22%3A%7B%22type%22%3A%22radio%22%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22choices%22%3A%5B%7B%22content%22%3A%22%7B%7Bpassage-ref%202%201%7D%7D%22%2C%22correct%22%3Atrue%7D%2C%7B%22correct%22%3Afalse%7D%5D%2C%22randomize%22%3Afalse%2C%22multipleSelect%22%3Afalse%2C%22displayCount%22%3Anull%2C%22noneOfTheAbove%22%3Afalse%2C%22onePerLine%22%3Atrue%7D%2C%22version%22%3A%7B%22major%22%3A0%2C%22minor%22%3A0%7D%7D%7D%7D%2C%22version%22%3A%7B%22major%22%3A0%2C%22minor%22%3A0%7D%7D%7D%7D%2C%22answerArea%22%3A%7B%22type%22%3A%22multiple%22%2C%22options%22%3A%7B%22content%22%3A%22%22%2C%22images%22%3A%7B%7D%2C%22widgets%22%3A%7B%7D%7D%2C%22calculator%22%3Afalse%7D%2C%22itemDataVersion%22%3A%7B%22major%22%3A0%2C%22minor%22%3A1%7D%2C%22hints%22%3A%5B%5D%7D)
which features a passage-ref inside a group inside the renderer.

See that the passage-ref's line numbers are correct.

Reviewers: michelle

Reviewed By: michelle

Subscribers: alpert, alex, dylan

Differential Revision: http://phabricator.khanacademy.org/D13766