修复了多选题会卡住的bug

This commit is contained in:
johlanse 2022-08-20 12:43:57 +08:00
parent f15d0e4ded
commit 18fed3acd9
1 changed files with 4 additions and 2 deletions

View File

@ -176,7 +176,7 @@ func (c *Core) RespondDaily(user *model.User, model string) {
if err != nil { if err != nil {
return return
} }
//id = 71 // id = 77
// 跳转到专项答题界面 // 跳转到专项答题界面
_, err = page.Goto(fmt.Sprintf("https://pc.xuexi.cn/points/exam-paper-detail.html?id=%d", id), playwright.PageGotoOptions{ _, err = page.Goto(fmt.Sprintf("https://pc.xuexi.cn/points/exam-paper-detail.html?id=%d", id), playwright.PageGotoOptions{
Referer: playwright.String(MyPointsUri), Referer: playwright.String(MyPointsUri),
@ -402,11 +402,13 @@ func (c *Core) RespondDaily(user *model.User, model string) {
} }
} }
answer = RemoveRepByLoop(answer)
if len(answer) < 1 { if len(answer) < 1 {
answer = append(answer, options...) answer = append(answer, options...)
log.Infoln("无法判断答案自动选择ABCD") log.Infoln("无法判断答案自动选择ABCD")
} }
log.Infoln("根据提示分别选择了", RemoveRepByLoop(answer)) log.Infoln("根据提示分别选择了", answer)
// 多选题选择 // 多选题选择
err = radioCheck(page, answer) err = radioCheck(page, answer)
if err != nil { if err != nil {