Manual entry

Manual entry of data that is entered singled. Here to enter title information as an example. Topics include account types, types of questions, the difficulty factor, basic information about the subject right answer, casual working and options. Determining types of questions into questions, and multiple-choice question form; these three different options for the number of topics. So add or delete options when the need for a limit, such as minimum there must be two options, could only have six options (multiple choice).
Because there is more information on the subject drop-down box to display, so there need to use data binding drop-down box. Here is not a detailed explanation of the data binding drop-down box. (As summarized in the first few have been written, so will not repeat here speak of) but the effect is to look at the function:
Here Insert Picture Description
which type drop-down box to change the subject content knowledge will trigger drop-down box data binding options affected by the type of title; so in the event of a change of subject type, options will display options and the number corresponding to the contents of the current subject type.
When the subject type is determined when the question, there are only two options; if the option number is greater than two to put out more than two options removed (for loop). When the subject is a multiple choice type, when the number of options are four; when the subject is a multiple-choice type, when the number of six options, and can not be greater than six.
Different types of questions, content width options are also different. So I wrote a binding event is when a change in the type of subject content options will change.
There is a special option is not to determine questions of A and B is √ and ×, so it is necessary to assign these two options. When changing the types of questions (questions not determined), will be changed to the option A, B, C, D ( E, F).
FIG code is as follows:
Here Insert Picture Description
then to add the questions according to the current options, the options when the current reaches the upper limit of the number of reminders option has reached its limit (six), the option can not be added. When you delete options, determine the current number of options, the number of options can not be less than two. :( see the effect of the code is not displayed) Here Insert Picture DescriptionHere Insert Picture Description
and then put the stem that can be uploaded to the page, but the problem is there are some pictures, some topics are plain text. So this needs to upload files. Look at the code:Here Insert Picture Description
You can save the new image upload after, but before saving the new need to do some work. As the casual working not in the same form with the option form, so it is a casual working with options spliced together. Then the correct answer but also to put it to use regular expressions defined in A between F. Here Insert Picture Description
Get information to all the questions, and then determine whether the information on these topics have been completed, if the acquisition is subject to the option, otherwise the administrator will remind questions title information is complete. And then determine whether the option is empty, save questions title information (radio, checkbox stitching casual working title information includes the option to determine questions only casual working).
Because the option is not only one, so it is necessary to use cycling as Buddha to traverse each option, as shown below:
Here Insert Picture Description
then the correct answer is processed, the answer to the provisions in a between F, if the answer is beyond the scope of options to remind "the correct answer is beyond the scope of options!."
Finally, submit the form:
Here Insert Picture Description
this topic has been entered as well. If there are errors, then please write down in the comments section, I will promptly change.

Guess you like

Origin blog.csdn.net/weixin_44560796/article/details/92760178
Recommended