Skip to content
Commits on Jan 27, 2016
  1. @alopatin

    Properly clean up after a problem when using interfaceFunctions

    alopatin committed
    Not having this line was causing a bug in webapp where a new
    ItemRenderer was being added to the page every time you advanced
    to the next question, and each one wanted to try and control the
    same DOM nodes (this didn't work out very well).
    
    Test Plan:
    In webapp, skip questions while keeping an eye on the React dev tools.
    Note that additional ItemRenderer instances are no longer being added.
    
    Auditors: michelle
Commits on Jan 21, 2016
  1. @allofthenorthwood

    Add callbacks for state change in ExerciseProblemTemplate (Bibliotron…

    allofthenorthwood committed
    … Execises part 8b)
    
    Summary:
    This sets us up to mimic all the DOM-manipulations that are triggered in khan-exercises/interface.js in React using callbacks.
    
    Also see the corresponding diff in webapp, D24807.
    
    Test Plan:
    Test that exercises in Bibliotron and non-Bibliotron still function correctly. (e.g. http://localhost:8080/science/physics/forces-newtons-laws/newtons-laws-of-motion/e/newtons-third-law).
    
    I also set up console logs in each of the functions to check that they're called properly since the visual changes will be hooked up in a later diff.
    
    Reviewers: benjaminpollack
    
    Subscribers: #bibliotron
    
    Differential Revision: https://phabricator.khanacademy.org/D24808
Commits on Jan 20, 2016
  1. @allofthenorthwood
  2. @allofthenorthwood

    Expose checkAnswer, skipQuestion, gotoNextProblem, and showHint to we…

    allofthenorthwood committed
    …bapp (Bibliotron Exercises part 7b)
    
    Summary: See corresponding diff in webapp D24765
    
    Test Plan:
    Click the buttons! They do things!!!
    {F234242}
    {F234243}
    
    Reviewers: benjaminpollack
    
    Reviewed By: benjaminpollack
    
    Subscribers: #bibliotron
    
    Differential Revision: https://phabricator.khanacademy.org/D24766
  3. @allofthenorthwood

    Pass a flag to problemTemplateRendered to skip DOM manipulation (Bibl…

    allofthenorthwood committed
    …iotron Exercises part 5b)
    
    Test Plan: In conjunction with the associated webapp diff (D24762) check that exercises load in both Bibliotron and not-Bibliotron (e.g. http://localhost:8080/science/physics/one-dimensional-motion/skill-check-for-one-dimensional-motion/e/one-dimensional-motion-skill-check) and that in not-Bibliotron the happy face shows up when you get the answer right.
    
    Reviewers: benjaminpollack
    
    Reviewed By: benjaminpollack
    
    Subscribers: #bibliotron
    
    Differential Revision: https://phabricator.khanacademy.org/D24763
Commits on Jan 15, 2016
  1. @jaredly

    Add imperative `showHint(hintNumber)` function

    jaredly committed
    Summary:
    This allows a client "showHint" call to be idempotent, and also to receive
    direct feedback as to whether the hint was successfully shown.
    
    Test Plan: This is a minimal change, and there's no testing setup for interface.js :( but you can smoke test by doing `python -mSimpleHTTPServer` and `open http://localhost:8000/exercises/subtraction_within_100.html`
    
    Reviewers: charlie, johnsullivan
    
    Reviewed By: johnsullivan
    
    Differential Revision: https://phabricator.khanacademy.org/D24504
Commits on Jan 12, 2016
  1. @jaredly

    Allow clients to interact imperatively w/ interface.js (starting with…

    jaredly committed
    … handleAttempt)
    
    Summary:
    This adds `Exercises.imperativeAPI.handleAttempt(options)`, which returns an
    object with all the information a client needs to know about the attempt.
    
    This can be used as an alternative to the current event-based approach, where
    a client calls `$('#check-answer-button').click()` and listens for
    `attemptMessageShown` and `checkAnswer` events.
    
    (john I'm putting you on b/c it looks like you've done things in khan-exercises recently. feel free to ignore if you like)
    
    Test Plan:
    `python -mSimpleHTTPServer` and `open http://localhost:8000/exercises/subtraction_3.html`
    
    - answer correctly, take hints, answer incorrectly, etc.
    
    Reviewers: charlie, johnsullivan
    
    Reviewed By: charlie, johnsullivan
    
    Subscribers: benkomalo
    
    Differential Revision: https://phabricator.khanacademy.org/D24480
Commits on Jan 11, 2016
  1. @jdan

    Prevent race condition in calculator modules

    jdan committed
    Summary:
    Our screenshot cron job is failing because of page errors like: http://sandcastle.kasandbox.org/media/castles/Khan:master/exercises/addition_1.html?debug&seed=31
    
    The problem is that `Calculator` is not defined when `init-calculator.js` is
    invoked. This is because we need `genfiles/calculator.js` to first be loaded,
    but in D24396 I unfortunately listed the dependencies in a single array:
    
        require(["./genfiles/calculator.js", "./utils/init-calculator.js"], function() {
            Calculator.init();
        });
    
    Which does not guarantee that they are loaded in order. Instead, I now nest them.
    
        require(["./genfiles/calculator.js"], function() {
            require(["./utils/init-calculator.js"], function() {
                Calculator.init();
            });
        });
    
    There is a better way to do this with requirejs configs but I do not believe it
    is necessary.
    
    Test Plan:
    I inserted a breakpoint just before this line on `khan-exercise.js` in http://sandcastle.kasandbox.org/media/castles/Khan:master/exercises/addition_1.html?debug&seed=31, then modified the code to use the nested require statements.
    Doing so reliably prevented the console errors.
    
    Reviewers: benjaminpollack, eater
    
    Reviewed By: eater
    
    Subscribers: #bibliotron
    
    Differential Revision: https://phabricator.khanacademy.org/D24511
Commits on Jan 8, 2016
  1. @jdan

    Refactored calculator UI code to a separate module

    jdan committed
    Summary:
    https://app.asana.com/0/75463145497297/76446024361663
    
    This changeset moves the code to initialize the calculator into its own module.
    We do this so that we can access this code separate from all of khan-exercises.
    Specifically, we'll be rendering calculators on the fly in the new bibliotron
    exercise pages, and need to wire up the events accordingly.
    
    The implementation of this code in webapp currently resembles the following,
    but it is not yet up for review:
    
    ```
    const React = require("react");
    const calculatorTemplate = require("../../exercises-package/calculator.handlebars");
    
    require("../../../khan-exercises/genfiles/calculator.js");
    require("../../../khan-exercises/utils/init-calculator.js");
    
    module.exports = React.createClass({
        componentDidMount: function() {
            Calculator.init();
        },
    
        render: function() {
            return <div
                dangerouslySetInnerHTML={{__html: calculatorTemplate()}}
            />;
        },
    });
    ```
    
    Specifically, we require two files from khan-exercises, which create a
    `Calculator` global and attach an `init` function to it. We can call this
    `init` from `componentDidMount`.
    
    Test Plan:
    * python -m SimpleHTTPServer
    * http://localhost:8080/exercises/standard_deviation.html
    * Verify the calculator works
    
    Reviewers: michelle, emily, benjaminpollack
    
    Reviewed By: benjaminpollack
    
    Subscribers: jlfwong, #bibliotron
    
    Differential Revision: https://phabricator.khanacademy.org/D24396
  2. @jdan

    Make sure a string is passed into JSON.parseString

    jdan committed
    Summary:
    In D23651 we added a try/catch to remedy a strange localStorage bug. In
    doing so we accidentally removed some code to make sure we were passing a
    string to JSON.parseString.
    
    This bit of code adds it back, and also contains the output of `make genfiles/calculator.js`.
    
    Test Plan:
    * python -m SimpleHTTPServer
    * http://localhost:8000/exercises/standard_deviation.html
    * Verify the calculator works
    
    Reviewers: benjaminpollack
    
    Reviewed By: benjaminpollack
    
    Subscribers: eater
    
    Differential Revision: https://phabricator.khanacademy.org/D24433
Commits on Dec 21, 2015
  1. @brownhead

    Enable anti-cheating code.

    brownhead committed
    Summary:
    Ticket: https://app.asana.com/0/27216215224639/49826201680046
    
    This change fully-enables the anti-cheating code we implemented some
    time ago. We ran into very problematic errors before, so we rolled it
    back. After making fixes, I pushed a "monitoring-only" version of the
    change that only reported whenever it detected cheating, rather than
    actually preventing the cheating.
    
    After looking at this monitoring-only version, I've decided that the
    change looks safe to deploy for real :).
    
    Test Plan:
    1) Go to /math/early-math/cc-early-math-add-sub-basics/cc-early-math-add-subtract-10/e/addition-and-subtraction-within-10
    2) Disconnect from the internet
    3) Take a hint
    4) Refresh to get blank page
    5) Reconnect
    6) Refresh to get real page
    7) See that you still have a hint taken
    
    Reviewers: benkraft
    
    Subscribers: eliana
    
    Differential Revision: https://phabricator.khanacademy.org/D24249
