Skip to content
Commits on Apr 9, 2016
  1. @crm416

    Include error information when requesting a retry

    crm416 committed Apr 6, 2016
    Summary:
    A small change to thread up the error when determining whether a request could retry.
    This could allow native to only retry timeouts, but will also be helpful for analytics
    purposes.
    
    Test Plan: Will come in the integration diffs.
    
    Reviewers: jared
    
    Reviewed By: jared
    
    Subscribers: #ios
    
    Differential Revision: https://phabricator.khanacademy.org/D26442
  2. @crm416

    Parameterize HTTP requests on a retry strategy

    crm416 committed Apr 6, 2016
    Summary:
    In our native apps, where connectivity is often inferior to that exhibited by a desktop, we want to
    make exercise-related network requests automatically retry a few times on failure (and then retry
    again if the user chooses to retry, rather than get kicked out of the current exercise). As such,
    we need a way to configure the retry behavior for network requests kicked off in khan-exercises.
    
    This diff adds a `retryStrategy` that is threaded down to our network requests. The `retryStrategy`
    is formulated as a function that takes an index (the number of times the request has been retried)
    and returns a promise that resolves to `true` if the request should be retried. This approach
    allows for asynchrony (i.e., such that we can throw up a modal to the user asking them if they want
    to retry) and meshes well with the current promise-based approach for network requests.
    
    As the default strategy is to never retry, behavior should remain unchanged outside of the native
    apps.
    
    On Asana @ https://app.asana.com/0/107925931410679/107969342010003.
    
    Test Plan:
    - (Testing for the retry behavior will follow shortly in a separate diff via the Electron bridge.)
    - To guarantee backwards compatibility:
        - Substate this change into webapp.
        - Navigate to an exercise.
        - Check answers, take hints, etc.
            - Verify that the requests go through successfully via DevTools.
        - Modify `request` such that the URL argument hits something live on the web (any HTTP URL), rather than your local devserver.
        - Turn off Wi-Fi.
        - Reload the page; take a hint.
            - Verify that failed requests appear in DevTools.
        - Check your answer.
            - Verify that the red bar appears (i.e., the request fully failed).
    
    Reviewers: jared, benkomalo
    
    Reviewed By: jared, benkomalo
    
    Subscribers: #android, #ios
    
    Differential Revision: https://phabricator.khanacademy.org/D26372
Commits on Mar 31, 2016
  1. @jaredly

    Pass up `hintsUsed` to interfaceFunctions.setHintsRemaining

    jaredly committed Mar 31, 2016
    Summary:
    So we can render `3/5`, and also render differently before any hints have been
    taken.
    
    Test Plan: NA see webapp diff re hints
    
    Differential Revision: https://phabricator.khanacademy.org/D26286
Commits on Mar 30, 2016
  1. @kevinbarabash

    Modify attemptMessage for web phone exercise beta

    kevinbarabash committed Mar 28, 2016
    Summary:
    Modify the attemptMessage to be either "Correct" or "Try again" as
    per the spec.  Call interfaceFunctions.setAnswerStatus to update the
    answer status as appropriate.
    
    Test Plan: n/a see test plan from webapp changes
    
    Reviewers: jared
    
    Differential Revision: https://phabricator.khanacademy.org/D26202
Commits on Mar 22, 2016
  1. @csilvers

    Deal with the fact that getUserProfile isn't defined on KA anymore.

    csilvers committed Mar 21, 2016
    This finishes the task done in D25801.
    
    This is not an ideal solution, since it means that powerUser and vip
    will never be set anymore, but I'm not going to worry about it that
    much since I think all this code is going away anyway when we move to
    perseus.  (Though maybe not?  I don't know how perseus does user
    feedback.)
    
    This fixes https://app.asana.com/0/27216215224639/103422119655835/f
    
    Auditors: emily, jlfwong
    
    Test plan:
    Fingers crossed
