Summary of the invention
It is desirable to provide a kind of method and apparatus exporting examination question, to solve above-mentioned examination question
The inefficient problem of output.
In an embodiment of the present invention, it is provided that a kind of method exporting examination question, including: connect
Receive the output environment that user determines;The structured content of examination question is carried out corresponding described output ring
The form conversion in border;Wherein, described structured content at least includes one below: exercise question,
Stem, answer, option, parsing, described structured content is xml form, and form is changed
Relation passes through xlt template record, the form of structured content after form conversion at least include with
One of lower: PDF, epub, txt, png, PSD, jpg, word, flash;Described form
The process of conversion includes: according to the structuring of the xml form of nodename traversal tree structure
The node of content;Wherein, described nodename is exercise question, stem, answer, option or solution
Analysis;In the xlt masterplate recording described form transformational relation, search and the node of current traversal
The node that title is identical;By the described structured content of the node of described traversal, according to xlt
The form conversion of the node of the described lookup in masterplate;Output format under described output environment
Examination question after conversion;Described structured content is obtained by following steps: according to described structure
Change content creating index masterplate;By index masterplate, the content in examination question is added label, shape
Become described structured content.
In an embodiment of the present invention, additionally provide a kind of device exporting examination question, including:
Receiver module, for receiving the output environment that user determines;Modular converter, for by examination question
Structured content carry out corresponding described output environment form conversion;Wherein, described structure
Change content and at least include one below: exercise question, stem, answer, option, parsing, described
Structured content is xml form, and form transformational relation passes through xlt template record, and form turns
The form of the structured content after changing at least include one below: PDF, epub, txt, png,
PSD、jpg、word、flash;Described modular converter includes: spider module, for according to
The node of the structured content of the xml form of nodename traversal tree structure;Wherein, institute
Stating nodename is exercise question, stem, answer, option or parsing;Search module, be used for
Record in the xlt masterplate of described form transformational relation, search and the nodename phase of current traversal
Same node;Transform subblock, for the described structured content by the node of described traversal,
Form conversion according to the node of the described lookup in xlt masterplate;Output module, in institute
State the examination question after output format conversion under output environment;Index creation module, for according to institute
State structured content and create index masterplate;Index module, for by indexing masterplate to examination question
In content add label, form described structured content.
By the step in embodiment, can be user after determining output environment, by structuring
After content is changed according to the form of output environment, export corresponding examination question.The examination of multiple format
Topic can export according to the output environment that user determines simultaneously, is effectively increased the effect of output examination question
Rate.
Detailed description of the invention
Below with reference to the accompanying drawings and in conjunction with the embodiments, the present invention is described in detail.See Fig. 1,
Comprise the following steps:
S11: receive the output environment that user determines;
S12: the structured content of examination question is carried out the form conversion of corresponding described output environment;
Wherein, described structured content at least includes one below: exercise question, stem, answer, choosing
Item, parsing;
S13: the examination question after output format is changed under described output environment.
By the step in embodiment, can be user after determining output environment, by structuring
After content is changed according to the form of output environment, export corresponding examination question.The examination of multiple format
Topic can export according to the output environment that user determines simultaneously, is effectively increased the effect of output examination question
Rate.
Preferably, described structured content is obtained by following steps:
Index masterplate is created according to described structured content;By index masterplate in examination question
Content adds label, forms described structured content.
Examination question is carried out structurized process, needs to be pre-created the index masterplate of xml form.
Index masterplate can be arranged according to the structure of examination question.Such as: examination question generally contains exercise question,
The various pieces such as crosshead mesh, stem, answer, option, parsing, in options, include again
Option A, option B etc., can arrange following index masterplate:
<xs:element name=" exercise question " type=" CT_Question "/>
<xs:element name=" crosshead mesh " type=" CT_SubQuestion "/>
<xs:element name=" option-A " type=" CT_Any "/>
<xs:element name=" option-B " type=" CT_Any "/>
<xs:element name=" option-C " type=" CT_Any "/>
<xs:element name=" option-D " type=" CT_Any "/>
<xs:element name=" option-E " type=" CT_Any "/>
<xs:element name=" option-F " type=" CT_Any "/>
<xs:element name=" answer " type=" CT_Any "/>
<xs:element name=" resolves " type=" CT_Any "/>
By above-mentioned setting, the index face containing above-mentioned setting as shown in Figure 2 can be formed
Plate.
Based on Fig. 2 indexes panel, the content in examination question is indexed.The process of index
Can in the following ways, such as: click on " exercise question " on index panel, in examination question
The item content index.Form the result of the screenshot capture after index as shown in Figure 3.Two
Between individual label " exercise question ", for the content of exercise question.Between two labels " answer ",
Content for answer.
According to index panel to content index in examination question after, formed structured content.Structuring
Content at least includes one below: exercise question, stem, answer, option, parsing.Following generation
Code shows the structured content of partial indexing:
In above-mentioned code, it is shown that structured content " exercise question " and " answer ".
Preferably, structured content can be xml form, in the following manner by structuring
The form of content is converted to the form of output environment.
See Fig. 4, comprise the following steps:
S21: travel through the structured content of the xml form of tree structure according to nodename
Node;Wherein, described nodename is exercise question, stem, answer, option or parsing;
S22: in the xlt masterplate recording described form transformational relation, searches and current traversal
The identical node of nodename;
S23: by the described structured content of the node of described traversal, according in xlt masterplate
The form conversion of the node of described lookup.
By above-mentioned steps, can be by the content of the node of structured content according in xlt masterplate
The form conversion of record inside same node point title.Such as: by the structuring of xml form
Hold and be converted to html form, word form or pdf form etc..
Preferably, the form of the structured content after the conversion of described form at least includes with purgation
One: PDF, epub, txt, png, PSD, jpg, word, flash.
Preferably, can be that every kind of output environment makes xlt masterplate respectively, it is also possible to by each
Masterplate gathers together, according to the selection of user, and the structuring after output format conversion respectively
Content.
During preferably for the terminal that output environment is browse network, can be by xml form
Structured content generates Txt, Png picture two parts form, and the content of Txt form is mainly entered
The retrieval of row content.Line in examination question is inscribed, due to more complicated, therefore in output
When form the output of two kinds of forms by the content in index node, portion is the picture of Png,
Portion is the text of Txt, in order to shows and retrieves.
Preferably, the described structured content after being changed by form shows with the form of preview graph;
Receive the clicking operation of content in described preview graph, show corresponding structured content;Connect
Receive the editor of the structured content to described display, again show with the form of preview graph.Example
As: Fig. 5 shows the examination after display format on the terminal of network browsing is changed
The screenshot capture of topic.
To the content after preview, if needing editor, can be by structurized xml form
Hold and edit, after editor preservation, again show with the form of preview graph.
Preferably, structurized content can store in data base, can provide a user with input
Window, all or part of structured content to be selected by user's input, to form multiple shape
The collection of the examination question of formula merges output, such as: have the examination question of answer and parsing, do not have answer
Examination question etc..These examination questions can show on relevant device according to the form of output environment, such as:
Terminal for typesetting, the terminal for network browsing or for network browsing
Mobile terminal etc..
Seeing Fig. 6, the present invention also provides for a kind of device exporting examination question, including:
Receiver module 31, for receiving the output environment that user determines;
Modular converter 32, for carrying out the structured content of examination question accordingly according to receiving mould
Block 31 determines the form conversion of described output environment;Wherein, described structured content is at least wrapped
Include one below: exercise question, stem, answer, option, parsing;
Output module 33, carries out lattice for exporting modular converter 32 under described output environment
Examination question after formula conversion.
Preferably, the described structured content in described device is xml form;
Described modular converter 32 includes:
Spider module 321, for the xml form according to nodename traversal tree structure
The node of structured content;Wherein, described nodename is exercise question, stem, answer, choosing
Item or parsing;
Search module 322, in the xlt masterplate recording described form transformational relation, look into
Look for the node identical with the nodename that spider module 321 currently travels through;
Transform subblock 323, for described in the node that described spider module 321 traveled through
Structured content, according to the node searching the module 322 described lookup in xlt masterplate
Form is changed.Wherein, xlt masterplate have recorded that receiver module 31 determines containing output environment
The form transformational relation of form.
Preferably, described device also includes:
Index creation module 34, for creating index masterplate according to described structured content;
Index module 35, for the index masterplate by index creation module 34 establishment to examination
Content in topic adds label, forms spider module 321 in the described structuring of traversal
Hold.
Preferably, described device also includes:
Preview graph display module 36, the institute after modular converter 32 is carried out form conversion
State structured content to show with the form of preview graph;
Link module 37, for receiving the preview to the display of described preview graph display module 36
The clicking operation of content on figure, shows corresponding structured content;
Repeat display module 38, for receiving the structuring to the display of described link module 37
The editor of content, shows with the form of preview graph again.
Preferably, the output environment in described device at least includes the operation of one of following equipment
Environment: the terminal for typesetting, the terminal for network browsing, clear for network
The mobile terminal look at.
Preferably, the form of the structured content after the conversion of the described form in described device is extremely
Include one below less: PDF, epub, txt, png, PSD, jpg, word, flash.
Obviously, those skilled in the art should be understood that the above-mentioned present invention each module or
Each step can realize with general calculating device, and they can concentrate on single calculating
On device, or it is distributed on the network that multiple calculating device is formed, alternatively, they
Can realize with calculating the executable program code of device, it is thus possible to they are stored
Performed by calculating device in the storage device, or it is integrated that they are fabricated to respectively
Circuit module, or the multiple modules in them or step are fabricated to single integrated circuit mould
Block realizes.So, the present invention is not restricted to the combination of any specific hardware and software.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention,
For a person skilled in the art, the present invention can have various modifications and variations.All
Within the spirit and principles in the present invention, any modification, equivalent substitution and improvement etc. made,
Should be included within the scope of the present invention.