Commits on Dec 17, 2015
  1. @tzjames

    Differentiate between error types when failing to load an exercise.

    tzjames committed
    Summary:
    We used to only blame the user's internet.  But it seems sometimes it is
    our fault too.  So now we differentitate between the different errors,
    to be less confusing to users whose internet is not to blame, and to
    help devs debug any particular issue based upon what our users report.
    
    This is to fix: https://app.asana.com/0/27216215224639/71186369010999
    
    Test Plan:
    git grep warnTimeout
    see that we weren't using this anywhere else.
    
    on dev khan exercise files if they exist get served directly.  So to test we
    can change the name so that it uses the exercises/handler_raw.py.
    ```
    diff --git a/khan-exercise.js b/khan-exercise.js
    index 8a9bcfd..eb048c3 100644
    --- a/khan-exercise.js
    +++ b/khan-exercise.js
    @@ -2048,7 +2048,7 @@ function loadExercise(exerciseId, fileName) {
    
         debugLog("loadExercise start " + fileName);
         // Packing occurs on the server but at the same "exercises/" URL
    -    $.get(urlBase + "exercises/" + fileName).done(function(data) {
    +    $.ajax({url:urlBase + "exercises/Z" + fileName, timeout:1000}).done(function(data) {
             debugLog("loadExercise got " + fileName);
    
             // Get rid of any external scripts in data before we shove data
    ```
    http://www.khanacademy.dev/math/arithmetic/addition-subtraction/basic_addition/e/addition_1
    See 404 message.
    
    Then in webapp:
    ```
    diff --git a/exercises/handler_raw.py b/exercises/handler_raw.py
    index 5aa90bd..03a1c8f 100644
    --- a/exercises/handler_raw.py
    +++ b/exercises/handler_raw.py
    @@ -17,6 +17,8 @@ class RawExercise(request_handler.RequestHandler):
             would also cause problems for the a/b tests in
             exercises.file_experiments.
             """
    +        import time
    +        time.sleep(5000)
             path = self.request.path
             filename = urllib.unquote(path.split('/', 3)[3])
    ```
    http://www.khanacademy.dev/math/arithmetic/addition-subtraction/basic_addition/e/addition_1
    See timeout message.
    
    Then in webapp:
    ```
    diff --git a/exercises/handler_raw.py b/exercises/handler_raw.py
    index 5aa90bd..9e1728a 100644
    --- a/exercises/handler_raw.py
    +++ b/exercises/handler_raw.py
    @@ -17,6 +17,7 @@ class RawExercise(request_handler.RequestHandler):
             would also cause problems for the a/b tests in
             exercises.file_experiments.
             """
    +        1/0
             path = self.request.path
             filename = urllib.unquote(path.split('/', 3)[3])
    ```
    
    See the generic error message.
    
    Then in javascript console do:
    MathJax.Ajax.Require("some.js")
    
    See the MathJax error message mentioning some.js.
    
    Reviewers: emily, lauren
    
    Subscribers: kevindangoor
    
    Differential Revision: https://phabricator.khanacademy.org/D24180
