-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from mitodl/variable_names_with_numbers
Introduces sampling for numbered variables
- Loading branch information
Showing
10 changed files
with
182 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<problem display_name="Numbered Variables" showanswer="always" weight="10" attempts=""> | ||
|
||
<p>If you have a system that contains a large or infinite number of numbered coefficients such as \(a_1\), \(a_2\), etc, it can be a pain to initialize all of these variables as independent variables that the grader should accept. Numbered variables allows you to specify that "a" is a numbered variable, and the system will then accept any entry of the form "a_{##}" where ## is an integer.</p> | ||
|
||
<p>The answer to the problem below is "a_{0} + a_{1} + a_{-1}". Try including "a_{42}" in your expression -- the grader should be happy to parse your expression and grade you appropriately.</p> | ||
|
||
<script type="text/python" system_path="python_lib"> | ||
from mitxgraders import FormulaGrader | ||
grader = FormulaGrader( | ||
answers='a_{0} + a_{1} + a_{-1}', | ||
numbered_vars=['a'] | ||
) | ||
</script> | ||
|
||
<customresponse cfn="grader" inline="1"> | ||
<textline math="1" inline="1" correct_answer="a_{0} + a_{1} + a_{-1}"/> | ||
</customresponse> | ||
|
||
<a href="https://github.com/mitodl/mitx-grading-library/tree/master/course/problem/formula9.xml" target="_blank">View source</a> | ||
|
||
</problem> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
Version number | ||
""" | ||
|
||
__version__ = "1.0.5" | ||
__version__ = "1.1" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters