diff --git a/README.md b/README.md index 136c847..374140e 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,9 @@ 运行`exportData.py`,按照提示操作。 -### 更新日志 +### 代码更新日志 - 2023.09.17 - 更新`importData.py`获取题库的方式,登录相关的代码来自[Coaixy/weiban-tool](https://github.com/Coaixy/weiban-tool) + - 题库开始记录选项id + diff --git a/Utils.py b/Utils.py index 49dfea0..c6296c4 100644 --- a/Utils.py +++ b/Utils.py @@ -98,11 +98,13 @@ def getPaperDetails(self): userQuestionsBank[i['id']] = {} userQuestionsBank[i['id']]['question'] = i['title'] userQuestionsBank[i['id']]['answer'] = [] + userQuestionsBank[i['id']]['answerIds'] = [] userQuestionsBank[i['id']]['type'] = i['type'] userQuestionsBank[i['id']]['typeLabel'] = i['typeLabel'] for j in i['optionList']: if j['isCorrect'] == 1: userQuestionsBank[i['id']]['answer'].append(j['content']) + userQuestionsBank[i['id']]['answerIds'].append(j['id']) return userQuestionsBank def fill_key(key): diff --git a/importOneReviewPaper.py b/importOneReviewPaper.py index 947e883..4ba8278 100644 --- a/importOneReviewPaper.py +++ b/importOneReviewPaper.py @@ -26,11 +26,13 @@ def getPaperDetails(data): userQuestionsBank[i['id']] = {} userQuestionsBank[i['id']]['question'] = i['title'] userQuestionsBank[i['id']]['answer'] = [] + userQuestionsBank[i['id']]['answerIds'] = [] userQuestionsBank[i['id']]['type'] = i['type'] userQuestionsBank[i['id']]['typeLabel'] = i['typeLabel'] for j in i['optionList']: if j['isCorrect'] == 1: userQuestionsBank[i['id']]['answer'].append(j['content']) + userQuestionsBank[i['id']]['answerIds'].append(j['id']) return userQuestionsBank def main():