Permalink
Browse files

Use type=number on exercises with multiple inputs.

Test Plan:
local, Chrome/OS X with local hack to bypass touch detection in
utils/answer-types.js

Reviewers: tom, eater

Reviewed By: eater

CC: stephanie, alpert

Differential Revision: http://phabricator.khanacademy.org/D1027
  • Loading branch information...
1 parent 4ce7471 commit 4b0f8d7f39d2639e60bb25c4f37f4e743e7ee3f4 @cbhl cbhl committed Jan 17, 2013
@@ -99,14 +99,14 @@
<span class="set-sol" data-each="FACTORS as FACTOR"><var>FACTOR</var></span>
<p class="input-format">
Enter all the different factors you can find (one factor per box):<br/>
- <span class="entry" type="number" data-forms="integer"></span><br/>
- <span class="entry" type="number" data-forms="integer"></span><br/>
- <span class="entry" type="number" data-forms="integer"></span><br/>
- <span class="entry" type="number" data-forms="integer"></span><br/>
- <span class="entry" type="number" data-forms="integer"></span><br/>
- <span class="entry" type="number" data-forms="integer"></span><br/>
- <span class="entry" type="number" data-forms="integer"></span><br/>
- <span class="entry" type="number" data-forms="integer"></span>
+ <span class="entry" data-forms="integer"></span><br/>
+ <span class="entry" data-forms="integer"></span><br/>
+ <span class="entry" data-forms="integer"></span><br/>
+ <span class="entry" data-forms="integer"></span><br/>
+ <span class="entry" data-forms="integer"></span><br/>
+ <span class="entry" data-forms="integer"></span><br/>
+ <span class="entry" data-forms="integer"></span><br/>
+ <span class="entry" data-forms="integer"></span>
</p>
</div>
@@ -5,7 +5,8 @@
<title>Factor expressions by grouping</title>
<script src="../khan-exercise.js"></script>
<style type="text/css">
- #answer_area input[type=text] {
+ #answer_area input[type=text],
+ #answer_area input[type=number] {
width: 30px;
}
</style>
@@ -49,9 +50,9 @@
<div class="input-format">
<div class="entry" data-type="multiple" style="font-size: 14px;">
<div style="float: left;">
- <code>(</code><span class="sol"></span><code>\space r + \space</code><span class="sol"></span><code>)</code>
+ <code>(</code><span class="sol" data-forms="integer"></span><code>\space r + \space</code><span class="sol" data-forms="integer"></span><code>)</code>
</div><div style="float: right;">
- <code>(</code><span class="sol"></span><code>\space s + \space</code><span class="sol"></span><code>)</code>
+ <code>(</code><span class="sol" data-forms="integer"></span><code>\space s + \space</code><span class="sol" data-forms="integer"></span><code>)</code>
</div>
</div>
</div>
@@ -5,7 +5,8 @@
<title>Solving quadratics by factoring</title>
<script src="../khan-exercise.js"></script>
<style type="text/css">
- #answer_area input[type=text] {
+ #answer_area input[type=text],
+ #answer_area input[type=number] {
width: 35px;
}
</style>
@@ -36,7 +37,7 @@
<div class="set-sol"><var>A</var></div>
<div class="set-sol"><var>B</var></div>
<div class="input-format"><p style="font-size: 12px;">
- <code>x = {}</code><span class="entry"></span><code>\space \text{and}\space x = {}</code><span class="entry"></span>
+ <code>x = {}</code><span class="entry" data-forms="integer"></span><code>\space \text{and}\space x = {}</code><span class="entry" data-forms="integer"></span>
</p></div>
</div>
@@ -77,7 +78,7 @@
<p class="problem">Determine where <code>f(x)</code> intersects the x-axis.</p>
<p class="question"><code>f(x) = <var>plus( SQUARE + "x^2")</var> + <var>plus( LINEAR + "x" )</var> + <var>CONSTANT</var></code></p>
<div class="solution" data-type="multiple">
- <p><code>x = \quad</code><span class="sol"><var>A</var></span></p>
+ <p><code>x = \quad</code><span class="sol" data-forms="integer"><var>A</var></span></p>
</div>
<div class="hints" data-apply="appendContents">
<div>
@@ -5,7 +5,8 @@
<title>Solving quadratics by factoring 2</title>
<script src="../khan-exercise.js"></script>
<style type="text/css">
- #answer_area input[type=text] {
+ #answer_area input[type=text],
+ #answer_area input[type=number] {
width: 35px;
}
</style>
@@ -36,7 +37,7 @@
<div class="set-sol"><var>A</var></div>
<div class="set-sol"><var>B</var></div>
<div class="input-format"><p style="font-size: 12px;">
- <code>x = {}</code><span class="entry"></span><code>\space \text{and} \space x = {}</code><span class="entry"></span>
+ <code>x = {}</code><span class="entry" data-forms="integer"></span><code>\space \text{and} \space x = {}</code><span class="entry" data-forms="integer"></span>
</p></div>
</div>
@@ -77,7 +78,7 @@
<p class="problem">Determine where <code>f(x)</code> intersects the x-axis.</p>
<p class="question"><code>f(x) = <var>plus( SQUARE + "x^2")</var> + <var>plus( LINEAR + "x" )</var> + <var>CONSTANT</var></code></p>
<div class="solution" data-type="multiple">
- <p><code>x = \quad</code><span class="sol"><var>A</var></span></p>
+ <p><code>x = \quad</code><span class="sol" data-forms="integer"><var>A</var></span></p>
</div>
<div class="hints" data-apply="appendContents">
<div id="hint1">
@@ -150,7 +150,7 @@
<div class="solution" data-type="set">
<div class="set-sol"><var>SOLUTION</var></div>
<div class="input-format">
- <p><code><var>X</var> = \quad</code><span class="entry"></span></p>
+ <p><code><var>X</var> = \quad</code><span class="entry" data-forms="integer, decimal"></span></p>
</div>
</div>
@@ -5,7 +5,10 @@
<title>Systems of equations word problems</title>
<script src="../khan-exercise.js"></script>
<style type="text/css">
- #answer_area input[type=text] {width: 50px;}
+ #answer_area input[type=text],
+ #answer_area input[type=number] {
+ width: 50px;
+ }
</style>
</head>
<body>
@@ -40,8 +43,8 @@
many home team and away team fans attended the game?</span></p>
</div>
<div class="solution" data-type="multiple">
- <p># of <var>UNIT_1</var> = <span class="sol"><var>X</var></span></p>
- <p># of <var>UNIT_2</var> = <span class="sol"><var>Y</var></span></p>
+ <p># of <var>UNIT_1</var> = <span class="sol" data-forms="integer, decimal"><var>X</var></span></p>
+ <p># of <var>UNIT_2</var> = <span class="sol" data-forms="integer, decimal"><var>Y</var></span></p>
</div>
<div class="hints">
<p>Let <code>x</code> equal the number of <var>UNIT_1</var> and <code>y</code> equal the number of <var>UNIT_2</var>.</p>
@@ -104,8 +107,8 @@
<p><span data-if="INDEX === 0 || INDEX === 1"><var>PROBLEM_1</var>. Bags of candy cost $<var>A1.toFixed( 2 )</var>, and bags of cookies cost $<var>B1.toFixed( 2 )</var>, and sales equaled $<var>C1.toFixed( 2 )</var> in total. There were <var>C2</var> more bags of cookies than candy sold.<br /><br /><var>PROBLEM_2</var>.</span><span data-else>The sum of two angles' measures is <var>C1</var> degrees. Angle 2 is <var>abs( C2 )</var> degrees smaller than <var>abs( A2 )</var> times angle 1.<br /><br />What are the measures of the two angles in degrees?</span></p>
</div>
<div class="solution" data-type="multiple">
- <p><span data-if="INDEX !== 2"># of </span><var>UNIT_1</var> = <span class="sol"><var>X</var></span></p>
- <p><span data-if="INDEX !== 2"># of </span><var>UNIT_2</var> = <span class="sol"><var>Y</var></span></p>
+ <p><span data-if="INDEX !== 2"># of </span><var>UNIT_1</var> = <span class="sol" data-forms="integer, decimal"><var>X</var></span></p>
+ <p><span data-if="INDEX !== 2"># of </span><var>UNIT_2</var> = <span class="sol" data-forms="integer, decimal"><var>Y</var></span></p>
</div>
<div class="hints">
<p>Let <code>x</code> equal the <span data-if="INDEX !== 2">number</span><span data-else>measure</span> of <var>UNIT_1</var> and <code>y</code> equal the <span data-if="INDEX !== 2">number</span><span data-else>measure</span> of <var>UNIT_2</var>.</p>
@@ -176,8 +179,8 @@
group paid $<var>C2.toFixed( 2 )</var> in total.<br /><br />Find the number of teachers and students on the field trips.</p>
</div>
<div class="solution" data-type="multiple">
- <p># of teachers = <span class="sol"><var>X</var></span></p>
- <p># of students = <span class="sol"><var>Y</var></span></p>
+ <p># of teachers = <span class="sol" data-forms="integer, decimal"><var>X</var></span></p>
+ <p># of students = <span class="sol" data-forms="integer, decimal"><var>Y</var></span></p>
</div>
<div class="hints">
<p>Let <code>x</code> equal the number of teachers and <code>y</code> equal the number of students.</p>
@@ -247,8 +250,8 @@
<div class="set-sol"><var>X</var></div>
<div class="set-sol"><var>Y</var></div>
<div class="input-format">
- <p><code>x</code> = <span class="entry"></span></p>
- <p><code>y</code> = <span class="entry"></span></p>
+ <p><code>x</code> = <span class="entry" data-forms="integer, decimal"></span></p>
+ <p><code>y</code> = <span class="entry" data-forms="integer, decimal"></span></p>
</div>
</div>
<div class="hints">
@@ -5,7 +5,8 @@
<title>Telling time</title>
<script src="../khan-exercise.js"></script>
<style type="text/css">
- #answer_area .short input[type=text] {
+ #answer_area .short input[type=text],
+ #answer_area .short input[type=number] {
width: 30px;
}
</style>
@@ -34,7 +35,7 @@
<div style="clear: both;"></div>
</div>
<div class="solution" data-type="multiple">
- <p class="short">The time is:<br><span class="sol"><var>HOUR</var></span> : <span class="sol"><var>NICE_MINUTE</var></span> <var>AM_PM</var></p>
+ <p class="short">The time is:<br><span class="sol" data-type="integer"><var>HOUR</var></span> : <span class="sol" data-type="integer"><var>NICE_MINUTE</var></span> <var>AM_PM</var></p>
<p class="example">a 12-hour time in hours and minutes</p>
</div>

0 comments on commit 4b0f8d7

Please sign in to comment.