Merge and squash pull request #31164 from saasmath/master

Closes #31164

commit 1261caef7cafbdf46285e3185b89d3fb71601dab
Author: Gary Anderson <git@garyvictoranderson.com>
Date:   Wed Oct 3 04:14:58 2012 -0700

    Accept approximate decimal answers in computing means

commit 08abd643e0df124ecf43600e9ad85077e14c987e
Merge: 87bc7c5 d1f63a4
Author: Gary Anderson <git@garyvictoranderson.com>
Date:   Wed Oct 3 03:55:57 2012 -0700

    Merge branch 'master' of https://github.com/Khan/khan-exercises

commit 87bc7c506f0265cf7aeab36dc6634b7a495f0111
Author: Gary Anderson <git@garyvictoranderson.com>
Date:   Tue Oct 2 03:27:10 2012 -0700

    Accept inexact answers for area computations using z-scores.

    In math and statistics courses, many students are taught to use graphing calculators or other
    technology, rather than tables, to compute areas under the normal curve.  These will differ
    in the last digit frequently from the approximate z-tables, leading to incorrectly reported errors in
    the exercises.
    This fixes the issue by accepting the correctly rounded technology produced answer.
Add matrix addition exercise. Also, add prependVars to tmpl.js.
Remove unused import
Add exercises: Matrix addition and Matrix subtraction

Summary: Also, add prependVars to tmpl.js.

Test Plan: Tested locally.

Reviewers: eater, yunfangjuan

Differential Revision: http://phabricator.khanacademy.org/D797
add scalar matrix multiplication exercise
fixes for D797
refactors for D797
refactor printMatrix to use deepZipWith
rename exercises/filenames and get rid of unused graphie import
Remove unused images.

Summary:
'grep -r repeating-sprites .' shows that these files aren't referenced
anywhere.

Reviewers: eater

Reviewed By: eater

Differential Revision: http://phabricator.khanacademy.org/D806
Copy over the images from the KA repository.

Summary:
The content of these images haven't changed, but the size has since we
spent some time compressing images for KA.

I used the following messy command to do this:

khan-exercises$ find . -name '*.png' | while read i; do for subdir in "" "badges/" "avatars/"; do orig=~/khan/stable/`echo $i | sed -e s,/css,, -e s,images/,images/$subdir,`; [ -e $orig ] && cp -v $orig $i; done; done

The following two files did not exist in the main KA repo, so I
compressed them manually by running pngout on them:
   images/protractor.png images/circ.png

Test Plan:
Viewed all the images in a viewer, for before-change and after-change,
and verified they look the same.

Reviewers: eater

Reviewed By: eater

Differential Revision: http://phabricator.khanacademy.org/D807
Remove an unused image.

Summary:
Ben eater sez, at http://phabricator.khanacademy.org/D807: "I happen
to know that images/circ.png isn't used anywhere. We can remove it,
fwiw."

Test Plan: Trust ben :-)  Also, did 'grep -r circ.png .' and found nothing.

Reviewers: eater

Reviewed By: eater

Differential Revision: http://phabricator.khanacademy.org/D808
Get rid of some more unused images

Summary:
'grep css/ -r .' shows that only throbber.css is being used from this
directory.

Reviewers: eater

Reviewed By: eater

Differential Revision: http://phabricator.khanacademy.org/D809
Lint

Test plan: Cross fingers

Auditors: alpert
Make answer types much more modular, and more internally consistent

Summary:
Separate answer-type creation into two steps, setup (where the answer area is
messed with) and validator creation (where a function to validate solutions is
created). These two may only communicate by a "guess" variable, generated by
the setup portion and evaluated by the validator portion. This allows for
cleaner and less hacky code, and also allows for multiple solutions to be
validated using the same setup.

Some of the khan-exercise.js code had to be modified to make this work
correctly, but most of the changes come from the rework of answer-types.js

Test Plan:
Go through lots of exercises and make sure that they still work, and that the
timeline still works with their answers

Reviewers: eater

Reviewed By: eater

CC: alpert

Differential Revision: http://phabricator.khanacademy.org/D793
Fix set answer type

... I think.

Auditors: xymostech, eater
Remove our 3-layer redundant snapping

For some reason, we perform snapping 3 times, instead of the required 1.
This apparently leads to some problems. I'm not sure why these problems
occur, but they do, and this fixes them.

Closes 31738, 31739
Merge pull request #31742 from xymostech/fix-snapx

Remove our 3-layer redundant snapping
Fix radio answer type to require selecting an answer and be whitespace insensitive

Test Plan: Tested limits_1 and expected_value exercises in devappserver. Checked that unselected radio couldn't be selected, correct answer was accepted, and history showed up in coach reports.

Reviewers: emily

Reviewed By: emily

Differential Revision: http://phabricator.khanacademy.org/D838
more -> at least

Test Plan: Tested locally

Reviewers: stephanie, yunfangjuan

Reviewed By: stephanie

Differential Revision: http://phabricator.khanacademy.org/D837