Summary: Remove Y= in front of expressions to avoid confusion and accept more answer forms. For a request from Tomer. Test Plan: Make sure the exercises accept sensible answers. e.g. multiplying_and_dividing_rational_expressions_3.html?debug&problem=multiply&seed=20 should now accept 1 (and not just 1/1). adding_and_subtracting_rational_expressions_3.html?seed=197&problem=expr-top&debug&lang=en should accept a - 3. dding_and_subtracting_rational_expressions_5.html?debug&seed=25 now accepts (p^2 + 21p + 23)/(3(p^2 + 3p + 2)) and (p^2 + 21p + 23)/((3p + 3)(p + 2)), but not (p^2 + 21p + 23)/(3(p + 1)(p + 2)) sadly. Also fixed adding_and_subtracting_rational_expressions_3.html?debug&problem=expr-top&seed=107 So the question does appear as (-k-2)/(10k) + 3, which makes the hints confusing. Reviewers: emily, eater Reviewed By: emily, eater Differential Revision: http://phabricator.khanacademy.org/D14209
Summary: I can't pretend I fully understand how answer-type.js works or why it's written the way it is, so what I've done may well be horrible. But as far as I can tell it works and fixes a lot of issues we've been having with the rational expression exercises that were recently converted to use expression entry. It also fixes Issue AI-289737 and might be useful for other things. Allow expression answer type to take multiple answers Allow exponents to the zero to be cancelled or not Allow rational expression to be factored or not Update more rational expression exercises Get expression editor to work with multiple answer type again Update rational expression exercises to accept factored answers were necessary Update more rational expression exercises Test Plan: I've tested at least a couple of exercises in each rational expression exercise and some others that use expression entry. I've also tested the following, which are probably worth re-testing, plus anything else you think I may have missed. Make sure the normal expression entry exercises still work. e.g. http://localhost:8000/exercises/writing_expressions_1.html Make sure expression entry works inside a multiple answer type. e.g. http://localhost:8000/exercises/inverses_of_functions.html?debug&problem=expression-editor Expression entry with multiple data options should now work. http://localhost:8000/exercises/simplifying_expressions_with_exponents.html?seed=81&problem=simplify-exponential-form-full&debug&lang=en Should now accept an answer of z^-9 and z^9r^0 (Issue AI-289737) Simplifying_rational_expressions_2 has the most issues because it does accept non-factored answers. http://localhost:8000/exercises/simplifying_rational_expressions_2.html?seed=88&problem=0&debug&lang=en Should now accept the answer in the hint: (-7y-10)/(-10y+4) Also the factored version: (-7y-10)/2/(-5y+2) or (-7y-10)/(2(-5y+2)) Also you should be multiply top and bottom by -1, and it shouldn't accept the original expression. Multiple expression types should inside a multiple answer type. e.g http://localhost:8000/exercises/multiplying_and_dividing_rational_expressions_1.html?seed=24&problem=divide&debug&lang=en Should accept (p-4)/(4p - 6) and (p-4)/(2(2p - 3)) http://localhost:8000/exercises/multiplying_and_dividing_rational_expressions_4.html?debug&problem=A-over-B-and-BC-over-A&seed=133 Other rational expression exercises should all work including http://localhost:8000/exercises/adding_and_subtracting_rational_expressions.html http://localhost:8000/exercises/multiplying_and_dividing_rational_expressions_1.html?seed=38&problem=divide&debug&lang=en Reviewers: eater, emily Reviewed By: emily Differential Revision: http://phabricator.khanacademy.org/D13229
Summary: Needed to make these exercises work well in the iPad app. TODO(eater): Plug our wysiwyg embuttoned expression editor into khan-exercises Test Plan: Do `grep regex exercises/*` and see that just exploring_angle_pairs_1 remains, which we're ok with. Run the unit tests at http://exercises.ka.local/test/ to verify the fixes to expressions in multiples/sets work and nothing else got broken in the process. Attempt one problem per problem type for each of the modified exercises, entering the question as the answer and get some sort of message about not simplifying or not being in the right form. Enter the answer from the hints and get graded correctly. Cross fingers that users will be able to figure this all out :\ Reviewers: charlie, aria Reviewed By: aria Subscribers: aria, peter Differential Revision: http://phabricator.khanacademy.org/D12070
Summary: Also did some misc cleanup in khan-exercise.js, mostly related to module-y things ("151 ++----"). I combined local jquery-ui into one file to make it easier to load. Test Plan: Opened addition_1, deriviative_intuition, graphing_points_2 locally, and all looked fine. In webapp/khan-exercises/, ran: ``` npm install -g requirejs r.js -o requirejs.config.js ``` then saw that /exercises/addition_1 looked right. Reviewers: eater, jack Reviewed By: jack CC: alex Differential Revision: http://phabricator.khanacademy.org/D7095
… the data-if attributes.
…tly-expanding whitespace problem in the cleaner.
fix #42324 Test plan: load each exercise locally and make sure it displays properly Auditors: peter, cbhl
…erent set of slightly easier exercises