CN111027286A - Electronic questionnaire generation method - Google Patents
Electronic questionnaire generation method Download PDFInfo
- Publication number
- CN111027286A CN111027286A CN201911322503.XA CN201911322503A CN111027286A CN 111027286 A CN111027286 A CN 111027286A CN 201911322503 A CN201911322503 A CN 201911322503A CN 111027286 A CN111027286 A CN 111027286A
- Authority
- CN
- China
- Prior art keywords
- questionnaire
- generating
- iql
- question
- sentence
- 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.)
- Granted
Links
Images
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention relates to a method for generating an electronic questionnaire, which comprises the following steps: s1, abstractly defining the questionnaire into IQL codes of the programming language in an integrated development environment supporting the writing and debugging of the IQL programming language; s2, converting the IQL code into xml intermediate code in a compiler supporting the IQL programming language, and generating an xml intermediate file; and S3, interpreting the xml intermediate file at the interpreter terminal supporting the IQL programming language and generating an electronic questionnaire. The IQL language of the invention is easy to learn, convenient to input, rich in written question types, strong in logic function and easy to debug and preview, and is used for solving the problems that the prior questionnaire system has single question type, weak logic function, low flexibility, high learning cost, incapability of immediate preview, lack of strong IDE tool support and the like.
Description
Technical Field
The invention relates to the technical field of computer programming languages, in particular to a method for generating an electronic questionnaire.
Background
The electronic questionnaire system in the investigation industry is developed in three stages from the earliest dedicated web questionnaire in an HTML form to a general HTML web questionnaire editor and then to a general questionnaire programming language. A universal HTML webpage questionnaire editor is provided, which is similar to a questionnaire star, a questionnaire network and other universal webpage questionnaire editing systems at present, and a user can write a questionnaire, add a subject, set jump and check logics of the subject, then issue the questionnaire and recycle questionnaire data. The general questionnaire programming language is characterized in that a questionnaire in reality is designed into a computer programming language in an abstract mode, a matched compiler and an interpreter are developed for the computer programming language, a user writes an electronic questionnaire according to grammar and a topic type provided by the questionnaire programming language, then the user uses a CQL compiler to compile and generate an intermediate language xml file, and the xml file is copied to a server of the questionnaire interpreter to be interpreted and generate the electronic questionnaire. General HTML web page questionnaire editor: however, the following disadvantages exist with the general HTML web page questionnaire editor:
① it is unable to write questionnaire with complex logic function, for example, unable to make mutual exclusion check to answers of two questions, lacking common question types such as transverse combination question of form, electronic signature question, etc.;
② not being able to assign a value to a question of a known answer or to display an answer on a question stem;
③ the questionnaire system can not be used as a subsystem or an underlying system, and can not be embedded into another set of system, such as CAPI (computer aided Access System), CATI (computer aided telephone Access System) and the like, and the system is very single in type.
The general questionnaire programming language suffers from the following drawbacks:
① can support few types of questions and cannot be used for writing questionnaires with complicated functions, such as multiple blank filling questions, horizontal combination of forms, and the like.
② cannot page multiple questions or user-defined paging, can only page one question, and does not support user-defined paging.
③ lack complex logic statements and do not support complex loop, exit, return, hint, checksum output statements such as foreach, break, return, prompt, and confirm.
④ grammar is too complex and learning cost is high.
⑤ logic check function is single, it does not support non-run time check and run time weak check function, it can not carry on complicated logic check before running, it also does not support regular expression, must fill, minimum length, maximum length, minimum value, maximum value and value type and other complicated check functions.
⑥ lack powerful IDE tool support such as inability to visualize or predefine edits, inability to just-in-time compile, lack of run preview functionality, lack of one-button deployment functionality, etc.
Therefore, there is a need in the industry to develop a method for generating an electronic questionnaire, which is easy to learn, convenient to enter, rich in subject types, powerful in logic function and easy to debug and preview
Disclosure of Invention
Aiming at the problems of single question type, weak logic function, low flexibility, high learning cost, incapability of immediate preview and lack of strong IDE tool support in the prior art, the invention provides a method for generating an electronic questionnaire.
The specific scheme of the application is as follows:
a method of generating an electronic questionnaire, comprising:
s1, abstractly defining the questionnaire into IQL codes of the programming language in an integrated development environment supporting the writing and debugging of the IQL programming language;
s2, converting the IQL code into xml intermediate code in a compiler supporting the IQL programming language, and generating an xml intermediate file;
and S3, interpreting the xml intermediate file at the interpreter terminal supporting the IQL programming language and generating an electronic questionnaire.
Preferably, the interpreting the xml intermediate file at the interpreter terminal includes: and converting the xml intermediate file into a Java self-defined object, and respectively storing the question, the module, the variable and the logic of the questionnaire into fields of corresponding areas of the self-defined object.
Preferably, the generating an electronic questionnaire comprises: traversing the logic area in the custom object, explaining and executing each statement one by one, and finally converting all the custom objects into an electronic questionnaire.
Preferably, said interpreting and executing each statement one by one includes: generating a question if the current sentence is a question sentence, executing questionnaire logic if the current sentence is a logic sentence, generating a paging button group if the current sentence is a paging sentence, stopping executing the following sentences and simultaneously recording current position information; if next page information of the user is received, taking out the current position, and continuously executing codes behind the current position; if the information of the previous page of the user is received, the initial position information of the previous page is taken out, the variable value of the previous page is restored, and then the statements are executed from the initial position of the current page to the paging statements.
Preferably, step S2 includes: and converting the IQL code into an xml intermediate code by lexical analysis, syntactic analysis, semantic analysis and intermediate code generation at a compiler, and generating an xml intermediate file.
Preferably, step S1 includes: the questionnaire is divided into parameters, variables, topics, logics, modules and predefined options, and parameters, variables, topics, logics, modules and predefined option IQL codes are described.
Preferably, the question type includes one of a choice question, a fill-in-blank question, a page description question, a matrix question, a scoring question, a form combination question, an advanced question type and a general question type, and the answer type includes one of a single choice option, a multiple choice option, an input box, a matrix pull-down and a canvas.
Preferably, the definition of the type topic comprises a topic type keyword, a main topic, a sub-topic, a remark description, an answer and a predefined option.
Preferably, the predefined option is one of unknown, rejected, and not applicable.
Compared with the prior art, the invention has the following beneficial effects:
according to the invention, through designing an electronic questionnaire programming language IQL language, a questionnaire is abstractly defined into IQL codes of the programming language in an integrated development environment supporting the writing and debugging of the IQL programming language, the IQL codes are converted into xml intermediate codes in a compiler supporting the IQL programming language, an xml intermediate file is generated, the xml intermediate file is interpreted in a programming language interpreter terminal supporting the IQL language, and the process from paper questionnaires to electronic questionnaires is realized. The IQL language of the invention is easy to learn, convenient to input, rich in written question types, strong in logic function and easy to debug and preview, and is used for solving the problems that the prior questionnaire system has single question type, weak logic function, low flexibility, high learning cost, incapability of immediate preview, lack of strong IDE tool support and the like.
Drawings
Fig. 1 is a schematic flow chart of a method for generating an electronic questionnaire of the present invention.
Fig. 2 is another schematic flow chart of the method for generating an electronic questionnaire of the present invention.
FIG. 3 is an electronic questionnaire generated by the present invention.
Detailed Description
The invention is further illustrated by the following figures and examples.
Referring to fig. 1-2, a method for generating an electronic questionnaire, comprising:
s1, abstractly defining the questionnaire into IQL codes of the programming language in an integrated development environment supporting the writing and debugging of the IQL programming language; step S1 includes: the questionnaire is divided into parameters, variables, topics, logics, modules and predefined options, and parameters, variables, topics, logics, modules and predefined option IQL codes are described. The questionnaire is divided into a plurality of parts, and the answer definition of the question and the logic verification function of the personalized customized question can be reused to the greatest extent.
The IQL language can be applied to the writing and implementation of various questionnaires in the investigation industry, can be independently operated as an independent system, and can also be used as a bottom system to develop various investigation systems. Such as: a web questionnaire system, a computer-assisted face-to-face access system, a computer-assisted telephone access system, and the like. The IQL language is a set of specifications, and the specific realization of the IQL language comprises a webpage end, an iOS end, an android end and a WeChat applet end, so that the requirements of various survey projects can be met, and technical support is better provided for the survey projects. The logic function statements of the programming language respectively have loop, selection, verification and prompt logic function statements such as for, foreach, if, valid, prompt and the like, wherein the valid statement mainly provides a verification function, a system pops up verification information when the verification condition is met, and execution operation of the logic statements is terminated; the prompt statement is an information prompt function, and the system executes a popup information window operation according to the information defined by the user.
Wherein the role of the parameter is mainly used for pre-initializing the value of a variable or a subject; the module is the smallest independent sub-questionnaire; the predefined options are several single options, dk (unknown), rf (answer rejected) and na (not applicable), which can be applied to any topic type, and only one of them can be selected between the normal answer and the predefined option of the topic. There are two broad categories of data types for the questionnaire programming language, one being the basic data type: int (integer), double (floating point), string (character), Datetime, Date, Time types, another type is a complex data type: array and Dictionary.
In this embodiment, in step S1, the abstract definition of the 37 common topic types including selection topic, fill-in-blank topic, page description topic, matrix topic, score topic, form combination topic, high-level topic and common topic is the syntax of the programming language. The answer type includes one of a single-choice option, a multiple-choice option, an input box, a matrix drop-down, and a canvas. The definition of the type title comprises a title type keyword, a main title, a sub-title, a remark description, an answer and a predefined option. Wherein the predefined option is one of unknown, rejected, and not applicable.
The IDE (integrated development environment) of the programming language adopts a Javafx technology, the IDE has the function of providing an integrated development environment which is convenient to write, debug and operate for the IQL programming language, an editor of the IDE tool can carry out intelligent prompt by matching a keyword library according to keywords input by a user, and highlight in different colors is carried out according to different types of keywords after the user finishes inputting. The immediate compiling is that after the user inputs and completes each line of codes, the IDE tool will automatically call IDK for compiling, if the compiling error is reported, red wavy lines are added below the current line of codes, and error information is prompted. The questionnaire operation and preview function is realized by integrating the tomcat7 server into the IDE, and operating the web application of the iql questionnaire interpreter terminal system to interpret and generate the questionnaire by operating the tomcat7 server in the IDE. The IDE tool can improve the user's input efficiency and reduce the error rate.
S2, converting the IQL code into xml intermediate code in a compiler supporting the IQL programming language, and generating an xml intermediate file; step S2 includes: and converting the IQL code into an xml intermediate code by lexical analysis, syntactic analysis, semantic analysis and intermediate code generation at a compiler, and generating an xml intermediate file.
The IDK (IQL Development kit) is realized by adopting JavaCC and Java technologies, the main function of the IDK is compiling, so the IDK is also called a compiler, and the IDK has the function of converting the IQL code written by a user into xml intermediate code and generating an xml intermediate file by the steps of lexical analysis, syntactic analysis, semantic analysis and intermediate code generation. The xml intermediate file can be divided into a module area, a variable area, a problem area and a logic area, and the modules, variables, problems and logics in the IQL source file are classified and stored, so that the language interpretation and execution are facilitated.
And S3, interpreting the xml intermediate file at the interpreter terminal supporting the IQL programming language and generating an electronic questionnaire. The interpreting the xml intermediate file at the interpreter terminal comprises the following steps: and converting the xml intermediate file into a Java custom object (object), and respectively storing the title, the module, the variable and the logic of the questionnaire into fields of a corresponding area of the custom object. The generating an electronic questionnaire comprises: and traversing the logic area in the custom object, explaining and executing each statement one by one (traversing object execution instructions), and finally converting all the custom objects into an electronic questionnaire. Wherein, the interpreting and executing each statement one by one comprises: generating a question if the current sentence is a question sentence, executing questionnaire logic if the current sentence is a logic sentence, generating a paging button group if the current sentence is a paging sentence, stopping executing the following sentences and simultaneously recording current position information; if next page information of the user is received, taking out the current position, and continuously executing codes behind the current position; when the previous page information of the user is received, the initial position information of the previous page is taken out, the variable value of the previous page is restored, and then the statements are executed from the initial position of the current page to the paging statements, as shown in fig. 3.
The interpreter terminal is developed and realized by adopting technologies such as Java Web, android and IOS.
The generation method of the electronic questionnaire has the following beneficial effects:
(1) the writing of the questionnaire is more efficient and faster. The input efficiency of the questionnaires is improved by various input modes of the questionnaires; and the strong IDE tool supports, and the questionnaire is convenient to input, preview, debug and deploy.
(2) The questionnaire questions are more abundant in type, and can meet the requirements of various types of questionnaires. At present, the IQL language supports writing 26 topic types, which specifically includes: the method comprises the following steps of combining single-item selection questions, multiple-item selection questions, single-item blank filling questions, multiple-item blank filling questions, matrix quantity table questions, matrix single-item selection questions, matrix multiple-item selection questions, matrix sliding bar questions, matrix pull-down questions, matrix numerical value questions, matrix text questions, matrix combination questions, file uploading questions, quantity table questions, NPS quantity table questions, sorting questions, pull-down frame questions, multi-level pull-down frame questions, proportion questions, sliding bar questions, fixed common question types (including name questions, gender questions, mobile phone number questions, postboxes, date questions, time questions, date and time questions, geographic position questions, high school questions, province city areas questions), signature questions, form combination questions, paragraph descriptions and pages, and can meet the writing requirements of various types of questionnaires by combining different types of questions.
(3) The questionnaire logic function is more powerful, can satisfy the writing of various logic complicated questionnaires. The IQL language provides powerful logic statements such as a parameter, a section module, an if else selection structure, a for and foreach loop structure, validate check, prompt and non-runtime check, and can meet complex functions such as parameter import, logic check, logic judgment, logic jump and assignment value of questionnaires.
(4) User-defined paging is supported. At present, IQL provides pager grammar, user-defined paging is carried out on users, the number of questions can be flexibly set on one page, and the requirements of the users are better met.
(5) The system has various types and is supported by multiple terminals, so that the requirements of different survey projects are met. The existing system developed based on the IQL language specification comprises a telephone access system, a face-to-face access system, a network questionnaire system and the like, and the terminal comprises a webpage end, an iOS end, an android end and a WeChat applet end, so that different requirements of different projects can be met.
(6) The grammar is close to the high-level language such as Python, and the learning cost is low.
(7) The strong logic check function can meet various logic check requirements. At present, the IQL supports non-operation-time verification, operation-time weak verification and operation-time strong verification, and different verification modes can be applied according to different requirements to meet different verification requirements.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (9)
1. A method for generating an electronic questionnaire, comprising:
s1, abstractly defining the questionnaire into IQL codes of the programming language in an integrated development environment supporting the writing and debugging of the IQL programming language;
s2, converting the IQL code into xml intermediate code in a compiler supporting the IQL programming language, and generating an xml intermediate file;
and S3, interpreting the xml intermediate file at the interpreter terminal supporting the IQL programming language and generating an electronic questionnaire.
2. The method of generating an electronic questionnaire of claim 1, wherein interpreting an xml intermediate file at an interpreter terminal comprises: and converting the xml intermediate file into a Java self-defined object, and respectively storing the question, the module, the variable and the logic of the questionnaire into fields of corresponding areas of the self-defined object.
3. The method of generating an electronic questionnaire of claim 2, wherein the generating an electronic questionnaire comprises: traversing the logic area in the custom object, explaining and executing each statement one by one, and finally converting all the custom objects into an electronic questionnaire.
4. The method according to claim 3, wherein the interpreting and executing each sentence one by one comprises:
generating a question if the current sentence is a question sentence, executing questionnaire logic if the current sentence is a logic sentence, generating a paging button group if the current sentence is a paging sentence, stopping executing the following sentences and simultaneously recording current position information; if next page information of the user is received, taking out the current position, and continuously executing codes behind the current position; if the information of the previous page of the user is received, the initial position information of the previous page is taken out, the variable value of the previous page is restored, and then the sentence is executed from the initial position of the current page to the paging sentence.
5. The method for generating an electronic questionnaire of claim 1, wherein step S2 comprises: and converting the IQL code into an xml intermediate code by lexical analysis, syntactic analysis, semantic analysis and intermediate code generation at a compiler, and generating an xml intermediate file.
6. The method for generating an electronic questionnaire of claim 1, wherein step S1 comprises: the questionnaire is divided into parameters, variables, topics, logics, modules and predefined options, and parameters, variables, topics, logics, modules and predefined option IQL codes are described.
7. The method of claim 6, wherein the question type includes one of a choice question, a fill-in-blank question, a page description question, a matrix question, a scoring question, a form combination question, an advanced question type and a general question type, and the answer type includes one of a single choice option, a multiple choice option, an input box, a matrix pull-down and a canvas.
8. The method of generating an electronic questionnaire of claim 7, wherein the definition of the genre topic comprises a topic genre keyword, a main heading, a sub-heading, a remark description, an answer, and a predefined option.
9. The method of generating an electronic questionnaire of claim 8, wherein the predefined option is one of unknown, rejected, and not applicable.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911322503.XA CN111027286B (en) | 2019-12-20 | 2019-12-20 | Electronic questionnaire generation method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911322503.XA CN111027286B (en) | 2019-12-20 | 2019-12-20 | Electronic questionnaire generation method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111027286A true CN111027286A (en) | 2020-04-17 |
CN111027286B CN111027286B (en) | 2020-11-13 |
Family
ID=70212475
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911322503.XA Active CN111027286B (en) | 2019-12-20 | 2019-12-20 | Electronic questionnaire generation method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111027286B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113609823A (en) * | 2021-07-14 | 2021-11-05 | Oppo广东移动通信有限公司 | Method and device for editing questionnaire logic, terminal equipment and storage medium |
CN113703746A (en) * | 2021-08-23 | 2021-11-26 | 风变科技(深圳)有限公司 | Course development method and device, computer equipment and storage medium |
CN113782135A (en) * | 2021-08-13 | 2021-12-10 | 中国中医科学院中医药信息研究所 | Method and system for analyzing and constructing case report table |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106598615A (en) * | 2016-12-21 | 2017-04-26 | 深圳市宜居云科技有限公司 | Recipe program code generation method and recipe compiling cloud platform system |
CN107918542A (en) * | 2017-11-23 | 2018-04-17 | 北京恒华伟业科技股份有限公司 | A kind of text string generation method and device |
US20180107457A1 (en) * | 2016-10-13 | 2018-04-19 | Tata Consultancy Services Limited | Systems and methods for dynamic generation of questionnaires on programming concepts |
-
2019
- 2019-12-20 CN CN201911322503.XA patent/CN111027286B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180107457A1 (en) * | 2016-10-13 | 2018-04-19 | Tata Consultancy Services Limited | Systems and methods for dynamic generation of questionnaires on programming concepts |
CN106598615A (en) * | 2016-12-21 | 2017-04-26 | 深圳市宜居云科技有限公司 | Recipe program code generation method and recipe compiling cloud platform system |
CN107918542A (en) * | 2017-11-23 | 2018-04-17 | 北京恒华伟业科技股份有限公司 | A kind of text string generation method and device |
Non-Patent Citations (2)
Title |
---|
ALBERT D. BETHKE: "Using XML as a Questionnaire Specification Language", 《PROCEEDINGS 2007 IEEE SOUTHEASTCON》 * |
常玉增 等: "基于DSL的通用调查问卷建模和应用", 《计算机科学与应用》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113609823A (en) * | 2021-07-14 | 2021-11-05 | Oppo广东移动通信有限公司 | Method and device for editing questionnaire logic, terminal equipment and storage medium |
CN113609823B (en) * | 2021-07-14 | 2023-12-12 | Oppo广东移动通信有限公司 | Method and device for editing questionnaire logic, terminal equipment and storage medium |
CN113782135A (en) * | 2021-08-13 | 2021-12-10 | 中国中医科学院中医药信息研究所 | Method and system for analyzing and constructing case report table |
CN113703746A (en) * | 2021-08-23 | 2021-11-26 | 风变科技(深圳)有限公司 | Course development method and device, computer equipment and storage medium |
CN113703746B (en) * | 2021-08-23 | 2024-05-14 | 风变科技(深圳)有限公司 | Course development method, course development device, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111027286B (en) | 2020-11-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111027286B (en) | Electronic questionnaire generation method | |
CN101339500B (en) | Data binding application program interface creation method based on XML mode | |
CN109241104B (en) | AISQL resolver in decision-making distributed database system and implementation method thereof | |
CN102096588A (en) | Control-containing page establishing method | |
CN102799428A (en) | Operation recording and playback method for interactive software | |
CN103593335A (en) | Chinese semantic proofreading method based on ontology consistency verification and reasoning | |
CN110837362A (en) | Method, system and editor for editing rule of guide type visual graphic modularization | |
Sabriye et al. | A framework for detecting ambiguity in software requirement specification | |
CN116048610A (en) | Flow-driven conversation system implementation method and workflow engine-based conversation robot | |
CN116755667A (en) | Low-code DSL language development method and device | |
KR102546424B1 (en) | Machine learning data generating apparatus, apparatus and method for analyzing errors in source code | |
Bader et al. | AI in software engineering at Facebook | |
CN101201750B (en) | Method of providing data for encoding/decoding using syntax lexical analysis tool | |
Salimzadeh et al. | Exploring the Feasibility of Crowd-Powered Decomposition of Complex User Questions in Text-to-SQL Tasks | |
Sharma et al. | Extracting high-level functional design from software requirements | |
KR102175539B1 (en) | Conversational service apparatus and method based on user utterance | |
Loaiza et al. | Partial Survey on AI Technologies Applicable to Automated Source Code Generation | |
Mohanan et al. | Natural Language Processing Approach for UML Class Model Generation from Software Requirement Specifications via SBVR. | |
Ponsard et al. | Assessment of EMF Model to Text Generation Strategies and Libraries in an Industrial Context. | |
Busemann | Ten years after: An update on TG/2 (and friends) | |
Kosanović et al. | Applang–A DSL for specification of mobile applications for android platform based on textX | |
Friedman-Hill | Software verification and functional testing with XML documentation | |
CN104657162A (en) | Service environment modification method and device | |
Ramamonjison et al. | LaTeX2Solver: a Hierarchical Semantic Parsing of LaTeX Document into Code for an Assistive Optimization Modeling Application | |
Li et al. | Semantic grounding in dialogue for complex problem solving |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |