Looking for XBlock to provide "calculated question"

Hi all
We are running edX to provide LMS in our university. In some courses, we want to have multichoice question based on formular and parameters (as “calculated question” in Moodle: Calculated question type - MoodleDocs). Is there any Xblock to provide such similar function in edX? Very appreciate if anyone can provide comments or suggetion.

Thank you.

I think the typical solution to this is to use Python embedded in the course. There is some documentation here: 10.45. Write-Your-Own-Grader Problem — Building and Running an edX Course documentation

Thank you @pdpinch

I will try to follow your advice.


@Hoang_PHAM_HUY This snippet will do what that Moodle example does:

<script type="loncapa/python">
w = random.randint(0, 10)
h = random.randint(0, 10)
area = w * h
    <label>Calculate the area of a rectangle, given the height and width below:</label>
    <p>Height = $h</p>
    <p>Width = $w</p>
    <numericalresponse answer="$area">
     <textline size="10"/>
          <div class="detailed-solution">
            <p>Multiply the width by the height to get the area.</p>