Commits on Dec 15, 2015
  1. @beneater

    Don't point people to GitHub to report content issues

    beneater committed
    Summary:
    When users report an issue with an exercise, that issue report generally gets
    automatically sent to JIRA where the content team goes through and resolves
    any legitimate content problems. Previously if communication with JIRA failed,
    we'd ask users to submit an issue report to GitHub instead. Unfortunately as
    the content team has grown and evolved, they're relying soley on JIRA and not
    looking at GitHub anymore. Consequently, we shouldn't ask users to file issues
    there as it will simply be a waste of their time. Instead if JIRA fails, we
    should simply thank them for their feedback.
    
    Of course if JIRA fails, this means their feedback has gone into a black hole
    never to be seen again :(. For now, we're okay with that because any legitimate
    problem with an exercise will elicit scores (or even hundreds) of similar issue
    reports, so we don't expect this'll mean we miss out on anything.
    
    Test Plan:
    Modify `issue_reporting.py` to always return an error:
    ```
     def do_post(handler, url, data, headers):
    +    handler.response.set_status(500)
    +    return
    ```
    
    Loaded an exercise page (e.g., `/e/addition_1`) and reported an error. Upon submitting, saw the helpful "Thank you for your feedback!" message and saw a 500 error in the network panel for the /jirapost POST.
    
    Reviewers: johnsullivan
    
    Reviewed By: johnsullivan
    
    Differential Revision: https://phabricator.khanacademy.org/D23543
Commits on Dec 11, 2015
  1. @crm416

    Explicitly require base modules

    crm416 committed
    Summary:
    Dynamically requiring the base modules makes their necessity undetectable by JavaScript bundlers.
    This diff separates the loading of the base modules from the dynamic loading of other exercise-
    specific modules and makes the loading of the base modules include explicit string-based "require"
    calls.
    
    Some additional context: On Android, we want to try and bundle the necessary assets from
    khan-exercises so that we can slim down our app, and it'd be preferable to have these dependencies
    made explicit by khan-exercises, rather than, e.g., configuring RequireJS to load the base modules
    from a configuration file in the Android repo.
    
    Test Plan:
    - Run khan-exercises (`python -m SimpleHTTPServer`).
    - Load an exercise.
    - Verify that there are no JS errors, and that the exercise loads sanely.
    - Complete the problem, and verify that the next problem loads sanely.
    
    Reviewers: eater, emily
    
    Reviewed By: emily
    
    Subscribers: benkomalo
    
    Differential Revision: https://phabricator.khanacademy.org/D23838
Commits on Dec 8, 2015
  1. @brownhead

    Answer major question in README.

    brownhead committed
    This answers the three questions laid out in the community lead handbook:
    
    * What should I do if I found a bug?
    * What should I do if I have a question?
    * What should I do if I want to contribute time to this project?
    
    Test Plan:
    Use GitHub's preview tab to ensure the Markdown is valid.
Commits on Nov 30, 2015
  1. @bpollack

    Do not assume window.localStorage's presence implies usability

    bpollack committed
    Summary:
    This commit is almost entirely a source-code comment; please see the
    comment for further details.
    
    Fixes https://app.asana.com/0/42800146980907/60752524596017
    
    Test Plan: Repro'd in IE11, verified this fix allows getting past the exact issue specified in the original Asana ticket, then made a huge comment and hoped for the best.
    
    Reviewers: amy, eliana, jordan, kevindangoor
    
    Reviewed By: kevindangoor
    
    Subscribers: kevindangoor, #support
    
    Differential Revision: https://phabricator.khanacademy.org/D23651
Commits on Nov 24, 2015
  1. @brownhead

    Reintroduce offline cheating detection.

    brownhead committed
    Summary:
    We removed the offline cheating detection because it was misfiring too
    often. I've come up with two potential causes of this misfiring and
    fixed both of them:
    
    1) We were not keying the `OfflineHintRecord` on the user ID (doh).
    2) We were not checking the the `userExercise` object had a name (when
       content creators look at a preview in Perseus One the exercise
       name will be undefined).
    
    Because the symptoms of this bug are somewhat severe (students being
    unable to get X in a row succsefully) I'm rolling this out tentatively.
    Every time we detect cheating, we'll send a message to the server that
    will make its way into our logs. I'll look at the frequency of these
    logs, as well as the percentage of coached users (most likely to cheat)
    that are caught with this, to see if the code is working or not.
    
    Test Plan:
    1) Open up any exercise.
    2) Disconnect from the internet or kill your app server.
    3) Take a hint.
    4) Close the tab (or refresh to get a blank screen)
    5) Reconnect or bring back up your app server
    6) See no hints, but see that the added Ajax request fired succesfully.
    
    Reviewers: eliana
    
    Reviewed By: eliana
    
    Subscribers: #sat
    
    Differential Revision: https://phabricator.khanacademy.org/D22672
