Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Mar 25, 2015
  1. @jeresig

    Fix up navigability of exercise hints. Fixes T3680.

    jeresig authored
    Summary:
    This makes it so that when you click the "Get Hint" button the screen reader will read off the newly-added hint.
    
    Additionally I made the individual hints navigable using a screen reader (gave them a tab order).
    
    Test Plan:
    View an exercise with a screen reader turned on. Navigate to the hint button and press enter. You should hear the newly-added hint read off.
    
    You should be able to navigate to hint using your keyboard, as well.
    
    Reviewers: aria, jordan
    
    Reviewed By: jordan
    
    Maniphest Tasks: T3680
    
    Differential Revision: https://phabricator.khanacademy.org/D16889
Commits on Mar 20, 2015
  1. @jdan

    Prevent issue form labels from appearing on a new line after their re…

    jdan authored
    …spective input
    
    Summary:
    Ref T3683
    
    Just a visual bug I came across while fixing something else. I'm not sure why this
    CSS is in khan-exercises, when the issue form is only defined in webapp as far as
    I can tell?
    
    {F119454}
    
    {F119455}
    
    Test Plan:
    . I'm doing all my testing in webapp, since the issue form doesn't appear in khan-exercises (?)
    . http://localhost:8080/mission/cc-third-grade-math/task/6265360852451328
    . Click "Report a mistake in this question"
    . See the labels are on the same line as the radio buttons
    
    Reviewers: aria, john
    
    Reviewed By: john
    
    Subscribers: #a11y
    
    Projects: #khan-exercises
    
    Maniphest Tasks: T3683
    
    Differential Revision: https://phabricator.khanacademy.org/D16882
  2. @jeresig

    Fix keyboard navigation and provide alerts when attempting to complet…

    jeresig authored
    …e problems. Fixes T3679.
    
    Summary:
    This is only for the exercise framework, not for Perseus (that'll be another diff).
    
    This makes it so that when you attempt to complete a problem and it is incorrect it'll read out a message explaining what went wrong (currently what is shown as the 'attempt message' beneath the button). It also stops the button from wiggling as there is now a textual message explaining that. Note the comments inline about these changes.
    
    Test Plan: It should now be possible, using a screen reader, to successfully navigate an exercise and at least submit an answer (and be told when you get that answer wrong).
    
    Reviewers: aria, jordan
    
    Reviewed By: jordan
    
    Maniphest Tasks: T3624
    
    Differential Revision: https://phabricator.khanacademy.org/D16868
Commits on Mar 19, 2015
  1. @jdan

    Added alt-text to positive reinforcement smiley faces

    jdan authored
    Summary:
    Ref T3684
    
    This probably won't be seen in webapp because of `problem-template.handlebars`,
    but I figured I should fix here as well
    
    Test Plan:
    . `python -m SimpleHTTPServer 1337`
    . `http://localhost:1337/exercises/absolute_value.html`
    . Enter a correct answer, hit Submit
    . See the smiley face has alt text
    
    Reviewers: john, aria
    
    Reviewed By: aria
    
    Subscribers: #a11y
    
    Projects: #khan-exercises
    
    Maniphest Tasks: T3684
    
    Differential Revision: https://phabricator.khanacademy.org/D16846
Commits on Mar 13, 2015
  1. @kevinb7

    Don't remove dummy points/lines when calling removeAllTools

    kevinb7 authored
    Summary:
    If a user clicked "clear" in the construction exercises snapping
    would stop working.  This is because we were removing the dummy
    objects that were used for snapping to points/lines that were part
    of the question.
    
    Test Plan:
    Using the following URLs:
    - /math/geometry/geometric-constructions/geo-bisectors/e/constructions_1
    - /math/geometry/geometric-constructions/polygons-inscribed-in-circles/e/constructions_2
    - /math/geometry/geometric-constructions/constructing-tangents/e/constructions_3
    
    Carry out the following steps:
    - add a straight edge or compass
    - click clear
    - add a straight edge and verify that the point snaps to existing lines/points
    - add a compase and verify that the center point snaps to existing lines/points
    
    Reviewers: eater
    
    Reviewed By: eater
    
    Differential Revision: https://phabricator.khanacademy.org/D16745
  2. @beneater

    Don't process math on the solution

    beneater authored
    I'm assuming this was exposed recently by a KaTeX change, but the code tags
    around the solution resulted in the answer being repeated, e.g., if the solution
    was "64", the thing we'd scrape out of the math-processed answer area would be
    something like "646464", which most people wouldn't think to enter when asked
    what 8^2 is.
    
    Test Plan:
    Load http://exercises.ka.local/exercises/positive_and_zero_exponents.html?debug&problem=write-solution and answer the question successfully.
    
    Auditors: emily, aria
  3. @petercollingridge

    Change structure of line of best fit exercise

    petercollingridge authored
    Summary:
    Restructure question layout for best fit problem
    For an email request from Ben Stenhaug.
    
    Reviewers: emily, eater
    
    Reviewed By: eater
    
    Differential Revision: https://phabricator.khanacademy.org/D16623
  4. @petercollingridge

    Specify that outline is a triangle so bisector theorum holds

    petercollingridge authored
    Summary: There's probably a better way to word this. https://khanacademy.atlassian.net/browse/AI-569866
    
    Reviewers: emily, eater
    
    Reviewed By: eater
    
    Differential Revision: https://phabricator.khanacademy.org/D16482
  5. @petercollingridge

    Fix hint and add more information to question

    petercollingridge authored
    Reviewers: emily, eater
    
    Reviewed By: eater
    
    Differential Revision: https://phabricator.khanacademy.org/D16481
  6. @petercollingridge
  7. @petercollingridge

    Remove stray equals sign

    petercollingridge authored
    Summary:
    For https://khanacademy.atlassian.net/browse/AI-496882
    I wonder whether I should remove all the red lines as most hints don't do this, but they are quite nicely done.
    
    Reviewers: emily, eater
    
    Reviewed By: eater
    
    Differential Revision: https://phabricator.khanacademy.org/D16147
  8. @petercollingridge
  9. @petercollingridge

    Fix wording of hint

    petercollingridge authored
    Reviewers: emily, eater
    
    Reviewed By: eater
    
    Differential Revision: https://phabricator.khanacademy.org/D15990
  10. @petercollingridge
Commits on Mar 10, 2015
  1. @spicyj

    Merge pull request #161430 from Khan/hidden-input

    spicyj authored
    Hide invisible input from screen readers.
  2. @jeresig
Commits on Mar 9, 2015
  1. @beneater

    Whitelist only style properties when setting styles

    beneater authored
    Summary:
    The functions in utils/graphie-drawing.js (which I think are just used by
    graphie-to-png users) take an `options` object which includes style properties
    and non-style properties all jumbled together.
    
    The `getStyles()` function promises to extract the style properties, but
    doesn't actually filter out only style properties.
    
    This leads to a weird side-effect. If you pass a property value that is a
    function to `$.css()`, the function will get called and the return value will
    be applied as the property value.
    
    This fixes `getStyles()` to only include style properties that are actually
    style properties. It's possible I missed some, but I think I got all the ones
    we use. Good news is this is only used by graphie-to-png users, so the risk of
    breaking something on the live site is pretty much nil.
    
    Test Plan:
    1. Run ./app.py
    2. http://localhost:5001/
    3. Enter this:
    ```
    init({range: [[-10, 10], [-10, 10]], scale: 20});
    
    var i = 0;
    drawPolygon({
        whyIsThisCalled: function() {
            i += 1;
        }
    });
    console.log("Was called " + i + " times");
    ```
    4. Regraph and see "Was called 0 times" in the console.
    5. Load and graph templates #13, #17, #18, #19, and #20 and verify they look the same.
    
    Reviewers: emily, alex
    
    Reviewed By: alex
    
    Subscribers: aria, kevinb
    
    Differential Revision: https://phabricator.khanacademy.org/D16505
Commits on Mar 6, 2015
  1. @csilvers

    Send /attempt and /hint requests to a multithreaded module when possi…

    csilvers authored
    …ble.
    
    Summary:
    Multithreaded modules (such as 'batch') are slower than the default
    module, but cheaper.  We use it when we don't mind the extra time
    taken.  In this case, we use it inside practice tasks, but not at the
    end of a task, because we know it will take a few seconds to finish
    the next problem in the task, so it doesn't matter if this API request
    takes a few seconds as well.  (Inside a practice task, the return
    value of the API call doesn't matter that much.)
    
    Test Plan:
    I ran 'make serve' and visited
          http://localhost:8080/math/geometry/intro_euclid/e/drawing-lines
    and clicked 'hint' and then answered the question right, and clicked
    'next question', and saw on the chrome network tab that it was hitting
    /_mt/ in each case, and there were no javascript or other errors.
    
    But the real test will be to do this in prod, when the batch module
    will be quite a bit slower than the default module (unlike in dev).
    Fingers crossed on that.
    
    Reviewers: alan
    
    Reviewed By: alan
    
    Subscribers: desmond
    
    Differential Revision: https://phabricator.khanacademy.org/D16572
Commits on Mar 5, 2015
  1. @csilvers

    Move another route to the batch module.

    csilvers authored
    Summary: This is the equivalnet of D16565, but for the khan-exercises module.
    
    Test Plan: Fingers crossed!  Will look at the logs once we set default.
    
    Reviewers: alan
    
    Subscribers: eater, chris
    
    Differential Revision: https://phabricator.khanacademy.org/D16566
Commits on Mar 4, 2015
  1. @csilvers

    No longer pass 'card' to /attempt and /hint.

    csilvers authored
    Summary:
    This is an unused param, and I already got rid of it on the server
    side.  This gets rid of it on the client side too, saving a few
    bytes.
    
    Test Plan:
    Fingers crossed.  I'll test when I update substate in webapp to bring
    in this commit.
    
    Reviewers: desmond
    
    Subscribers: eater
    
    Differential Revision: https://phabricator.khanacademy.org/D16536
Commits on Mar 3, 2015
  1. @beneater

    Fix views_of_a_function answer type in iPad app

    beneater authored
    Summary:
    In the iOS app, we hide the inputs and show MathOutput thingies instead. This
    means that we muck around in the DOM such that each <td> has a <span> and a
    hidden <input> as children rather than just the <input>. The guess extraction
    part of the custom answer type assumed that the <input>s were the only children
    of <td>s. This change explicitly looks for input elements rather than assuming.
    
    This also adds a fix that prevents grading if you don't fill out any answers.
    
    Test Plan:
    iOS
    ===
    1. Update khan-exercises in the iOS app with this change.
    2. Run the iPad app, find the Views of a function exercise.
    3. Answer a question that requires filling out a table, submit and get it right.
    4. Hit "check" on a question that requires filling out a table without entering anything and see that it doesn't grade it.
    
    Local mode
    ===
    1. Load http://exercises.ka.local/exercises/views_of_a_function.html
    2. Answer a question that requires filling out a table, submit and get it right.
    3. Hit "check answer" on a question that requires filling out a table without entering anything and see that it doesn't grade it.
    
    Reviewers: emily
    
    Reviewed By: emily
    
    Differential Revision: https://phabricator.khanacademy.org/D16426
Commits on Mar 2, 2015
  1. @xymostech

    Upgrade katex in to v0.2.0

    xymostech authored
    Summary: Upgrade katex to the latest version.
    
    Test Plan:
     - Visit an exercise (like [this
       one](http://exercises.ka.local/exercises/adding_decimals_0.5.html))
     - Find some math on the page.
     - See that it's katex-y.
     - See that it has mathml in it (ooh, ahh).
     - See that there are no errors in the console (oh wait there are! oh
       but they're not related to katex...)
    
    Reviewers: eater
    
    Reviewed By: eater
    
    Differential Revision: https://phabricator.khanacademy.org/D16454
Commits on Feb 27, 2015
  1. @marcia

    Close experiment in favor of clues (khan-exercises)

    marcia authored
    Summary:
    Khan-exercises companion to:
    - webapp https://phabricator.khanacademy.org/D16411
    - perseus https://phabricator.khanacademy.org/D16412
    
    See https://app.asana.com/0/2465302980218/24278591617679
    
    When the user answers incorrectly, we will now always show the clue (or rather, "rationale" as it's known to some) for why that answer was incorrect if that content exists. Though the experiment was only for perseus exercises, this khan-ex change is required because both rationales and "hey you, simplify your answer to be more correct" messages share some codes.
    
    Not sure who owns this, so sending to Eater and CC'ing Michelle. Feel free to redirect.
    
    Test Plan:
    Test a perseus exercise with rationales:
    ===
    Visit /exercise/naming-shapes-2, one of the exercises in targeted_clues_exercises.Exercise
    Get the answer wrong
    See that a rationale popped up
    https://s3.amazonaws.com/uploads.hipchat.com/6574/17223/mz1VI41oFSaHfFt/upload.png
    
    See that you can select the right answer and proceed
    
    Test a perseus exercise without rationales:
    ===
    Visit any other exercise, say /e/recognizing-shapes, that doesn't have rationales
    Get some right / wrong and make sure nothing exploded
    
    Test a khan-exercise exercise with a score.message
    ===
    Visit /e/simplifying_fractions
    Enter the correct fraction but unsimplified
    See a message under the check answer button about simplifying
    https://s3.amazonaws.com/uploads.hipchat.com/6574/17223/Cb2RaGudAevpdSj/upload.png
    
    Answer correctly too
    
    Test a khan-exercise exercises without triggering score.message
    ===
    Visit /e/addition_1
    Answer wrong and right successfully
    
    Reviewers: eater
    
    Reviewed By: eater
    
    Subscribers: michelle
    
    Differential Revision: https://phabricator.khanacademy.org/D16413
Commits on Feb 22, 2015
  1. @beneater
Commits on Feb 19, 2015
  1. @beneater

    Fix dropdown z-index

    beneater authored
    Test Plan:
    Load http://exercises.ka.local/exercises/inequalities_on_a_number_line.html?problem=equation_from_line
    Turn on the scratchpad
    Use the dropdown
    
    Auditors: aria
Commits on Feb 5, 2015
  1. @ariabuckles

    Check Answer: Remove defunct "Try Again" code

    ariabuckles authored
    Summary:
    This code currently doesn't do anything useful.
    We can revisit this in the future if we want to (though
    we all seem to sort of like the current way), but I guess
    for now the code ought to reflect what actually happens ;)
    
    Test Plan:
    Do additon_1 in webapp and see that I can still check answer
    and progress.
    
    Auditors: emily, eater
Commits on Feb 4, 2015
  1. @mgp

    Include any error with each apiRequestEnded event

    mgp authored
    Summary:
    Toward fixing
    https://app.asana.com/0/16089597562651/24907729174260/f.
    
    The native side of the iOS app cannot determine whether the underlying
    JS has failed a request. This provides such telemetry.
    
    Test Plan:
    Add a breakpoint in the always method.
    Make a successful attempt. Assert that requestEndedParameters is undefined.
    Go offline. Make a failed attempt. Assert that requestEndedParameters is a JS object.
    
    Reviewers: david, benkomalo, nacho, eater
    
    Reviewed By: nacho, eater
    
    Subscribers: nacho, andy
    
    Differential Revision: https://phabricator.khanacademy.org/D16050
Commits on Feb 2, 2015
  1. @xymostech

    Add mobile support for the primeFactorization answer type

    xymostech authored
    Summary:
    Add a class to the input that is produced so that mobile can
    tell that the input should use the expression widget. Also, add some
    more filtering of the guess to handle the LaTeX that it recieves from
    MyScript.
    
    Test Plan:
     - Apply the corresponding mobile diff
     - Visit the Prime Factorization exercise
     - Answer problems where the solution looks like:
       - `2`
       - `2^3`
       - `2 \cdot 3`
       - `2 \times 3`
       - `2 ^ 3 \times 3 ^ 2`
     - See that they all work
    
    Reviewers: eater
    
    Reviewed By: eater
    
    Differential Revision: https://phabricator.khanacademy.org/D15918
Commits on Jan 28, 2015
  1. @beneater

    Determinstically choose problem type

    beneater authored
    Somehow some refactor resulted in us using `Math.random()` instead of `KhanUtil.random()` for choosing the problem type. The latter is stable for a given user.
    
    Test Plan:
    1. Load http://stable.ka.local/math/geometry/geometric-constructions/geo-bisectors/e/constructions_1 in webapp
    2. Refresh the page ~5 times
    3. Get the same problem each time
    4. Cross fingers that we didn't get the same problem by chance (p=0.0016)
    
    Auditors: emily
Commits on Jan 26, 2015
  1. @beneater

    Don't always assume double arrows in graphInit()

    beneater authored
    Summary: This if statement would always evaluate as true, which I'm pretty sure isn't what we want, though who knows what's out there that depends on this behavior :\
    
    Test Plan:
    1. Substate this into graphie-to-png
    2. Run app.py in graphie-to-png
    3. Go to http://localhost:5001/ and choose "1. Simple plot"
    4. Change the `axisArrows: "<->"` line to `"->"` and `""` and regraph, seeing the correct axis arrows
    
    Reviewers: aria, emily
    
    Reviewed By: emily
    
    Differential Revision: https://phabricator.khanacademy.org/D15861
Commits on Jan 23, 2015
  1. @beneater

    Can't have <p> inside a <p>

    beneater authored
    Test Plan: `make lint` in webapp
    
    Auditors: emily
  2. @dmnd

    Send client local datetime when submitting problem attempts

    dmnd authored
    Summary:
    Streaks needs clients to send client local time when recording activity like
    problem attempts.
    
    So, use moment().format() to send an ISO 8601 datetime string:
    
      * In webapp, moment is listed as a dependency of interface.js
        (see D15748)
      * In standalone mode moment is l loaded from local-only
      * In iOS moment is loaded from local-only via exercise-view.html
        (diff pending)
    
    Test Plan:
      * Opened standalone mode, answered a question and things seem to work.
      * Tested with webapp and saw that the endpoint received a value for `client_dt`.
      * Tested with iOS and saw that the app sent a value for `client_dt`
    
    Reviewers: emily, eater, jlfwong
    
    Reviewed By: eater, jlfwong
    
    Subscribers: alpert, emily, marcia
    
    Differential Revision: https://phabricator.khanacademy.org/D15725
Commits on Jan 21, 2015
  1. @beneater

    Fix congruent angles exercise in IE

    beneater authored
    This seems to work...
    
    Test Plan:
    Test http://exercises.ka.local/exercises/congruent_angles.html in IE9 and Chrome. In both browsers:
    - Verify no JS errors in console
    - Verify all angles (except the given angle) are clickable
    - Verify the midpoint of the lines is not clickable (to see that the mouse target for hash marks was properly removed)
    - Take hints
    - Verify the correct answer is accepted and incorrect answers aren't
    
    Auditors: emily, charlie
Commits on Jan 15, 2015
  1. @xymostech

    Fix up graphing inequalities exercises (for mobile)

    xymostech authored
    Summary:
    Make some changes to the different graphing inequalities
    exercises so that they're more mobile friendly. The main change is
    making the checkboxes and radio buttons play nicely with the funky
    styling we put on them in mobile land, while still looking good in
    non-mobile (done through some `body:not(.mobile)` trickery). Also, add
    some padding to graphs to reduce text collisions, and remove/move around
    some input elements to make more sense.
    
    Test Plan:
     - Visit all 4 exercises locally (not on mobile)
       - See that all of the radio buttons/checkboxes look about the same as
         before
       - Take hints, see no text overlaps
       - See that all of the exercises are still answerable.
     - Visit all 4 exercises on mobile ("Graphing and solving linear
       inequalities", "Graphing linear inequalities in two variables",
       "Graphing systems of inequalities", and "Graphing and solving systems
       of inequalities")
       - See that all of the radio buttons/checkboxes look good and are not
         squished together.
       - Take hints, see that no text overlaps.
    
    Reviewers: eater
    
    Reviewed By: eater
    
    Subscribers: marcos
    
    Differential Revision: https://phabricator.khanacademy.org/D15747
Commits on Jan 14, 2015
  1. @petercollingridge

    Fix cut and copy questions

    petercollingridge authored
    Summary: Unit plural for https://khanacademy.atlassian.net/browse/AI-466113 and says tools are below for https://khanacademy.atlassian.net/browse/AI-478982
    
    Reviewers: eater, emily
    
    Reviewed By: emily
    
    Differential Revision: https://phabricator.khanacademy.org/D15633
Something went wrong with that request. Please try again.