คู่มือสร้างเกมทายใจ (Quiz JSON)
เอกสารนี้อธิบายทุกส่วนที่ต้องรู้ตั้งแต่ quiz_id ไปจนถึง การ์ดผลลัพธ์ , รูปแบบ 9:16 คงที่ มีเครดิต DUANGKUB ผู้เล่นกด บันทึกรูป ได้
เริ่มต้นอย่างไร (5 ขั้นตอน)
- 1ไปที่ สร้างเกมใหม่ หรือโหลดเทมเพลตจากหน้านี้ , ระบบจะสร้าง JSON เปล่าให้
- 2กรอก
quiz_id(slug ภาษาอังกฤษตัวเล็ก) ให้ตรงกับใน JSON , เช่นmy_quiz_001 - 3แก้
metadataquestions[]results[]ใน JSON editor , Preview อัปเดตอัตโนมัติ - 4กดบันทึก , ระบบรัน AUNSSH Guard ถ้าได้ Pass หรือ Warn จึงเผยแพร่ได้
- 5ทดลองเล่นที่หน้า Preview แล้วดู การ์ดผลลัพธ์ ตอนจบเกม , ผู้เล่นจะเห็นการ์ด 9:16 และปุ่ม บันทึกรูป
โครงสร้าง JSON ราก
ทุกเกมต้องมี 4 ส่วนหลัก: quiz_idmetadataquestions และ results
{ "quiz_id": "my_quiz_001", "metadata": { "title": "ชื่อเกม", "description": "คำอธิบายสั้นๆ บนหน้าเล่น", "cover_image": null, "theme_color": "#4A90E2", "scoring_type": "personality_count", "allow_back_button": true }, "questions": [ /* อย่างน้อย 1 ข้อ */ ], "results": [ /* อย่างน้อย 1 ผลลัพธ์ */ ] }quiz_idSlug ภาษาอังกฤษตัวเล็ก ใช้ใน URL เช่น /quiz/play/my_quiz_001
questions[]อย่างน้อย 1 ข้อ ทุก option ต้องชี้ไปคำถามถัดไปหรือ results
results[]อย่างน้อย 1 ผล ต้องสอดคล้องกับ scoring_type ที่ตั้งไว้
metadata , ข้อมูลเกม
อยู่ใน object metadata กำหนดชื่อเกม ธีมสี และพฤติกรรมขณะเล่น
| Field | บังคับ | คำอธิบาย |
|---|---|---|
title | ใช่ | ชื่อเกมที่แสดงบนหน้าเล่นและในการ์ดผลลัพธ์ |
description | ไม่ | คำอธิบายสั้นๆ ใต้ชื่อเกม |
cover_image | ไม่ | URL รูปปกบนหน้าเล่น , ไม่แสดงในการ์ดผลลัพธ์ อีกต่อไป |
theme_color | ไม่ | สีธีม hex เช่น #4A90E2 ใช้กับ progress bar บนหน้าเล่น ไม่กระทบการ์ดผลลัพธ์ |
scoring_type | ใช่ | วิธีคิดคะแนน , ดูรายละเอียดใน scoring_type |
allow_back_button | ไม่ | true = ผู้เล่นย้อนกลับแก้คำตอบได้ |
การ์ดผลลัพธ์ รูปแบบคงที่ (แก้ไม่ได้)
เมื่อผู้เล่นตอบครบ ระบบแสดง การ์ดผลลัพธ์ สัดส่วน 9:16 กึ่งกลางหน้าจอ พร้อมปุ่ม บันทึกรูปผู้สร้างเกมปรับแต่ง branding การ์ดไม่ได้
องค์ประกอบที่ระบบกำหนดให้ (คงที่)
| ส่วน | รายละเอียด |
|---|---|
brand | ด้านบน: DUANGKUB QUIZ ไม่มีรูป |
ชื่อเกม | จาก metadata.title จัดกึ่งกลาง ขึ้นบรรทัดใหม่ตามคำภาษาไทย |
ผลลัพธ์ | results[].title ตัวใหญ่ + results[].description ด้านล่าง |
footer | ซ้าย: duangkub.com · ขวา: By + author_name ของเกม |
สี | พื้นหลังครีม #FAF8F5 ตัวอักษรดำ #1A1814 มินิมอล อ่านชัด |
ขนาดรูป | 1080×1920 px (9:16) เหมาะแชร์ Story / Reels |
ระบบจัดขึ้นบรรทัดใหม่แบบรู้คำภาษาไทย เช่น เกาหลี จะไม่ถูกตัดเป็น เก + หลี แต่จะตัดที่ขอบเขตคำ เช่น เกา แล้วขึ้นบรรทัด หลี หรือย้ายทั้งคำ เกาหลี ลงบรรทัดใหม่
result_image และ cover_imageไม่แสดงในการ์ด เนื้อหากลางการ์ดมาจากข้อความใน results[] เท่านั้นquestions คำถามและตัวเลือก
แต่ละข้อใน questions[] ประกอบด้วยคำถาม รูปแบบการแสดงผล และตัวเลือก
ฟิลด์ระดับคำถาม
id รหัสไม่ซ้ำ เช่น q1question_text ข้อความคำถามquestion_image URL รูปประกอบ (หรือ null)layout_type เช่น text_onlyimage_top_text_bottomfull_bleed_imagechoice_display_type , เช่น list_verticalimage_gridcardsoptions[] , รายการตัวเลือก อย่างน้อย 1 ตัวฟิลด์ระดับตัวเลือก (options[])
| Field | คำอธิบาย |
|---|---|
choice_id | รหัสตัวเลือกไม่ซ้ำในเกม |
text | ข้อความที่ผู้เล่นเห็น |
image_url | รูปประกอบตัวเลือก (ถ้ามี) |
score | คะแนนตัวเลข , ใช้เมื่อ scoring_type เป็น total_score หรือ weighted_tags |
tags[] | แท็กบุคลิก , ใช้เมื่อ scoring_type เป็น personality_count หรือ weighted_tags |
next_question_id | ID คำถามถัดไป หรือ results เพื่อจบเกม , สำคัญ ทุกเส้นทางต้องจบที่ results |
next_question_id ต่างกันในแต่ละ option ถ้าไม่ใส่ ระบบไปข้อถัดไปใน array อัตโนมัติscoring_type , วิธีคิดคะแนน
ตั้งใน metadata.scoring_type แล้วกำหนด mapping_criteria ในแต่ละผลลัพธ์ให้ตรงกัน
personality_countนับจำนวน tags ที่ผู้เล่นเลือก , แท็กที่ได้มากสุดชนะ
mapping: target_tag
total_scoreรวม score จากทุกตัวเลือก , ผลที่ตรงช่วงคะแนนชนะ
mapping: min_score + max_score
weighted_tagsรวมน้ำหนัก score ต่อแท็ก , แท็กที่มีคะแนนรวมสูงสุดชนะ
mapping: target_tag
results , ผลลัพธ์และแชร์
แต่ละผลใน results[] คือคำตอบที่ผู้เล่นอาจได้รับ , เนื้อหานี้จะแสดงบนการ์ดผลลัพธ์
| Field | บังคับ | คำอธิบาย |
|---|---|---|
result_id | ใช่ | รหัสผลลัพธ์ไม่ซ้ำ |
title | ใช่ | ชื่อผลลัพธ์ , แสดงตัวใหญ่กลางการ์ด |
description | ไม่ | คำอธิบายผลลัพธ์ , แนะนำให้เขียนยาวพอให้ผู้เล่นรู้สึกคุ้ม |
result_image | ไม่ | URL รูปผลลัพธ์ , ไม่แสดงในการ์ด แล้ว แต่เก็บไว้ใน JSON ได้ |
sharing_meta | ไม่ | ข้อมูลแชร์ , share_titleshare_description |
mapping_criteria | ไม่ | เงื่อนไขจับคู่ผล , ต้องสอดคล้องกับ scoring_type |
{ "result_id": "res_mage", "title": "จอมเวทย์ผู้รอบรู้", "description": "คุณใช้สติปัญญาและความเยือกเย็นในการแก้ปัญหา...", "result_image": null, "sharing_meta": { "share_title": "ฉันได้เป็น 'จอมเวทย์' แล้วคุณล่ะ?", "share_description": "มาลองเล่นเกมทายใจนี้กัน" }, "mapping_criteria": { "by_scoring_type": "personality_count", "target_tag": "mage" } }หน้าจอหลังเล่นจบ , ผู้เล่นเห็นอะไร
- ระบบคำนวณผลจาก
scoring_typeและเลือกresults[]ที่ตรงเงื่อนไข - แสดง การ์ดผลลัพธ์ 9:16 กึ่งกลาง , brand → ชื่อเกม → ชื่อผล → คำอธิบาย → footer (รูปแบบคงที่)
- มีปุ่ม บันทึกรูป เพียงปุ่มเดียว , ดาวน์โหลด PNG 1080×1920 ไปแชร์ Story / Reels ได้เลย
- พื้นหลังครีม
#FAF8F5ตัวอักษรดำ , ไม่มีรูปปกหรือรูปผลลัพธ์ - ขึ้นบรรทัดใหม่แบบรู้คำไทย , ไม่ตัดคำกลางพยางค์
- มุมซ้ายล่าง:
duangkub.com· มุมขวา:By ชื่อผู้สร้างจากauthor_name(แก้ branding ไม่ได้)
results[].description ให้กระชับแต่มีสาระ , ข้อความนี้จะอยู่ในการ์ดและรูปที่ผู้เล่นแชร์ผู้สร้างเกม (Author)
author_typeOfficial (staff) , เกมโดยทีมงานดวงคับดอตคอม แสดง badge ทางการ
Community (member) , เกมโดยสมาชิก ตั้งเป็น Community อัตโนมัติเมื่อสร้างจากหน้าสมาชิก
author_nameชื่อที่แสดงใต้เกม เช่น โดย ชื่อเล่นของคุณ และใน footer การ์ดเป็น By ชื่อเล่นของคุณ
สมาชิกใช้ชื่อจากโปรไฟล์อัตโนมัติ แก้เองไม่ได้ เพื่อป้องกันการปลอมชื่อ
AUNSSH Guard ตรวจอะไรบ้าง
- • field บังคับครบหรือไม่
- •
next_question_idชี้ไป question ที่มีจริง - • ไม่มี loop ที่ทำให้เกมไม่จบ
- • ทุกเส้นทางจบที่
results
- • หลีกเลี่ยง URL จาก
example.com - • เติม
sharing_metaให้ครบ - • คำอธิบายผลลัพธ์ยาวพอ
- • ห้าม script-like payload
สถานะ Guard
By Aunssh.com
Template Patterns
คัดลอก JSON ด้านล่างไปแก้ต่อได้ , หรือโหลดจากหน้า สร้างเกมใหม่
Branching Personality Quiz
เหมาะกับเกมทายใจที่แต่ละตัวเลือกพาไปคนละคำถาม
{ "quiz_id": "ultimate_game_001", "metadata": { "title": "ตามหาอาชีพที่ใช่ในโลกแฟนตาซี", "description": "ตอบคำถามเพื่อวิเคราะห์ตัวตนและอาชีพที่เหมาะกับคุณ", "cover_image": "https://example.com/cover.jpg", "theme_color": "#4A90E2", "scoring_type": "personality_count", "allow_back_button": true }, "questions": [ { "id": "q1", "question_text": "คุณตื่นขึ้นมาในห้องมืดๆ สิ่งแรกที่คุณควานหาคืออะไร?", "question_image": "https://example.com/dark-room.jpg", "layout_type": "image_top_text_bottom", "choice_display_type": "image_grid", "options": [ { "choice_id": "c1_a", "text": "ไม้กายสิทธิ์เปล่งแสง", "image_url": "https://example.com/wand.jpg", "score": 10, "tags": [ "mage", "intellect" ], "next_question_id": "q2" }, { "choice_id": "c1_b", "text": "ดาบเหล็กเล่มโต", "image_url": "https://example.com/sword.jpg", "score": 20, "tags": [ "warrior", "power" ], "next_question_id": "q3" } ] }, { "id": "q2", "question_text": "เมื่อเวทมนตร์ของคุณทำงาน คุณอยากให้มันเป็นแสงสีอะไร?", "question_image": null, "layout_type": "text_only", "choice_display_type": "list_vertical", "options": [ { "choice_id": "c2_a", "text": "สีน้ำเงินเยือกเย็น", "image_url": null, "score": 5, "tags": [ "mage", "calm" ], "next_question_id": "results" } ] }, { "id": "q3", "question_text": "หากต้องบุกฝ่าศัตรู คุณจะเลือกวิธีแบบไหน?", "question_image": null, "layout_type": "text_only", "choice_display_type": "list_vertical", "options": [ { "choice_id": "c3_a", "text": "เปิดทางด้วยพละกำลัง", "image_url": null, "score": 10, "tags": [ "warrior", "brave" ], "next_question_id": "results" } ] } ], "results": [ { "result_id": "res_mage", "title": "จอมเวทย์ผู้รอบรู้", "description": "คุณใช้สติปัญญาและความเยือกเย็นในการแก้ปัญหา...", "result_image": "https://example.com/mage-result.jpg", "sharing_meta": { "share_title": "ฉันได้เป็น 'จอมเวทย์' แล้วคุณล่ะ?", "share_description": "มาลองเล่นเกมทายใจนี้กัน" }, "mapping_criteria": { "by_scoring_type": "personality_count", "target_tag": "mage", "min_score": null, "max_score": null } }, { "result_id": "res_warrior", "title": "นักรบหัวใจแกร่ง", "description": "คุณตัดสินใจไว ชัดเจน และพร้อมเป็นแนวหน้า...", "result_image": "https://example.com/warrior-result.jpg", "sharing_meta": { "share_title": "ฉันได้เป็น 'นักรบ' แล้วคุณล่ะ?", "share_description": "มาลองเล่นเกมทายใจนี้กัน" }, "mapping_criteria": { "by_scoring_type": "personality_count", "target_tag": "warrior", "min_score": null, "max_score": null } } ] }Linear Personality Quiz
ทุกคนเจอคำถามชุดเดียวกัน แล้ววัดผลจากการนับ tags
{ "quiz_id": "linear_personality_001", "metadata": { "title": "คุณเป็นหัวหน้าทีมแบบไหน?", "description": "ตอบครบทุกข้อ แล้วดูว่าคุณเป็นผู้นำสายไหน", "cover_image": null, "theme_color": "#3454D1", "scoring_type": "personality_count", "allow_back_button": true }, "questions": [ { "id": "q1", "question_text": "เมื่อทีมเริ่มสับสน คุณจะทำอะไรเป็นอย่างแรก?", "question_image": null, "layout_type": "text_only", "choice_display_type": "list_vertical", "options": [ { "choice_id": "c1_a", "text": "จัดลำดับความสำคัญใหม่ทันที", "image_url": null, "score": 2, "tags": [ "strategist" ], "next_question_id": "q2" }, { "choice_id": "c1_b", "text": "คุยกับทุกคนเพื่อรับฟังปัญหา", "image_url": null, "score": 2, "tags": [ "empathetic" ], "next_question_id": "q2" } ] }, { "id": "q2", "question_text": "เวลาเดดไลน์ใกล้เข้ามา คุณจะเน้นอะไร?", "question_image": null, "layout_type": "text_only", "choice_display_type": "list_vertical", "options": [ { "choice_id": "c2_a", "text": "เร่ง execution ให้ชัดและเร็ว", "image_url": null, "score": 2, "tags": [ "strategist" ], "next_question_id": "results" }, { "choice_id": "c2_b", "text": "ดู morale ทีมไม่ให้หลุด", "image_url": null, "score": 2, "tags": [ "empathetic" ], "next_question_id": "results" } ] } ], "results": [ { "result_id": "res_strategist", "title": "Strategic Lead", "description": "คุณเป็นหัวหน้าที่เก่งด้านการกำหนดทิศทางและเร่งให้ทีมเดินหน้า", "result_image": null, "sharing_meta": { "share_title": "ฉันเป็น Strategic Lead", "share_description": "ลองดูว่าคุณเป็นหัวหน้าทีมแบบไหน" }, "mapping_criteria": { "by_scoring_type": "personality_count", "target_tag": "strategist", "min_score": null, "max_score": null } }, { "result_id": "res_empathetic", "title": "Empathetic Lead", "description": "คุณเป็นหัวหน้าที่เก่งด้านความเข้าใจคนและรักษาสมดุลในทีม", "result_image": null, "sharing_meta": { "share_title": "ฉันเป็น Empathetic Lead", "share_description": "ลองดูว่าคุณเป็นหัวหน้าทีมแบบไหน" }, "mapping_criteria": { "by_scoring_type": "personality_count", "target_tag": "empathetic", "min_score": null, "max_score": null } } ] }Total Score Quiz
เหมาะกับแบบประเมินที่รวมคะแนนแล้วจับช่วงผลลัพธ์
{ "quiz_id": "score_range_001", "metadata": { "title": "คุณเครียดจากงานมากแค่ไหน?", "description": "ตอบครบแล้วระบบจะรวมคะแนนทั้งหมดเพื่อสรุประดับความเครียด", "cover_image": null, "theme_color": "#C44569", "scoring_type": "total_score", "allow_back_button": true }, "questions": [ { "id": "q1", "question_text": "คุณคิดเรื่องงานนอกเวลางานบ่อยแค่ไหน?", "question_image": null, "layout_type": "text_only", "choice_display_type": "list_vertical", "options": [ { "choice_id": "c1_a", "text": "แทบไม่เลย", "image_url": null, "score": 1, "tags": [], "next_question_id": "q2" }, { "choice_id": "c1_b", "text": "บ่อยมาก", "image_url": null, "score": 5, "tags": [], "next_question_id": "q2" } ] }, { "id": "q2", "question_text": "พักผ่อนเต็มที่ได้กี่วันต่อสัปดาห์?", "question_image": null, "layout_type": "text_only", "choice_display_type": "list_vertical", "options": [ { "choice_id": "c2_a", "text": "อย่างน้อย 3 วัน", "image_url": null, "score": 1, "tags": [], "next_question_id": "results" }, { "choice_id": "c2_b", "text": "แทบไม่มีเลย", "image_url": null, "score": 5, "tags": [], "next_question_id": "results" } ] } ], "results": [ { "result_id": "res_low", "title": "ความเครียดต่ำ", "description": "ตอนนี้คุณยังคุมสมดุลงานกับชีวิตได้ค่อนข้างดี", "result_image": null, "sharing_meta": { "share_title": "ระดับความเครียดของฉันอยู่ในโซนต่ำ", "share_description": "ลองเช็กระดับความเครียดจากงานของคุณดู" }, "mapping_criteria": { "by_scoring_type": "total_score", "target_tag": null, "min_score": 0, "max_score": 4 } }, { "result_id": "res_high", "title": "ความเครียดสูง", "description": "คุณน่าจะต้องเริ่มจัดสมดุลและฟื้นพลังอย่างจริงจัง", "result_image": null, "sharing_meta": { "share_title": "ระดับความเครียดของฉันค่อนข้างสูง", "share_description": "ลองเช็กระดับความเครียดจากงานของคุณดู" }, "mapping_criteria": { "by_scoring_type": "total_score", "target_tag": null, "min_score": 5, "max_score": 10 } } ] }Checklist ก่อนเผยแพร่
- □
quiz_idตรงกับ slug ในฟอร์ม - □ ทุก
next_question_idชี้ถูกที่ - □ ไม่มี loop / dead-end
- □
mapping_criteriaตรงกับscoring_type
- □
results[].titleและdescriptionเขียนชัดเจน - □ ทดสอบ บันทึกรูป แล้วอ่านง่ายบนพื้นครีม
- □ ชื่อผล/คำอธิบายไม่ยาวเกินจนล้นการ์ด 9:16
- □
sharing_metaครบ (Guard อาจเตือนถ้าขาด)