Skip to content
Commits on Nov 14, 2015
  1. @brownhead

    Cleanup README and make status clearer.

    brownhead committed Nov 13, 2015
    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 Nov 12, 2015
    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 Nov 8, 2015
    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 Nov 7, 2015
    Update copyright on README
  2. @brownhead

    Merge pull request #161495 from mankal111/master

    brownhead committed Nov 7, 2015
    Change equal sign to approx if MEAN is rounded
  3. @csilvers

    Add support for two new problem-error types.

    csilvers committed Nov 6, 2015
    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 Nov 4, 2015
    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 Oct 11, 2015
    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 Oct 11, 2015
    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 Oct 11, 2015
    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 Oct 29, 2015
    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 Oct 28, 2015
    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 Oct 22, 2015
    …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 Oct 22, 2015
    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 Oct 21, 2015
    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 Oct 21, 2015
    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.
Commits on Oct 13, 2015
  1. @csilvers
  2. @csilvers

    Add a bunch of eslint-disable comments for legacy code.

    csilvers committed Oct 13, 2015
    Summary:
    We're introducing a new, stricter js/jsx linter in the khan-linter
    repo: eslint.  It has a bunch of rules to enforce our style guide,
    that the old jshint did not have.  But most legacy code doesn't follow
    our style guide so well.
    
    This change allows us to upgrade to the new linter for new code, while
    keeping old code compliant.  I do this by adding 'eslint-disable'
    directives everywhere.
    
    Here's the mondo command I ran to do this all automatically.  First, I
    applied D22374 in my khan/devtools/khan-linter rule.  Then, in
    khan-exercises/, I ran this mondo command:
    
      ~/khan/devtools/khan-linter/runlint.py > /var/tmp/le
      cat /var/tmp/le | grep -v 'File ignored' | perl -nle '/^([^:]*):\d+:\d+: [EW]([^ ]*)/ and print "$1 $2"' | sort -u | perl -ane '$t{$F[0]} .= " $F[1],"; if (eof) {for $k (keys %t) { chop $t{$k}; open(OLD, $k); open(NEW, ">$k.tmp"); print NEW qq{/* TODO(csilvers): fix these lint errors (http://eslint.org/docs/rules): */\n/* eslint-disable$t{$k} */\n/* To fix, remove an entry above, run ka-lint, and fix errors. */\n\n}; while (<OLD>) {print NEW $_}; close(OLD); close(NEW); rename("$k.tmp", "$k") }}'
    
    It's not as bad as it looks.  Basically it runs the linter, munges the
    output to be 'filename violated-rule-name' pairs, and then uses some
    perl to collect all the violated-rules for a single filename in one
    place, and to prepend the appropriate eslint-disable comment on to the
    file.
    
    Test Plan:
    In khan-exercises/, ran
       ~/khan/devtools/khan-linter/runlint.py
    and saw no errors.
    
    Reviewers: emily, kevinb
    
    Subscribers: john
    
    Differential Revision: https://phabricator.khanacademy.org/D22393
  3. @jaredly

    Add more specific types to fix 2 exercises on mobile

    jaredly committed Oct 13, 2015
    Summary:
    Points, Lines and Planes & Caesar Cipher Decryption were both unanswerable on
    mobile, because they both want something other than an equasion or a number.
    With more specific grammars, (and in conjunction with a recent update to the
    iOS app), they can now be answered!
    
    These are the only two exercises that I found which were unanswerable for
    grammar-related reasons, and I don't think there are any more, at least within
    khan-exercises.
    
    Test Plan:
    Fire up khan-exercises locally (see readme), and try out both affected
    exercises. Verify that they are still answerable on the web.
    
    Reviewers: charlie, emily
    
    Reviewed By: emily
    
    Subscribers: andy, bryan, #ios
    
    Differential Revision: https://phabricator.khanacademy.org/D22360
