Skip to content

Commit

Permalink
fixed: fixed model bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Changbaiqi committed Dec 26, 2024
1 parent 1c0d82f commit e44dac2
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 25 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
tag_name:
description: 'Tag name for the release'
required: true
default: 'v2.5.0-Beta.5' # Default tag name
default: 'v2.5.0-Beta.6' # Default tag name

permissions:
contents: write # Allow writing to GitHub releases
Expand All @@ -23,7 +23,8 @@ env:
VERSION: ${{ github.ref_name }} # Dynamic version based on the tag name
RELEASE_DIR: release
RELEASE_NOTICES: |
- [‍👏] 修复学习通无法正常考试BUG
- [👏] 添加英华可自由设置是否自动提交考试试卷选项
- [‍🔧] 修复英华无法正常使用暴力模式BUG
注:当前学习通功能为测试阶段日志显示比较乱,后续版本更新会调整
Expand Down
2 changes: 1 addition & 1 deletion config/logo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
: \ \; : .' \ | , / `----' ---' ; : ;
\ ' ;| , .-./ ---`-' | , /
`--` `--`---' ---`-'
Yatori-go-console v2.5.0-Beta.5
Yatori-go-console v2.5.0-Beta.6
仅用于学习交流,请勿用于违法和商业用途!!!
GitHub开源地址:https://github.com/yatori-dev/yatori-go-console
个人博客:https://blogs.changbaiqi.top
13 changes: 7 additions & 6 deletions logic/xuexitong/XueXiTongPart.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ package xuexitong

import (
"fmt"
"github.com/thedevsaddam/gojsonq"
xuexitong "github.com/yatori-dev/yatori-go-core/aggregation/xuexitong"
"github.com/yatori-dev/yatori-go-core/api/entity"
xuexitongApi "github.com/yatori-dev/yatori-go-core/api/xuexitong"
lg "github.com/yatori-dev/yatori-go-core/utils/log"
"log"
"strconv"
"sync"
"time"
"yatori-go-console/config"
utils2 "yatori-go-console/utils"

"github.com/thedevsaddam/gojsonq"
xuexitong "github.com/yatori-dev/yatori-go-core/aggregation/xuexitong"
"github.com/yatori-dev/yatori-go-core/api/entity"
xuexitongApi "github.com/yatori-dev/yatori-go-core/api/xuexitong"
lg "github.com/yatori-dev/yatori-go-core/utils/log"
)