Commits on Mar 21, 2016
  1. @csilvers

    Be more conservative about saying something is a multiple of pi.

    csilvers committed Mar 21, 2016
    Summary:
    I can't figure out how 'pi' is being set as a possible answer-form for
    questions like
       https://www.khanacademy.org/math/cc-fourth-grade-math/cc-4th-place-value-rounding/cc-4th-rounding/e/rounding-whole-numbers-2
    
    But it is, and rather than have to fix that up, and then trust editors
    to properly say "this answer involves pi" at all, let's just be better
    about guessing whether a number is a multiple of pi.
    
    This is probably not perfect, but I think is good enough.  If we're
    worried this will suppress legitimate messaging, we could just
    suppress it if the answer is an integer, which I expect will catch 95%
    of the confusing cases now.
    
    This resolves https://app.asana.com/0/27216215224639/96623486099021/f
    
    This also resolves T2578
    
    Test Plan:
    Ran `python -m SimpleHTTPServer` and visited localhost:8000/test
    
    Also will try the rounding-whole-numbers questions after this is deployed.
    I expect not to get a "approximated pi" warning if I say xxxx0001 as
    an answer.
    
    Reviewers: eater
    
    Reviewed By: eater
    
    Subscribers: jared
    
    Maniphest Tasks: T2578
    
    Differential Revision: https://phabricator.khanacademy.org/D26043
