Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

这个为什么不答题呀(如何添加一个题库接口) #7

Open
2682856025 opened this issue Oct 14, 2022 · 8 comments
Open

这个为什么不答题呀(如何添加一个题库接口) #7

2682856025 opened this issue Oct 14, 2022 · 8 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@2682856025
Copy link

截屏2022-10-14 上午10 18 02

截屏2022-10-14 上午10 17 56

更新完版本之后不报错了 但是不答题

@chettoy
Copy link
Owner

chettoy commented Oct 14, 2022

The reason for not answering questions is that the question bank interface is not currently included in the open source code.
A binary containing the question bank interface may be released later.
不回答问题的原因是,题库接口目前不包括在开放源代码中
包含题库接口的二进制文件可能会在以后发布

@2682856025
Copy link
Author

怎么用自己的题库接口啊

@chettoy
Copy link
Owner

chettoy commented Oct 14, 2022

Replace the question bank by implementing _answers.req() or _answers.find2(), the latter is recommended as simpler.

class _answers:

    @staticmethod
    def req(fxxkstar: FxxkStar, questions: List[dict], work_id: str, card_url: str) -> List[dict]:
        return []

    @staticmethod
    def find2(question: dict | str) -> list:
        return []

where question might be question: dict = {"topic": "Example question", "type": 0} or question: str = "Example question",
where type = 0: Single Choice, 1: Multiple Choice, 2: Fill in the Blank, 3: Judgment, 4: Short answer questions.
Example of return value

[
    {
        "index": 0,
        "result": [
            {
                "correct": [
                    {
                        "option": "D",
                        "content": "test option D"
                    }
                ],
                "topic": "Example question",
                "type": 0
            }
        ],
        "topic": "Example question"
    }
]

@2682856025
Copy link
Author

emmmm 没看懂

@2682856025
Copy link
Author

可以出个中文的空模版吗

@chettoy
Copy link
Owner

chettoy commented Oct 14, 2022

In short: you need to implement the function _answers.find2(), with the parameters being the text of the question and the type of question (e.g. radio, fill-in-the-blank), and the return value being the query result of the question bank, in the format above.
简而言之:你需要实现函数_answers.find2(),参数是问题的文本和问题的类型(如单选、填空),返回值是题库的查询结果,格式如上。

@chettoy
Copy link
Owner

chettoy commented Oct 14, 2022

In this function, you need to request your question bank to query the incoming questions and convert the returned results into the above format.
在这个函数中,你需要请求你的题库查询传入的问题,并将返回的结果转换为上述格式

@chettoy chettoy added documentation Improvements or additions to documentation enhancement New feature or request labels Oct 16, 2022
@chettoy chettoy changed the title 这个为什么不答题呀 这个为什么不答题呀(如何添加一个题库接口) Oct 16, 2022
@Darth-Zzz
Copy link

可不可以让程序随便回答一下题目,再根据反馈得到正确的答案

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants