Skip to content

Commit 4c8b62a

Browse files
author
xirenbing
committed
Stop updata
1 parent 8c48a5b commit 4c8b62a

File tree

4 files changed

+38
-45
lines changed

4 files changed

+38
-45
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ img/*
44
test/*
55
*codes/*
66
*vscode*/*
7+
*bak*

FAQ.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,3 @@
9797

9898
- 代码经过简单重构后已经 将功能封装,可以参照注释直接使用or开发
9999

100-
101-
102-
## At last
103-
104-
本脚本主要用来学习,欢迎大家前来一起交流:grinning:*QQ群:1075080181*
105-
106-
如果有帮到你的话请赏颗:star:

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ autocx是autochaoxing的**Docker**版本,主要由[KimJungWha](https://github.
8282

8383
## 更新
8484

85+
- 2020-4-18:
86+
87+
- **题库服务器停止维护并暂时关闭,脚本目前将不再进行自动答题**
88+
- **项目停止维护**
89+
8590
- 2020-4-7:
8691

8792
- 上传2.0版win10x64打包程序,[通道](https://github.com/Luoofan/autochaoxing/releases)
@@ -153,8 +158,14 @@ autocx是autochaoxing的**Docker**版本,主要由[KimJungWha](https://github.
153158

154159
<br/>
155160

156-
## 写在最后
157161

158-
本脚本主要用来学习,欢迎大家前来一起交流:grinning:*QQ群:1075080181*
159162

160-
如果有帮到你的话请赏颗:star:
163+
## 免责声明
164+
165+
本项目完全开源,免费,仅供技术学习和交流,**开发者团队并未授权任何组织、机构以及个人将其用于商业或者盈利性质的活动。也从未使用本项目进行任何盈利性活动。未来也不会将其用于开展营利性业务。个人或者组织,机构如果使用本项目产生的各类纠纷,法律问题,均由其本人承担。**
166+
167+
如果您开始使用本项目,即视为同意项目免责声明中的一切条款,条款更新不再另行通知。
168+
169+
The project is completely open source, free, and is for technical learning and communication only. **The developer team does not authorize any organization, organization, or individual to use it for commercial or profitable activities. Never use this project for any profitable activities. It will not be used for profit-making business in the future. Individuals or organizations and organizations that use the various disputes arising from the project and legal issues shall be borne by themselves.**
170+
171+
If you start using this project, you are deemed to agree to all the terms in the project disclaimer, and the terms are updated without further notice.

source_code/singlecourse.py

Lines changed: 23 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ def __init__(self, driver, menu_url, course_name, pattern=0, rate=1, out_fp=stdo
5050
#self._out_fp=open(course_name+'.txt', 'w+', encoding="utf-8") if SYSTEM==1 else stdout
5151

5252
def _setflag(self):
53+
self._err_lt=[] # 错误章节列表
5354
self._chapter = 0
5455
self._section = 0
5556
self._subsection = 0
5657
self._end = 0
58+
self._que_server_flag=0 #1正常 0异常
5759

5860
def work(self):
5961
if self.pattern == 0:
@@ -843,6 +845,21 @@ def _ans_question(self):
843845
# if(len(err_lt)==0):
844846
return 0
845847

848+
def _go_que_task(self):
849+
try:
850+
err_section = self._ans_question()
851+
852+
if err_section != 0:
853+
print(COLOR.ERR, 'unfinished!', COLOR.END, file=self._out_fp)
854+
self._err_lt.append(err_section) # 记录答题提交失败的章节
855+
else:
856+
print(COLOR.OK, 'finished!', COLOR.END, file=self._out_fp)
857+
except:
858+
try:
859+
send_err(traceback.format_exc())
860+
except:
861+
pass
862+
846863
##
847864
# brief 单课程自动模式
848865
# details 自动完成单课程下的任务(过程不需要输入),递归调用自身,未完成任务点为空时退出
@@ -856,7 +873,6 @@ def _perform_model0(self):
856873
return
857874
self._out_fp.flush()
858875

859-
error_lt = [] # 错误章节列表
860876
last_time = time.time()-120 # 答题间隔控制,减少答题验证码的弹出
861877

862878
# 遍历每个未完成章节
@@ -883,19 +899,8 @@ def _perform_model0(self):
883899
sleep(120-(now_time-last_time))
884900
last_time = time.time()
885901

886-
try:
887-
err_section = self._ans_question()
888-
889-
if err_section != 0:
890-
print(COLOR.ERR, 'unfinished!', COLOR.END, file=self._out_fp)
891-
error_lt.append(err_section) # 记录答题提交失败的章节
892-
else:
893-
print(COLOR.OK, 'finished!', COLOR.END, file=self._out_fp)
894-
except:
895-
try:
896-
send_err(traceback.format_exc())
897-
except:
898-
pass
902+
if self._que_server_flag==1:
903+
self._go_que_task()
899904

900905
if end_flag==1:
901906
print(COLOR.OK, 'finish the lesson! quit! ', COLOR.END, file=self._out_fp)
@@ -910,7 +915,6 @@ def _perform_model0(self):
910915
def _perform_model1(self):
911916
self._g2p_chapter_section()
912917

913-
error_lt = []
914918
last_time = time.time()-300
915919
self._chapter = eval(input(COLOR.NOTE + "please select which chapter:" + COLOR.END, file=self._out_fp))
916920
self._section = eval(input(COLOR.NOTE + "please select which section:" + COLOR.END, file=self._out_fp))
@@ -927,12 +931,8 @@ def _perform_model1(self):
927931
last_time = time.time()
928932
if self._end == 2:
929933
print(COLOR.OK, 'finish the lesson! quit! ', COLOR.END, file=self._out_fp)
930-
err_section = self._ans_question()
931-
if err_section != 0:
932-
print(COLOR.ERR, 'unfinished!', COLOR.END, file=self._out_fp)
933-
error_lt.append(err_section) # 记录答题提交失败的章节
934-
else:
935-
print(COLOR.OK, 'finished!', COLOR.END, file=self._out_fp)
934+
if self._que_server_flag==1:
935+
self._go_que_task()
936936
self._section += 1
937937
#log_fp.write("err_lt:" + str(error_lt) + '\n')
938938

@@ -948,7 +948,6 @@ def _perform_model2(self):
948948
subsection = eval(input("please select which subsection(if not input 0):"))
949949

950950
self._out_fp.flush()
951-
error_lt = [] # 错误章节列表
952951
last_time = time.time()-150 # 答题间隔控制,减少答题验证码的弹出
953952

954953
# 遍历每个未完成章节
@@ -977,17 +976,6 @@ def _perform_model2(self):
977976
sleep(150-(now_time-last_time))
978977
last_time = time.time()
979978

980-
try:
981-
err_section = self._ans_question()
982-
983-
if err_section != 0:
984-
print(COLOR.ERR, 'unfinished!', COLOR.END, file=self._out_fp)
985-
error_lt.append(err_section) # 记录答题提交失败的章节
986-
else:
987-
print(COLOR.OK, 'finished!', COLOR.END, file=self._out_fp)
988-
except:
989-
try:
990-
send_err(traceback.format_exc())
991-
except:
992-
pass
979+
if self._que_server_flag==1:
980+
self._go_que_task()
993981
#log_fp.write("err_lt:" + str(error_lt) + '\n')

0 commit comments

Comments
 (0)