เรากำลังเปิดตัวการควบคุมแบบละเอียดสำหรับผู้ตอบเพื่อให้ผู้สร้างแบบฟอร์มควบคุมผู้ที่มีสิทธิ์ตอบได้มากขึ้น แบบฟอร์มที่สร้างด้วย API หลังจากวันที่ 31 มกราคม 2026 จะมีสถานะ "ไม่ได้เผยแพร่" โดยค่าเริ่มต้น ดูข้อมูลเพิ่มเติมได้ที่
การเปลี่ยนแปลง API ใน Google ฟอร์ม
ตั้งค่าตัวเลือกการให้คะแนนแบบทดสอบ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
การดูแลจัดการแบบทดสอบเป็นหนึ่งในฟีเจอร์หลักของ Google ฟอร์ม คู่มือนี้จะแสดงวิธีสร้างแบบทดสอบและเพิ่มตัวเลือกการให้คะแนนด้วย Forms API
สร้างแบบทดสอบพื้นฐาน
ระยะแรกของการสร้างแบบทดสอบเป็นกระบวนการ 2 ขั้นตอน ได้แก่ คุณสร้างแบบฟอร์ม แล้วอัปเดตการตั้งค่าของแบบฟอร์มเพื่อกำหนดให้เป็นแบบทดสอบ ดูวิธีการตั้งค่าพื้นฐานได้ที่หัวข้อสร้างแบบฟอร์มหรือแบบทดสอบ
เพิ่มคำถาม
หลังจากสร้างแบบทดสอบแล้ว ให้เพิ่มคำถาม (ดูรายการประเภทคำถามได้ที่ Question object
) คุณสามารถใส่ตัวเลือกการให้คะแนนเมื่อเพิ่มคำถามเป็นครั้งแรก หรือจะอัปเดตในภายหลังก็ได้ ตัวอย่างโค้ด JSON สำหรับรายการคำถามใหม่ที่มีตัวเลือกการให้คะแนนจะมีลักษณะดังนี้
"item": {
"title": "Which of these singers was not a member of Destiny's Child?",
"questionItem": {
"question": {
"required": True,
"grading": {
"pointValue": 2,
"correctAnswers": {
"answers": [{"value": "Rihanna"}]
},
"whenRight": {"text": "You got it!"},
"whenWrong": {"text": "Sorry, that's wrong"}
},
"choiceQuestion": {
"type": "RADIO",
"options": [
{"value": "Kelly Rowland"},
{"value": "Beyoncé"},
{"value": "Rihanna"},
{"value": "Michelle Williams"}
]
}
}
}
}
ดูวิธีเพิ่มรายการคำถามลงในแบบฟอร์มได้ที่อัปเดตแบบฟอร์มหรือแบบทดสอบ
เพิ่มตัวเลือกการให้คะแนน
การเพิ่มตัวเลือกการให้คะแนนในคำถามแบบทดสอบจะช่วยให้กระบวนการให้คะแนนเป็นแบบอัตโนมัติ
แต่ละคำถามสามารถกำหนดคะแนนเต็มและแสดงความคิดเห็นเกี่ยวกับคำตอบของผู้ใช้
สำหรับคำถามประเภทต่างๆ ด้านล่าง การเพิ่มช่องcorrectAnswers
จะช่วยให้ระบบสามารถให้คะแนนคำถามเหล่านั้นโดยอัตโนมัติเมื่อส่งแบบทดสอบ คุณสามารถแสดงความคิดเห็นที่เฉพาะเจาะจงสำหรับคำตอบที่ถูกต้องและไม่ถูกต้องได้โดยใช้ช่อง whenRight
และ whenWrong
- ช่องทำเครื่องหมาย
- วิทยุ
- เมนูแบบเลื่อนลง
คำถามคำตอบสั้นๆ ยังให้คะแนนโดยอัตโนมัติได้ด้วยการเพิ่มcorrectAnswers
ช่อง แต่คุณจะให้คะแนนได้เพียง generalFeedback
เท่านั้น ไม่สามารถให้คะแนนเป็น whenRight
หรือ whenWrong
สำหรับคำถามประเภทอื่นๆ การให้คะแนนจะไม่เป็นแบบอัตโนมัติ และคุณจะให้คะแนนได้เพียง generalFeedback
หมายเหตุ: ระบบจะบันทึกและประเมินคำตอบของผู้ใช้เป็นข้อความ (ดูรายละเอียดเกี่ยวกับการจัดรูปแบบคำตอบประเภทต่างๆ ได้ที่ออบเจ็กต์ TextAnswer
) ยกเว้นคำถามที่คำตอบเป็นการอัปโหลดไฟล์ คำตอบต้องตรงกับเฉลยคำตอบทุกประการจึงจะถือว่าถูกต้อง
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-04-09 UTC
[null,null,["อัปเดตล่าสุด 2025-04-09 UTC"],[],["Create a quiz in Google Forms by first building a form, then converting it to a quiz via settings. Add questions, specifying the question type and whether it's required. Include grading options like `pointValue`, `correctAnswers`, and feedback (`whenRight`, `whenWrong`). Questions with `correctAnswers` (Checkbox, Radio, Dropdown, Short answer) can be auto-graded. Feedback options are available for correct and incorrect answers, except for short answers that only offer `generalFeedback`. Answers are evaluated as text for correctness.\n"],null,["# Set up quiz grading options\n\nAdministering quizzes is one of the key features of Google Forms. This guide\nshows you how to create a quiz and add grading options with the Forms API.\n\nMake a basic quiz\n-----------------\n\nThe first stage of making a quiz is a two-step process: you create a form,\nthen update the form's settings to define it as a quiz. See\n[Create a form or quiz](/workspace/forms/api/guides/create-form-quiz#convert_a_form_to_a_quiz)\nfor basic setup instructions.\n\nAdd questions\n-------------\n\nAfter you've created the quiz, add the questions (see the\n[`Question object`](/workspace/forms/api/reference/rest/v1/forms#question) for a\nlist of question types). You can include\n[grading options](#grading-options) when you first add the questions, or\nupdate them later. Sample JSON code for a new question item that includes\ngrading options looks like this: \n\n \"item\": {\n \"title\": \"Which of these singers was not a member of Destiny's Child?\",\n \"questionItem\": {\n \"question\": {\n \"required\": True,\n \"grading\": {\n \"pointValue\": 2,\n \"correctAnswers\": {\n \"answers\": [{\"value\": \"Rihanna\"}]\n },\n \"whenRight\": {\"text\": \"You got it!\"},\n \"whenWrong\": {\"text\": \"Sorry, that's wrong\"}\n },\n \"choiceQuestion\": {\n \"type\": \"RADIO\",\n \"options\": [\n {\"value\": \"Kelly Rowland\"},\n {\"value\": \"Beyoncé\"},\n {\"value\": \"Rihanna\"},\n {\"value\": \"Michelle Williams\"}\n ]\n }\n }\n }\n }\n\nSee [Update a form or quiz](/workspace/forms/api/guides/update-form-quiz#add_an_item)\nto learn how to add a question item to a form.\n\nAdd grading options\n-------------------\n\nAdding grading options to quiz questions helps automate the grading process.\nEach question can have an assigned point value and give the user feedback about\ntheir answer.\n\nFor the question types below, adding a`correctAnswers` field enables them to\nbe automatically graded when the quiz is submitted. You can provide\nspecific feedback for correct and incorrect answers using the `whenRight` and\n`whenWrong` fields.\n\n- Checkbox\n- Radio\n- Dropdown\n\nShort answer questions can also be auto-graded by adding a `correctAnswers`\nfield, but you can only provide `generalFeedback`, not `whenRight` or\n`whenWrong` feedback. For other types of questions, grading is not automatic\nand you can only provide `generalFeedback`.\n\n**Note:** Except for questions where the answer is via a file upload, the\nuser's answer is captured and evaluated as text (see the\n[`TextAnswer`](/workspace/forms/api/reference/rest/v1/forms.responses#textanswer)\nobject for specifics about how different types of answers are formatted). To\nbe correct, the answer must match the answer key exactly."]]