CN114153450A - Questionnaire display dynamic control method, system, electronic equipment and storage medium - Google Patents

Questionnaire display dynamic control method, system, electronic equipment and storage medium Download PDF

Info

Publication number
CN114153450A
CN114153450A CN202111348201.7A CN202111348201A CN114153450A CN 114153450 A CN114153450 A CN 114153450A CN 202111348201 A CN202111348201 A CN 202111348201A CN 114153450 A CN114153450 A CN 114153450A
Authority
CN
China
Prior art keywords
model
questionnaire information
questionnaire
questions
answer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111348201.7A
Other languages
Chinese (zh)
Inventor
梁群
费毅华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Zhongyan Network Technology Co ltd
Original Assignee
Shanghai Zhongyan Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Zhongyan Network Technology Co ltd filed Critical Shanghai Zhongyan Network Technology Co ltd
Priority to CN202111348201.7A priority Critical patent/CN114153450A/en
Publication of CN114153450A publication Critical patent/CN114153450A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The method comprises the steps of establishing a basic class model and a subclass model of questionnaire information by analyzing the questionnaire information, wherein the basic class model is used for representing the questionnaire information, and the subclass model is used for representing different question types of questions in the questionnaire information; after responding to the question answering system to load and finish the questionnaire information, establishing a global object variable of the questionnaire information and model objects of different question types; and responding to the operation of a user on answer options of the questions according to the global object variables and model objects of different question types, and triggering the preset operation on the questions in the questionnaire information. The method and the device solve the technical problems that in the prior questionnaire dynamic display logic control method in the related art, a programmer is low in operation efficiency and prone to making mistakes.

Description

