Interactive teaching platform imports the method for word exam pool
[technical field]
The present invention relates to interactive teaching platform, particularly a kind of interactive teaching platform imports the method for word exam pool.
[background technology]
Interactive teaching platform provides the platform of classroom interaction answer and examination for the teacher, but can run into such problem when the teacher edits exercise question: the exam pool file of existing word form can't directly import interactive teaching platform at hand, also must edit one by one at interactive teaching platform.Because interactive teaching platform is only processed the object that the content in the exam pool file of word form is worked as in the common interactive teaching platform, can't read the particular content in the exam pool file of word form and particular content resolved, be the attribute information of each exercise question in the None-identified particular content, also just can't directly import interactive teaching platform.Interactive teaching platform only at identification exercise question type information and after obtaining the attribute information of exercise question, just can directly import.The attribute information of described exercise question comprises: problem, option one, option 2, option 3, option 4, option 5, option 6 and answer.In view of this, the inventor is for defective further investigation and generation this case of prior art.
[summary of the invention]
The technical problem to be solved in the present invention is to provide a kind of interactive teaching platform to import the method for word exam pool, and teacher's exam pool file to existing word form when using interactive teaching platform need not carry out the secondary editor again, realizes directly importing.
The present invention is achieved in that
Interactive teaching platform imports the method for word exam pool, comprises the steps:
Step 1, trial obtain Word Ole object, if obtain successfully, then allow Word program in the FWord connection, if failure then set up Word Ole object and allow Word program in the FWord connection; Open the exam pool file by FWord;
Step 2, obtain by the ListParagraphs object among the FWord that each establishes numbered paragraph object in the described exam pool file, described ListParagraphs object with described each establish numbered paragraph object and deposit with the form of chained list; To establish numbered paragraph object definition and be numbering paragraph object;
Step 3, read a numbering paragraph object by ListParagraphs.Item (i), i is circulation sign, total number of the span of i: i=1 ~ numbering paragraph object;
When reading numbering paragraph object by ListParagraphs.Item (i) for the first time, i=1; When reading numbering paragraph object by ListParagraphs.Item (i) for the second time, i=2, by that analogy, whenever read once i+1 by ListParagraphs.Item (i), judge that whether i+1 is greater than total number of numbering the paragraph object, if not, execution in step 4, if, illustrate that all paragraphs in the described exam pool file all are disposed process ends;
Step 4, from described exam pool file, read out the character string of i numbering paragraph object, and be set to the exercise question character string; In the exam pool file, all be provided with numbering before the exercise question of every problem, thereby judge that according to numbering this character string is the exercise question character string;
Step 5, from described exam pool file, read and be next to i the paragraph object after the numbering paragraph object, and judge whether described paragraph object numbers the paragraph object,
If not, then defining this paragraph object is the 1st non-numbering paragraph object of i numbering paragraph object, read out the character string of the 1st non-numbering paragraph object of described i numbering paragraph object from described exam pool file, and it is deposited to character string chain table object, then execution in step 6;
If, illustrate that then i is numbered under exercise question character string corresponding to paragraph object, there is not option, there is not answer, do not meet the form of interactive teaching platform, can not import interactive teaching platform, return step 3;
Step 6, from the next paragraph object of the 1st non-numbering paragraph object reading described i numbering paragraph object described exam pool file, and judge whether this paragraph object is numbering paragraph object, if not, by this paragraph object definition, be the 2nd non-numbering paragraph object of i numbering paragraph object, from described exam pool file, reading out described i character string of numbering the 2nd non-numbering paragraph object of paragraph object, and it is deposited successively to described character string chain table object, then perform step 7
If illustrate that then i option and answer of numbering under exercise question character string corresponding to paragraph object all has been disposed execution in step 8;
Step 7, continue to process next paragraph object downwards according to the principle of step 6, if non-numbering paragraph object is then deposited the character string that reads out successively to described character string chain table object, repeating step 7, until read numbering paragraph object, jump to step 8;
Step 8, read each character string in the described character string chain table object, if any one character string only comprises in each described character string: null character (NUL) or carriage return character or line feed character or carriage return character and line feed character or line feed character and carriage return character, then this character string is deleted execution in step 9 from described character string chained list;
If the character string number in the described character string chained list of step 9 is 0, or the first two character in last character string is not " answer " two words in the described character string chained list, illustrate that i is numbered under exercise question character string corresponding to paragraph object, do not have option, do not have answer, or i is numbered under exercise question character string corresponding to paragraph object, there is not answer, both of these case does not all meet the form of interactive teaching platform, can not import interactive teaching platform, then returns step 3; If not, execution in step 10 then;
In step 10, the described character string chained list, only be not 1 if do not comprise the number of the character string of " answer " two words, then only it is set to the option one character string; Only be not 2 if do not comprise the number of the character string of " answer " two words, then it set gradually and be option one character string and option 2 character strings; By that analogy, be 6 if do not comprise the number of the character string of " answer " two words, then only it is set gradually into the option one character string to option 6 character strings; Surpass 6 if do not comprise the number of the character string of " answer " two words, then only top 6 character strings are set gradually into the option one character string to option 6 character strings, abandon the remaining character string that does not comprise " answer " two words; Then execution in step 11;
In step 11, the described character string chained list, the character string that comprises " answer " two words is set to the answer character string;
Step 12, deletion option one character string carriage return character and the line feed character to option 6 character strings and the answer character string; So far get access to the attribute information that meets the interactive teaching platform form, be respectively exercise question character string, option one character string to option 6 character strings and answer character string, then carry out topic types and judge, described topic types is judged and is comprised that specifically step 341 is to 352:
Step 341, judge whether the length of answer character string is 1, is, then execution in step 342, are not, then execution in step 346;
Step 342, judging whether numeral of answer character string, is that then execution in step 343, otherwise carry out 344;
Step 343, judge whether option one character string, option 2 character strings, option 3 character strings, option 4 character strings, option 5 character strings and option 6 character strings are sky, be, the topic types that then identifies this topic is the topic of filling a vacancy, in interactive teaching platform, set up a problem object in the page, namely import this topic, return step 3, no, be judged to be and import this topic, return step 3;
Step 344, judging whether among the A to F of answer character string, is that then execution in step 345, are not, are judged to be to import this topic, return step 3;
Step 345, judge whether the answer character string satisfies one of following condition, if satisfy, the topic types that then identifies this topic is single choice test items, sets up a problem object in the page in interactive teaching platform, namely imports this topic, returns step 3; If following condition does not all satisfy, then be judged to be and can't import this topic, return step 3;
Condition one, when the answer character string is A, option one character string and option 2 character strings are not empty, option 3 character strings to option 6 character strings be empty or are not sky;
Condition two, when the answer character string is B, option one, option one character string and option 2 character strings are not empty, option 3 character strings to option 6 character strings be empty or are not sky;
Condition three, when the answer character string is C, option one character string to option 3 character strings are not empty, option 4 character strings to option 6 character strings be empty or are not sky;
Condition four, when the answer character string is D, option one character string to option 4 character strings are not empty, option 5 character strings and option 6 character strings be empty or are not sky;
Condition five, when the answer character string is E, option one character string to option 5 character strings are not empty, the character string of option 6 correspondences be empty or is not sky;
Condition six, when the answer character string is F, option one character string to option 6 character strings all are not empty;
Step 346, judge whether numerical value of answer character string, be, execution in step 347, no, execution in step 350;
Step 347, the numerical value answer whether interactive teaching platform can be identified of judgement answer character string, be, execution in step 348, no, be judged to be and can't import this topic, return step 3;
Step 348, judge that whether option one character string, option 2 character strings, option 3 character strings, option 4 character strings, option 5 character strings and option 6 character strings are empty, be, the topic types that then identifies this topic is the topic of filling a vacancy, in interactive teaching platform, set up a problem object in the page, namely import this topic, return step 3; No, execution in step 349;
Whether step 349, answer character string only have a plurality of numerals of combination in any in digital 1 to digital 6, and each numeral does not repeat, the option number of character string is arranged more than or equal to the greatest measure in the answer character string in option one, option 2, option 3, option 4, option 5 and the option 6 simultaneously, the topic types that then identifies this topic is the ordering topic, in interactive teaching platform, set up a problem object in the page, namely import this topic, return step 3; No, be judged to be and can't import this topic, return step 3;
Step 350, judge whether correct or mistake of answer character string, be, execution in step 351, no, execution in step 352;
Step 351, judge that option one character string and option 2 character strings whether for empty, are that the topic types that then identifies this topic is True-False, sets up a problem object in the page in interactive teaching platform, namely imports this topic, returns step 3; No, be judged to be and can't import this topic, return step 3;
Step 352, judge whether a plurality of letters of alphabetical A combination in any to the alphabetical F of answer character string, and each letter does not repeat, simultaneously answer character string satisfies one of following condition, and the topic types that then identifies this topic is multiple-choice question, sets up a problem object in the page in interactive teaching platform, namely import this topic, return step 3, no, namely following condition does not all satisfy, then be judged to be and import this topic, return step 3;
Condition seven, when the answer character string contains A, option one character string and option 2 character strings are not empty, option 3 character strings to option 6 character strings be empty or are not sky;
Condition eight, when the answer character string contains B, option one character string and option 2 character strings are not empty, option 3 character strings to option 6 character strings be empty or are not sky;
Condition nine, when the answer character string contains C, option one character string to option 3 character strings are not empty, option 4 character strings to option 6 character strings be empty or are not sky;
Condition ten, when the answer character string contains D, option one character string to option 4 character strings are not empty, option 5 character strings to option 6 character strings be empty or are not sky;
Condition 11, when the answer character string contains E, option one character string to option 5 character strings are not empty, option 6 character strings be empty or are not sky;
Condition 12, when the answer character string contains F, option one character string to option 6 character strings all are not empty.
Further, in the described step 347, the numerical value answer that interactive teaching platform can be identified refers to: meet the numerical value answer of any condition in following two conditions:
Condition 13, the numeric character string that can directly change with StrToFloat;
Condition 14, the numeric character string that can not change with StrToFloat are judged "/" of whether only containing an expression fractional form in this numeric character string, and molecule is integer or decimal, and denominator also is integer or decimal;
Described interactive teaching platform is directly changed with StrToFloat eligible 13 numerical value answer, and the result who draws keeps three decimals; When described interactive teaching platform is changed eligible 14 numerical value answer, read respectively molecule and denominator and carry out division calculation, the result who draws keeps three decimals.
The present invention has following advantage: the present invention at first identifies the exercise question of each topic according to numbering, and then identify each option and answer according to the character string under the exercise question, thereby obtain to meet in the word exam pool exercise question of interactive teaching platform form, then carry out the topic types determining step, identify topic types, therefore, teacher's exam pool file to existing word form when using interactive teaching platform just need not carry out the secondary editor again, directly imports to get final product.
[description of drawings]
The present invention is further illustrated in conjunction with the embodiments with reference to the accompanying drawings.
Fig. 1 is schematic flow sheet of the present invention.
Fig. 2 is one of process flow diagram of topic types determining step of the present invention.
Fig. 3 be topic types determining step of the present invention process flow diagram two.
Fig. 4 be topic types determining step of the present invention process flow diagram three.
[embodiment]
See also Fig. 1, interactive teaching platform imports the method for word exam pool, comprises the steps:
Step 1, trial obtain Word Ole object, if obtain successfully, then allow Word program in the FWord connection, if failure then set up Word Ole object and allow Word program in the FWord connection; Open the exam pool file by FWord; Described Ole full name: Object Linking and Embedding, Chinese: object connects and embeds, and is called for short the OLE technology.It is integrated that OLE is not only multipad, but also definition and the mechanism that has been connected that a kind of permission application program is carried out " connection " each other as software " object " (data acquisition be connected with service data function), this connection mechanism and agreement are called the Component Object Model (COM); Described FWord is a variable depositing Word Ole object;
Step 2, obtain by the ListParagraphs object among the FWord that each establishes numbered paragraph object in the described exam pool file, described ListParagraphs object with described each establish numbered paragraph object and deposit with the form of chained list; To establish numbered paragraph object definition and be numbering paragraph object; Described ListParagraphs refers to represent paragraph in specified documents, tabulation or the zone of list of application form by the set that the Paragraph object forms;
Step 3, read a numbering paragraph object by ListParagraphs.Item (i), i is circulation sign, total number of the span of i: i=1 ~ numbering paragraph object;
When reading numbering paragraph object by ListParagraphs.Item (i) for the first time, i=1; When reading numbering paragraph object by ListParagraphs.Item (i) for the second time, i=2, by that analogy, whenever read once i+1 by ListParagraphs.Item (i), judge that whether i+1 is greater than total number of numbering the paragraph object, if not, execution in step 4, if, illustrate that all paragraphs in the described exam pool file all are disposed process ends;
Step 4, from described exam pool file, read out the character string of i numbering paragraph object by the Range.Text method, and be set to the exercise question character string; In the exam pool file, all be provided with numbering before the exercise question of every problem, thereby judge that according to numbering this character string is the exercise question character string;
Step 5, pass through Next(1) method reads from described exam pool file and is next to i the paragraph object after the numbering paragraph object, and judge whether described paragraph object numbers the paragraph object,
If not, then defining this paragraph object is the 1st non-numbering paragraph object of i numbering paragraph object, from described exam pool file, read out the character string of the 1st non-numbering paragraph object of described i numbering paragraph object by the Range.Text method, and it is deposited to character string chain table object, then execution in step 6;
If, illustrate that then i is numbered under exercise question character string corresponding to paragraph object, there is not option, there is not answer, do not meet the form of interactive teaching platform, can not import interactive teaching platform, return step 3;
Step 6, pass through again Next(1) method reads the next paragraph object of the 1st non-numbering paragraph object of described i numbering paragraph object from described exam pool file, and judge whether this paragraph object numbers the paragraph object, if not, then be the 2nd non-numbering paragraph object of i numbering paragraph object with this paragraph object definition, from described exam pool file, read out the character string of the 2nd non-numbering paragraph object of described i numbering paragraph object by the Range.Text method, and it is deposited successively to described character string chain table object, then execution in step 7
If illustrate that then i option and answer of numbering under exercise question character string corresponding to paragraph object all has been disposed execution in step 8;
Step 7, continue to process next paragraph object downwards according to the principle of step 6, if non-numbering paragraph object is then deposited the character string that reads out successively to described character string chain table object, repeating step 7, until read numbering paragraph object, jump to step 8;
Step 8, read each character string in the described character string chain table object, if any one character string only comprises in each described character string: null character (NUL) or carriage return character or line feed character or carriage return character and line feed character or line feed character and carriage return character, then this character string is deleted execution in step 9 from described character string chained list;
If the character string number in the described character string chained list of step 9 is 0, or the first two character in last character string is not " answer " two words in the described character string chained list, illustrate that i is numbered under exercise question character string corresponding to paragraph object, do not have option, do not have answer, or i is numbered under exercise question character string corresponding to paragraph object, there is not answer, both of these case does not all meet the form of interactive teaching platform, can not import interactive teaching platform, then returns step 3; If not, execution in step 10 then;
In step 10, the described character string chained list, only be not 1 if do not comprise the number of the character string of " answer " two words, then only it is set to the option one character string; Only be not 2 if do not comprise the number of the character string of " answer " two words, then it set gradually and be option one character string and option 2 character strings; By that analogy, be 6 if do not comprise the number of the character string of " answer " two words, then only it is set gradually into the option one character string to option 6 character strings; Surpass 6 if do not comprise the number of the character string of " answer " two words, then only top 6 character strings are set gradually into the option one character string to option 6 character strings, abandon the remaining character string that does not comprise " answer " two words; Then execution in step 11;
In step 11, the described character string chained list, the character string that comprises " answer " two words is set to the answer character string;
Step 12, deletion option one character string carriage return character and the line feed character to option 6 character strings and the answer character string; So far get access to the attribute information that meets the interactive teaching platform form, be respectively exercise question character string, option one character string to option 6 character strings and answer character string, then carry out topic types and judge, described topic types is judged and is comprised that specifically step 341 is to 352:
See also Fig. 2, step 341, judge whether the length of answer character string is 1, is, then execution in step 342, are not, then execution in step 346;
Step 342, judging whether numeral of answer character string, is that then execution in step 343, otherwise carry out 344;
Step 343, judge whether option one character string, option 2 character strings, option 3 character strings, option 4 character strings, option 5 character strings and option 6 character strings are sky, be, the topic types that then identifies this topic is the topic of filling a vacancy, in interactive teaching platform, set up a problem object in the page, namely import this topic, return step 3, no, be judged to be and import this topic, return step 3;
Step 344, judging whether among the A to F of answer character string, is that then execution in step 345, are not, are judged to be to import this topic, return step 3;
Step 345, judge whether the answer character string satisfies one of following condition, if satisfy, the topic types that then identifies this topic is single choice test items, sets up a problem object in the page in interactive teaching platform, namely imports this topic, returns step 3; If following condition does not all satisfy, then be judged to be and can't import this topic, return step 3;
Condition one, when the answer character string is A, option one character string and option 2 character strings are not empty, option 3 character strings to option 6 character strings be empty or are not sky;
Condition two, when the answer character string is B, option one, option one character string and option 2 character strings are not empty, option 3 character strings to option 6 character strings be empty or are not sky;
Condition three, when the answer character string is C, option one character string to option 3 character strings are not empty, option 4 character strings to option 6 character strings be empty or are not sky;
Condition four, when the answer character string is D, option one character string to option 4 character strings are not empty, option 5 character strings and option 6 character strings be empty or are not sky;
Condition five, when the answer character string is E, option one character string to option 5 character strings are not empty, the character string of option 6 correspondences be empty or is not sky;
Condition six, when the answer character string is F, option one character string to option 6 character strings all are not empty;
See also Fig. 3, step 346, judge whether numerical value of answer character string, be, execution in step 347, no, execution in step 350;
Step 347, the numerical value answer whether interactive teaching platform can be identified of judgement answer character string, be, execution in step 348, no, be judged to be and can't import this topic, return step 3; The numerical value answer that interactive teaching platform can be identified refers to: meet the numerical value answer of any condition in following two conditions:
Condition 13, the numeric character string that can directly change with StrToFloat;
Condition 14, the numeric character string that can not change with StrToFloat are judged "/" of whether only containing an expression fractional form in this numeric character string, and molecule is integer or decimal, and denominator also is integer or decimal;
Described interactive teaching platform is directly changed with StrToFloat eligible 13 numerical value answer, and the result who draws keeps three decimals; When described interactive teaching platform is changed eligible 14 numerical value answer, read respectively molecule and denominator and carry out division calculation, the result who draws keeps three decimals.
Step 348, judge that whether option one character string, option 2 character strings, option 3 character strings, option 4 character strings, option 5 character strings and option 6 character strings are empty, be, the topic types that then identifies this topic is the topic of filling a vacancy, in interactive teaching platform, set up a problem object in the page, namely import this topic, return step 3; No, execution in step 349;
Whether step 349, answer character string only have a plurality of numerals of combination in any in digital 1 to digital 6, and each numeral does not repeat, the option number of character string is arranged more than or equal to the greatest measure in the answer character string in option one, option 2, option 3, option 4, option 5 and the option 6 simultaneously, the topic types that then identifies this topic is the ordering topic, in interactive teaching platform, set up a problem object in the page, namely import this topic, return step 3; No, be judged to be and can't import this topic, return step 3;
See also Fig. 4, step 350, judge whether correct or mistake of answer character string, be, execution in step 351, no, execution in step 352;
Step 351, judge that option one character string and option 2 character strings whether for empty, are that the topic types that then identifies this topic is True-False, sets up a problem object in the page in interactive teaching platform, namely imports this topic, returns step 3; No, be judged to be and can't import this topic, return step 3;
Step 352, judge whether a plurality of letters of alphabetical A combination in any to the alphabetical F of answer character string, and each letter does not repeat, simultaneously answer character string satisfies one of following condition, and the topic types that then identifies this topic is multiple-choice question, sets up a problem object in the page in interactive teaching platform, namely import this topic, return step 3, no, namely following condition does not all satisfy, then be judged to be and import this topic, return step 3;
Condition seven, when the answer character string contains A, option one character string and option 2 character strings are not empty, option 3 character strings to option 6 character strings be empty or are not sky;
Condition eight, when the answer character string contains B, option one character string and option 2 character strings are not empty, option 3 character strings to option 6 character strings be empty or are not sky;
Condition nine, when the answer character string contains C, option one character string to option 3 character strings are not empty, option 4 character strings to option 6 character strings be empty or are not sky;
Condition ten, when the answer character string contains D, option one character string to option 4 character strings are not empty, option 5 character strings to option 6 character strings be empty or are not sky;
Condition 11, when the answer character string contains E, option one character string to option 5 character strings are not empty, option 6 character strings be empty or are not sky;
Condition 12, when the answer character string contains F, option one character string to option 6 character strings all are not empty.
The present invention has following advantage: the present invention at first identifies the exercise question of each topic according to numbering, and then each character string under the identification exercise question character string, and be set to respectively each option character string and answer character string, thereby obtain to meet in the word exam pool exercise question of interactive teaching platform form, then carry out the topic types determining step, identify topic types, therefore, teacher's exam pool file to existing word form when using interactive teaching platform just need not carry out the secondary editor again, directly imports to get final product.
Although more than described the specific embodiment of the present invention; but being familiar with those skilled in the art is to be understood that; our described specific embodiment is illustrative; rather than for the restriction to scope of the present invention; those of ordinary skill in the art are in modification and the variation of the equivalence of doing according to spirit of the present invention, all should be encompassed in the scope that claim of the present invention protects.