Commits on Nov 20, 2015
  1. @brownhead

    Merge pull request #161545 from Khan/brownhead-update-readme

    brownhead committed
    Cleanup README and make status clearer.
Commits on Nov 16, 2015
  1. @jeresig

    Add some text to ellipse_intuition to help explain the exercise better.

    jeresig committed
    Summary:
    This is a follow-up to:
    https://app.asana.com/0/27216215224639/61584404026126
    
    It adds in some helpful, explanatory, text to the exercise.
    
    Test Plan:
    Load up the exercise, e.g.:
    http://localhost/khan-webapp/khan-exercises/exercises/ellipse_intuition.html
    
    See that it looks ok:
    {F207127}
    
    Reviewers: emily, csilvers
    
    Reviewed By: csilvers
    
    Subscribers: csilvers
    
    Differential Revision: https://phabricator.khanacademy.org/D23298
Commits on Nov 14, 2015
  1. @brownhead

    Cleanup README and make status clearer.

    brownhead committed
    This makes the purpose of the repo a little clearer, but there's still
    more work to be done around defining the kinds of contributions we
    want.
    
    Test Plan:
    None
Commits on Nov 12, 2015
  1. @jeresig

    Merge pull request #161539 from Christi/patch-1

    jeresig committed
    Update division 1.5 to remove 2 digit divisors...
Commits on Nov 9, 2015
  1. @Christi

    Update division 1.5 to remove 2 digit divisors...

    Christi committed
    Should satisfy the request under https://app.asana.com/0/27216215224639/61298094679643.
    
    Removes all 2 digit divisors and adds 4 digit divisors.
Commits on Nov 7, 2015
  1. @brownhead

    Merge pull request #161433 from rhc2104/patch-1

    brownhead committed
    Update copyright on README
  2. @brownhead

    Merge pull request #161495 from mankal111/master

    brownhead committed
    Change equal sign to approx if MEAN is rounded
  3. @csilvers

    Add support for two new problem-error types.

    csilvers committed
    Summary:
    In a separate commit (in webapp), we are going to change the options
    that we show when you click on 'report a problem' at the bottom-right
    of pages like
       https://es.khanacademy.org/math/trigonometry/less-basic-trigonometry/law-sines-cosines/e/law_of_sines
    
    This handles the backend (khan-exercises) support for this: Mapping
    the new options (indexed by element-id) to the jira name we use for
    them, and to the placeholder text we associate with them.
    
    Test Plan:
    Fingers crossed -- I don't know how to test this until the webapp
    changes are in too, and everything is deployed!
    
    Reviewers: eater
    
    Reviewed By: eater
    
    Subscribers: cameron
    
    Differential Revision: https://phabricator.khanacademy.org/D23140