Commits on Oct 8, 2015
  1. @kevinbarabash

    Add processText function.

    kevinbarabash committed Oct 8, 2015
    Summary:
    This adds a `processText` function analogous to the
    `processMath` function which allows labels which aren't mathy to be
    re-rendered as non-mathy.
    
    This is used for graphie label jipt, so we can re-render text labels
    with the translated text.
    
    Test Plan:
     - Visit http://exercises.ka.local/exercises/division_1.html
     - Take all the hints.
     - See that the "We can make a row of n circles" and "How many circles
       are there if we make m rows?" labels look good.
     - In the console, run
       `label = KhanUtil.currentGraph.label([0, 0], "test", "center", false)`
     - See that a label appears over the division, centered on the left
       side.
     - Run `label.processText("this is a longer string")`, see that the new
       string is rendered and is appropriately centered.
    
    Reviewers: eater, emily
    
    Reviewed By: eater
    
    Subscribers: kevinb
    
    Differential Revision: https://phabricator.khanacademy.org/D21232
Commits on Oct 1, 2015
  1. @eliawry

    Temporarily don't detect offline hints.

    eliawry committed Oct 1, 2015
    Summary:
    Hopefully fixes https://app.asana.com/0/27216215224639/49826201680046
    
    The plan is to monitor Zendesk for a day after this is deployed.
    If this reduces the number of reports of hints being seen
    substantially, we con probably fix this by including the item
    sha in the hint detection and we can do this. A real repro has been
    a bear to reproduce, so this test plan is the best we can do.
    
    Test Plan:
    In Firefox, Chrome, Safari, and incognito for each of those:
    
    1. Open an exercise on your learning dashboard that has hints.
    2. Kill your dev server
    3. Take a hint
    4. Refresh the page to show a blank page
    5. Start your dev server
    6. Refresh the page to show the exercise again
    7. Verify there are no errors (though stil no hints)
    8. Congrats! You're a cheater
    
    Reviewers: johnsullivan
    
    Reviewed By: johnsullivan
    
    Differential Revision: https://phabricator.khanacademy.org/D22128
  2. @lsavino

    Revert change to remove mathzoom from khan-exercises

    lsavino committed Sep 30, 2015
    Summary:
    The change didn't have the effect I expected; in testing, this change seemed to stop MathJax from attempting to load MathZoom.js (which used to cause a 'File failed to load' error in the iOS app), but after landing & testing again, the error returned.
    
    Reverting instead of updating webapp to point to the version of khan-exercise with the rebuilt mathjax.
    
    Test Plan:
    Check out problems like 'finding absolute value' and 'subtracting within 1000' in webapp; they still load!
    
    I can't check the behavior in the iOS app right now because exercises crash on load in Xcode 7, and I suspect Xcode 6 is failing to build while Xcode 7 is open looking at the project (while Xcode 7 downloads iOS 8 simulators). I'd like to land this before checking on iOS, though, so we don't risk someone bumping the k-e submodule without updating MathJax references in socrates & the webapp html template.
    
    Reviewers: kevinb, emily, jared, james
    
    Reviewed By: james
    
    Subscribers: james, #ios
    
    Differential Revision: https://phabricator.khanacademy.org/D22127
Commits on Sep 30, 2015
  1. @lsavino

    Remove MathZoom from kathjax.py, and rebuild MathJax

    lsavino committed Sep 30, 2015
    Summary:
    MathZoom was still being linked from MathJax, and mobile clients were showing a "File failed to load" error every time a user first loaded an exercise. This removes (hopefully) the last reference to MathZoom.
    
    Still TODO: Once this is landed, update socrates.js with the link to the appropriate KAthJax config file.
    
    Addresses https://app.asana.com/0/15238128244105/52923964249346.
    
    Test Plan:
    Load a new khan-exercises exercise in iOS ('finding absolute value' is favorite); you can interact with the exercise and the 'file failed to load' error no longer shows.
    
    Make the same changes in webapp (remove the MathZoom reference & rebuild), and khan-exercises still load & show progress.
    
    Reviewers: emily, kevinb
    
    Reviewed By: kevinb
    
    Subscribers: andy, #ios
    
    Differential Revision: https://phabricator.khanacademy.org/D22079
