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.
HPH

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.

Best

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

<problem>
<script type="loncapa/python">
w = random.randint(0, 10)
h = random.randint(0, 10)
area = w * h
</script>
  
    <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"/>
    </numericalresponse>
      <solution>
          <div class="detailed-solution">
              <p>Explanation</p>
            <p>Multiply the width by the height to get the area.</p>
          </div>
      </solution>
</problem>