A test paper composition method and system for automatically cutting off the questions and leaving blanks
Through the method of automatically cutting and arranging the blank space according to the topic, it solves the problems of paper waste and complicated teacher tasks in the existing paper composition method. It realizes flexible and reasonable blank space and automatic composition, reducing the teacher's workload. workload.
Patent Information
- Application Number
- CN202310229021.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-10
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2043-03-10
AI Technical Summary
The existing method of writing papers fails to effectively manage the white space after the questions, resulting in a waste of paper and complicated tasks for teachers, and there is not enough or too much white space for subjective questions.
Using the method of automatically cutting to the topic and leaving blank space, the questions and answer areas are placed in the HTML file in order as blocks, and intelligent cutting and arrangement are performed to ensure that the blocks do not cross the page, and through HTML file construction, intelligent cutting and arrangement The unit realizes automatic volume formation.
It achieves flexible and reasonable blank space to reduce waste, reduces the complexity of the teacher's tasks, and improves the efficiency of writing papers.
Smart Images

Figure CN116468002B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of test paper composition, and in particular to a test paper composition method and system with automatic topic switching and blank leaving. Background Art
[0002] The existing test paper assembling method does not consider the blank space after the questions, and basically adopts a unified blank space. If the test paper is assembled and then printed into a paper test paper without manual control, it is easy to cause paper waste, such as a large amount of blank space. Moreover, the blank space of the subjective questions is also a problem. If there is too little blank space, students will not have enough space to answer; if there is too much blank space, paper will be wasted.
[0003] In addition, currently most examination papers are compiled manually by teachers, which makes the teachers' tasks complicated.
[0004] Therefore, there is an urgent need to provide a test paper composition method and system that can automatically cut questions and leave blanks, reduce waste, and at the same time reduce the complexity of teachers' tasks. Summary of the invention
[0005] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a test paper composition method and system that automatically cuts off the questions and leaves blanks, which can automatically cut off the questions and leave blanks, reduce waste, and at the same time reduce the complexity of teachers' tasks.
[0006] The objective of the present invention is achieved through the following technical solutions:
[0007] A method for automatically cutting off the topic and leaving blanks for test papers comprises the following steps:
[0008] S1: Put all the questions and answer areas to be composed into the HTML file as blocks in order, and mark the blocks;
[0009] S2: Intelligently cut some blocks in the test paper through block marking, so that each block will not cross pages in the test paper;
[0010] S3: Arrange the blocks after intelligent cutting one by one according to the test paper pages.
[0011] Further, the step S1 includes the following sub-steps:
[0012] S101: Convert all topics into HTML sub-files one by one;
[0013] S102: concatenate all HTML sub-files of the topic into an HTML file, and mark the topics in blocks;
[0014] S103: setting answer areas for all questions that require answer areas in the HTML file and marking the answer areas as blocks;
[0015] S104: Clear the non-empty blocks in the answer area and keep the size unchanged.
[0016] Further, the step S2 includes the following sub-steps:
[0017] S201: Obtaining the absolute coordinate information of the block mark;
[0018] S202: judging whether each block spans across pages according to the absolute coordinate information of the block mark and the printing size of the test paper text, and performing intelligent cutting on the blocks that span across pages;
[0019] The step S3 comprises the following sub-steps:
[0020] S301: Obtaining the absolute coordinate information of the block mark corresponding to each block;
[0021] S302: Convert the absolute coordinate information into page coordinate information according to the test paper page.
[0022] Furthermore, the absolute coordinate information includes the starting point coordinates and the height, and the width of the block is set to the text width in the test paper text printing size;
[0023] The method for determining whether each block crosses pages in the sub-step S202 is:
[0024] According to the order of block tags in the HTML file, the heights of block tags are accumulated one by one to obtain the accumulated height; during the accumulation process, if the accumulated height is less than the text height in the test paper text printing size, the accumulation continues; if the accumulated height is equal to the text height in the test paper text printing size, the accumulated height is cleared and the accumulation continues; if the accumulated height is greater than the text height in the test paper text printing size, the block corresponding to the last accumulated block tag is identified as a cross-page block and the cross-page block is intelligently cut into the front page block and the back page block, and the accumulated height is set to the height of the block tag corresponding to the back page block and the accumulation continues.
[0025] As another design, the absolute coordinate information includes the starting point coordinates, width and height;
[0026] The method for determining whether each block crosses pages in the sub-step S202 is:
[0027] Multiply the height and width of the block marker of each block to obtain the block area, and accumulate the block areas of the block markers one by one in the order of the block markers in the HTML file to obtain the accumulated area; during the accumulation process, if the accumulated area is smaller than the text area in the test paper text printing size, continue to accumulate; if the accumulated area is equal to the text area in the test paper text printing size, the accumulated area is cleared and continued to accumulate; if the accumulated area is larger than the text area in the test paper text printing size, the block corresponding to the last accumulated block marker is identified as a cross-page block and the cross-page block is intelligently cut into the front page block and the back page block, and the accumulated area is set to the block area of the block marker corresponding to the back page block and continues to accumulate.
[0028] Furthermore, the intelligent cutting of the cross-page blocks in step S202 is as follows:
[0029] If the block across pages is a blank block, the block across pages will be cut directly;
[0030] If the block across pages is a non-blank block, the DOM structure of the block across pages is dynamically adjusted.
[0031] Furthermore, the dynamic adjustment of the DOM structure is as follows:
[0032] Extract the child DOM nodes of the block that crosses pages from the end to the beginning, and put the extracted child DOM nodes into the new block until the remaining child DOM nodes in the block that crosses pages no longer cross pages;
[0033] If the extracted child DOM node cannot be perfectly cut, continue to cut this child DOM node until this child DOM node no longer crosses pages.
[0034] Further, the following steps are performed after step S3:
[0035] S4: Convert HTML files into PDF files for printing.
[0036] A test paper assembling system with automatic question cutting and blank leaving realizes a test paper assembling method with automatic question cutting and blank leaving, comprising an HTML file construction unit, an intelligent cutting unit and an arrangement unit, wherein the HTML file construction unit puts all the questions and answer areas to be assembled into an HTML file as blocks in sequence, and marks the blocks; the intelligent cutting unit intelligently cuts some blocks in the blocks through the block marks, so that each block will not cross pages in the test paper; and the arrangement unit arranges each block after intelligent cutting one by one according to the test paper pages.
[0037] The beneficial effects of the present invention are:
[0038] The present invention can automatically cut off the questions and leave blanks, and the blank space is flexible and reasonable, which reduces waste; it helps teachers or question-setting units to complete automatic test paper assembly, reduces manual operations, and alleviates the complexity of teachers' tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a structural diagram of a test paper composition system that automatically cuts off questions and leaves blanks;
[0040] Figure 2 The main process of test paper composition and question selection;
[0041] Figure 3 It is an intelligent cutting process for blocks that span across pages. DETAILED DESCRIPTION
[0042] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0043] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0044] Embodiment 1:
[0045] like Figures 1 to 3 As shown, a method for automatically cutting off the questions and leaving blanks for test papers comprises the following steps:
[0046] S1: Put all the questions and answer areas to be composed into the HTML file as blocks in order, and mark the blocks;
[0047] S101: Convert all topics into HTML sub-files one by one.
[0048] If the title information is stored in HTML format, no conversion is required. If it is in other formats (such as LaTeX format), it needs to be converted to HTML format first.
[0049] S102: concatenate all HTML sub-files of the topic into an HTML file, and mark the topics in blocks;
[0050] Each question is a block.
[0051] Set the width of the body to the required printing width (for example, A4, 96dpi is 794px).
[0052] S103: setting answer areas for all questions that require answer areas in the HTML file and marking the answer areas as blocks;
[0053] For objective questions, it is often not necessary to set an answer area, or a centralized answer area (such as an answer sheet or answer form) will be set. The centralized answer area is placed in the HTML file as a block as the answer area to be assembled.
[0054] For a small number of objective test questions, regular matching is required to find the answer area. The answer area does not need to be placed in the HTML file as a block to be included in the test paper, but can be placed as a marked block.
[0055] For subjective questions, an answer area is formed after the subjective question by inserting a reference answer to the subjective question or reserving a preset height, and the answer area is marked as an answer block.
[0056] Each subjective question answering area is a block.
[0057] Reserve a preset height when there is no reference answer for subjective questions.
[0058] S104: clearing non-empty blocks in the answer area and keeping the size unchanged;
[0059] Remove the innerHTML in the subjective question answering area in step S103, and keep the height unchanged (for the case of inserting reference answers to subjective questions).
[0060] S2: Intelligently cut some blocks in the test paper through block marking, so that each block will not cross pages in the test paper;
[0061] S201: Obtaining the absolute coordinate information of the block mark;
[0062] The absolute coordinate information includes the starting point coordinates and height, and also includes width (if the width of the block is set to the text width in the test paper text printing size, there is no need to obtain the width. In this embodiment, the width of the block is set to the text width in the test paper text printing size before step S2).
[0063] The absolute coordinate information is obtained by loading the HTML file in a loader, and the loader is webview.
[0064] In body:onload, the positions of all blocks are calculated to obtain the absolute coordinate positions of all blocks in HTML (ie, absolute coordinate information).
[0065] S202: judging whether each block spans across pages according to the absolute coordinate information of the block mark and the printing size of the test paper text, and performing intelligent cutting on the blocks that span across pages;
[0066] Specifically, according to the order of block tags in the HTML file, the heights of block tags are accumulated one by one to obtain the accumulated height; during the accumulation process, if the accumulated height is less than the text height in the test paper text printing size, the accumulation continues; if the accumulated height is equal to the text height in the test paper text printing size, the accumulated height is cleared and the accumulation continues; if the accumulated height is greater than the text height in the test paper text printing size, the block corresponding to the last accumulated block tag is identified as a cross-page block and the cross-page block is intelligently cut into the front page block and the back page block, and the accumulated height is set to the height of the block tag corresponding to the back page block and the accumulation continues.
[0067] If the width of the block is not set to the text width in the test paper text print size, the absolute coordinate information includes the starting point coordinates, width and height. When judging whether each block spans pages, the width of the block mark must also be considered. Specifically,
[0068] Multiply the height and width of the block marker of each block to obtain the block area, and accumulate the block areas of the block markers one by one in the order of the block markers in the HTML file to obtain the accumulated area; during the accumulation process, if the accumulated area is smaller than the text area in the test paper text printing size, continue to accumulate; if the accumulated area is equal to the text area in the test paper text printing size, the accumulated area is cleared and continued to accumulate; if the accumulated area is larger than the text area in the test paper text printing size, the block corresponding to the last accumulated block marker is identified as a cross-page block and the cross-page block is intelligently cut into the front page block and the back page block, and the accumulated area is set to the block area of the block marker corresponding to the back page block and continues to accumulate.
[0069] For example, the text height to be printed on each page of the test paper is fixed (for example, A4 paper, 96dpi is 1123px, and the text height must not be greater than this size). If the accumulated height exceeds the text height, it is considered to be across pages. For blocks that span pages, intelligent block cutting is performed, that is, one block is cut into multiple new blocks.
[0070] After intelligent cutting, you need to mark the blocks of the previous page and the next page.
[0071] The intelligent cutting of the cross-page blocks in step S202 is as follows:
[0072] If the block across pages is a blank block, the block across pages will be cut directly;
[0073] Cut the block across pages so that the height of the next page block is equal to the accumulated height minus the text height in the test paper text printing size. Then the previous page block can be placed in the test paper. Therefore, it is sufficient to directly cut it into multiple blocks according to the height.
[0074] For example, when there are 100px left on the page and the height of the blank block is 300px, the blank block is cut into two new blocks, one is 100px (the height of the previous page block) and the other is 200px (the height of the next page block).
[0075] If the block across the page is the area for answering subjective questions, it will be a blank block (i.e. a white space).
[0076] If the block across pages is a non-blank block, the DOM structure of the block across pages is dynamically adjusted.
[0077] The block of the question is the non-blank block.
[0078] The dynamic adjustment of the DOM structure is performed in body:onload.
[0079] The dynamic adjustment of the DOM structure is:
[0080] Extract the child DOM nodes of the block that crosses pages from the end to the beginning, and put the extracted child DOM nodes into the new block until the remaining child DOM nodes in the block that crosses pages no longer cross pages;
[0081] If the extracted child DOM node cannot be cut perfectly, continue to cut this child DOM node until this child DOM node no longer crosses pages;
[0082] The cutting method is different depending on whether the child DOM node has a grandchild DOM node (that is, whether the child DOM node itself is non-text):
[0083] When this child DOM node has a grandchild DOM node (that is, the child DOM node itself is not text), the grandchild DOM nodes of this child DOM node are extracted from the end to the beginning and put into a new block;
[0084] When this child DOM node does not have a grandchild DOM node (that is, the child DOM node itself is text), binary cutting is performed until the conditions are met and no cross-page is allowed.
[0085] After intelligently cutting the blocks that span pages, each block will be placed exactly on each page of the test paper, and there will be no more blocks spanning pages.
[0086] S3: Arrange the blocks after intelligent cutting one by one according to the test paper pages;
[0087] S301: Obtaining the absolute coordinate information of the block mark corresponding to each block;
[0088] S302: converting the absolute coordinate information into page coordinate information according to the test paper page;
[0089] The blocks after intelligent cutting do not correspond to the questions or answer areas one by one. It is possible that multiple blocks correspond to one question or answer area. This is because the blocks on the previous page and the blocks on the next page appear after intelligent cutting.
[0090] The page coordinate information is the location information (specific page number, coordinates) of the questions in the final test paper, as well as the answer area of all questions. The page coordinate information is also the page coordinate information.
[0091] For the answer area of objective questions that require regular matching (this answer area does not need to be placed in the HTML file as a block as the answer area to be compiled, but can be placed as a mark block), its position is converted according to the relative position information between the mark block and the corresponding question block, and the absolute coordinate information of the answer area in each page of the test paper can be obtained.
[0092] According to business needs, the page coordinate information can also be converted into the required business data structure.
[0093] S4: Convert HTML files into PDF files for printing.
[0094] At this time, the DOM nodes in the HTML file are dynamically adjusted to achieve cutting and no longer cross pages.
[0095] It should be noted that the tool that converts HTML files to PDF must be consistent with the loader (webview in this embodiment) that calculates the absolute coordinate information. For example, if Chrome is used for printing, the webview must also be Chrome. If wkhtmltopdf is used for HTML to PDF conversion, this problem will not occur.
[0096] A test paper assembling system with automatic question cutting and blank leaving realizes a test paper assembling method with automatic question cutting and blank leaving, comprising an HTML file construction unit, an intelligent cutting unit and an arrangement unit, wherein the HTML file construction unit puts all the questions and answer areas to be assembled into an HTML file as blocks in sequence, and marks the blocks; the intelligent cutting unit intelligently cuts some blocks in the blocks through the block marks, so that each block will not cross pages in the test paper; and the arrangement unit arranges each block after intelligent cutting one by one according to the test paper pages.
[0097] Through a test paper composition method and system with automatic question cutting and blank leaving, the question area position information and answer area position of the final test paper can be obtained, and the answer area of the subjective question can be intelligently left blank through the reference answer.
[0098] A test paper composing method and system with automatic topic cutting and blank leaving can automatically cut off the topic and leave blank, and the blank space is flexible and reasonable to reduce waste; it helps teachers or test-setting units to complete automatic test paper composing, reduces manual operations, and alleviates the complexity of teachers' tasks.
[0099] A test paper assembling method and system with automatic question cutting and blank leaving will assemble the questions into a test paper, automatically leave a blank in the answer area, and automatically calculate the area coordinate information of each question and the answer area coordinate information. This technology can be combined with other technologies (such as smart dot pen technology) to collect and process paper answer information.
[0100] In the field of education, homework and exams are important parts of the teaching process. They are an evaluation of what students have learned and a means of measuring teachers' teaching outcomes.
[0101] The current educational Internet technology is mainly used for the assignment of homework and examinations through electronic devices (such as tablets). The teacher assigns homework on the teacher's end, and the students answer the questions electronically on the tablet. However, there are some obvious disadvantages to using electronic devices such as tablets. Using them for a long time will have a certain impact on vision, and it is also difficult to control electronic devices such as tablets.
[0102] With the development of smart dot pen technology, students can answer questions on paper test papers, collect handwriting through the micro camera at the tip of the pen, and then upload the collected data to the server via Bluetooth or WIFI. In this application scenario, the accuracy of the regional coordinate information of the question and the coordinate information of the answer area is particularly important. If the manual box selection method is used, it is troublesome and time-consuming. If the generated PDF document is used for intelligent question selection using image recognition technology, it will encounter great challenges because the types of questions are varied.
[0103] The regional coordinate information of the questions and the coordinate information of the answering area are obtained by a test paper composition method and system that automatically cuts off the questions and leaves blanks. Combined with the intelligent dot matrix pen technology, the paper answer information can be collected and processed.
[0104] The above-mentioned embodiments only express the specific implementation of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.
Claims
1. A method for automatically cutting off the questions and leaving blanks for test papers, characterized in that: The following steps are involved: S1: Put all the questions and answer areas to be composed into the HTML file as blocks in order, and mark the blocks; S2: Intelligently cut some blocks in the test paper through block marking, so that each block will not cross pages in the test paper; S3: Arrange the blocks after intelligent cutting one by one according to the test paper pages; The step S2 comprises the following sub-steps: S201: Obtaining the absolute coordinate information of the block mark; S202: judging whether each block spans across pages according to the absolute coordinate information of the block mark and the printing size of the test paper text, and performing intelligent cutting on the blocks that span across pages; The absolute coordinate information includes the height, and the width of each block is set to the text width in the test paper text printing size; the method for determining whether each block crosses pages in the sub-step S202 is: According to the order of block tags in the HTML file, the heights of block tags are accumulated one by one to get the cumulative height; During the accumulation process, if the accumulated height is less than the text height in the test paper text printing size, the accumulation continues; if the accumulated height is equal to the text height in the test paper text printing size, the accumulated height is cleared and the accumulation continues; if the accumulated height is greater than the text height in the test paper text printing size, the block corresponding to the last accumulated block mark is identified as a cross-page block and the cross-page block is intelligently cut into the front page block and the back page block, and the accumulated height is set to the height of the block mark corresponding to the back page block and the accumulation continues; Or the absolute coordinate information includes width and height; the method for determining whether each block crosses pages in the sub-step S202 is: The height and width of the block marker of each block are multiplied to obtain the block area. According to the order of the block markers in the HTML file, the block areas of the block markers are accumulated one by one to obtain the accumulated area. During the accumulation process, if the accumulated area is smaller than the text area in the test paper text printing size, the accumulation continues; if the accumulated area is equal to the text area in the test paper text printing size, the accumulated area is cleared and the accumulation continues; if the accumulated area is larger than the text area in the test paper text printing size, the block corresponding to the last accumulated block mark is identified as a cross-page block and the cross-page block is intelligently cut into the front page block and the back page block, and the accumulated area is set to the block area of the block mark corresponding to the back page block and the accumulation continues; The intelligent cutting of the cross-page blocks in step S202 is as follows: If the block across pages is a blank block, the block across pages will be cut directly; If the block across pages is a non-blank block, the DOM structure of the block across pages is dynamically adjusted; The dynamic adjustment of the DOM structure is: Extract the child DOM nodes of the block that crosses pages from the end to the beginning, and put the extracted child DOM nodes into new blocks until the remaining child DOM nodes in the block that crosses pages no longer cross pages; If the extracted child DOM node cannot be cut perfectly, continue to cut this child DOM node until this child DOM node no longer crosses pages; When this child DOM node has a grandchild DOM node, continue to extract the grandchild DOM nodes of this child DOM node from the end to the beginning and put them into a new block; When this child DOM node does not have a grandchild DOM node, a binary split is performed until it no longer crosses pages.
2. The method for automatically setting up test papers with blank spaces according to claim 1, characterized in that: The step S1 comprises the following sub-steps: S101: Convert all topics into HTML sub-files one by one; S102: concatenate all HTML sub-files of the topic into an HTML file, and mark the topics in blocks; S103: setting answer areas for all questions that require answer areas in the HTML file and marking the answer areas as blocks; S104: Clear the non-empty blocks in the answer area and keep the size unchanged.
3. The method for automatically setting up a test paper with blank space according to claim 1, characterized in that: The step S3 comprises the following sub-steps: S301: Obtaining the absolute coordinate information of the block mark corresponding to each block; S302: Convert the absolute coordinate information into page coordinate information according to the test paper page.
4. The method for automatically setting up test papers with blank spaces according to claim 1, characterized in that: After step S3, the following steps are performed: S4: Convert HTML files into PDF files for printing.
5. A system for automatically setting the topic and leaving blanks, realizing a method for automatically setting the topic and leaving blanks as claimed in any one of claims 1 to 4, characterized in that: The method comprises an HTML file construction unit, an intelligent cutting unit and an arrangement unit. The HTML file construction unit puts all the questions and answer areas to be assembled into an HTML file as blocks in sequence, and marks the blocks; the intelligent cutting unit intelligently cuts some blocks in the blocks by using the block marks, so that each block will not cross pages in the test paper; The arrangement unit arranges the intelligently cut blocks one by one according to the test paper pages.
Citation Information
Patent Citations
Method for generating and recognizing a test paper with question card in one
CN109344381A
A method for adaptively typesetting teaching content on a tablet device
CN109376351A
Error book generation method suitable for electronic typoscope
CN110705534A
Novel image-text typesetting processing method
CN111626036A
Intelligent test paper composition method and device, storage medium and electronic equipment
CN112365402A