Commits on Nov 5, 2015
  1. @petercollingridge

    Add missing apostrophe

    petercollingridge committed
    Summary: This is basically the same as https://phabricator.khanacademy.org/D22339 but that wouldn't merge since this i18n thingy has changed. It seemed easiest to make a new branch.
    
    Reviewers: eater
    
    Reviewed By: eater
    
    Differential Revision: https://phabricator.khanacademy.org/D23052
Commits on Nov 4, 2015
  1. @petercollingridge

    Change histogram to dotplot

    petercollingridge committed
    Summary: Reword question description and make number mathy. For https://khanacademy.atlassian.net/browse/AI-962752
    
    Reviewers: emily, eater
    
    Reviewed By: eater
    
    Differential Revision: https://phabricator.khanacademy.org/D22338
  2. @petercollingridge

    Reword question

    petercollingridge committed
    Summary:
    I don't know how worthwhile these changes are, but they do make the questions better.
    Slightly reword question. https://khanacademy.atlassian.net/browse/AI-976986
    
    Reviewers: emily, eater
    
    Reviewed By: eater
    
    Differential Revision: https://phabricator.khanacademy.org/D22337
  3. @petercollingridge

    Make coordinate plural

    petercollingridge committed
    Summary: For https://khanacademy.atlassian.net/browse/AI-922263
    
    Reviewers: emily, eater
    
    Reviewed By: eater
    
    Differential Revision: https://phabricator.khanacademy.org/D22340
