Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the devices, modules or units to be determined as different devices, modules or units, and are not used for limiting the sequence or interdependence relationship of the functions executed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
To make the objects, technical solutions and advantages of the present disclosure more apparent, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.
The present disclosure provides a method and an apparatus for generating test questions, an electronic device, and a computer-readable storage medium, which are intended to solve the above technical problems in the prior art.
The following describes the technical solutions of the present disclosure and how to solve the above technical problems in specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present disclosure will be described below with reference to the accompanying drawings.
In one embodiment, a method for generating test questions is provided, as shown in fig. 1, the method including:
step S101, determining whether a test question generation instruction is received;
step S102, responding to a received test question generating instruction, and acquiring a preset test question template, a logic expression corresponding to the test question template and variable parameters in the test question template;
in practical application, a user can generate test questions by interacting with the terminal. For example, a user opens a web page or an application client for generating test questions on a terminal, an interactive interface may be preset in the web page or the application client, and a virtual button preset in the interactive interface and used for generating test questions or having the same function is clicked, the virtual button may correspond to a test question generation instruction, the terminal may determine whether the test question generation instruction is received by monitoring whether the virtual button is clicked, when it is monitored by the terminal that the user clicks the virtual button, it may be determined that the test question generation instruction is received, and then a preset test question template, a logic expression corresponding to the test question template, and variable parameters in the test question template may be obtained from a test question database. The logic expression is a condition which is required to be met by the variable parameters in the test question template so as to ensure that the generated test question logic is correct.
Step S103, determining whether the assignment aiming at the variable parameter is received;
step S104, responding to the received assignment aiming at the variable parameter, and acquiring the variable parameter value of the variable parameter;
after a user selects the test question template, the variable parameters in the test question template can be obtained, the text input boxes corresponding to the variable parameters are displayed in the interactive interface, the user can assign the variable parameters in the text input boxes, and meanwhile, the terminal monitors whether the user initiates a confirmation instruction for assigning the variable parameters. When a user inputs numerical values corresponding to variable parameters in each text input box and initiates a confirmation instruction by clicking the determined virtual button, the terminal monitors the confirmation instruction and can determine that assignment aiming at the variable parameters is received.
Step S105, determining whether the variable parameter values meet the logic expression;
and S106, when the variable parameter values meet the logic expression, generating the target test questions based on the test question template, the logic expression, the variable parameters and the variable parameter values.
After the user inputs the values corresponding to the variable parameters, whether the variable parameter values meet the logic expression or not needs to be judged, and if the variable parameter values meet the logic expression, the target test questions can be generated based on the test question template, the logic expression, the variable parameters and the variable parameter values.
In the embodiment of the disclosure, a terminal firstly determines whether a test question generation instruction is received, acquires a preset test question template, a logic expression corresponding to the test question template and a variable parameter in the test question template in response to the received test question generation instruction, then determines whether assignment aiming at the variable parameter is received, acquires a variable parameter value of the variable parameter in response to the received assignment aiming at the variable parameter, and then determines whether the variable parameter value meets the logic expression; and generating the target test question based on the test question template, the logic expression, the variable parameter and the variable parameter value in response to the variable parameter value satisfying the logic expression. Therefore, on the premise of ensuring the consistency of the logic of the test questions, the user randomly changes the variable parameters in the test questions to change the results of the test questions, so that a new test question is generated, a large amount of labor cost and time cost are saved, the test questions aiming at the same knowledge point are solved, and the correct answers can be obtained by the students through the back answers, so that the knowledge point can not be mastered skillfully, and the flexible and valuable test questions can be obtained automatically.
In one embodiment, a method for generating test questions is provided, as shown in fig. 2, the method includes:
step S201, determining whether a test question generation instruction is received;
step S202, responding to a received test question generating instruction, and acquiring a preset test question template, a logic expression corresponding to the test question template and variable parameters in the test question template;
in practical application, a user can generate test questions by interacting with the terminal. For example, a user opens a web page or an application client for generating test questions on a terminal, an interactive interface may be preset in the web page or the application client, and a virtual button preset in the interactive interface and used for generating test questions or having the same function is clicked, the virtual button may correspond to a test question generation instruction, the terminal may determine whether the test question generation instruction is received by monitoring whether the virtual button is clicked, when it is monitored by the terminal that the user clicks the virtual button, it may be determined that the test question generation instruction is received, and then a preset test question template, a logic expression corresponding to the test question template, and variable parameters in the test question template may be obtained from a test question database. The logic expression is a condition which is required to be met by the variable parameters in the test question template so as to ensure that the generated test question logic is correct.
For example, a test question template is "ax2And + bx + c is 0 ", wherein a, b and c are variable parameters, and a logic expression corresponding to the test question template is' a × c<0', when "a + c<0 "ax2The logic of + bx + c ═ 0 "is correct, and the equation has a real number solution if a ═ c>0, then the generated topic is wrong. That is, the user needs to input the values of a, b, and c, respectively, and the input values of a and c need to satisfy "a × c<A logical expression of 0 ".
As another example, a test question template is "x2D is a variable parameter, and the logic expression corresponding to the test question template is d<0', when "d<When 0 "x2The logic of + d ═ 0 "is correct, the equation has a real number solution, if d is correct>0, then the generated topic is wrong. That is, the user needs to input the value of d, and the input value of d needs to beTo satisfy "d<A logical expression of 0 ".
In a preferred embodiment of the present disclosure, in response to receiving a test question generation instruction, acquiring a preset test question template, a logic expression corresponding to the test question template, and a variable parameter in the test question template, including:
acquiring a matched test question template from a pre-constructed test question database according to a request identifier in a received test question generating instruction, wherein the test question database stores the test question template, variable parameters in the test question template, logic expressions corresponding to the test question template and pairwise corresponding relations among the test question template, the variable parameters and the logic expressions;
and acquiring corresponding logic expressions and variable parameters according to the corresponding relations.
Specifically, before generating the test questions, the user may pre-construct a test question database for storing the test question template, the variable parameters in the test question template, and the logic expressions corresponding to the test question template, where the test question template, the variable parameters, and the logic expressions have pairwise correspondence, for example, the test question template "ax2The logical expression corresponding to + bx + c ═ 0 "is" a × c<0 'corresponding variable parameters are' a, b and c ', and the logical expression corresponding to the variable parameters' a, b and c 'is' a c<0 ", and so on.
In the test question database, each test question template has a corresponding logic expression and a variable parameter, and the variable parameter can be one or more. For example, the test question template "ax2The + bx + c ═ 0' includes three variable parameters of a, b and c, and the test question template "x2D is a variable parameter included in + d ═ 0 ".
Furthermore, the test question template may also be configured with corresponding classification identifiers, such as test question template "ax2The classification identifier of + bx + c ═ 0 "may be a" unitary quadratic equation ", and each classification identifier is displayed in the interactive interface, before the user clicks" generate test question ", the classification identifier of the required test question template, such as a" unitary quadratic equation ", may be selected first, so that the test question template and the variation of the test question template may be selected from the unitary quadratic equationThe quantity parameters and the logic expression of the test question template generate test questions.
Alternatively, it may be an ID identification, such as "a
2+b
2=c
2The ID identification of "may be" pythagorean theorem ",
the ID identification of (a) may be a "trigonometric identity" or the like. Of course, other identifiers may also be used, and may be set according to actual requirements, which is not limited in the embodiment of the present disclosure.
In a preferred embodiment of the present disclosure, the logic expression is generated by:
receiving an original logic expression based on natural language input by a user;
and inputting the original logic expression into a preset conversion model to obtain a target logic expression based on the machine language.
Specifically, the logic expression may be generated by converting a natural language-based logic expression (e.g., "a × c < 0") into a machine language-based logic expression using a preset conversion model, such as a seq2seq model, where the input of the conversion model is the natural language-based logic expression and the output is the machine language-based logic expression, such as a code-form logic expression.
In a preferred embodiment of the present disclosure, the logical expression is a machine language-based logical expression entered by a user.
Further, the machine language based logic expression may also be manually input by a user. The conversion into the machine language-based logic expression has the advantage of being used for subsequent test question generation.
Step S203, determining whether the assignment aiming at the variable parameter is received;
step S204, responding to the received assignment aiming at the variable parameter, and acquiring the variable parameter value of the variable parameter;
after the user selects the test question template, the variable parameters in the test question template can be obtained, and the corresponding variable parameters are displayed in the interactive interfaceThe text input box is used for enabling a user to assign values to the variable parameters in the text input boxes, and meanwhile, the terminal monitors whether the user initiates a confirmation instruction for assigning the variable parameters. When a user inputs numerical values corresponding to variable parameters in each text input box and initiates a confirmation instruction by clicking the determined virtual button, the terminal monitors the confirmation instruction and can determine that assignment aiming at the variable parameters is received. For example, "ax2If the variable parameter in + bx + c ═ 0 "is" a, b, and c ", the user can be allowed to enter the values corresponding to" a, b, and c ", respectively. And then, acquiring the numerical value of each variable parameter input by the user from each text input box.
Step S205, determining whether the variable parameter value meets the logic expression;
step S206, responding to the variable parameter value satisfying the logic expression, and generating a target test question based on the test question template, the logic expression, the variable parameter and the variable parameter value;
specifically, after the user inputs the values corresponding to the variable parameters, it is necessary to determine whether the variable parameter values satisfy the logical expressions, and if so, the target test questions may be generated based on the test question template, the logical expressions, the variable parameters, and the variable parameter values. For example, for the question template "ax2And + bx + c is 0 ", a value of a input by the user is 5, b is 8, c is-3, a is-15 and is less than 0, and the logical expression corresponding to the test question template is satisfied, so that the target test question can be generated by using the values of" 5, 8 and-3 ".
Step S207, responding to the variable parameter value not meeting the logic expression, generating an error prompt and displaying the error prompt;
specifically, after the user inputs the values corresponding to the variable parameters, if the values of the variable parameters do not satisfy the logical expression, an error prompt may be generated and displayed to the user, for example, the values corresponding to "a, b, and c" input by the user are "5, 8, 3", and obviously do not satisfy "a × c < 0", so that an "error" may be generated: and a + c > 0' to prompt and display the error to the user, and then the user is enabled to re-input the value of a or the value of c.
And after the user inputs a new numerical value again, continuously judging whether the new numerical value meets the logic expression corresponding to the test question template, if not, continuously generating an error prompt and displaying the error prompt to the user to enable the user to input the new numerical value again until the newly input new numerical value meets the logic expression, and then generating the target test question based on the test question template, the logic expression, the variable parameter and the new variable parameter value.
And S208, solving the target test questions to obtain the solution result of the target test questions.
Specifically, after the target test question is generated, the target test question may be solved to obtain a corresponding solution result. In this way, the user can generate answers corresponding to the test questions while generating the test questions.
In the embodiment of the disclosure, a terminal firstly determines whether a test question generation instruction is received, acquires a preset test question template, a logic expression corresponding to the test question template and a variable parameter in the test question template in response to the received test question generation instruction, then determines whether assignment aiming at the variable parameter is received, acquires a variable parameter value of the variable parameter in response to the received assignment aiming at the variable parameter, and then determines whether the variable parameter value meets the logic expression; and generating the target test question based on the test question template, the logic expression, the variable parameter and the variable parameter value in response to the variable parameter value satisfying the logic expression. Therefore, on the premise of ensuring the consistency of the logic of the test questions, the user randomly changes the variable parameters in the test questions to change the results of the test questions, so that a new test question is generated, a large amount of labor cost and time cost are saved, the test questions aiming at the same knowledge point are solved, and the correct answers can be obtained by the students through the back answers, so that the knowledge point can not be mastered skillfully, and the flexible and valuable test questions can be obtained automatically.
Meanwhile, the generated test questions can be solved, so that the answer results corresponding to the generated test questions can be obtained, the generated test questions can be checked whether to be correct, the step of solving the questions by the question taker is omitted, and the time of the question taker is further saved.
Fig. 3 is a schematic structural diagram of a device for generating test questions according to another embodiment of the present disclosure, and as shown in fig. 3, the device of this embodiment may include:
a first determining module 301, configured to determine whether a test question generating instruction is received;
a first obtaining module 302, configured to, in response to a received test question generating instruction, obtain a preset test question template, a logic expression corresponding to the test question template, and a variable parameter in the test question template;
a second determining module 303, configured to determine whether an assignment for the variable parameter is received;
a second obtaining module 304, configured to, in response to receiving the assignment for the variable parameter, obtain a variable parameter value of the variable parameter;
a third determining module 305 for determining whether the variable parameter value satisfies the logical expression;
a first generating module 306, configured to generate a target test question based on the test question template, the logic expression, the variable parameter, and the variable parameter value in response to the variable parameter value satisfying the logic expression.
In a preferred embodiment of the present disclosure, the method further includes:
and the second generation module is used for responding to the variable parameter value not meeting the logic expression, generating an error prompt and displaying the error prompt.
In a preferred embodiment of the present disclosure, the first obtaining module includes:
the test question template acquisition sub-module is used for acquiring a matched test question template from a pre-constructed test question database according to a request identifier in a received test question generation instruction, wherein the test question database stores the test question template, variable parameters in the test question template, a logic expression corresponding to the test question template and pairwise corresponding relations among the test question template, the variable parameters and the logic expression;
and the corresponding information acquisition submodule is used for acquiring the corresponding logic expression and the corresponding variable parameter according to the corresponding relation.
In a preferred embodiment of the present disclosure, the logic expression is generated by:
receiving an original logic expression based on natural language input by a user;
and inputting the original logic expression into a preset conversion model to obtain a target logic expression based on the machine language.
In a preferred embodiment of the present disclosure, the logical expression is a machine language-based logical expression entered by a user.
In a preferred embodiment of the present disclosure, the method further includes:
and the answer module is used for answering the target test questions to obtain the answer results of the target test questions.
The test question generation device of this embodiment can execute the test question generation methods shown in the first embodiment and the second embodiment of the present disclosure, and the implementation principles thereof are similar, and are not described herein again.
In the embodiment of the disclosure, a terminal firstly determines whether a test question generation instruction is received, acquires a preset test question template, a logic expression corresponding to the test question template and a variable parameter in the test question template in response to the received test question generation instruction, then determines whether assignment aiming at the variable parameter is received, acquires a variable parameter value of the variable parameter in response to the received assignment aiming at the variable parameter, and then determines whether the variable parameter value meets the logic expression; and generating the target test question based on the test question template, the logic expression, the variable parameter and the variable parameter value in response to the variable parameter value satisfying the logic expression. Therefore, on the premise of ensuring the consistency of the logic of the test questions, the user randomly changes the variable parameters in the test questions to change the results of the test questions, so that a new test question is generated, a large amount of labor cost and time cost are saved, the test questions aiming at the same knowledge point are solved, and the correct answers can be obtained by the students through the back answers, so that the knowledge point can not be mastered skillfully, and the flexible and valuable test questions can be obtained automatically.
Meanwhile, the generated test questions can be solved, so that the answer results corresponding to the generated test questions can be obtained, the generated test questions can be checked whether to be correct, the step of solving the questions by the question taker is omitted, and the time of the question taker is further saved.
Referring now to FIG. 4, a block diagram of an electronic device 400 suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., car navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
The electronic device includes: a memory and a processor, wherein the processor may be referred to as a processing device 401 described below, and the memory may include at least one of a Read Only Memory (ROM)402, a Random Access Memory (RAM)403, and a storage device 408, which are described below:
as shown in fig. 4, electronic device 400 may include a processing device (e.g., central processing unit, graphics processor, etc.) 401 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage device 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the electronic apparatus 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Generally, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 408 including, for example, tape, hard disk, etc.; and a communication device 409. The communication means 409 may allow the electronic device 400 to communicate wirelessly or by wire with other devices to exchange data. While fig. 4 illustrates an electronic device 400 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 409, or from the storage device 408, or from the ROM 402. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 401.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText transfer protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: determining whether a test question generation instruction is received; responding to a received test question generating instruction, and acquiring a preset test question template, a logic expression corresponding to the test question template and variable parameters in the test question template; determining whether a value assignment for the variable parameter is received; when receiving assignment aiming at the variable parameter, acquiring a variable parameter value of the variable parameter; determining whether the variable parameter values satisfy the logical expression; and generating a target test question based on the test question template, the logic expression, the variable parameter and the variable parameter value in response to the variable parameter value satisfying the logic expression.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules or units described in the embodiments of the present disclosure may be implemented by software or hardware.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, [ example one ] there is provided a generating method of a test question, including:
determining whether a test question generation instruction is received;
responding to a received test question generating instruction, and acquiring a preset test question template, a logic expression corresponding to the test question template and variable parameters in the test question template;
determining whether a value assignment for the variable parameter is received;
when receiving assignment aiming at the variable parameter, acquiring a variable parameter value of the variable parameter;
determining whether the variable parameter values satisfy the logical expression; and
and generating a target test question based on the test question template, the logic expression, the variable parameter and the variable parameter value in response to the variable parameter value satisfying the logic expression.
Preferably, the method further comprises the following steps:
and generating an error prompt and displaying the error prompt in response to the variable parameter value not meeting the logic expression.
Preferably, the obtaining a preset test question template, a logic expression corresponding to the test question template, and a variable parameter in the test question template in response to receiving a test question generation instruction includes:
acquiring a matched test question template from a pre-constructed test question database according to a request identifier in a received test question generating instruction, wherein the test question database stores the test question template, variable parameters in the test question template, a logic expression corresponding to the test question template and pairwise corresponding relations among the test question template, the variable parameters and the logic expression;
and acquiring corresponding logic expressions and variable parameters according to the corresponding relations.
Preferably, the logical expression is generated by:
receiving an original logic expression based on natural language input by a user;
and inputting the original logic expression into a preset conversion model to obtain a target logic expression based on the machine language.
Preferably, the logical expression is a machine language based logical expression entered by a user.
Preferably, the method further comprises the following steps:
and solving the target test questions to obtain the solution results of the target test questions.
According to one or more embodiments of the present disclosure, [ example two ] there is provided the apparatus of example one, further comprising:
the first determining module is used for determining whether a test question generating instruction is received or not;
the test question generating module is used for generating a test question generating instruction according to the received test question;
a second determination module to determine whether a value assignment for the variable parameter is received;
the second obtaining module is used for obtaining the variable parameter value of the variable parameter in response to receiving the assignment aiming at the variable parameter;
a third determining module for determining whether the variable parameter value satisfies the logical expression;
and the first generation module is used for responding to the condition that the variable parameter value meets the logic expression and generating a target test question based on the test question template, the logic expression, the variable parameter and the variable parameter value.
Preferably, the method further comprises the following steps:
and the second generation module is used for responding to the variable parameter value not meeting the logic expression, generating an error prompt and displaying the error prompt.
Preferably, the first obtaining module includes:
the test question template acquisition sub-module is used for acquiring a matched test question template from a pre-constructed test question database according to a request identifier in a received test question generation instruction, wherein the test question database stores the test question template, variable parameters in the test question template, a logic expression corresponding to the test question template and pairwise corresponding relations among the test question template, the variable parameters and the logic expression;
and the corresponding information acquisition submodule is used for acquiring the corresponding logic expression and the corresponding variable parameter according to the corresponding relation.
Preferably, the logical expression is generated by:
receiving an original logic expression based on natural language input by a user;
and inputting the original logic expression into a preset conversion model to obtain a target logic expression based on the machine language.
Preferably, the logical expression is a machine language based logical expression entered by a user.
Preferably, the method further comprises the following steps:
and the answer module is used for answering the target test questions to obtain the answer results of the target test questions.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.