--- metadata: display_name: Custom Python-Evaluated Input markdown: !!null data: |

In custom Python-evaluated input (also called "write-your-own-grader" problems), the grader uses a Python script that you create and embed in the problem to evaluate a learner's response or provide hints. These problems can be any type. Numerical input and text input problems are the most common write-your-own-grader problems.

You can use script tag format or answer tag format to create these problems.

You can create custom Python-evaluated input problems that provide partial credit or that randomize variables in the Python code. You can also add images to the solution by using an HTML "img" tag. Note that the "img" tag must be between the "div" tags that are inside the "solution" tags, and that learners do not see these images until they click the "Show Answer" button.

For more information, see Write-Your-Own-Grader Problem in Building and Running an Open edX Course.

When you add the problem, be sure to select Settings to specify a Display Name and other values that apply.

You can use the following example problem as a model.



Explanation

Any set of integers on the line \(y = 10 - x\) satisfy these constraints.


Explanation

Any set of integers on the line \(y = 20 - x\) satisfy these constraints.

To add an image to the solution, use an HTML "img" tag. Make sure to include alt text.

Description of image, with a primary goal of explaining its
                    relevance to the problem or concept being illustrated for someone
                    who is unable to see the image.