Courseware generation method and system
By combining Word to HTML and Excel mapping tables with the Qt framework, the problem of fragmented courseware production processes has been solved, enabling efficient and convenient courseware generation and supporting unified management and dynamic display of multimedia resources.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-10
AI Technical Summary
The existing courseware production process is cumbersome and inefficient, with resource creation and course structured arrangement being disconnected, making rapid synchronization and iteration impossible and subsequent maintenance difficult.
It employs batch processing of Word documents to HTML and automated association with Excel mapping tables, combined with the Qt framework and QXlsx library, to dynamically parse and render multimedia resources, achieving standardized preprocessing, structured definition, and on-demand rendering of resources.
It achieves seamless process integration, improves arrangement efficiency, reduces later maintenance costs, and supports flexible management of multiple types of resources and efficient courseware generation.
Smart Images

Figure CN121834082A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer software technology, specifically relating to the digital arrangement, automated conversion and dynamic display technology of multimedia teaching resources, and particularly to a courseware generation method and system based on the Qt framework, HTML front-end rendering and Excel structured mapping. Background Technology
[0002] In multimedia teaching scenarios, the creation of high-quality interactive courseware is crucial for improving teaching effectiveness. However, existing courseware creation methods generally suffer from cumbersome processes and low efficiency. The main solutions and their shortcomings are as follows: Professional courseware creation tools (such as PowerPoint and Articulate Storyline): The layout process is time-consuming and requires designers to have certain art and interaction design skills. When the source materials (such as Word documents) are updated, the entire courseware needs to be manually re-edited, making it impossible to achieve rapid content synchronization and iteration. The integration of different media resources (text, images, and videos) relies on manual operation, which is inefficient.
[0003] Content Management Systems (CMS) on online education platforms, while offering some resource management functions, still heavily rely on manual processes for uploading, arranging, and organizing resources. This is especially true when converting large amounts of professional Word documents into online content, which typically requires copying and pasting or complex formatting adjustments, resulting in broken workflows and preventing "one-click" or "semi-automatic" conversions.
[0004] Directly writing HTML web pages: While highly flexible, this method demands advanced technical skills from course authors and lacks effective tools for managing the overall course structure. Course resources (such as images, videos, and chapters) are scattered, and the costs of modification, updating, and maintenance are extremely high, making it difficult to ensure consistency between course resources and the directory structure.
[0005] The fundamental flaw in the above solutions lies in the fact that "resource creation" and "structured course arrangement" are two separate processes. They lack a technological means to quickly and systematically convert raw professional materials (such as Word documents) into online content and automatically associate it with the course catalog structure. This results in a bottleneck in the entire courseware production process, long arrangement time, and low overall efficiency. Summary of the Invention
[0006] This invention aims to solve the problems of fragmented courseware production processes, cumbersome manual operations, low arrangement efficiency, and difficult post-maintenance in the existing technology, and provides a courseware generation method and system with seamless process connection, high efficiency and convenience, and strong maintainability.
[0007] A method for generating courseware includes the following steps: Step (1) Resource standardization preprocessing and structured definition: ① HTML conversion of text and image resources: Input Word documents and use Office COM components or unoconv tools to batch convert them into HTML files, preserving the original fonts, paragraphs, and embedded object formatting, and mapping Word heading styles to corresponding HTML heading tags; ② Course structure definition and Excel mapping table generation: Input the course outline drawn by XMind, and export it as an Excel mapping table containing fields such as node ID, parent node ID, node name, resource type, resource path / identifier, and sort number, so that each node is associated with the corresponding resource information; Step (2) Dynamic parsing and loading of Qt application: ① After the courseware program based on the Qt framework starts, it reads the Excel mapping table through the QXlsx library, uses a recursive algorithm to parse the data and reconstruct the tree data structure in memory; ② Dynamically populate the in-memory directory tree into Qt's tree control to generate a visual interactive navigation directory tree UI. The UI items store the corresponding node ID and resource information. Step (3) Rendering and presentation on demand: ① Capture user node click events and query the mapping table based on the node ID to obtain the resource type and resource path / identifier; ② If the resource is HTML, extract the specified DOM fragment from the corresponding HTML file using CSS selectors; if the resource is audio, video, or image, load the file according to the path and embed HTML tags. ③ Use the Qt WebEngine control to dynamically render HTML content or embedded multimedia files.
[0008] A courseware generation system, comprising: Resource preprocessing module: used to convert Word documents into standardized HTML files, export XMind course outlines and generate Excel mapping tables, which contain fields such as node ID, parent node ID, node name, resource type, resource path / identifier, and sort number; Parsing and loading module: Developed based on the Qt framework, integrating the QXlsx library, it is used to read Excel mapping tables, reconstruct the memory tree data structure through a recursive algorithm, and dynamically build the UI navigation directory tree; Rendering and presentation module: Integrates Qt WebEngine control to respond to user operations, load HTML fragments or multimedia files according to resource type, and achieve lossless rendering and dynamic display of content; Storage module: Used to store HTML files, multimedia resource files, and Excel mapping tables, realizing the separate storage of course structure and content resources.
[0009] The technical solution of this invention has the following advantages compared with the prior art: Solving the problem of workflow disruption: By batch processing Word to HTML and automating the association of Excel mapping tables, manual copying and pasting and formatting adjustments are avoided, enabling "one-click" course assembly and connecting the entire process from original materials to finished courseware.
[0010] Improve orchestration and integration efficiency: The mapping table supports unified management of multiple types of resources. Qt programs dynamically build directory trees, and users can click to render the corresponding content, realizing "content is directory, directory is navigation", which greatly shortens the orchestration time.
[0011] Enhanced maintainability: The course structure (Excel mapping table) and content resources (HTML, media files) are stored separately. After updating the Word document, only the HTML needs to be converted again. The mapping table does not need to be significantly modified, reducing the later maintenance cost.
[0012] High stability and scalability: Based on the mature Qt framework and Chromium kernel, the system has strong stability; the collaborative scheduling model is not limited to a specific number of tasks or devices and can be seamlessly extended to large-scale scheduling networks, making it highly universal.
[0013] High resource utilization: It breaks the single resource binding model, realizes the flexible allocation and unified management of multiple types of teaching resources, completes the production of high-quality courseware with less operating cost, and reduces the cost of teaching resource investment. Attached Figure Description
[0014] Figure 1 This is a flowchart illustrating the courseware generation method of the present invention. Detailed Implementation
[0015] The technical solution of the present invention will be described in detail below with reference to the reaction: like Figure 1 As shown, the courseware generation method and system of the present invention achieves dynamic association between the course framework and teaching resources through three core stages: resource standardization preprocessing, dynamic parsing and loading, and on-demand rendering. The specific technical solution is as follows: I. Courseware Generation Method 1. Resource standardization preprocessing and structured definition 1.1 HTML Conversion of Image and Text Resources: Input the original Word document (.docx), and use Microsoft Office COM components (Windows system) or the unoconv tool (cross-platform) to batch convert it to standard HTML files using the "Save As" function. The conversion process strictly preserves the original formatting (font, font size, color, paragraph indentation, bullet points, etc.), and converts images in the document to HTML. Tags (stored in separate files or embedded in Base64), tables converted <h1>、< / h1> The tag maps Word's "Heading 1", "Heading 2", etc. styles to HTML styles. <h2>Equal tags, for subsequent content fragmentation provides the basis. If the conversion does not take effect, you can manually adjust the Word style to ensure format inheritance.
[0016] 1.2, course structure definition and Excel mapping table generation: input the user's course outline drawn in mind mapping software such as XMind, first exported as structured data containing nodes, parent-child relationship and hierarchical information, preferably exported as an Excel file (.xlsx). The generated Excel mapping table contains at least node ID, parent node ID, node name, resource type, resource path / identifier, and sequence number fields, where: node ID is a unique identifier (GUID or hierarchical number); parent node ID points to its parent node, root node is empty or 0; resource type includes html, video, audio, image; resource path / identifier is a CSS selector or content block identifier for HTML type, and a file path for multimedia type; sequence number defines the display order of nodes at the same level. Fill in the resource information for each node manually or with the help of tools to complete the accurate association of course skeleton and teaching resources.
[0017] 2, Qt application dynamic analysis and loading 2.1 Mapping table analysis and directory tree reconstruction: after the courseware main program based on Qt framework starts, the resource management module reads the above-mentioned Excel mapping table through QXlsx library, parses the table data using recursive algorithm, and reconstructs the tree-shaped data structure (QTreeWidgetItem or custom tree node class) in memory according to node ID and parent node ID.
[0018] 2.2 UI directory tree construction: the resource management module dynamically fills the directory tree object in memory into Qt's QTreeWidget or QTreeView control, generates a user- visible, interactive course navigation directory tree UI, and stores the corresponding node ID and resource information in the data attribute of each UI item.
[0019] 3, rendering and rendering on demand 3.1 Responsive resource loading: when the user clicks on the UI directory tree node, the program captures the click event and obtains the node ID, queries the mapping table data in memory according to the node ID, determines the resource type and resource path / identifier. If it is an HTML type, use the JavaScript execution capability of QWebEnginePage to extract the specified DOM fragment from the corresponding HTML file according to the CSS selector; if it is a video, audio, image type, load the resource directly according to the file path and embed it into the corresponding HTML tag.
[0020] 3.2 Dynamic Rendering: Loaded HTML content fragments or HTML pages embedding multimedia resources are placed into the QWebEngineView control. This control, based on the Chromium kernel, can perfectly render complex HTML+CSS content, ensuring lossless rendering of the original layout, and also supports built-in playback of multimedia files. When the user clicks on a node in the directory tree, the content area on the right switches and renders the corresponding content instantly without refreshing, achieving a smooth dynamic courseware experience.
[0021] II. Courseware Generation System This system includes a resource preprocessing module, a parsing and loading module, a rendering and presentation module, and a storage module. The functions of each module are as follows: Resource preprocessing module: Responsible for batch conversion of Word documents to HTML files while preserving formatting, exporting XMind course outlines and generating standardized Excel mapping tables, realizing standardized preprocessing and structured definition of resources.
[0022] Parsing and loading module: Developed based on the Qt framework and integrating the QXlsx library, it is used to read Excel mapping tables, rebuild the memory directory tree, and dynamically construct the UI navigation directory to achieve automated parsing and visualization of the course structure.
[0023] Rendering module: Integrates Qt WebEngine controls, responds to user operations, loads corresponding content according to resource type and achieves lossless rendering, supports dynamic display and refresh-free switching of HTML content and multimedia files.
[0024] Storage module: Used to separate and store HTML files, audio and video, images and other content resources from Excel mapping tables, ensuring that the course structure and content resources are independent of each other, facilitating maintenance and updates.
[0025] Phase 1: Resource Standardization Preprocessing and Structured Definition 1. HTML conversion of image and text resources: Input: The original Word document (.docx).
[0026] Technical Implementation: This method uses Microsoft Office COM components or third-party libraries (such as LibreOffice's unoconv command-line tool) to call their "Save As" function, batch converting Word documents into standard HTML files (.html). This conversion process strictly adheres to the following format conversion rules: Preserve all original formatting: including font, font size, color, bold, italics, paragraph indentation, bullet points, and numbered lists.
[0027] Handling embedded objects: Converting images and tables in the document into HTML. Tags (images saved as standalone files or embedded in Base64) and< / h2>
[0028] <h1>、< / h1> Tags. Heading level mapping: Maps Word's "Heading 1", "Heading 2", etc. styles to HTML styles respectively. <h2>Tags such as these are important bases for subsequent content fragmentation.
[0029] Output: Generates an HTML file with the same layout as the original document and its associated resource folder.
[0030] If the conversion does not take effect, manually adjust the Word style, because this depends on converting Word to HTML, and the style is inherited from the Word document.
[0031] 2. Course structure definition and Excel mapping table generation: Input: Course outlines drawn by users in mind mapping software such as XMind.
[0032] Technical Implementation: a. Export as structured data: Export the mind map file as a structure containing nodes, parent-child relationships, and hierarchical information. It is preferred to export it as an Excel file (.xlsx) because the QXlsx library can efficiently read and write it, and it is easy for manual viewing and modification.
[0033] b. Design the Excel mapping table structure: The generated Excel file follows specific data structuring rules and must contain at least the following: Node ID: A unique identifier, such as an automatically generated GUID or hierarchy number (1.1.1).
[0034] Parent node ID: Points to the ID of its parent node. The parent node ID of the root node is empty or a specific value (such as 0).
[0035] Node name: The text displayed in the directory tree, such as "Chapter 1 Introduction".
[0036] Resource type: an enumeration of values, such as html, video, audio, and image.
[0037] Resource path / identifier: The specific location of the associated resource. For HTML types, this field can store a CSS selector or content block identifier (such as #section-2-1) to locate the segment from a large HTML file; for multimedia types, it stores a relative or absolute file path.
[0038] Sort number: The display order within the same level.
[0039] c. Establish the association: In the Excel mapping table, manually or with the help of auxiliary tools, fill in the corresponding "resource type" and "resource path / identifier" for each course node, thereby completing the precise association between the course skeleton and the teaching resources.
[0040] Output: A standard .xlsx file, namely the "Course Resource Mapping Table". This file is the core configuration file and data structure carrier that connects the course structure and content.
[0041] 1. Chapter mapping relationship: The chapter nodes are extracted from the structured data in Excel to form a table of contents tree.
[0042] 2. File mapping relationship: For HTML type nodes, the "Resource Path / Identifier" field can be filled with the path to the HTML file, and combined with CSS selectors (such as `#section-1-1`) to locate specific chapter segments.
[0043] The output HTML file is used to achieve a precise mapping of "course node ↔ HTML content fragment" through selectors or identifiers.
[0044] The mapping table supports manual verification and modification to ensure that resource associations are correct.
[0045] Phase Two: Dynamic Parsing and Loading of Qt Applications 3. Qt application loading and parsing mapping table: Technical Implementation: After the main program of the courseware, developed based on the Qt framework, starts, its resource management module uses the QXlsx library to read the aforementioned "course resource mapping table". Internally, the program parses the row data in the Excel file using a recursive algorithm, reconstructing a tree-like data structure in memory (QTreeWidgetItem or a custom tree node class) based on the node ID and parent node ID columns. This process solves the problem of "how to obtain a directory tree from an xlsx file".
[0046] Output: A complete, traversable course directory tree object in memory.
[0047] 4. Dynamically build the UI directory tree: Technical Implementation: The resource management module dynamically populates the in-memory directory tree object into Qt's QTreeWidget or QTreeView controls, generating a user-visible and interactive course navigation directory tree UI. Each UI item (QTreeWidgetItem) stores its corresponding node ID and resource information in its data property.
[0048] Phase 3: On-Demand Rendering and Presentation 5. Responsive resource loading: Trigger: The user clicks on any node in the UI directory tree.
[0049] Technical Implementation: a. Query Mapping: A Qt application captures click events and retrieves the data (node ID) of the clicked node.
[0050] b. Locating Resources: Based on the node ID, the program quickly looks up the table (i.e., queries the Excel mapping table data already loaded in memory) to obtain the "resource type" and "resource path / identifier" associated with the node.
[0051] c. Load according to rules: If the resource type is HTML, the content loading module will dynamically extract the specified DOM fragments from the corresponding HTML file based on the "resource path / identifier" (such as a CSS selector) and utilize QWebEnginePage's JavaScript execution capabilities. This rule enables precise segmentation and on-demand loading of different sections within a single HTML file.
[0052] If the resource type is video / audio / image, the file will be loaded directly based on the path in the Excel file.
[0053] Loading rules: If the resource type in the Excel file is `video` / `audio` / `image`, then the "Resource Path / Identifier" field in the Excel file stores the relative or absolute path of that media file (e.g., `. / media / chapter1 / video.mp4`).
[0054] The node ID is bound to the media file path through the corresponding row in the mapping table, realizing chained addressing of "node → path → file".
[0055] d. The program loads the media file directly based on the path and embeds it in the HTML page (via `...`) <video> `、` <audio>`、` The `tag` is used for rendering and playback.
[0056] 6. Qt WebEngine dynamic rendering: Technical Implementation: For loaded HTML content fragments, the application places them into a QWebEngineView control. QWebEngineView, based on the Chromium engine, can perfectly render complex HTML+CSS content, ensuring the original layout from Word is rendered without loss of quality. For multimedia such as videos, their paths can be embedded in the HTML. <video>Within the tag, it is handled by QWebEngineView's built-in player.
[0057] Effect: When a user clicks on the directory tree on the left, the corresponding teaching content is instantly switched and rendered in the content area on the right without refreshing, achieving a smooth dynamic courseware experience.
[0058] This invention addresses the three core problems raised in the background art one by one through the following specific means: (1) Problems of process breakage and complicated manual operation → The process is connected by automatic association of "resource standardization preprocessing" and "course structure mapping table".
[0059] 1) Use a Word to HTML converter to process in batches, avoiding manual copying, pasting, and formatting adjustments.
[0060] 2) The mind map structure is automatically bound to the HTML content through an Excel mapping table, enabling "one-click" course assembly without the need for repeated arrangement.
[0061] (2) The problem of low efficiency in content arrangement and integration → Achieve efficient resource integration through "dynamic parsing of mapping table + on-demand loading".
[0062] 1) The mapping table structure is clear and supports unified management of multiple types of resources (text, images, audio and video).
[0063] 2) Qt programs dynamically load mapping tables and build directory trees. When the user clicks, the corresponding content is rendered, realizing "content is the directory, and the directory is the navigation".
[0064] (3) The problem of difficult maintenance after the arrangement is completed → maintainability is achieved by "mapped table driven + independent resource storage".
[0065] Extremely high system stability and efficiency: Through a dynamic mutual assistance mechanism between devices, the system can quickly respond using nearby devices in the task network when a device fails, avoiding the high latency and high cost of dispatching from a remote location, ensuring task continuity, and significantly improving overall scheduling efficiency.
[0066] High resource utilization: It breaks the rigid model of "one device, one task" and realizes cross-task sharing and flexible allocation of equipment resources, thereby enabling the same workload to be completed with fewer physical devices, directly reducing asset investment and operating costs.
[0067] Advanced scheduling capabilities: This invention provides a novel scheduling paradigm that does not exist in the prior art. Its core algorithm can automatically generate and execute complex collaborative schemes, making it more capable of handling large-scale, dynamically changing, and complex engineering scenarios.
[0068] Excellent scalability: The collaborative scheduling model of this invention is not limited to a specific number of tasks or devices, and can be seamlessly extended to large-scale scheduling networks, making it highly universal.
[0069] 1) The course structure (Excel) and content resources (HTML, media files) are separated, so modifying any part does not require reconstructing the whole.
[0070] 2) After updating a Word document, you only need to reconvert the HTML; the mapping table does not need to be significantly modified, thus achieving "content updates do not affect the structure".
[0071] Development and runtime environment: Development framework: Qt 5.15 or later (Qt 6 LTS recommended), integrating the Qt WebEngine module and the QXlsx third-party library.
[0072] Programming language: C++.
[0073] Key technology libraries: QtWebEngineWidgets: used for embedding and rendering HTML content. QXlsx: used for reading and writing course resource mapping tables in Excel .xlsx format. Office COM Automation (Windows) or unoconv (cross-platform): used for batch conversion of Word to HTML.
[0074] Hardware environment: Ordinary desktop or laptop computer. Configuration recommendations: CPU i5 or equivalent or above, 8GB or more of memory, a dedicated graphics card is preferred, and hard disk space depends on the scale of the courseware resources.
[0075] Implementation steps briefly described: 1. The teacher prepares a Word document "xxx.docx" and saves it as "xxx.html" using Word software.
[0076] 2. Teachers use XMind to create course outlines, including nodes such as "Chapter 1" and "Section 1".
[0077] For example:
[0078] 3. Export the XMind file as "course_map.xlsx". In this Excel file, in the row for "Section 1", enter the associated HTML resource path ". / resources / xxx.html".
[0079] 4. Launch this teaching software. The software's resource management module will read "course_map.xlsx" and generate a directory tree on the left side of the UI interface.
[0080] 5. When the user clicks "Section 1", the resource loading module requests and loads ". / resources / xxx.html", rendering its content as is in the main display area. If this node is associated with a video, it will be loaded via "..." <video>The "" tag loads and plays.
[0081] By referring to the above methods, those skilled in the art can fully implement the present invention and experience its high efficiency and convenience.
[0082] The above embodiments enable the rapid creation of physics courseware. When updating the Word handouts, only the HTML file needs to be converted again, and the mapping table does not need to be modified, thus achieving synchronous updates of the courseware content, significantly improving the efficiency of courseware creation and maintenance.
[0083] This invention effectively solves the core pain points of existing courseware production through the synergistic effect of standardized preprocessing, structured mapping, dynamic parsing and on-demand rendering, providing an efficient, convenient and scalable courseware generation solution for multimedia teaching, which can be widely applied to the development of teaching courseware for various disciplines.< / video> < / video> < / audio> < / video> < / h2>
Claims
1. A method for generating courseware, characterized in that, Includes the following steps: Step (1) Resource standardization preprocessing and structured definition: ① HTML conversion of text and image resources: Input Word documents and use Office COM components or unoconv tools to batch convert them into HTML files, preserving the original fonts, paragraphs, and embedded object formatting, and mapping Word heading styles to corresponding HTML heading tags; ② Course structure definition and Excel mapping table generation: Input the course outline drawn by XMind, and export it as an Excel mapping table containing fields such as node ID, parent node ID, node name, resource type, resource path / identifier, and sort number, so that each node is associated with the corresponding resource information; Step (2) Dynamic parsing and loading of Qt application: ① After the courseware program based on the Qt framework starts, it reads the Excel mapping table through the QXlsx library, uses a recursive algorithm to parse the data and reconstruct the tree data structure in memory; ② Dynamically populate the in-memory directory tree into Qt's tree control to generate a visual interactive navigation directory tree UI. The UI items store the corresponding node ID and resource information. Step (3) Rendering and presentation on demand: ① Capture user node click events and query the mapping table based on the node ID to obtain the resource type and resource path / identifier; ② If the resource is HTML, extract the specified DOM fragment from the corresponding HTML file using CSS selectors; if the resource is audio, video, or image, load the file according to the path and embed HTML tags. ③ Use the Qt WebEngine control to dynamically render HTML content or embedded multimedia files.
2. The courseware generation method according to claim 1, characterized in that, In step (1)①, the auxiliary resources of the HTML file include independently stored image files or images embedded in Base64 format, and the tables in Word are converted to HTML.
3. The courseware generation method according to claim 1, characterized in that, In step (1) ②, the node ID of the Excel mapping table is a GUID or hierarchical number, the parent node ID of the root node is empty or a preset value of 0, and the resource path / identifier is a CSS selector or content block identifier for HTML type, and a relative or absolute file path for multimedia type.
4. The courseware generation method according to claim 1, characterized in that, In step (3) ②, HTML fragment extraction is achieved through the JavaScript execution capability of QWebEnginePage, and multimedia files are extracted through... <video> 、 <audio>, The tag is embedded in the HTML page.< / audio> < / video> 5. A courseware generation system, characterized in that, include: Resource preprocessing module: used to convert Word documents into standardized HTML files, export XMind course outlines and generate Excel mapping tables, which contain fields such as node ID, parent node ID, node name, resource type, resource path / identifier, and sort number; Parsing and loading module: Developed based on the Qt framework, integrating the QXlsx library, it is used to read Excel mapping tables, reconstruct the memory tree data structure through a recursive algorithm, and dynamically build the UI navigation directory tree; Rendering and presentation module: Integrates Qt WebEngine control to respond to user operations, load HTML fragments or multimedia files according to resource type, and achieve lossless rendering and dynamic display of content; Storage module: Used to store HTML files, multimedia resource files, and Excel mapping tables, realizing the separate storage of course structure and content resources.
6. The courseware generation system according to claim 5, characterized in that, The resource preprocessing module supports batch conversion of Word documents, and the conversion process strictly preserves the original format and embedded objects.
7. The courseware generation system according to claim 5, characterized in that, The UI navigation directory tree constructed by the parsing and loading module supports node traversal, with each UI node associated with corresponding resource information, thus realizing "directory as navigation".
8. The courseware generation system according to claim 5, characterized in that, The rendering module supports perfect rendering of HTML+CSS content, as well as built-in playback of audio and video files, enabling content switching without page refresh.
9. The courseware generation system according to claim 5, characterized in that, It uses the Qt 5.15 or later framework, the programming language is C++, and the key technology libraries include QtWebEngineWidgets, QXlsx, Office COM Automation or unoconv. Label.