Method and system for automatically generating questions for a programming language
AssigneeInfosys Limited
InventorsAlsaad Ishaq, Satheesha Byadarahally Nanjappa, Seema Acharya
Life of this patent
Estimating the term…
Abstract
The present invention provides a method, system and computer program product for generating a family of questions for a programming language. Generating the family of questions includes the generation of various questions from a particular compilable code, and the corresponding options for the questions. The options include various correct and incorrect options for the questions.
Claims12
A computer-implemented method for creating a family of programming language test questions, the method comprising:
- generating the family of programming language test questions, each question in the family including a question body to be presented to a test taker and a plurality of response options to be correspondingly presented to the test taker, the question body comprising a segment of compilable program code, and at least one of the response options representing an outcome of execution of the segment of compilable program code, the step of generating comprising using at least one processor for:
- a. storing in a memory, a pre-defined parent question comprising a first segment of compilable program code written in the programming language;
- b. generating a template question comprising a second segment of compilable program code, by inserting one or more user-defined variables in the first segment of compilable program code of the pre-defined parent question;
- c. generating a first question body for a first question in the family of questions, the first question body comprising a third segment of compilable program code generated by assigning a first set of unique random values to the one or more user-defined variables in the second segment of compilable program code of the template question;
- and
- d. generating a first plurality of response options corresponding to the first question, the first plurality of response options comprising at least one correct option and at least one incorrect option,
- wherein the at least one correct option is generated by a compiler program and is based on a compiler program input comprising the third segment of code;
- and
- wherein the at least one incorrect option is generated by compiling one or more misinterpretation codes, a misinterpretation code being generated by:
- generating a fourth segment of compilable program code, wherein the fourth segment of compilable program code includes (i) a first program statement that is also included within the second segment of compilable program code, and (ii) a second program statement that is not included within the second segment of compilable program code;
- and
- assigning the first set of unique random values corresponding to the third segment of compilable program code, to one or more variables within the fourth segment of compilable program code.
A system for automatically creating a family of questions for a programming language, the system comprising a processor coupled to a memory, the processor being configured to generate a family of programming language test questions, each question in the family including a question body to be presented to a test taker and a plurality of response options to be correspondingly presented to the test taker, the question body comprising a segment of compilable program code, and at least one of the response options representing an outcome of execution of the segment of compilable program code, wherein the processor is configured to generate the family of questions by executing the following tasks:
- a. storing in the memory, a pre-defined parent question comprising a first segment of compilable program code written in the programming language;
- b. generating a template question comprising a second segment of compilable code by inserting one or more variables in the first segment of compilable program code, the one or more variables being defined by a user;
- c. generating a first question body for a first question in the family of questions, the first question body comprising a third segment of compilable program code generated by assigning a first set of unique random values to the one or more variables in the second segment of compilable program code of the template question;
- and
- d. generating a first plurality of response options corresponding to the first question, the first plurality of response options comprising at least one correct option and at least one incorrect option,
- wherein the at least one correct option is generated by a compiler program and is based on a compiler program input comprising the third segment of code;
- and
- wherein the at least one incorrect option is generated by compiling one or more misinterpretation codes, a misinterpretation code being generated by:
- generating a fourth segment of compilable program code, wherein the fourth segment of compilable program code includes (i) a first program statement that is also included within the second segment of compilable program code, and (ii) a second program statement that is not included within the second segment of compilable program code;
- and
- assigning the first set of unique random values corresponding to the third segment of compilable program code, to one or more variables within the fourth segment of compilable program code.
A computer program product for use with a computer, the computer program product comprising a non-transitory computer usable medium having a computer readable program code embodied therein for creating a family of programming language test questions, the computer readable program code comprising instructions for:
- generating the family of programming language test questions, each question in the family including a question body to be presented to a test taker and a plurality of response options to be correspondingly presented to the test taker, the question body comprising a segment of compilable program code, and at least one of the response options representing an outcome of execution of the segment of compilable program code, the step of generating comprising:
- a. storing in a memory, a pre-defined parent question comprising a first segment of compilable program code written in the programming language;
- b. generating a template question comprising a second segment of compilable program code by inserting one or more user-defined variables in the first segment of compilable program code of the pre-defined parent question;
- c. generating a first question body for a first question in the family of questions, the first question body comprising a third segment of compilable program code generated by assigning a first set of unique random values to the one or more variables in the second segment of compilable program code of the template question;
- and
- d. generating a first plurality of response options corresponding to the first question, the first plurality of response options comprising at least one correct option and at least one incorrect option,
- wherein the at least one correct option is generated by a compiler program and is based on a compiler program input comprising the third segment of code;
- and
- wherein the at least one incorrect option is generated by compiling one or more misinterpretation codes, a misinterpretation code being generated by:
- generating a fourth segment of compilable program code, wherein the fourth segment of compilable program code includes (i) a first program statement that is also included within the second segment of compilable program code, and (ii) a second program statement that is not included within the second segment of compilable program code;
- and
- assigning the first set of unique random values corresponding to the third segment of compilable program code, to one or more variables within the fourth segment of compilable program code.
Dependencies are inferred from the claim text.