Commits on Mar 14, 2016
  1. @crm416

    Disable autoproceed behavior when registering a skip attempt

    crm416 committed Mar 8, 2016
    Summary:
    On mobile, when the user hits the skip button, we do some work ourselves to proceed to the next
    problem. (For example, we may need to load the next Perseus exercise, or tear things down and build
    them back up if we're switching exercise frameworks.) The automatic trigger of `gotoNextProblem` in
    `handleAttempt` is causing all sorts of bugs, so we'd like to disable it.
    
    Instead, clients are now expected to trigger the loading of the next problem themselves, out-of-band
    from the `handleAttempt` method.
    
    Test Plan:
    - Substate this change into webapp.
    - Enable Bibliotron (by navigating to `localhost:8080/enable-bibliotron`).
    - Navigate to a skill check (e.g., `http://localhost:8080/science/physics/one-dimensional-motion/skill-check-for-one-dimensional-motion/e/one-dimensional-motion-skill-check`).
        - Verify that skipping works!
        - Verify that checking the answer works.
    - Navigate to a mission warm-up.
        - Verify that skipping works!
    - For the mobile test plan, see: D25792.
    
    Reviewers: benkomalo, jared
    
    Reviewed By: benkomalo, jared
    
    Subscribers: eliana, oliver, nacho, #ios
    
    Differential Revision: https://phabricator.khanacademy.org/D25790
  2. @crm416

    Require explicit ask to hide problem UI on network errors

    crm416 committed Mar 11, 2016
    Summary:
    When we timeout on a network request to record a problem attempt (or hit any other error during
    that request), khan-exercises hides the entire problem UI by applying a CSS change.
    
    This makes for an awkward experience on mobile, where we throw up an error modal and kick the user
    out of the exercise, and the exercise in the background goes blank at the same time. It can also
    lead to incompletable exercises if, for whatever reason, we fail to recycle the webview on mobile,
    since whenever the user opens a subsequent exercise, the UI will be blank. (There are cases where
    this happens--they're being addressed independently.)
    
    This diff tries to remove more implicit webby behavior from `interface.js` by adding a custom
    error-handling callback to `handleAttempt`. Web clients will continue to see the same behavior,
    while the API that mobile clients rely on will be able to pass in a `null` callback to avoid
    messing with the problem UI.
    
    Test Plan:
    - Change the request timeout to something ludicrously small (1000ms is good enough).
    - Substate this change into the iOS app and rebuild the JS.
    - Run the mobile app.
    - Navigate to an exercise.
    - Attempt a problem.
        - Verify that the error modal appears, and that the exercise does _not_ blank out in the background.
    - Substate this change into webapp.
    - Attempt a problem.
        - Verify that the UI goes blank, etc.
    
    Reviewers: jared, benkomalo
    
    Reviewed By: jared, benkomalo
    
    Subscribers: #ios
    
    Differential Revision: https://phabricator.khanacademy.org/D25875
Commits on Mar 10, 2016
  1. @crm416

    Disallow degenerate case in rhombus creation

    crm416 committed Mar 9, 2016
    Summary:
    In `areas_of_trapezoids_rhombi_and_kites`, if the random values were drawn such that `SH == -B2`,
    then the rhombus would be constructed in a way such that there wasn't room for the right angle
    sign, leading to a JavaScript error. On mobile, this made such exercises uncompletable.
    
    Test Plan:
    - Run `python -m SimpleHTTPServer`.
    - Navigate to `areas_of_trapezoids_rhombi_and_kites`.
    - Load a bunch of times; verify that things are sane and that there are no errors.
    
    Reviewers: emily
    
    Reviewed By: emily
    
    Subscribers: jared, #ios
    
    Differential Revision: https://phabricator.khanacademy.org/D25841
  2. @xymostech

    Replace references to KA.getUserID

    xymostech committed Mar 8, 2016
    Summary:
    We're moving `KA.getUserID` off of the global `window.KA`
    object and into the required KA object: D25778, so we can't use it in
    khan-exercises any more. There's a new piece of data, `window.KA.userId`
    that will be accessible, so use that instead.
    
    Test Plan: - Cross fingers?
    
    Reviewers: jlfwong
    
    Reviewed By: jlfwong
    
    Subscribers: jared
    
    Differential Revision: https://phabricator.khanacademy.org/D25801
  3. @crm416

    Fix point positioning in `graphing_points` hints

    crm416 committed Mar 9, 2016
    Summary:
    This was causing JS errors when taking hints during the exercise. On mobile, users were
    subsequently kicked out of the session.
    
    Test Plan:
    - Run `python -m SimpleHTTPServer`.
    - Navigate to the `graphing_points` exercise.
    - Get to an exercise that requires you to put a point on the graph.
        - Don't interact with the graph, but take all the hints.
            - Verify that there are no JS errors.
    - Get to another exercise that requires you to put a point on the graph.
        - Put a point on the graph (above where the hint will place a helpful line), and then take all the hints.
            - Verify that there are no JS errors.
            - Verify that the point is brought above the line.
    
    Reviewers: emily
    
    Reviewed By: emily
    
    Subscribers: jared, #ios
    
    Differential Revision: https://phabricator.khanacademy.org/D25833
Commits on Mar 9, 2016
  1. @crm416

    Update `local-only` dependencies

    crm416 committed Mar 8, 2016
    Summary:
    D25503 included a change to use part of the Moment API that wasn't available in the version of
    `moment.js` included in the `local-only` subdirectory. On mobile, these `local-only` dependencies
    are actually used as production dependencies, since we don't have webapp to rely on. (This is not a
    good setup, but it's what we have to work with for now.) This diff is just a result of running the
    `update_local.sh` script.
    
    Test Plan:
    - On web:
        - Run khan-exercises in local mode.
        - Open up the console.
        - Verify that `moment().locale` is defined. (This behavior isn't actually used when testing locally.)
    - On iOS:
        - Substate this change into the webview repo.
        - Re-build the JS bundle.
        - Verify that exercises load and complete without error.
    
    Reviewers: jared, john
    
    Reviewed By: jared, john
    
    Subscribers: john, #ios
    
    Differential Revision: https://phabricator.khanacademy.org/D25789
Commits on Mar 2, 2016
  1. @csilvers

    Update the eslint-disable directives.

    csilvers committed Mar 2, 2016
    Summary:
    We've changed our ka-lint eslintrc recently, removing some rules we
    used to enforce, and getting ready to add new ones -- including a big
    one: var -> const/let.
    
    This updates the eslint-disable comments at the top of files to
    reflect the new eslintrc.
    
    First, I modified the khan-linter repo to enable the var->const/let
    rule.  Then, similar to D25634, I ran this command to undo existing
    eslint-disable:
       git grep -l 'fix these lint errors' | grep -v genfiles | xargs perl -nli -e 'm,fix these lint errors .http://eslint.org/docs/rules, and $skip=4; print unless $skip-- > 0'
    
    I then ran this command to make sure it didn't do anything wrong:
       git diff | grep '^-[^-]' | grep -v '^-/\*'
    
    I then ran
        ~/khan/devtools/khan-linter/runlint.py > /var/tmp/l
        cat /var/tmp/l | grep -v -e genfiles | 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") }}'
    
    Test Plan: ka-lint
    
    Reviewers: jlfwong
    
    Reviewed By: jlfwong
    
    Differential Revision: https://phabricator.khanacademy.org/D25644
Commits on Feb 23, 2016
  1. @jeresig

    Fix timestamp on attempt data to work across locales.

    jeresig committed Feb 22, 2016
    Summary:
    See the inline comment.
    Fix for: https://app.asana.com/0/27216215224639/92638698970527
    
    (I added a few people who committed to khan-exercises recently, let me know if there's someone else who should be reviewing this change!)
    
    Test Plan:
    In three versions of an exercise:
    http://localhost:8080/math/early-math/cc-early-math-counting-topic/cc-early-math-counting/e/counting-out-1-20-objects
    http://localhost:8080/math/early-math/cc-early-math-counting-topic/cc-early-math-counting/e/counting-out-1-20-objects?lang=es
    http://localhost:8080/math/early-math/cc-early-math-counting-topic/cc-early-math-counting/e/counting-out-1-20-objects?lang=bn
    
    I dragged an apple into the bin and clicked the submit button. With the console open I confirmed that the HTTP request to the attempt API was successful. Inspecting the HTTP request I confirmed that it included: `client_dt: 2016-02-22T16:46:37-05:00`, which is what we want across all locales.
    
    Reviewers: alex, johnsullivan, emily
    
    Reviewed By: emily
    
    Differential Revision: https://phabricator.khanacademy.org/D25503
Commits on Feb 12, 2016
  1. @bpollack

    Change wording for incorrect answers to be more encouraging

    bpollack committed Feb 12, 2016
    Summary:
    This was actually called for during Bibliotron testing, but I don't see
    any reason why the change can't be bubbled upwards to the main site.
    
    Fixes https://app.asana.com/0/42800146980907/84682676928120
    
    Test Plan: Checked out the new wording
    
    Reviewers: alex, jordan, michelle
    
    Reviewed By: jordan, michelle
    
    Subscribers: #bibliotron
    
    Differential Revision: https://phabricator.khanacademy.org/D25372
  2. @xymostech

    Don't depend on `KA.getUserID` existing.

    xymostech committed Feb 11, 2016
    Summary:
    On the React render server, `KA` exists but `KA.getUserID` doesn't.
    This makes the calculator init not fail when that happens.
    
    Test Plan:
     - Render an article on the react render server
     - See that it doesn't complain about `window.KA.getUserID` not being a
       function.
    
    Auditors: eater, jlfwong
Commits on Jan 27, 2016
  1. @alopatin

    Properly clean up after a problem when using interfaceFunctions

    alopatin committed Jan 26, 2016
    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 Jan 20, 2016
    … 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 Jan 19, 2016
    …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 Jan 19, 2016
    …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 Jan 14, 2016
    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 Jan 12, 2016
    … 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 Jan 11, 2016
    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 Jan 6, 2016
    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 Jan 7, 2016
    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 Dec 21, 2015
    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 Dec 16, 2015
    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 Nov 19, 2015
    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 Dec 5, 2015
    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 Dec 8, 2015
    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 Nov 24, 2015
    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 Oct 22, 2015
    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 Nov 20, 2015
    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 Nov 12, 2015
    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
Something went wrong with that request. Please try again.