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 have been shown in the accompanying 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 are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present 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. Furthermore, 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 "including" and variations thereof as used herein are intended to be 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. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are used merely to distinguish one from another device, module, or unit, and are not intended to limit the device, module, or unit to the particular device, module, or unit or to limit the order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
For the purposes of clarity, technical solutions and advantages of the present disclosure, the following further details the embodiments of the present disclosure with reference to the accompanying drawings.
The present disclosure provides a method, an apparatus, an electronic device, and a computer-readable storage medium for generating test questions, which aim to solve the above technical problems in the prior art.
The following describes the technical solutions of the present disclosure and how the technical solutions of the present disclosure solve the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail 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 a test question is provided, as shown in fig. 1, and the method includes:
step S101, determining whether a test question generation instruction is received;
step S102, a preset test question template, a logic expression corresponding to the test question template and variable parameters in the test question template are obtained in response to receiving a test question generation instruction;
in practical applications, a user may generate a test question by interacting with a terminal. For example, a user opens a webpage or an application client for generating a test question on the terminal, an interactive interface can be preset in the webpage or the application client, a virtual button for generating the test question or the same function can be preset in the interactive interface, the virtual button can correspond to a test question generation instruction, the terminal can determine whether the test question generation instruction is received by monitoring whether the virtual button is clicked, when the terminal monitors that the user clicks the virtual button, the terminal can determine 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 can 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 to ensure that the generated test question logic is correct.
Step S103, determining whether assignment for variable parameters is received;
step S104, in response to receiving assignment for the variable parameter, obtaining a variable parameter value of the variable parameter;
after the user selects the test question template, variable parameters in the test question template can be obtained, text input boxes corresponding to the variable parameters are displayed in the interactive interface, the text input boxes are used for enabling the user to assign the variable parameters, and meanwhile, the terminal monitors whether the user initiates a confirmation instruction for assigning the variable parameters. When the user inputs the numerical value corresponding to each variable parameter in each text input box, and clicks the virtual button of 'determining' to initiate a confirmation instruction, the terminal monitors the confirmation instruction, and then the terminal can determine that the assignment for each variable parameter is received.
Step S105, determining whether the variable parameter value meets a logic expression;
and S106, when the variable parameter value meets the logic expression, generating a target test question based on the test question template, the logic expression, the variable parameter and the variable parameter value.
After the user inputs the values corresponding to the variable parameters, whether the variable parameter values meet the logic expression needs to be judged, and if yes, the target test questions can be generated based on the test question templates, 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, and in response to receiving the test question generation instruction, obtains a preset test question template, a logic expression corresponding to the test question template and variable parameters in the test question template, then determines whether assignment for the variable parameters is received, and in response to receiving the assignment for the variable parameters, obtains variable parameter values of the variable parameters, and then determines whether the variable parameter values meet 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 logics of the test questions, the user changes the results of the test questions by randomly changing the variable parameters in the test questions, so that a new test question is generated, a great amount of labor cost and time cost are saved, the problem that students can obtain correct answers through back answers aiming at the test questions with the same knowledge points is solved, the problem that the students cannot know the knowledge points skillfully is solved, and the flexible and changeable test questions with value can be automatically obtained.
In one embodiment, a method for generating a test question is provided, as shown in fig. 2, and the method includes:
Step S201, determining whether a test question generation instruction is received;
step S202, a preset test question template, a logic expression corresponding to the test question template and variable parameters in the test question template are obtained in response to receiving a test question generation instruction;
in practical applications, a user may generate a test question by interacting with a terminal. For example, a user opens a webpage or an application client for generating a test question on the terminal, an interactive interface can be preset in the webpage or the application client, a virtual button for generating the test question or the same function can be preset in the interactive interface, the virtual button can correspond to a test question generation instruction, the terminal can determine whether the test question generation instruction is received by monitoring whether the virtual button is clicked, when the terminal monitors that the user clicks the virtual button, the terminal can determine 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 can 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 to ensure that the generated test question logic is correct.
For example, a test question template is "ax 2 +bx+c=0 ", wherein a, b, c are variable parameters, and the logical expression corresponding to the test question template is" a×c<0", when" a x c<When 0', ax 2 Logic of +bx+c=0 "is correct, and the equation has a real solution if a×c>0, then the generated title is erroneous. 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 ".
For another example, a test question template is "x 2 +d=0 ", wherein d is a variable parameter, and the logical expression corresponding to the test question template is" d<0", when" d<When 0", x 2 Logic of +d=0 "is correct, the equation has a real solution, if d>0, then the generated title is erroneous. That is, the user needs to input the value of d, and the input value of d needs to satisfy "d<A logical expression of 0 ".
In a preferred embodiment of the present disclosure, in response to receiving a test question generation instruction, obtaining a preset test question template, a logic expression corresponding to the test question template, and variable parameters in the test question template, including:
obtaining 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 template, variable parameters in the test question template, a logic expression corresponding to the test question template and a corresponding relation among the test question template, the variable parameters and the logic expression are stored in the test question database;
And obtaining the corresponding logic expression and variable parameters according to the corresponding relation.
Specifically, before generating the test questions, the user may construct a test question database in advance for storing test question templates, variable parameters in the test question templates, and logic expressions corresponding to the test question templates, wherein the test question templates, the variable parameters, and the logic expressions have a correspondence relationship of two-to-two, such as a test question template "ax 2 The logical expression corresponding to +bx+c=0 is "a×c<0", the corresponding variable parameter is" a, b, c ", the logic expression corresponding to the variable parameter" a, b, c "is" a×c<0", etc.
In the test question database, each test question template has a corresponding logic expression and variable parameters, and the variable parameters can be one or a plurality of variable parameters. For example, the test question template "ax 2 The +bx+c=0' comprises three variable parameters of a, b and c, and the test question template "x 2 +d=0 "includes d as a variable parameter.
Further, the test question template may also set a corresponding classification identifier, such as a test question template "ax 2 The classification identifier of +bx+c=0 may be a "unitary quadratic equation", and each classification identifier is displayed in the interactive interface, and before the user clicks on "generate test question", the classification identifier of the required test question template, for example, the "unitary quadratic equation", may be selected, so that the test question template, the variable parameters of the test question template, and the logic expression of the test question template may be selected from the unitary quadratic equation to generate the test question.
Alternatively, it may also be an ID identification, such as "a 2 +b 2 =c 2 The ID identification of "may be" pythagorean theorem ",the ID identification of (c) may be "triangle identity" or the like. Of course, other identifiers may be provided, and may be set according to actual requirements, which is not limited by the embodiments of the present disclosure.
In a preferred embodiment of the present disclosure, the logical expression is generated by:
receiving an original logic expression input by a user and based on natural language;
inputting the original logic expression into a preset conversion model to obtain a target logic expression based on the machine language.
Specifically, the generating a logical expression may use a preset conversion model, such as a seq2seq model, to convert a logical expression based on a natural language (such as "a×c < 0") into a logical expression based on a machine language, where an input of the conversion model is the logical expression based on the natural language, and an output is the logical expression based on the machine language, such as a logical expression in a code form.
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 entered manually by a user. The conversion to a machine language based logical expression has the benefit of being useful for subsequent test question generation.
Step S203, determining whether assignment for variable parameters is received;
step S204, in response to receiving the assignment for the variable parameter, obtaining the variable parameter value of the variable parameter;
after the user selects the test question template, variable parameters in the test question template can be obtained, text input boxes corresponding to the variable parameters are displayed in the interactive interface, the text input boxes are used for enabling the user to assign the variable parameters, and meanwhile, the terminal monitors whether the user initiates a confirmation instruction for assigning the variable parameters. When the user inputs the numerical value corresponding to each variable parameter in each text input box, and clicks the virtual button of 'determining' to initiate a confirmation instruction, the terminal monitors the confirmation instruction, and then the terminal can determine that the assignment for each variable parameter is received. For example, "ax 2 If the variable parameters of +bx+c=0 are "a, b, c", the user can input "a, b,c "corresponding to the value of c". Then, the numerical value of each variable parameter input by the user is obtained from each text input box.
Step S205, determining whether the variable parameter value meets a logic expression;
Step S206, 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;
specifically, after the user inputs the values corresponding to the variable parameters, it needs to determine whether the variable parameter values satisfy the logic expression, and if so, the target test question can be generated based on the test question template, the logic expression, the variable parameters and the variable parameter values. For example, template "ax" for test questions 2 +bx+c=0 ", the value of a is 5, the value of b is 8,c, the value of a is-3, a×c= -15, and is less than 0, and the logical expression corresponding to the test question template is satisfied, then the value of" 5,8, -3 "can be adopted to generate the target test question.
Step S207, generating an error prompt and displaying the error prompt in response to the variable parameter value not meeting the logic expression;
specifically, after the user inputs the values corresponding to the variable parameters, if the values of the variable parameters do not satisfy the logic 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 "a×c <0" is not satisfied, so that an "error" may be generated: an error indication of a >0 "is presented to the user, which then lets the user reenter the value of a or the value of c.
After the user inputs the new value again, continuously judging whether the new 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, enabling the user to input the new value again until the new value input again meets the logic expression, and then generating a target test question based on the test question template, the logic expression, the variable parameters and the new variable parameter values.
And step S208, solving the target test questions to obtain a solving result of the target test questions.
Specifically, after the target test question is generated, the target test question can be solved, and a corresponding solving result is obtained. Thus, 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, and in response to receiving the test question generation instruction, obtains a preset test question template, a logic expression corresponding to the test question template and variable parameters in the test question template, then determines whether assignment for the variable parameters is received, and in response to receiving the assignment for the variable parameters, obtains variable parameter values of the variable parameters, and then determines whether the variable parameter values meet 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 logics of the test questions, the user changes the results of the test questions by randomly changing the variable parameters in the test questions, so that a new test question is generated, a great amount of labor cost and time cost are saved, the problem that students can obtain correct answers through back answers aiming at the test questions with the same knowledge points is solved, the problem that the students cannot know the knowledge points skillfully is solved, and the flexible and changeable test questions with value can be automatically obtained.
Meanwhile, the generated test questions can be solved, so that a solution result corresponding to the generated test questions is obtained, whether the generated test questions are correct or not can be checked, the step of solving the questions by a question-setting person is omitted, and the time of the question-setting person is further saved.
Fig. 3 is a schematic structural diagram of a test question generating device according to another embodiment of the present disclosure, where, as shown in fig. 3, the device in this embodiment may include:
a first determining module 301, configured to determine whether a test question generating instruction is received;
the first obtaining module 302 is configured to obtain 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;
a second determining module 303, configured to determine whether an assignment for the variable parameter is received;
a second obtaining module 304, configured to obtain a variable parameter value of the variable parameter in response to receiving an assignment for the variable parameter;
a third determining module 305, configured to determine whether the variable parameter value satisfies the logic 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, further comprising:
and the second generation module is used for generating an error prompt and displaying the error prompt in response to the variable parameter value not meeting the logic expression.
In a preferred embodiment of the present disclosure, the first acquisition module includes:
the test question template acquisition sub-module is used for acquiring matched test question templates from a pre-constructed test question database according to the request identification in the received test question generation instruction, wherein the test question templates, variable parameters in the test question templates, logic expressions corresponding to the test question templates and corresponding relations among the test question templates, the variable parameters and the logic expressions are stored in the test question database;
and the corresponding information acquisition sub-module is used for acquiring corresponding logic expressions and variable parameters according to the corresponding relation.
In a preferred embodiment of the present disclosure, the logical expression is generated by:
receiving an original logic expression input by a user and based on natural language;
and inputting the original logic expression into a preset conversion model to obtain a target logic expression based on 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, further comprising:
and the solving module is used for solving the target test questions to obtain solving results of the target test questions.
The generating device of the test questions of the present embodiment may execute the generating methods of the test questions shown in the first embodiment and the second embodiment of the present disclosure, and the implementation principles are similar, and are not repeated here.
In the embodiment of the disclosure, a terminal firstly determines whether a test question generation instruction is received, and in response to receiving the test question generation instruction, obtains a preset test question template, a logic expression corresponding to the test question template and variable parameters in the test question template, then determines whether assignment for the variable parameters is received, and in response to receiving the assignment for the variable parameters, obtains variable parameter values of the variable parameters, and then determines whether the variable parameter values meet 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 logics of the test questions, the user changes the results of the test questions by randomly changing the variable parameters in the test questions, so that a new test question is generated, a great amount of labor cost and time cost are saved, the problem that students can obtain correct answers through back answers aiming at the test questions with the same knowledge points is solved, the problem that the students cannot know the knowledge points skillfully is solved, and the flexible and changeable test questions with value can be automatically obtained.
Meanwhile, the generated test questions can be solved, so that a solution result corresponding to the generated test questions is obtained, whether the generated test questions are correct or not can be checked, the step of solving the questions by a question-setting person is omitted, and the time of the question-setting person is further saved.
Referring now to fig. 4, a schematic 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., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 4 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
An electronic device includes: a memory and a processor, where the processor may be referred to as a processing device 401 described below, 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 described below, as follows:
As shown in fig. 4, the electronic device 400 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 401, which may perform various suitable actions and processes according to a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage means 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other by a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
In general, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touchpad, 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, magnetic tape, hard disk, etc.; and a communication device 409. The communication means 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. While fig. 4 shows an electronic device 400 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communications device 409, or from storage 408, or from ROM 402. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 401.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 context of this 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 the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, 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 communication 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 networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated 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 generation 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 an assignment for the variable parameter is received; acquiring a variable parameter value of the variable parameter in response to receiving an assignment for the variable parameter; determining whether the variable parameter value satisfies 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 in response to the variable parameter value satisfying the logic expression.
Computer program code for carrying out operations of the present disclosure may be written in 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 kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts 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 involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware.
The functions described above herein 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: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), 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. The 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, there is provided a method for generating a test question, including:
determining whether a test question generation instruction is received;
responding to a received test question generation 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 an assignment for the variable parameter is received;
acquiring a variable parameter value of the variable parameter in response to receiving an assignment for the variable parameter;
determining whether the variable parameter value satisfies the logic 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 meeting the logic expression.
Preferably, the method further comprises:
and generating an error prompt and displaying the error prompt in response to the variable parameter value not meeting the logic expression.
Preferably, the responding to receiving the test question generating instruction, obtaining a preset test question template, a logic expression corresponding to the test question template and a variable parameter in the test question template, includes:
Obtaining 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 a pairwise corresponding relation among the test question template, the variable parameters and the logic expression;
and obtaining the corresponding logic expression and variable parameters according to the corresponding relation.
Preferably, the logical expression is generated by:
receiving an original logic expression input by a user and based on natural language;
and inputting the original logic expression into a preset conversion model to obtain a target logic expression based on machine language.
Preferably, the logical expression is a machine language based logical expression entered by a user.
Preferably, the method further comprises:
and solving the target test questions to obtain the solving results of the target test questions.
According to one or more embodiments of the present disclosure, there is provided an 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 first acquisition module is used for responding to the received test question generation 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;
A second determining module, configured to determine whether an assignment for the variable parameter is received;
the second acquisition module is used for acquiring variable parameter values of the variable parameters in response to receiving assignment of the variable parameters;
a third determining module for determining whether the variable parameter value satisfies the logic expression;
and the first generation module is used for responding to the variable parameter value to meet 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:
and the second generation module is used for generating an error prompt and displaying the error prompt in response to the variable parameter value not meeting the logic expression.
Preferably, the first acquisition module includes:
the test question template acquisition sub-module is used for acquiring matched test question templates from a pre-constructed test question database according to the request identification in the received test question generation instruction, wherein the test question templates, variable parameters in the test question templates, logic expressions corresponding to the test question templates and corresponding relations among the test question templates, the variable parameters and the logic expressions are stored in the test question database;
And the corresponding information acquisition sub-module is used for acquiring corresponding logic expressions and variable parameters according to the corresponding relation.
Preferably, the logical expression is generated by:
receiving an original logic expression input by a user and based on natural language;
and inputting the original logic expression into a preset conversion model to obtain a target logic expression based on machine language.
Preferably, the logical expression is a machine language based logical expression entered by a user.
Preferably, the method further comprises:
and the solving module is used for solving the target test questions to obtain solving results of the target test questions.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although 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. In 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 limiting the scope of the present 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 example forms of implementing the claims.