# Calculated multichoice

คำถามประเภท Calculated multichoice จะคล้ายกับคำถาม multichoice แบบอื่น มีจุดเด่นคือสามารถใส่สูตรเข้าไปแล้วระบบจะทำการสุ่มตัวเลขและผลลัพธ์ออกมาเป็นตัวเลือกให้ โดยใช้ตัวแปรเดียวกัน และคำถามประเภทนี้ยังสามารถแชร์ตัวแปรกับคำถามประเภท Calculated ได้อีกด้วย และจุดเด่นอีกข้อหนึ่งคือข้อความและสูตรสามารถเพิ่มเข้าไปในตัวเลือกคำตอบได้ โดยใช้ {=...}

### การสร้างตัวเลือกในคำถามประเภท Calculated multichoice

อาจารย์ตั้งโจทย์ และตัวเลือกที่ต้องการให้น.ศ.เห็นคือ "จงคำนวนพื้นที่สี่เหลี่ยม เมื่อ ก = {A} และ ส = {B}cm"

ตัวเลือกคำตอบที่ถูกต้องที่อาจารย์ต้องเขียน คือ พื้นที่สี่เหลี่ยมคือ {={A}\*{B}} cm2

ตัวเลือกที่ถูกต้องที่จะแสดงผลออกมาคือ พื้นที่สี่เหลี่ยมคือ $$10.0cm^2$$

​ระบบจะทำการสุ่มค่าออกมาใส่ในตัวแปรให้ ตัวอย่างคือ {A} = 4.0 {B} = 2.5&#x20;

ดังนั้นแล้วอาจารย์จะต้องใส่สูตรในตัวเลือกลวงด้วย เช่น พื้นที่สี่เหลี่ยมคือ {={A}\*{}B}-{B} cm2 และ พื้นที่สี่เหลี่ยมคือ {={A}\*{B}+{A}} cm2

### การแสดงสูตรในตัวเลือก

เมื่อต้องการแสดงตัวอย่างให้น.ศ.เข้าใจในโจทย์ เช่นโจทย์ประเภทแยกตัวประกอบ

ตัวอย่างโจทย์ที่อาจารย์ตั้ง จงแยกตัวประกอบ $$3x^2+5xy+2y^2$$​ เมื่อ x = {A} และ y = {B}&#x20;

ตัวเลือกที่ถูกต้องคือ (3\*{A}+2\*{B})({A}+{B})

และตัวเลือกจะแสดงผลออกมาเป็น (3+4)(1+2) เป็นต้น

![ส่วนของการตั้งค่าจะเหมือนกับคำถามประเภท Multiple Choice](/files/KNmuveb47NeAi9QKDDDG)

![ส่วนของ Answer](/files/xt0SnFqZ1QAouHBB8oKq)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tlic.cmu.ac.th/cmumoodle-manual/quiz/creating-quiz/question-type/calculated-multichoice.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