Questionnaire display dynamic control method, system, electronic equipment and storage medium
Technical Field
The application belongs to the technical field of computers, and particularly relates to a method and a system for dynamically controlling questionnaire display, electronic equipment and a storage medium.
Background
An excellent questionnaire system can dynamically adjust the subsequent answering content according to the answering condition of a user. For example, when a certain condition is satisfied (a certain option is selected for a certain question), some following questions are displayed or hidden, or the following questions are directly jumped to, and even answering can be directly finished. The judgment of the condition is related to the question type, and the judgment method is different for different question types.
In the prior art, condition judgment and logic control are hard coded in a questionnaire system, errors are easy to occur and the operation efficiency is low during questionnaire analysis and dynamic display.
Disclosure of Invention
A first objective of the embodiments of the present application is to provide a method for dynamically controlling questionnaire presentation, which is intended to solve at least one problem in the prior art.
The embodiment of the application is realized in such a way that a questionnaire dynamic display control method comprises the following steps:
analyzing questionnaire information, and establishing a basic class model and a subclass model of the questionnaire information, wherein the basic class model is used for representing the questionnaire information, and the subclass model is used for representing different question types of questions in the questionnaire information;
responding to the loading completion questionnaire information of the answering system, and creating a global object variable and model objects of different question types of the questionnaire information;
and responding to the operation of a user on answer options of the questions according to the global object variables and model objects of different question types, and triggering the preset operation on the questions in the questionnaire information.
In one embodiment, establishing the base class model and the subclass model of the questionnaire information comprises: establishing a basic type model QBASE of the questionnaire information, binding a plurality of public methods to a prototype object of the basic type model QBASE, and establishing the subclass models corresponding to different question types by taking the basic type model QBASE as the prototype object for different question types.
In one embodiment, the plurality of common methods includes at least one of the following functions: render, get _ answer, set _ answer.
In one embodiment, the creating the global object variables and the model objects of different question types of the questionnaire information includes: creating a global object variable with the name of Q, traversing all questions in the questionnaire information, creating a model object of the question type according to the question type of the questions, taking an option value of the model object as a key, taking the model object as a value, and adding the option value into the global object variable, wherein the option value is a number or an array.
In one embodiment, the triggering of the preset operation on the question in the questionnaire information in response to the operation of the user on the answer option of the question according to the global object variable and the model objects of different question types includes: responding to the operation of the user on answer options of the questions, acquiring option values returned by a selection function, determining the answer options selected by the user on the questions through the option values, and triggering the preset operation according to the selected answer options, wherein the preset operation comprises automatic check, skip, display, hiding, plastering and answer termination of the questions.
In one embodiment, the determining the answer choice selected by the user for the topic by the choice value comprises: and determining answer options selected by the user for the question according to the option values through the isin function by a prototype object binding method isin function of the digital type.
Another object of an embodiment of the present application is to provide a questionnaire display dynamic control system, including:
the analysis module is used for analyzing questionnaire information and establishing a basic class model and a subclass model of the questionnaire information, wherein the basic class model is used for representing the questionnaire information, and the subclass model is used for representing different question types of questions in the questionnaire information;
the response module is used for responding to the completion of the loading of the questionnaire information by the answering system and creating a global object variable of the questionnaire information and model objects of different question types;
and the triggering module is used for responding to the operation of a user on answer options of the questions according to the global object variable and model objects of different question types and triggering the preset operation on the questions in the questionnaire information.
In one embodiment, establishing the base class model and the subclass model of the questionnaire information comprises: establishing a basic type model QBASE of the questionnaire information, binding a plurality of public methods to a prototype object of the basic type model QBASE, and establishing the subclass models corresponding to different question types by taking the basic type model QBASE as the prototype object for different question types.
It is a further object of the embodiments of the present application to provide an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the computer program, when executed by the processor, causes the processor to execute the steps of the questionnaire presentation dynamic control method.
It is yet another object of an embodiment of the present application to provide a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, causes the processor to execute the steps of the questionnaire presentation dynamic control method.
According to the questionnaire display dynamic control method, the system, the electronic device and the storage medium, a basic class model and a subclass model of questionnaire information are established by analyzing the questionnaire information, wherein the basic class model is used for representing the questionnaire information, and the subclass model is used for representing different question types of questions in the questionnaire information; after responding to the question answering system to load and finish the questionnaire information, establishing a global object variable of the questionnaire information and model objects of different question types; and responding to the operation of a user on answer options of the questions according to the global object variables and model objects of different question types, and triggering the preset operation on the questions in the questionnaire information. The setting of the conditions and the realization of the corresponding operation are realized through the standard codes, so that the options selected by the user can be conveniently judged, the corresponding operation is triggered according to the options to carry out personalized display on the questions, the condition judgment and the logic control are not required to be hard coded in a questionnaire system, and the questionnaire programming efficiency is improved.
Drawings
Fig. 1 is a flow chart of an implementation of a questionnaire display dynamic control method provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of the main modules of a questionnaire presentation dynamic control system provided in an embodiment of the present application;
FIG. 3 is a diagram of an exemplary system architecture that may be used with embodiments of the present application;
fig. 4 is a schematic structural diagram of a computer system suitable for implementing the terminal device or the server according to the embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the examples of this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, etc. may be used to describe various information in the embodiments of the present application, the information should not be limited by these terms. These terms are only used to distinguish one type of information from another.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
To further clarify the technical measures and effects taken by this application to achieve the intended purpose of the invention, the following detailed description is given, along with the accompanying drawings and preferred embodiments, of specific embodiments, structures, features and effects according to this application.
Fig. 1 shows an implementation flow of a method for dynamically controlling questionnaire display according to an embodiment of the present application, and for convenience of description, only the relevant parts of the embodiment of the present application are shown, which is detailed as follows:
a questionnaire display dynamic control method comprises the following steps:
s101: analyzing questionnaire information, and establishing a basic class model and a subclass model of the questionnaire information, wherein the basic class model is used for representing the questionnaire information, and the subclass model is used for representing different question types of questions in the questionnaire information;
s102: responding to the loading completion questionnaire information of the answering system, and creating a global object variable and model objects of different question types of the questionnaire information;
s103: and responding to the operation of a user on answer options of the questions according to the global object variables and model objects of different question types, and triggering the preset operation on the questions in the questionnaire information.
In step S101: analyzing questionnaire information, and establishing a basic class model and a subclass model of the questionnaire information, wherein the basic class model is used for representing the questionnaire information, and the subclass model is used for representing different question types of questions in the questionnaire information. When the questionnaire information is configured completely and the system dynamically displays the questionnaire information, the questionnaire information is firstly analyzed, and a basic class model and a subclass model of the questionnaire information are established, so that a corresponding model is established when the questionnaire information is loaded subsequently. Here, the basic class model corresponds to questionnaire information to represent class types in which all questions in the questionnaire information include all entities in common, and the subclass model corresponds to an attribute type of each question type.
In one embodiment, establishing the base class model and the subclass model of the questionnaire information comprises: establishing a basic type model QBASE of the questionnaire information, binding a plurality of public methods to a prototype object of the basic type model QBASE, and establishing the subclass models corresponding to different question types by taking the basic type model QBASE as the prototype object for different question types. The plurality of common methods includes at least one of the following functions: render, get _ answer, set _ answer. Therefore, modeling can be carried out on different types of questions, and positioning of the questions in the questionnaire information is achieved.
Here, a basic class model Qbase can be first established, and various common methods such as render, get _ answer, and set _ answer are bound to the prototype of the object. Where the topic-dependent methods need to be implemented in a subclass.
Secondly, aiming at different question types, QBase is used as prototype to establish respective subclass models. For example, for a radio topic, the key codes are as follows:
Figure BDA0003354996290000061
in step S102: and responding to the loading completion questionnaire information of the answering system, and creating a global object variable and model objects of different question types of the questionnaire information. After the answer system has loaded the questionnaire information, the global object variables of the questionnaire information and model objects of different question types can be created. Thereby realizing the positioning and judgment of the options of the topic.
In one embodiment, the creating the global object variables and the model objects of different question types of the questionnaire information includes: creating a global object variable with the name of Q, traversing all questions in the questionnaire information, creating a model object of the question type according to the question type of the questions, taking an option value of the model object as a key, taking the model object as a value, and adding the option value into the global object variable, wherein the option value is a number or an array.
For example, after the questionnaire information is loaded, the answering system creates a global object variable named Q, traverses all questions in the questionnaire information, creates respective model objects according to the types of the questions, and then adds the model objects, using cid of the model object as key and the model object as value, to the global object Q. After this step, the system can access the model object corresponding to the question of Q1 through q.q1, and further can obtain the option selected by the user for the question through q.q1.select (). The rest types are analogized in the same way.
In step S103: and responding to the operation of a user on answer options of the questions according to the global object variables and model objects of different question types, and triggering the preset operation on the questions in the questionnaire information. When a user answers a question, after selecting a certain option, whether the current display of the questionnaire needs to be dynamically adjusted or not needs to be judged, so that after the user operates the option, the preset operation of the question in the questionnaire information is triggered according to the global object variable and model objects of different question types and the operation of the user on the answer option of the question. Thereby realizing the control of the dynamic display of the questionnaire.
In one embodiment, the triggering of the preset operation on the question in the questionnaire information in response to the operation of the user on the answer option of the question according to the global object variable and the model objects of different question types includes: responding to the operation of the user on answer options of the questions, acquiring option values returned by a selection function, determining the answer options selected by the user on the questions through the option values, and triggering the preset operation according to the selected answer options, wherein the preset operation comprises automatic check, skip, display, hiding, plastering and answer termination of the questions.
In one embodiment, the determining the answer choice selected by the user for the topic by the choice value comprises: and determining answer options selected by the user for the question according to the option values through the isin function by a prototype object binding method isin function of the digital type.
For example, for the q.q.1.select (). isin (1,2) expression, the system is such that:
in general, the cid corresponding to option 1 is 1, and the cid corresponding to option 2 is 2 … ….
If it is a radio topic, the select () function returns the number corresponding to the option cid selected by the user. Through the prototype binding method isin for the Number type, the option selected by the radio topic user can be contained in the first and second options, namely, option 1 or option 2 is selected. The code is as follows:
Figure BDA0003354996290000081
Figure BDA0003354996290000091
if it is a multiple choice question, the select () function returns an array of the choice cid selected by the user. By the prototype binding method isin for the Array type, the option selected by the multi-choice question user can be contained in the first and second options, namely option 1 or option 2 is selected or option 1 and option 2 are selected simultaneously. The code is as follows:
Figure BDA0003354996290000092
Figure BDA0003354996290000101
similarly, we can implement other logic for notins, include, notincludes, continains, and so on.
It should be noted that, in order to implement the above scheme, a programmer is first required to define a logic control language specification. Such as: the question answers obtain the norm, such as the radio question, pass the code; judging the condition to be standard; combining condition judgment specifications to define and operation (and relation), or operation (or relation), non-operation (reversal relation) among conditions; operating specifications, and the like. Secondly, various specifications need to be implemented in the answering system. The control code is then written in a questionnaire editing system through a logical control language specification. Therefore, the system can automatically read the control codes and carry out logic control according to the current answer in the answering process of the user.
Here, the first step and the second step need only be done once, and after completion, all the following questionnaires only need to be subjected to the operations of the third step and the fourth step, so that the control of questionnaire logic can be completed. Thereby saving the operating efficiency of the programmer.
For example, the logical definition of questionnaire information can be implemented by the following embodiments:
infrastructure decomposition
Q.Q1.select()==1&&Q.Q2.select().isin(1,2)
■ structural decomposition
V. Q: the start function is the inherent content of each sentence code.
V. Q1: the title number represents the title of Q1. It indicates that this code is related to the Q1 topic.
V select (): representing the selected answer.
■ Note: the different question types represent different codes for the selected answers, as set forth in the following section.
V ═ is: compare the signs, indicating equality.
V. isin: a compare function, represented within a certain set.
V & & &: the logical symbol means "and".
■ if the answer to the question compares to 1 and equals 1;
■ Q2 compares the answer selected to set (1,2) to whether it is within set (1,2) (or is a subset of set (1, 2)).
Three logical relationship definitions: and, or not.
■ and &. All sub-conditions concatenated by & & symbol are satisfied, the total condition is only satisfied.
■ or- (c) -, is satisfied by any one of the sub-conditions of the symbolic series, and the total condition is satisfied.
■ non-! The one condition is negated. Placing a condition ahead indicates negation of the condition.
Attention is paid to the following points:
the meaning of AND, OR, NOT is understood.
② can be used in combination with or without. When the codes are combined, the relation between the codes of each sentence must be clarified, and the codes are wrapped by () when necessary, so that the logic confusion is avoided.
Four cases of the preset operation:
display device
And V.satisfies the condition.
The method can be applied to various question types and can be arranged on the question, the option and the matrix row.
The check code is applied to the target position of the current question, and the condition that the previous question mark does not meet is judged. And if the conditions are met, displaying the current target. Otherwise it is not displayed.
The display also represents an option. For example, if the question is displayed, the question has an answer; if the question is not displayed, the question has no answer
Jump to
If the check mark meets the condition, jumping to a question.
The square root can be applied to various question types and is generally arranged on a question stem.
The check code is applied to the question stem of the current question, and the question or the previous question mark is judged not to meet the condition. If the conditions are met, the current question jumps to the target question from the question after being answered, and a plurality of questions can be spanned in the middle and cannot be answered. Otherwise, the next question is answered in turn.
Check-in questions crossed-over in the middle have no answer.
The jump logic for the remaining questions, except for the question to be examined, suggests the use of a "show" code to achieve the purpose of answering or not answering. The jump logic may be replaced with display logic, recommending the use of display code.
Plastering
And if the V-shaped particles do not meet the condition, plastering. Rendering is not optional. Thus, in contrast to the purpose of "display", non-plastering means optional, equivalent to the meaning of display; the representation of plastering is not optional and is equivalent to the meaning of not displaying.
The method is generally applied to two question types of single-choice questions and multiple-choice questions, and acts on options.
The check code shares a code with the display code.
Automatic selection
And if the V is satisfied, automatically selecting the option.
The method is generally applied to question types of single-choice questions and multiple-choice questions, and acts on the choices.
The method is generally applied to price questions, income questions, age questions and brand recognition questions. For example, the birth year is filled in first, and the next question can automatically calculate the age bracket according to the birth year and select the corresponding option. The following is an example of code for an embodiment of the invention:
a condition judgment code:
problems of single choice
Q.Q1.select()==1
Q1 selects option number 1
Q.Q1.select().isin(1,2)
The answers to Q1 are both within the options numbered 1 and 2.
Q.Q1.select().notin(1,2)
The answer to Q1 is outside the range of choices numbered 1 and 2.
Q.Q1.input(1)<=20
The open option numbered 1 of Q1 fills out an answer less than or equal to 20.
Multiple choice question
Q.Q1.select().include(1,2)
Q1 selects both option number 1 and option number 2.
Q.Q1.select().notinclude(1,2)
Neither option numbered 1 nor option numbered 2 was selected by Q1.
Q.Q1.select().any(1,2)
Q1 selects any option numbered 1 or 2.
Q.Q1.input(1)<=20
The open option numbered 1 of Q1 fills out an answer less than 20.
Filling in the blank
Q.Q1.input(1).asInt()>3
Option 1 of Q1 fills in an answer greater than 3.
Q.Q1.input (1). include ('Changan')
Option 1 of Q1 is just filling in "chang an".
Question of grading
Q.Q1.score(1)&&Q.Q1.score(1)[0].asInt()>3
Q1 with title 1 has a score greater than 3. The code before "&" is used to determine that the option of the question has an answer.
Problem of sorting
Q.Q1.score(1)&&Q.Q1.score(1)>3
Q1 has a ranking number greater than 3 for the option entitled 1.
Question of matrix radio
Q.Q1.row(2).select()==1
Option 1 is selected for matrix row number 2 of Q1.
Q.Q1.row(2).select().isin(1,2)
The answers to the matrix row numbered 2 of Q1 are all within the options numbered 1 and 2.
Q.Q1.row(2).select().notin(1,2)
The answers for the matrix row numbered 2 of Q1 are all outside the options numbered 1 and 2.
Q.Q1.row(2).input(1).asInt()!=30
Q1 matrix row number 2, open option number 1 filled out answer not equal to 30
Matrix multiple choice question
Q.Q1.row(2).select().include(1,2)
The matrix row numbered 2 of Q1 selects both the option numbered 1 and the option numbered 2. Q.Q1.row (2). select (). nottingclude (1,2)
The matrix row numbered 2 of Q1 neither selects option numbered 1 nor option numbered 2. Q.Q1.row (2). select (). isin (1,2)
The answers to the matrix row numbered 2 of Q1 are all within the options numbered 1 and 2.
Q.Q1.row(2).select().notin(1,2)
The answers for the matrix row numbered 2 of Q1 are all outside the options numbered 1 and 2.
Q.Q1.row(2).select().any(1,2)
Any of the options numbered 1 or 2 are selected for the matrix row numbered 2 of Q1.
Q.q.1.row (2). input (1). input ('car')
Q1 matrix row number 2, with the answer filled out with the open option number 1 containing the text "car".
Matrix gap filling problem
Q.Q1.row(2).input(1)>3
Q1 matrix row number 2, option 1 fills in an answer greater than 3.
Q.Q.1.row (2). input (1). include ('Changan')
Q1 matrix row number 2, option 1 filled in the answer containing the text "chang 'an", the "chang' an" being filled in.
Question of matrix scoring
Q.Q1.row(1).op(1).score()&&Q.Q1.row(1).op(1).score()>3
Option 1 of row 1 of the Q1 topic matrix has a score greater than 3. The code before "&" is used to determine that the option of the question has an answer.
Jump code
if(condition1){next=‘1’}
else if(condition2){next=‘2’}
else{next=‘Q10’}
Wherein:
condition1, 2: the conditions that need to be satisfied when executing the jump are the same as the writing method of the display code, and are not described herein. That is, the skip code has a frame of if … next … else if … next … else … next more than the display code, and the syntax structure of the internal condition completely coincides with the display code.
{ next ═ 1' }: answer completion (successful completion)
{ next ═ 2' }: answer is over (screened)
{ next ═ Q10': jump to topic Q10.
Therefore, according to the questionnaire display dynamic control method provided by the embodiment of the application, a basic class model and a subclass model of the questionnaire information are established by analyzing the questionnaire information, wherein the basic class model is used for representing the questionnaire information, and the subclass model is used for representing different question types of questions in the questionnaire information; after responding to the question answering system to load and finish the questionnaire information, establishing a global object variable of the questionnaire information and model objects of different question types; and responding to the operation of a user on answer options of the questions according to the global object variables and model objects of different question types, and triggering the preset operation on the questions in the questionnaire information. The setting of the conditions and the realization of the corresponding operation are realized through the standard codes, so that the options selected by the user can be conveniently judged, the corresponding operation is triggered according to the options to carry out personalized display on the questions, the condition judgment and the logic control are not required to be hard coded in a questionnaire system, and the questionnaire programming efficiency is improved.
Fig. 2 shows a schematic diagram of main modules of a questionnaire presentation dynamic control system provided in an embodiment of the present application, and for convenience of description, only parts related to the embodiment of the present application are shown, which are detailed as follows:
a questionnaire presentation dynamic control system 200, comprising:
the analysis module 201 is configured to analyze questionnaire information, and establish a basic class model and a subclass model of the questionnaire information, where the basic class model is used to represent the questionnaire information, and the subclass model is used to represent different question types of questions in the questionnaire information;
the response module 202 is configured to respond to the completion of the loading of the questionnaire information by the answering system, and create a global object variable of the questionnaire information and model objects of different question types;
and the triggering module 203 is configured to trigger a preset operation on a question in the questionnaire information in response to an operation of a user on an answer option of the question according to the global object variable and model objects of different question types.
In the parsing module 201: the system comprises a basic model and a subclass model, wherein the basic model and the subclass model are used for analyzing questionnaire information and establishing the basic model and the subclass model of the questionnaire information, the basic model is used for representing the questionnaire information, and the subclass model is used for representing different question types of questions in the questionnaire information. When the questionnaire information is configured completely and the system dynamically displays the questionnaire information, the questionnaire information is firstly analyzed, and a basic class model and a subclass model of the questionnaire information are established, so that a corresponding model is established when the questionnaire information is loaded subsequently. Here, the basic class model corresponds to questionnaire information to represent class types in which all questions in the questionnaire information include all entities in common, and the subclass model corresponds to an attribute type of each question type.
In one embodiment, establishing the base class model and the subclass model of the questionnaire information comprises: establishing a basic type model QBASE of the questionnaire information, binding a plurality of public methods to a prototype object of the basic type model QBASE, and establishing the subclass models corresponding to different question types by taking the basic type model QBASE as the prototype object for different question types. The plurality of common methods includes at least one of the following functions: render, get _ answer, set _ answer. Therefore, modeling can be carried out on different types of questions, and positioning of the questions in the questionnaire information is achieved.
Here, a basic class model Qbase can be first established, and various common methods such as render, get _ answer, and set _ answer are bound to the prototype of the object. Where the topic-dependent methods need to be implemented in a subclass.
Secondly, aiming at different question types, QBase is used as prototype to establish respective subclass models. For example, for a radio topic, the key codes are as follows:
Figure BDA0003354996290000171
Figure BDA0003354996290000181
in the response module 202: and the system is used for responding to the question answering system to load the completed questionnaire information and creating the global object variables of the questionnaire information and model objects of different question types. After the answer system has loaded the questionnaire information, the global object variables of the questionnaire information and model objects of different question types can be created. Thereby realizing the positioning and judgment of the options of the topic.
In one embodiment, the creating the global object variables and the model objects of different question types of the questionnaire information includes: creating a global object variable with the name of Q, traversing all questions in the questionnaire information, creating a model object of the question type according to the question type of the questions, taking an option value of the model object as a key, taking the model object as a value, and adding the option value into the global object variable, wherein the option value is a number or an array.
For example, after the questionnaire information is loaded, the answering system creates a global object variable named Q, traverses all questions in the questionnaire information, creates respective model objects according to the types of the questions, and then adds the model objects, using cid of the model object as key and the model object as value, to the global object Q. After this step, the system can access the model object corresponding to the question of Q1 through q.q1, and further can obtain the option selected by the user for the question through q.q1.select (). The rest types are analogized in the same way.
In the trigger module 203: and the model objects are used for responding to the operation of the user on answer options of the questions according to the global object variables and the model objects of different question types and triggering the preset operation on the questions in the questionnaire information. When a user answers a question, after selecting a certain option, whether the current display of the questionnaire needs to be dynamically adjusted or not needs to be judged, so that after the user operates the option, the preset operation of the question in the questionnaire information is triggered according to the global object variable and model objects of different question types and the operation of the user on the answer option of the question. Thereby realizing the control of the dynamic display of the questionnaire.
In one embodiment, the triggering of the preset operation on the question in the questionnaire information in response to the operation of the user on the answer option of the question according to the global object variable and the model objects of different question types includes: responding to the operation of the user on answer options of the questions, acquiring option values returned by a selection function, determining the answer options selected by the user on the questions through the option values, and triggering the preset operation according to the selected answer options, wherein the preset operation comprises automatic check, skip, display, hiding, plastering and answer termination of the questions.
In one embodiment, the determining the answer choice selected by the user for the topic by the choice value comprises: and determining answer options selected by the user for the question according to the option values through the isin function by a prototype object binding method isin function of the digital type.
For example, for the q.q.1.select (). isin (1,2) expression, the system is such that:
in general, the cid corresponding to option 1 is 1, and the cid corresponding to option 2 is 2 … ….
If it is a radio topic, the select () function returns the number corresponding to the option cid selected by the user. Through the prototype binding method isin for the Number type, the option selected by the radio topic user can be contained in the first and second options, namely, option 1 or option 2 is selected. The code is as follows:
Figure BDA0003354996290000191
Figure BDA0003354996290000201
if it is a multiple choice question, the select () function returns an array of the choice cid selected by the user. By the prototype binding method isin for the Array type, the option selected by the multi-choice question user can be contained in the first and second options, namely option 1 or option 2 is selected or option 1 and option 2 are selected simultaneously. The code is as follows:
Figure BDA0003354996290000211
Figure BDA0003354996290000221
similarly, we can implement other logic for notins, include, notincludes, continains, and so on.
An embodiment of the present application further provides an electronic device, including: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by one or more processors, the one or more processors realize the questionnaire display dynamic control method of the embodiment of the application
The embodiment of the present application further provides a computer-readable medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for dynamically controlling questionnaire display according to the embodiment of the present application is implemented.
Fig. 3 illustrates an exemplary system architecture 300 to which the questionnaire presentation dynamic control method or system of the embodiments of the present application can be applied.
As shown in fig. 3, the system architecture 300 may include terminal devices 301, 302, 303, a network 304, and a server 305. The network 304 serves as a medium for providing communication links between the terminal devices 301, 302, 303 and the server 305. Network 304 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal device 301, 302, 303 to interact with the server 305 via the network 304 to receive or send messages or the like. The terminal devices 301, 302, 303 may have various communication client applications installed thereon, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, and the like.
The terminal devices 301, 302, 303 may be various electronic devices having a display screen and supporting web browsing, including but not limited to in-vehicle smart screens, smart phones, tablets, laptop portable computers, desktop computers, and the like.
The server 305 may be a server providing various services, such as a background management server providing support for users using incoming and outgoing messages sent by the terminal devices 301, 302, 303. The background management server can perform analysis and other processing after receiving the terminal device request, and feed back the processing result to the terminal device.
It should be noted that the questionnaire presentation dynamic control method provided in the embodiment of the present application is generally executed by the terminal devices 301, 302, and 303, and accordingly, the questionnaire presentation dynamic control system is generally disposed in the terminal devices 301, 302, and 303.
It should be understood that the number of terminal devices, networks, and servers in fig. 3 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 4, shown is a block diagram of a computer system 400 suitable for use in implementing the electronic device of an embodiment of the present application. The computer system shown in fig. 4 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present application.
As shown in fig. 4, the computer system 400 includes a Central Processing Unit (CPU)401 that can 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 section 408 into a Random Access Memory (RAM) 403. In the RAM403, various programs and data necessary for the operation of the system 400 are also stored. The CPU 401, ROM 402, and RAM403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
The following components are connected to the I/O interface 405: an input section 406 including a keyboard, a mouse, and the like; an output section 407 including a display device such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 408 including a hard disk and the like; and a communication section 409 including a network interface card such as a LAN card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet. A driver 410 is also connected to the I/O interface 405 as needed. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 410 as necessary, so that a computer program read out therefrom is mounted into the storage section 408 as necessary.
In particular, according to embodiments disclosed herein, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments disclosed herein include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising 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 through the communication section 409, and/or installed from the removable medium 411. The above-described functions defined in the system of the present application are executed when the computer program is executed by a Central Processing Unit (CPU) 401.
It should be noted that the computer readable medium shown in the present application may 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 application, 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 this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, 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: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
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 application. 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 or flowchart illustration, and combinations of blocks in the block diagrams 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 described in the embodiments of the present application may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a determination module, an extraction module, a training module, and a screening module. Where the names of these modules do not in some cases constitute a limitation of the module itself, for example, a determination module may also be described as a "module that determines a set of candidate users".
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A questionnaire dynamic display control method is characterized by comprising the following steps:
analyzing questionnaire information, and establishing a basic class model and a subclass model of the questionnaire information, wherein the basic class model is used for representing the questionnaire information, and the subclass model is used for representing different question types of questions in the questionnaire information;
responding to the loading completion questionnaire information of the answering system, and creating a global object variable and model objects of different question types of the questionnaire information;
and responding to the operation of a user on answer options of the questions according to the global object variables and model objects of different question types, and triggering the preset operation on the questions in the questionnaire information.
2. The questionnaire presentation dynamic control method of claim 1, wherein establishing a base class model and a subclass model of the questionnaire information comprises: establishing a basic type model QBASE of the questionnaire information, binding a plurality of public methods to a prototype object of the basic type model QBASE, and establishing the subclass models corresponding to different question types by taking the basic type model QBASE as the prototype object for different question types.
3. The questionnaire presentation dynamic control method of claim 2, wherein the plurality of common methods comprise at least one of the following functions: render, get _ answer, set _ answer.
4. The questionnaire presentation dynamic control method of claim 2, wherein the creating of the global object variables and model objects of different question types for the questionnaire information comprises: creating a global object variable with the name of Q, traversing all questions in the questionnaire information, creating a model object of the question type according to the question type of the questions, taking an option value of the model object as a key, taking the model object as a value, and adding the option value into the global object variable, wherein the option value is a number or an array.
5. The questionnaire display dynamic control method of claim 4, wherein the triggering of the preset operation on the question in the questionnaire information in response to the user operation on the answer option of the question according to the global object variable and the model objects of different question types comprises: responding to the operation of the user on answer options of the questions, acquiring option values returned by a selection function, determining the answer options selected by the user on the questions through the option values, and triggering the preset operation according to the selected answer options, wherein the preset operation comprises automatic check, skip, display, hiding, plastering and answer termination of the questions.
6. The method for dynamically controlling questionnaire presentation according to claim 5, wherein the determining the answer choice selected by the user for the question through the choice value comprises: and determining answer options selected by the user for the question according to the option values through the isin function by a prototype object binding method isin function of the digital type.
7. A questionnaire presentation dynamic control system, comprising:
the analysis module is used for analyzing questionnaire information and establishing a basic class model and a subclass model of the questionnaire information, wherein the basic class model is used for representing the questionnaire information, and the subclass model is used for representing different question types of questions in the questionnaire information;
the response module is used for responding to the completion of the loading of the questionnaire information by the answering system and creating a global object variable of the questionnaire information and model objects of different question types;
and the triggering module is used for responding to the operation of a user on answer options of the questions according to the global object variable and model objects of different question types and triggering the preset operation on the questions in the questionnaire information.
8. The questionnaire presentation dynamic control system of claim 7, wherein establishing a base class model and a subclass model of the questionnaire information comprises: establishing a basic type model QBASE of the questionnaire information, binding a plurality of public methods to a prototype object of the basic type model QBASE, and establishing the subclass models corresponding to different question types by taking the basic type model QBASE as the prototype object for different question types.
9. An electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer program, when executed by the processor, causes the processor to execute the steps of the questionnaire presentation dynamic control method of any one of claims 1 to 6.
10. A computer-readable storage medium, having a computer program stored thereon, which, when executed by a processor, causes the processor to perform the steps of the questionnaire presentation dynamic control method of any of claims 1 to 6.
CN202111348201.7A 2021-11-15 2021-11-15 Questionnaire display dynamic control method, system, electronic equipment and storage medium Pending CN114153450A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111348201.7A CN114153450A (en) 2021-11-15 2021-11-15 Questionnaire display dynamic control method, system, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111348201.7A CN114153450A (en) 2021-11-15 2021-11-15 Questionnaire display dynamic control method, system, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114153450A true CN114153450A (en) 2022-03-08

Family

ID=80459917

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111348201.7A Pending CN114153450A (en) 2021-11-15 2021-11-15 Questionnaire display dynamic control method, system, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114153450A (en)

Similar Documents

Publication Publication Date Title
US20210333984A1 (en) Method and apparatus for generating customized visualization component
CN111784108B (en) Modeling method and device of main data management platform
CN111045653A (en) System generation method and device, computer readable medium and electronic equipment
CN113971243A (en) Data processing method, system, equipment and storage medium applied to questionnaire survey
US20060123331A1 (en) Method and system of forms management in a call center
CN113296772A (en) Page configuration method and device, computer equipment and readable storage medium
CN115130442A (en) Report generation method and device, storage medium and computer equipment
CN117473037B (en) Examination question bank construction method and system based on large language model and electronic equipment
CN114297476A (en) Questionnaire survey method, system, electronic equipment and storage medium based on user tags
CN112711731A (en) Data point burying method, device, equipment and storage medium
CN111428159B (en) Online classification method and device
US20210287668A1 (en) Assisting meeting participants via conversation loop detection and resolution using conversation visual representations and time-related topic usage
CN111131359B (en) Method and apparatus for generating information
CN114153450A (en) Questionnaire display dynamic control method, system, electronic equipment and storage medium
CN115221448A (en) Webpage configuration method and device, electronic equipment and storage medium
CN114968917A (en) Method and device for rapidly importing file data
CN110888583B (en) Page display method, system and device and electronic equipment
US8826166B2 (en) Evaluating and comparing the requirements of a task with the capabilities of an entity
CN113706209B (en) Operation data processing method and related device
CN114428823B (en) Data linkage method, device, equipment and medium based on multidimensional variable expression
CN111367517B (en) Information generation method and device
CN112307154B (en) Advertisement promotion result display method and device, electronic equipment and storage medium
CN118551057A (en) Task execution method, device, equipment, medium and program product
CN117035664A (en) Template-based trust approval standardized processing method, device, equipment and medium
CN114611480A (en) Method and system for editing intelligent questionnaire, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination