Files
K12Study/docs/architecture/modules/02-习题与作业/er图.drawio

40 lines
7.9 KiB
Plaintext
Raw Normal View History

<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="app.diagrams.net" modified="2026-04-14T10:43:00.000Z" agent="Oz" version="24.7.17">
<diagram id="homework-er" name="ER图">
<mxGraphModel dx="1800" dy="1200" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1800" pageHeight="1200" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="02 习题与作业 - ER图" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;fontSize=22;fontStyle=1;" parent="1" vertex="1">
<mxGeometry x="20" y="20" width="400" height="30" as="geometry"/>
</mxCell>
<mxCell id="10" value="hw_question_bank&lt;br&gt;PK bank_id&lt;br&gt;bank_name, subject_code, grade_code&lt;br&gt;status, tenant_id, created_at" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1"><mxGeometry x="40" y="110" width="240" height="120" as="geometry"/></mxCell>
<mxCell id="11" value="hw_question_item&lt;br&gt;PK question_id&lt;br&gt;FK bank_id -&gt; hw_question_bank.bank_id&lt;br&gt;question_type, stem, difficulty&lt;br&gt;tenant_id, created_at" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1"><mxGeometry x="310" y="110" width="270" height="130" as="geometry"/></mxCell>
<mxCell id="12" value="hw_question_version&lt;br&gt;PK version_id&lt;br&gt;FK question_id -&gt; hw_question_item.question_id&lt;br&gt;version_no, answer_key, analysis&lt;br&gt;is_current, tenant_id" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1"><mxGeometry x="610" y="110" width="280" height="130" as="geometry"/></mxCell>
<mxCell id="13" value="hw_question_kp_rel&lt;br&gt;PK (question_id, kp_id)&lt;br&gt;FK question_id -&gt; hw_question_item.question_id&lt;br&gt;FK kp_id -&gt; cl_knowledge_point.kp_id&lt;br&gt;weight, tenant_id" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1"><mxGeometry x="920" y="110" width="280" height="130" as="geometry"/></mxCell>
<mxCell id="14" value="hw_paper&lt;br&gt;PK paper_id&lt;br&gt;paper_name, subject_code, total_score&lt;br&gt;tenant_id, created_by, created_at" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;" parent="1" vertex="1"><mxGeometry x="40" y="290" width="240" height="120" as="geometry"/></mxCell>
<mxCell id="15" value="hw_paper_question&lt;br&gt;PK (paper_id, question_id)&lt;br&gt;FK paper_id -&gt; hw_paper.paper_id&lt;br&gt;FK question_id -&gt; hw_question_item.question_id&lt;br&gt;question_order, score, tenant_id" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1"><mxGeometry x="310" y="290" width="300" height="130" as="geometry"/></mxCell>
<mxCell id="16" value="hw_assignment&lt;br&gt;PK assignment_id&lt;br&gt;FK paper_id -&gt; hw_paper.paper_id&lt;br&gt;title, publish_time, deadline&lt;br&gt;status(DRAFT/PUBLISHED/CLOSED)&lt;br&gt;tenant_id, created_by" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1"><mxGeometry x="640" y="290" width="300" height="150" as="geometry"/></mxCell>
<mxCell id="17" value="hw_assignment_target&lt;br&gt;PK target_id&lt;br&gt;FK assignment_id -&gt; hw_assignment.assignment_id&lt;br&gt;target_type(class/student)&lt;br&gt;target_ref_id, tenant_id" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1"><mxGeometry x="970" y="290" width="280" height="130" as="geometry"/></mxCell>
<mxCell id="18" value="hw_submission&lt;br&gt;PK submission_id&lt;br&gt;FK assignment_id -&gt; hw_assignment.assignment_id&lt;br&gt;FK student_id -&gt; tb_sys_user.user_id&lt;br&gt;submit_time, used_seconds&lt;br&gt;status(SUBMITTED/RESUBMITTED)&lt;br&gt;tenant_id" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" parent="1" vertex="1"><mxGeometry x="1280" y="290" width="330" height="150" as="geometry"/></mxCell>
<mxCell id="19" value="hw_submission_answer&lt;br&gt;PK answer_id&lt;br&gt;FK submission_id -&gt; hw_submission.submission_id&lt;br&gt;FK question_id -&gt; hw_question_item.question_id&lt;br&gt;answer_content, answer_type, tenant_id" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" parent="1" vertex="1"><mxGeometry x="1280" y="470" width="330" height="130" as="geometry"/></mxCell>
<mxCell id="20" value="hw_submission_attachment&lt;br&gt;PK attachment_id&lt;br&gt;FK submission_id -&gt; hw_submission.submission_id&lt;br&gt;file_type, object_key, file_hash&lt;br&gt;tenant_id, created_at" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" parent="1" vertex="1"><mxGeometry x="920" y="470" width="330" height="130" as="geometry"/></mxCell>
<mxCell id="21" value="设计方法与原因&lt;br&gt;1) 题目版本化:保障历史作业可追溯&lt;br&gt;2) 试卷与作业分离:一份试卷可多次发布&lt;br&gt;3) 发布对象独立表:支持按班级/学员精细投放&lt;br&gt;4) 提交主表+答案明细:便于后续批改并行处理" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;" parent="1" vertex="1">
<mxGeometry x="40" y="470" width="840" height="130" as="geometry"/>
</mxCell>
<mxCell id="100" value="1:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;" parent="1" source="11" target="10" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="101" value="1:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;" parent="1" source="12" target="11" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="102" value="M:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;" parent="1" source="13" target="11" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="103" value="1:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;" parent="1" source="15" target="14" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="104" value="1:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;" parent="1" source="15" target="11" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="105" value="N:1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;" parent="1" source="16" target="14" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="106" value="1:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;" parent="1" source="17" target="16" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="107" value="1:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;" parent="1" source="18" target="16" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="108" value="1:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;" parent="1" source="19" target="18" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="109" value="N:1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;" parent="1" source="19" target="11" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="110" value="1:N" style="edgeStyle=orthogonalEdgeStyle;rounded=0;jettySize=auto;html=1;endArrow=block;endFill=1;" parent="1" source="20" target="18" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>