From d41d9d2ac8f343a2d4004a2c96b4b140543b3798 Mon Sep 17 00:00:00 2001 From: Sahatsawat Kanpai Date: Tue, 14 Jan 2025 15:35:12 +0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20point=20the=20API=20into=20EXAM-WAR?= =?UTF-8?q?EHOUSE-API=20for=20export=20to=20docx,=20with=20example=20from?= =?UTF-8?q?=20AI-STOU-EW-II=20R01=20section=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sample/index.html | 37 +++++++++++++++++++++++++++---------- src/export.ts | 6 +++--- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/sample/index.html b/sample/index.html index d3c9880..1d4b06e 100644 --- a/sample/index.html +++ b/sample/index.html @@ -19,16 +19,33 @@

CKEditor 5 – Development Sample

-

คำภาษาอังกฤษในข้อใดไม่สามารถใช้คำไทยแทนได้

-

ก. ร่างกายที่ฟิตจะช่วยป้องกันการบาดเจ็บที่เกิดจากความเหนื่อยล้า

-

ข. การบริหารข้อมืออาจใช้วิธีบีบลูกเทนนิสในท่ากระดกข้อมือขึ้นลง

-

ค. นักกอล์ฟควรออกกําลังและบริหารร่างกายให้มีกล้ามเนื้อที่แข็งแรง

-

ง. กล้ามเนื้อที่มีความยืดหยุ่นดีจะทนทานพอที่จะเล่นให้จบเกม

+

ในการทดลองวัดความยาวของวัตถุชิ้นหนึ่งที่มีความยาวประมาณ + 6 เซนติเมตร ด้วยไม้บรรทัดที่มีความละเอียด 0.1 เซนติเมตร โดยทำการวัดทั้งหมด 5 ครั้ง ได้ข้อมูลดังนี้

+

5.84 6.00 6.26 5.90 + 12.25

+

ถ้าจะต้องรายงานค่าเฉลี่ยของการวัดความยาวครั้งนี้  + +  และรายงานความคลายเคลื่อนของความยาวเฉลี่ย  + +  ด้วยสูตร

+

+ +  

+

เมื่อ  + +  และ  + +  คือ ค่าที่มากที่สุด + และค่าที่น้อยที่สุดของข้อมูล ตามลำดับ

+

ข้อใดแสดงผลการรายงานการวัดความยาวได้ถูกต้อง +

diff --git a/src/export.ts b/src/export.ts index 09d5d49..fd00d7a 100644 --- a/src/export.ts +++ b/src/export.ts @@ -60,11 +60,11 @@ export default class Export extends Plugin { console.log(doc.body.innerHTML); - fetch('http://localhost:3000/docx', { + fetch('http://localhost:8080/aspose/html-to-word', { method: 'POST', - body: JSON.stringify({ htmlData: this.editor.getData() }), + body: doc.body.innerHTML, headers: { - 'Content-Type': 'application/json' + 'Content-Type': 'text/plain' } }) .then(response => response.blob())