Commits on Sep 24, 2015
  1. @benjaminjkraft

    Send Travis alerts to Slack instead of HipChat

    benjaminjkraft committed Sep 23, 2015
    Summary: See also D21940 in perseus.
    
    Test Plan: fingers crossed.
    
    Reviewers: eater, mroth
    
    Reviewed By: mroth
    
    Subscribers: benjaminpollack
    
    Differential Revision: https://phabricator.khanacademy.org/D21941
Commits on Sep 22, 2015
  1. @eliawry

    Fix rounding whole numbers

    eliawry committed Sep 22, 2015
    Summary:
    Users are stuck on rounding whole numbers because the place they are supposed to round to is not being displayed.
    
    Perhaps the problem is with casting TPLACE to a string. This does that manually.
    
    The relevant asana task is
    
    https://app.asana.com/0/27216215224639/49975697797334
    
    Before this diff, debug information would display
    TPLACE as {}, now it will display as "ten" or whatever the appropriate number is. TPLACEPLURAL will be "tens" or the corresponding number.
    
    I hope this works - I wasn't able to repro the bug on my machine, and no one at KA has been able to. I'll follow up a day after deploy and see if this has fixed the problem. I suspect it will.
    
    Test Plan:
    The debug information seems more sensible now - instead of logging TPLACE as {}, it logs it as the appropriate number.
    
    I wish I could repro, but so far no one's been able to do so. I think it makes sense to deploy this and see if the problems go away. Another option would be to replace this exercise with a perseus exercise with the same content.
    
    Reviewers: eater, emily
    
    Reviewed By: emily
    
    Differential Revision: https://phabricator.khanacademy.org/D21863
Commits on Sep 17, 2015
  1. @kevinbarabash

    Remove MathZoom.js from MathJax

    kevinbarabash committed Sep 17, 2015
    Summary:
    In a previous diff I added MathZoom.js from MathJax because some browsers were
    requesting.  This diff removes the file and removes it from the list of extensions
    we might load.  In a follow up diff I will update references to the old MathJax
    config in webapp so that they're pointing at this new build.
    
    Test Plan:
    - load http://localhost:8080/math/algebra/systems-of-linear-equations/introduction-to-systems-of-linear-equations/e/verifying-solutions-to-systems-of-equations?mp-r-id=yqKY-Ao=
    - verify that MathJax.js loads but that the browser doesn't load (or try to load) MathZoom.js
    
    Reviewers: emily
    
    Subscribers: eater
    
    Differential Revision: https://phabricator.khanacademy.org/D21775
Commits on Sep 16, 2015
  1. @mankal111
Commits on Sep 10, 2015
  1. @kevinbarabash

    Add MathZoom.js to MathJax for real

    kevinbarabash committed Sep 10, 2015
    Summary:
    MathJax was trying to load MathZoom.js even though we removed it from
    the config file and rebuilt KathJax.  In this diff we include so that
    MathJax is happy when it tries to load it.
    
    Test Plan:
    - load http://localhost:8080/math/cc-eighth-grade-math/cc-8th-systems-topic/cc-8th-systems-overview/e/systems_of_equations_with_substitution?mp-r-id=GjFgG84=
    - verify that there's no errors in the console and there's no red warning bar at the top of the exercise
    
    Reviewers: emily
    
    Reviewed By: emily
    
    Differential Revision: https://phabricator.khanacademy.org/D21613
  2. @kevinbarabash

    Add MathZoom.js extension to third_party MathJax.

    kevinbarabash committed Sep 10, 2015
    Summary:
    Some browsers recently started request MathZoom.js recently.  I was unable
    to determine why this started so I've decided to include MathZoom.js.
    
    Test Plan:
    - update submodule in webapp and deploy
    - verify that 404s for MathZoom.js in the logs disappear.
    
    Reviewers: emily
    
    Reviewed By: emily
    
    Subscribers: alpert
    
    Differential Revision: https://phabricator.khanacademy.org/D21557
  3. @mankal111