Commits on Oct 29, 2015
  1. @csilvers

    Update khan-exercises to remove all references to Jed.

    csilvers committed
    As of D22753, i18n.js doesn't use Jed anymore!  Nothing else does
    either.  So we can remove it.
    
    I did this by running update_local.sh and then running `git grep -iw
    jed` and deleting all references.
    
    Auditors: john
    
    Test Plan:
    Ran
       python -mSimpleHTTPServer
    and visited
       http://localhost:8000/exercises/absolute_value.html
    and saw it load correctly.  There's no easy way to check i18n from the
    local-server, so I'll check it once I update webapp with this.
  2. @alopatin

    Fix $_ in local i18n.js so that Perseus can use it when running locally

    alopatin committed
    Summary:
    /local-only/i18n.js defined window.$_ using an unspecified reference to
    createFragment, which didn't cause an error when testing locally because
    khan-exercises doesn't include any React code. However, the same local
    javscript file is used when running Perseus locally - and Perseus uses
    $_ all over the place.
    
    Test Plan:
    I ran ./local-only/update-local.sh as part of this commit. Since the
    newest i18n.js no longer exports $._ I grepped to make sure it was no
    longer used in any exercise/util:
    grep -E '(jQuery|\$)\._\(|(jQuery|\$)\.ngettext|(jQuery|\$)\.i18nDoNotTranslate' -r .
    
    make lint
    python build/lint_i18n_strings_test.py
    
    make pack
    Checked that both [unpacked](http://localhost:8000/exercises/decimals_on_the_number_line_1.html) and [packed](http://localhost:8000/exercises-packed/decimals_on_the_number_line_1.html?lang=es) exercises work
    
    Updated the khan-exercises submodule in the Perseus repo and verified
    that [widgets using $_](http://localhost:9000/test.html#content=%7B%22question%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%22alignment%22%3A%22default%22%2C%22static%22%3Afalse%2C%22graded%22%3Atrue%2C%22options%22%3A%7B%22choices%22%3A%5B%7B%7D%2C%7B%7D%5D%2C%22randomize%22%3Afalse%2C%22multipleSelect%22%3Afalse%2C%22displayCount%22%3Anull%2C%22hasNoneOfTheAbove%22%3Afalse%2C%22onePerLine%22%3Atrue%2C%22deselectEnabled%22%3Afalse%7D%2C%22version%22%3A%7B%22major%22%3A1%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%2C%22periodicTable%22%3Afalse%7D%2C%22itemDataVersion%22%3A%7B%22major%22%3A0%2C%22minor%22%3A1%7D%2C%22hints%22%3A%5B%5D%7D) render properly.
    
    Reviewers: csilvers
    
    Reviewed By: csilvers
    
    Differential Revision: https://phabricator.khanacademy.org/D22830
Commits on Oct 22, 2015
  1. @csilvers

    Simplify the local-only script since i18n.js already defines window.i…

    csilvers committed
    …18n.
    
    Summary:
    Now the 'local' version of i18n.js (used for local testing) is more
    similar to the 'real' version from webapp (used in prod).
    
    I ran update_local.sh, which also picked up some khan-site.css
    changes.  I guess our css has gotten simpler!
    
    Test Plan:
    Ran
       python -mSimpleHTTPServer
    and visited
       http://localhost:8000/exercises-packed/adding_decimals.html
    and saw it render without error.
    
    Reviewers: john
    
    Reviewed By: john
    
    Subscribers: emily
    
    Differential Revision: https://phabricator.khanacademy.org/D22651
  2. @csilvers

    Change from $._ and $.ngettext over to i18n._ and i18n.ngettext.

    csilvers committed
    Summary:
    With D22593 and followups, we can now move from $._ to i18n._,
    removing an (arbitrary) dependence of translation code on jquery.
    
    This is a mostly-automated process: .  First I found files that use $._
    and changed them to i18n._.  Then I added the necessary require lines,
    either reusing an existing require of i18n.js if it exists, or adding
    a new one if it didn't:
    
        git grep -l '$\._(' | xargs perl -pli -e 's/\$\._/i18n._/g'
        git grep -l '$\.ngettext(' | xargs perl -pli -e 's/\$\.ngettext/i18n.ngettext/g'
    
    I then cleaned up lint_i18n_strings.py, particularly
    StringInVarFilter.
    
    I also had to add 'no-undef' eslint directives to a bunch of files,
    since khan-exercises doesn't have a proper require() system, and
    depends on i18n being a global.
    
    Test Plan:
    build/lint_i18n_strings_test.py
    
    Ran
       python -mSimpleHTTPServer
    and visited
       http://localhost:8000/exercises-packed/adding_decimals.html
    and saw it render properly.
    
    Reviewers: john
    
    Reviewed By: john
    
    Subscribers: emily
    
    Differential Revision: https://phabricator.khanacademy.org/D22647
  3. @csilvers

    Copy over an ES5-compatible version of i18n.js.

    csilvers committed
    It turns out that some of the tests in khan-exercises use phantomjs,
    which doesn't know about all those cool new ES6/7 features.  Luckily,
    we have a transpiled version of i18n.js around to use instead.  So
    let's.
    
    Auditors: jlfwong
    
    Test Plan:
    phantomjs test/runner.js test/index.html
Commits on Oct 21, 2015
  1. @csilvers

    Update the local files, and update the local script as well.

    csilvers committed
    i18n.js has been rewritten a lot since the last time we updated locals
    (in mid-2014).  In particular it now uses our new build scheme with
    require lines and module.exports and a bunch of other stuff
    khan-exercises doesn't like.  This massages things so they work
    again.  It's fragile, but working!
    
    Auditors: jlfwong
    
    Test Plan:
    Ran
       python -mSimpleHTTPServer
    and visited
       http://localhost:8000/exercises-packed/adding_decimals.html?lang=es
    and saw it render properly.
Something went wrong with that request. Please try again.