|
@@ -0,0 +1,214 @@
|
|
|
+
|
|
|
+# 2.课程学习功能模块:
|
|
|
+描述:生成学习思维导图,自动跟踪记录学习进度,记录用户的学习时间、知识点学习情况等信息,并通过数据可视化库将这些数据转化为进度条、饼图、学习日历等直观的展示形式,方便用户查看
|
|
|
+# 表设计
|
|
|
+根据您的需求,我们可以设计一个符合设计范式的Parse Schema,包括学习思维导图、学习进度跟踪等相关表。以下是各个表的设计及其字段名称,使用PlantUML类图表示。
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+<h2>思维导图表 (MindMap)<h3>
|
|
|
+
|
|
|
+<br>objectId (String)
|
|
|
+<br>createdAt (String)
|
|
|
+<br>title (String) - 思维导图标题
|
|
|
+<br>description (String) - 思维导图描述
|
|
|
+<br>user (Pointer) - 创建者(用户)
|
|
|
+<br>knowledgePoints (Array) - 关联的知识点
|
|
|
+
|
|
|
+<h2>知识点表 (KnowledgePoint)<h3>
|
|
|
+
|
|
|
+<br>objectId (String)
|
|
|
+<br>createdAt (String)
|
|
|
+<br>name (String) - 知识点名称
|
|
|
+<br>content (String) - 知识点内容
|
|
|
+<br>mindMap (Pointer) - 关联的思维导图
|
|
|
+<br>prerequisites (Array) - 先修知识点
|
|
|
+
|
|
|
+<h2>用户表 (User)<h3>
|
|
|
+
|
|
|
+<br>objectId (String)
|
|
|
+<br>createdAt (String)
|
|
|
+<br>username (String) - 用户名
|
|
|
+<br>email (String) - 用户邮箱
|
|
|
+<br>learningProgress (Array) - 关联的学习进度
|
|
|
+
|
|
|
+<h2>学习进度表 (LearningProgress)<h3>
|
|
|
+
|
|
|
+<br>objectId (String)
|
|
|
+<br>createdAt (String)
|
|
|
+<br>user (Pointer) - 用户
|
|
|
+<br>knowledgePoint (Pointer) - 学习的知识点
|
|
|
+<br>studyTime (Number) - 学习时间(分钟)
|
|
|
+<br>completionStatus (Boolean) - 完成状态
|
|
|
+<br>date (Date) - 学习日期
|
|
|
+
|
|
|
+<h2>数据可视化表 (Visualization)<h3>
|
|
|
+
|
|
|
+<br>objectId (String)
|
|
|
+<br>createdAt (String)
|
|
|
+<br>user (Pointer) - 用户
|
|
|
+<br>type (String) - 可视化类型(如:进度条、饼图、学习日历等)
|
|
|
+<br>data (JSON) - 可视化数据
|
|
|
+
|
|
|
+### PlantUML 类图表示
|
|
|
+
|
|
|
+以下是上述表的PlantUML类图表示:
|
|
|
+
|
|
|
+```plantuml
|
|
|
+@startuml
|
|
|
+
|
|
|
+class MindMap {
|
|
|
+ +objectId: String
|
|
|
+ +createdAt: Date
|
|
|
+ +title: String
|
|
|
+ +description: String
|
|
|
+ +user: Pointer<User>
|
|
|
+ +knowledgePoints: Array<Pointer<KnowledgePoint>>
|
|
|
+}
|
|
|
+
|
|
|
+class KnowledgePoint {
|
|
|
+ +objectId: String
|
|
|
+ +createdAt: Date
|
|
|
+ +name: String
|
|
|
+ +content: String
|
|
|
+ +mindMap: Pointer<MindMap>
|
|
|
+ +prerequisites: Array<Pointer<KnowledgePoint>>
|
|
|
+}
|
|
|
+
|
|
|
+class User {
|
|
|
+ +objectId: String
|
|
|
+ +createdAt: Date
|
|
|
+ +username: String
|
|
|
+ +email: String
|
|
|
+ +learningProgress: Array<Pointer<LearningProgress>>
|
|
|
+}
|
|
|
+
|
|
|
+class LearningProgress {
|
|
|
+ +objectId: String
|
|
|
+ +createdAt: Date
|
|
|
+ +user: Pointer<User>
|
|
|
+ +knowledgePoint: Pointer<KnowledgePoint>
|
|
|
+ +studyTime: Number
|
|
|
+ +completionStatus: Boolean
|
|
|
+ +date: Date
|
|
|
+}
|
|
|
+
|
|
|
+class Visualization {
|
|
|
+ +objectId: String
|
|
|
+ +createdAt: Date
|
|
|
+ +user: Pointer<User>
|
|
|
+ +type: String
|
|
|
+ +data: JSON
|
|
|
+}
|
|
|
+
|
|
|
+MindMap "1" -- "*" KnowledgePoint : contains
|
|
|
+User "1" -- "*" LearningProgress : tracks
|
|
|
+LearningProgress "*" -- "1" KnowledgePoint : studies
|
|
|
+User "1" -- "*" Visualization : generates
|
|
|
+
|
|
|
+@enduml
|
|
|
+```
|
|
|
+# 说明
|
|
|
+<br>1.每个表都有默认的 objectId 和 createdAt 字段。
|
|
|
+<br>2.表之间的关系通过Pointer表示,以确保数据的规范性和完整性。
|
|
|
+<br>3.设计遵循了数据库的规范化原则,避免了数据冗余。
|
|
|
+
|
|
|
+# 二、业务逻辑描述
|
|
|
+**课程学习的完整逻辑**:
|
|
|
+用户在APP内,通过文本生成学习流程后,再根据流程绘制思维导图完成整个学习计划
|
|
|
+<br>**数据来源**
|
|
|
+<br>用户输入:用户的学习需求等
|
|
|
+<br>**文本生成**
|
|
|
+<br>提示词:兴趣学习计划生成提示词
|
|
|
+<br>**结果存储**:StudyPlan
|
|
|
+<br>**学习目标** knowledgePoints 知识点
|
|
|
+<br>**计划详情** content 完整学习内容
|
|
|
+<br>根据学习计划结果,排期生成任务
|
|
|
+<br>**生成结果**:learningList
|
|
|
+<br>**循环数组**:向LearningProgress表逐个插入数据。
|
|
|
+## 以下是一个针对学习目标为“摄影”的 `LearningProgress` 表结构的 JSON 格式测试数据数组示例:
|
|
|
+
|
|
|
+```json
|
|
|
+[
|
|
|
+ {
|
|
|
+ "objectId": "lp1",
|
|
|
+ "createdAt": "2024-12-01T10:00:00Z",
|
|
|
+ "user": { "pointer": "user1" },
|
|
|
+ "knowledgePoint": { "pointer": "kp1" },
|
|
|
+ "studyTime": 120,
|
|
|
+ "completionStatus": true,
|
|
|
+ "date": "2024-12-01"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "objectId": "lp2",
|
|
|
+ "createdAt": "2024-12-02T10:00:00Z",
|
|
|
+ "user": { "pointer": "user1" },
|
|
|
+ "knowledgePoint": { "pointer": "kp2" },
|
|
|
+ "studyTime": 90,
|
|
|
+ "completionStatus": false,
|
|
|
+ "date": "2024-12-02"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "objectId": "lp3",
|
|
|
+ "createdAt": "2024-12-03T10:00:00Z",
|
|
|
+ "user": { "pointer": "user1" },
|
|
|
+ "knowledgePoint": { "pointer": "kp3" },
|
|
|
+ "studyTime": 150,
|
|
|
+ "completionStatus": true,
|
|
|
+ "date": "2024-12-03"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "objectId": "lp4",
|
|
|
+ "createdAt": "2024-12-04T10:00:00Z",
|
|
|
+ "user": { "pointer": "user1" },
|
|
|
+ "knowledgePoint": { "pointer": "kp4" },
|
|
|
+ "studyTime": 60,
|
|
|
+ "completionStatus": false,
|
|
|
+ "date": "2024-12-04"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "objectId": "lp5",
|
|
|
+ "createdAt": "2024-12-05T10:00:00Z",
|
|
|
+ "user": { "pointer": "user1" },
|
|
|
+ "knowledgePoint": { "pointer": "kp5" },
|
|
|
+ "studyTime": 180,
|
|
|
+ "completionStatus": true,
|
|
|
+ "date": "2024-12-05"
|
|
|
+ }
|
|
|
+]
|
|
|
+```
|
|
|
+
|
|
|
+在这个示例中,`user` 字段指向一个用户(`user1`),`knowledgePoint` 字段指向不同的知识点(`kp1`, `kp2`, `kp3`, `kp4`, `kp5`),每个学习进度记录了学习时间、完成状态和日期。您可以根据实际需求调整这些数据。
|
|
|
+
|
|
|
+## 以下是基于您提供的课程学习完整逻辑的 PlantUML 时序图代码。您可以将此代码粘贴到任何支持 PlantUML 的工具中,以生成时序图。
|
|
|
+
|
|
|
+```plantuml
|
|
|
+@startuml
|
|
|
+actor User
|
|
|
+participant "学习需求输入" as Input
|
|
|
+participant "文本生成模块" as TextGen
|
|
|
+participant "学习计划存储" as StudyPlan
|
|
|
+participant "思维导图生成" as MindMap
|
|
|
+participant "任务排期生成" as TaskScheduler
|
|
|
+participant "学习进度表" as LearningProgress
|
|
|
+
|
|
|
+User -> Input : 输入学习需求
|
|
|
+Input -> TextGen : 生成学习计划
|
|
|
+TextGen -> StudyPlan : 存储学习计划
|
|
|
+StudyPlan -> MindMap : 绘制思维导图
|
|
|
+MindMap -> User : 提供思维导图
|
|
|
+User -> TaskScheduler : 根据学习计划生成任务
|
|
|
+TaskScheduler -> LearningProgress : 向学习进度表插入数据
|
|
|
+
|
|
|
+@enduml
|
|
|
+```
|
|
|
+
|
|
|
+### 时序图说明:
|
|
|
+1. **用户输入学习需求**:用户在应用程序内输入他们的学习需求。
|
|
|
+2. **文本生成模块**:接收用户输入并生成学习计划。
|
|
|
+3. **学习计划存储**:将生成的学习计划存储在 `StudyPlan` 中。
|
|
|
+4. **思维导图生成**:根据学习计划绘制思维导图。
|
|
|
+5. **用户获取思维导图**:用户查看生成的思维导图。
|
|
|
+6. **任务排期生成**:用户根据学习计划生成具体任务。
|
|
|
+7. **学习进度表**:将生成的任务逐个插入到 `LearningProgress` 表中。
|
|
|
+
|