Commits on Sep 1, 2015
  1. @petercollingridge

    Limit places to places we have names for

    petercollingridge committed Sep 1, 2015
    Summary:
    Fix problem of selecting places for which there is no name in the plural dictionary. For an email request from Cameron for JIRA issue https://khanacademy.atlassian.net/browse/AI-958915
    He said it was urgent.
    
    Reviewers: emily, eater
    
    Reviewed By: eater
    
    Differential Revision: https://phabricator.khanacademy.org/D21122
Commits on Aug 27, 2015
  1. @brownhead

    Prevent cheating with offline hints.

    brownhead committed Aug 27, 2015
    Summary:
    This solves the problem posed by the [Prevent using offline hints to cheat project](https://docs.google.com/a/khanacademy.org/document/d/1gLXa3kD89mZtcms4p0SYtDrY3lgRY_nfPrNuE6SZP6E/edit?usp=sharing).
    Previously, a user could disconnect from the internet, take a hint, then
    reconnect without any penalty.
    
    Now if they try this, their browser will remember that they took a hint
    when they reconnect and click the "take a hint" button for them.
    
    Test Plan:
    Follow the test plan below for the following environments: Chrome,
    Chrome Incognito, Firefox, Firefox Private, Safari, Safari Private.
    
    1) Open an exercise on your learning dashboard that has hints.
    2) Kill your dev server
    3) Take a hint
    4) Refresh the page to show a blank page
    5) Start your dev server
    6) Refresh the page to show the exercise again
    7) Verify that it shows that you still took a hint (unless you're in
       Safari Private, in which case it should just not error).
    
    Reviewers: alex, emily
    
    Reviewed By: emily
    
    Differential Revision: https://phabricator.khanacademy.org/D20938
  2. @brownhead

    Remove ServerActionQueue from interface.js.

    brownhead committed Aug 27, 2015
    Summary:
    The ServerActionQueue was added for the [hint cheating project](https://docs.google.com/a/khanacademy.org/document/d/1gLXa3kD89mZtcms4p0SYtDrY3lgRY_nfPrNuE6SZP6E/edit?usp=sharing)
    but it unfortunately caused some nasty bugs in production. After trying
    to clean things up this week I've come to the conclusion that the queue
    (in any form) is very dangerous and shouldn't be done right now.
    
    This change removes the queue and reverts all changes related to it.
    
    In a follow up diff I will solve the original objective of the hint
    cheating project by safer/simpler means.
    
    Test Plan:
    This is removing code from paths that were not being executed because
    no one was allowed to pass the gandalf bridge. So this should be a very
    safe change.
    
    Run through an exercise on your mission dashboard and ensure that
    everything behaves. Be sure to take some hints.
    
    Reviewers: alex, emily
    
    Reviewed By: emily
    
    Differential Revision: https://phabricator.khanacademy.org/D20934
Commits on Aug 25, 2015
  1. @petercollingridge

    Increase the range of questions

    petercollingridge committed Aug 25, 2015
    Summary:
    For an email request from Lindsay:
    * Include digits with 3 to 7 digits
    * Include rounding to tens, hundreds, thousands, ten thousands, and hundred thousands
    * Include commas in numbers with 5 or more digits
    
    I also changed the way numbers are created in the first exercise type, so there's a greater ranges (i.e. numbers with repeated digits and 0s as digits)
    
    Reviewers: emily, eater
    
    Reviewed By: eater
    
    Differential Revision: https://phabricator.khanacademy.org/D20061
  2. @petercollingridge

    Remove questions with radians

    petercollingridge committed Aug 25, 2015
    Summary: For an email request from Ben Stenhaug. I've also simplified the circumference to angle and visa versa questions so the circumference and arcs are not in terms of pi.
    
    Reviewers: emily, eater
    
    Reviewed By: eater
    
    Differential Revision: https://phabricator.khanacademy.org/D19923
Something went wrong with that request. Please try again.