point the API into EXAM-WAREHOUSE-API for export to docx, with example from AI-STOU-EW-II R01 section 3

This commit is contained in:
Sahatsawat Kanpai 2025-01-14 15:35:12 +07:00
parent 6ac2543517
commit d41d9d2ac8
2 changed files with 30 additions and 13 deletions

View File

@ -19,16 +19,33 @@
<h1>CKEditor 5 Development Sample</h1>
<div id="editor">
<p><span style="font-size:16pt;">คำภาษาอังกฤษในข้อใด<strong>ไม่สามารถ</strong>ใช้คำไทยแทนได้</span></p>
<p><span style="font-size:16pt;">ก. ร่างกายที่</span><span style="color:#0070c0;font-size:16pt;"><u>ฟิต</u></span><span
style="font-size:16pt;">จะช่วยป้องกันการบาดเจ็บที่เกิดจากความเหนื่อยล้า</span></p>
<p><span style="font-size:16pt;">ข. การบริหารข้อมืออาจใช้วิธีบีบลูก</span><span
style="color:#e97132;font-size:16pt;"><u>เทนนิส</u></span><span
style="font-size:16pt;">ในท่ากระดกข้อมือขึ้นลง</span></p>
<p><span style="font-size:16pt;">ค. นัก</span><span style="color:#4ea72e;font-size:16pt;"><u>กอล์ฟ</u></span><span
style="font-size:16pt;">ควรออกกําลังและบริหารร่างกายให้มีกล้ามเนื้อที่แข็งแรง</span></p>
<p><span style="font-size:16pt;">ง. กล้ามเนื้อที่มีความยืดหยุ่นดีจะทนทานพอที่จะเล่นให้จบ</span><span
style="color:#7030a0;font-size:16pt;"><u>เกม</u></span></p>
<p><span style="font-family:'Angsana New', serif;font-size:16pt;">ในการทดลองวัดความยาวของวัตถุชิ้นหนึ่งที่มีความยาวประมาณ
6 เซนติเมตร ด้วยไม้บรรทัดที่มีความละเอียด 0.1 เซนติเมตร โดยทำการวัดทั้งหมด 5 ครั้ง ได้ข้อมูลดังนี้</span></p>
<p style="text-align:center;"><span style="font-family:'Angsana New', serif;font-size:16pt;">5.84 6.00 6.26 5.90
12.25</span></p>
<p><span style="font-family:'Angsana New', serif;font-size:16pt;">ถ้าจะต้องรายงาน</span><span
style="color:#4d8db0;font-family:'Angsana New', serif;font-size:16pt;"><strong><u>ค่าเฉลี่ย</u></strong></span><span
style="font-family:'Angsana New', serif;font-size:16pt;">ของการวัดความยาวครั้งนี้&nbsp;</span><span
style="font-size:16pt;">
<script type="math/tex">\left(\overline{x}\right)</script>
</span><span
style="font-family:'Angsana New', serif;font-size:16pt;">&nbsp;และรายงานความคลายเคลื่อนของความยาวเฉลี่ย&nbsp;</span><span
style="font-size:16pt;">
<script type="math/tex">\left(\Delta\overline{x}\right)</script>
</span><span style="font-family:'Angsana New', serif;font-size:16pt;">&nbsp;ด้วยสูตร</span></p>
<p style="text-align:center;"><span style="font-size:16pt;">
<script type="math/tex">\Delta\overline{x}=\frac{x_{\max}-x_{\min}}{2}</script>
</span><span style="font-family:'Angsana New', serif;font-size:16pt;">&nbsp;</span></p>
<p><span style="font-family:'Angsana New', serif;font-size:16pt;">เมื่อ&nbsp;</span><span style="font-size:16pt;">
<script type="math/tex">x_{\max}</script>
</span><span style="font-family:'Angsana New', serif;font-size:16pt;">&nbsp;และ&nbsp;</span><span
style="font-size:16pt;">
<script type="math/tex">x_{\min}</script>
</span><span style="font-family:'Angsana New', serif;font-size:16pt;">&nbsp;คือ ค่าที่มากที่สุด
และค่าที่น้อยที่สุดของข้อมูล ตามลำดับ</span></p>
<p><span style="font-family:'Angsana New', serif;font-size:16pt;">ข้อใดแสดงผลการรายงานการวัดความยาว</span><span
style="color:#7ccc7b;font-family:'Angsana New', serif;font-size:16pt;"><i><strong><u>ได้ถูกต้อง</u></strong></i></span>
</p>
</div>
<script src="./ckeditor.dist.js"></script>

View File

@ -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())