# Poetry Quiz
This interface, from the plug-in 1.1.8 Start Support
Poetry Question and Answer Verification Interface Service
# to initialize
Plugin version number in the document, only for example reference, the latest version of the plugin,Subject to this
{
"pages": [
"pages/index/index"
],
"plugins": {
"chatbot": {
"version": "1.2.23",
"provider": "wx8c631f7e9f2465e1"
}
},
"requiredBackgroundModes": [
"audio"
],
"sitemapLocation": "sitemap.json"
}
var plugin = requirePlugin("chatbot")
App({
onLaunch: function () {
plugin.init({
appid: "P5Ot9PHJDechCYqDFAW1AiK6OtG3Ja", //Mini Program sample account, for learning and reference only
openid: "", //User's openid, not required, it is recommended to pass this parameter
success: () => {}, //Not required
fail: (error) => {}, //Not required
})
},
})
# Call the title to get the interface
plugin.api.nlp('poem_fetch_question', {question_count: 5, userid: '1234243434'}).then(nothing => {
console.log("poem_fetch_question result : ", nothing)
})
# Request parameters
field | type | Must be selected | describe |
---|---|---|---|
userid | string | yes | Unique user id |
question_count | int | yes | Number of Pull Problems |
# Return to Results
name | type | Introductions |
---|---|---|
status | int | Return result status code, -1 For the exception, 0 is normal. |
message | string | Unusual or Normal Details |
初始值_list | array | An array of questions followed by questions_List Internal Fields |
question_初始值 | string | Issue Unique ID |
hard_level | string | The difficulty of the problem is: easy, medium, Hard Level 3 |
question | string | Topic stem |
question_type | string | Type of question, which are currently single choice,choice |
content_scope | string | The scope of the topic can be ignored |
answer_options | array | Answer Options |
answer_index | int | Correct Answer Option Ordinal, Counting from 0 |
answer_content | string | Answer Text Content |
For example:
{
"status": 0,
"message": "success",
"question_list": [
{
"question_id": "osolLXMB_nf-J97dYMXj",
"hard_level": "easy",
"question": " Famous Lines of Poet Li Shangyin" There is not much way to go" The next word? " ,
"question_type": "choice",
"content_scope": "1",
"answer_options": [
"to cross the frozen river of the yellow river."
"Hold the knee light front shadow,"
"green birds are eager to explore."
"Fragrant floating moon dusk."
],
"answer_index": 2,
"answer_content": "The Green Bird Is Eager to See"
},
{
"question_id": "kcolLXMB_nf-J97dYMXj",
"hard_level": "easy",
"question": " Who wrote the classic lines in the song "The Hut is Broken by the Autumn Wind"?" There are thousands of houses in the world, and the cold people all smile."",
"question_type": "choice",
"content_scope": "1",
"answer_options": [
"zhang ji";
"han,"
"li yu";
"Du Fu"
],
"answer_index": 3,
"answer_content": "Du Fu"
},
{
"question_id": "rMolLXMB_nf-J97dYMXj",
"hard_level": "easy",
"question": " Famous sentence" A lone boat, fishing alone in the snow." Out of? " ,
"question_type": "choice",
"content_scope": "1",
"answer_options": [
"The Departure Table,"
"Jinse,"
"River Snow,"
"Guan Shan Yue"
],
"answer_index": 2,
"answer_content": "River Snow."
}
]
}
# Call Question Answer Verification Interface
plugin.api.nlp('poem_check_answer', {question_id: '231231231', user_answer_content: 'Yes'}).then(nothing => {
console.log("poem_check_answer result : ", nothing)
})
# Request parameters
field | type | Must be selected | describe |
---|---|---|---|
question_初始值 | string | yes | Question ID |
user_answer_content | string | yes | User Answers(You can choose the number, starting with 1, or the letter A-D, the question "Yes" or "No," and the sentence.) |
# Return to Results
name | type | Introductions |
---|---|---|
status | int | Return result status code, -1 For the exception, 0 is normal. |
message | string | Unusual or Normal Details |
check_result | int | 0 or 1, 0 The answer is wrong, 1 is correct. |
For example:
{
"status": 0,
"message": "success",
"check_result": 1
}