var videosLock sync.WaitGroup //视频锁
Expand Down Expand Up @@ -95,7 +96,7 @@ func nodeListStudy(setting config.Setting, user *config.Users, userCache *xuexit
return
}
key, _ := strconv.Atoi(courseItem.Key)
action, err := xuexitong.PullCourseChapterAction(userCache, courseItem.Cpi, key) //获取对应章节信息
action, _, err := xuexitong.PullCourseChapterAction(userCache, courseItem.Cpi, key) //获取对应章节信息
if err != nil {
log.Fatal(err)
}
Expand Down
42 changes: 26 additions & 16 deletions logic/yinghua/YinghuaPart.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ func userBlock(setting config.Setting, user *config.Users, cache *yinghuaApi.Yin
nodesLock.Add(1)
go nodeListStudy(setting, user, cache, &item) //多携程刷课
}
nodesLock.Wait() //等待所有视频刷完
nodesLock.Wait() //等待所有节点结束
nodesLock.Wait() //等待所有节点结束
videosLock.Wait() //等待所有视频刷完
lg.Print(lg.INFO, "[", lg.Green, cache.Account, lg.Default, "] ", lg.Purple, "所有待学习课程学习完毕")
if setting.BasicSetting.CompletionTone == 1 { //如果声音提示开启,那么播放
soundMut.Lock()
Expand Down Expand Up @@ -272,18 +272,22 @@ func workAction(setting config.Setting, user *config.Users, userCache *yinghuaAp
modelLog.ModelPrint(setting.BasicSetting.LogModel == 0, lg.INFO, "[", lg.Green, userCache.Account, lg.Default, "] ", "<"+setting.AiSetting.AiType+">", lg.Default, " 【"+node.Name+"】 ", lg.Yellow, "正在AI自动写章节作业...")
//开始写作业
for _, work := range detailAction {
err := yinghua.StartWorkAction(userCache, work, setting.AiSetting.AiUrl, setting.AiSetting.Model, setting.AiSetting.APIKEY, setting.AiSetting.AiType)
err := yinghua.StartWorkAction(userCache, work, setting.AiSetting.AiUrl, setting.AiSetting.Model, setting.AiSetting.APIKEY, setting.AiSetting.AiType, user.CoursesCustom.ExamAutoSubmit)
if err != nil {
lg.Print(lg.INFO, "[", lg.Green, userCache.Account, lg.Default, "] ", "<"+setting.AiSetting.AiType+">", " 【", node.Name, "】 ", lg.BoldRed, "该章节作业无法正常执行,服务器返回信息:", err.Error())
continue
}
//打印最终分数
s, error := yinghua.WorkedFinallyScoreAction(userCache, work)
if error != nil {
lg.Print(lg.INFO, "[", lg.Green, userCache.Account, lg.Default, "] ", "<"+setting.AiSetting.AiType+">", " 【", node.Name, "】 ", lg.BoldRed, error)
continue
if user.CoursesCustom.ExamAutoSubmit == 1 {
//打印最终分数
s, error := yinghua.WorkedFinallyScoreAction(userCache, work)
if error != nil {
lg.Print(lg.INFO, "[", lg.Green, userCache.Account, lg.Default, "] ", "<"+setting.AiSetting.AiType+">", " 【", node.Name, "】 ", lg.BoldRed, error)
continue
}
lg.Print(lg.INFO, "[", lg.Green, userCache.Account, lg.Default, "] ", "<"+setting.AiSetting.AiType+">", " 【", node.Name, "】", lg.Green, "章节作业AI答题完毕,最高分:", s, "分", " 试卷总分:", fmt.Sprintf("%.2f分", work.Score))
} else {
lg.Print(lg.INFO, "[", lg.Green, userCache.Account, lg.Default, "] ", "<"+setting.AiSetting.AiType+">", " 【", node.Name, "】", lg.Green, "AI考试完毕,,请自行前往主页提交试卷")
}
lg.Print(lg.INFO, "[", lg.Green, userCache.Account, lg.Default, "] ", "<"+setting.AiSetting.AiType+">", " 【", node.Name, "】", lg.Green, "章节作业AI答题完毕,最高分:", s, "分", " 试卷总分:", fmt.Sprintf("%.2f分", work.Score))
}

}
Expand Down Expand Up @@ -312,17 +316,23 @@ func examAction(setting config.Setting, user *config.Users, userCache *yinghuaAp
//开始考试
modelLog.ModelPrint(setting.BasicSetting.LogModel == 0, lg.INFO, "[", lg.Green, userCache.Account, lg.Default, "] ", "<"+setting.AiSetting.AiType+">", lg.Default, " 【"+node.Name+"】 ", lg.Yellow, "正在AI自动考试...")
for _, exam := range detailAction {
err := yinghua.StartExamAction(userCache, exam, setting.AiSetting.AiUrl, setting.AiSetting.Model, setting.AiSetting.APIKEY, setting.AiSetting.AiType)
err := yinghua.StartExamAction(userCache, exam, setting.AiSetting.AiUrl, setting.AiSetting.Model, setting.AiSetting.APIKEY, setting.AiSetting.AiType, user.CoursesCustom.ExamAutoSubmit)
if err != nil {
lg.Print(lg.INFO, "[", lg.Green, userCache.Account, lg.Default, "] ", "<"+setting.AiSetting.AiType+">", " 【", node.Name, "】 ", lg.BoldRed, "该考试无法正常执行,服务器返回信息:", err.Error())
continue
}
//打印最终分数
s, error := yinghua.ExamFinallyScoreAction(userCache, exam)
if error != nil {
lg.Print(lg.INFO, "[", lg.Green, userCache.Account, lg.Default, "] ", "<"+setting.AiSetting.AiType+">", " 【", node.Name, "】 ", lg.BoldRed, error.Error())
continue

if user.CoursesCustom.ExamAutoSubmit == 1 {
//打印最终分数
s, error := yinghua.ExamFinallyScoreAction(userCache, exam)
if error != nil {
lg.Print(lg.INFO, "[", lg.Green, userCache.Account, lg.Default, "] ", "<"+setting.AiSetting.AiType+">", " 【", node.Name, "】 ", lg.BoldRed, error.Error())
continue
}
lg.Print(lg.INFO, "[", lg.Green, userCache.Account, lg.Default, "] ", "<"+setting.AiSetting.AiType+">", " 【", node.Name, "】", lg.Green, "AI考试完毕,最终分:", s, "分", " 试卷总分:", fmt.Sprintf("%.2f分", exam.Score))
} else {
lg.Print(lg.INFO, "[", lg.Green, userCache.Account, lg.Default, "] ", "<"+setting.AiSetting.AiType+">", " 【", node.Name, "】", lg.Green, "AI考试完毕,请自行前往主页提交试卷")
}
lg.Print(lg.INFO, "[", lg.Green, userCache.Account, lg.Default, "] ", "<"+setting.AiSetting.AiType+">", " 【", node.Name, "】", lg.Green, "AI考试完毕,最终分:", s, "分", " 试卷总分:", fmt.Sprintf("%.2f分", exam.Score))

}
}

0 comments on commit e44dac2

Please sign in to comment.