def TuPianYuXueSheng(self): if not Toolkit.IsElementPresentcss( 'tr[auth="paper_bind||is_super"]>td>a.btn-success' ): # 判断第2A步 图片与学生 是不是展开的 WebOp.shared_wd.find_element_by_css_selector( 'div[auth="paper_bind||paper_grouping||is_super"]').click() WebOp.shared_wd.find_element_by_css_selector( 'tr[auth="paper_bind||is_super"]>td>a.btn-success').click( ) # 学生关联--处理按钮 if Toolkit.IsElementPresentxpath(u"//div[text()='没有数据']"): WebOp.shared_wd.find_element_by_css_selector( 'button.btn-default').click() # 点击返回 else: # 加入处理学生关联的情况,第一页交给用户处理,剩余的后台处理 WebOp.shared_wd.find_element_by_xpath( '//span[text()="交给用户处理"]').click() # Toolkit.is_not_visible('//span[text()="提交中"]') if not Toolkit.IsElementPresentcss('button.btn-default'): for one in range(99): WebOp.shared_wd.find_element_by_css_selector( 'div.students>div:nth-child(1)').click() WebOp.shared_wd.find_element_by_css_selector( 'button.btn-success>span.ng-scope').click() # Toolkit.is_not_visible('//span[text()="提交中"]') if Toolkit.IsElementPresentcss('button.btn-default'): break Toolkit.is_visible( '//div[@class="text-center"]/button[text()="返回"]') WebOp.shared_wd.find_element_by_css_selector( 'button.btn-default').click()
def DaFenKuang(self): Toolkit.is_visible(u'//div[text()="第2B步 - 图片与成绩"]') if not Toolkit.IsElementPresentcss( 'tr[auth="paper_score||is_super"]>td.text-center>a' ): # 判断第2B步 图片与成绩 是不是展开的 WebOp.shared_wd.find_element_by_css_selector( 'div[auth="marking_choice||marking_blanks||blank_score||blank_tag||marking_correction||marking_writing||marking_scores||paper_score||is_super"]' ).click() if Toolkit.IsElementPresentcss( 'tr[auth="marking_scores||is_super"]'): # 判断打分框是否存在 WebOp.shared_wd.find_element_by_css_selector( 'tr[auth="marking_scores||is_super"]>td>a.btn-success').click( ) if Toolkit.IsElementPresentxpath(u'//div[text()="本题已处理完成!"]'): WebOp.shared_wd.find_element_by_css_selector( 'button.btn-default').click() # 点击返回
def GaiCuoTi(self): Toolkit.is_visible(u'//div[text()="第2B步 - 图片与成绩"]') if not Toolkit.IsElementPresentcss( 'tr[auth="paper_score||is_super"]>td.text-center>a' ): # 判断第2B步 图片与成绩 是不是展开的 WebOp.shared_wd.find_element_by_css_selector( 'div[auth="marking_choice||marking_blanks||blank_score||blank_tag||marking_correction||marking_writing||marking_scores||paper_score||is_super"]' ).click() if Toolkit.IsElementPresentcss( 'tr[auth="marking_correction||is_super"]'): # 判断改错题是否存在 WebOp.shared_wd.find_element_by_css_selector( 'tr[auth="marking_correction||is_super"]>td>a.btn-success' ).click() if Toolkit.IsElementPresentxpath(u'//div[text()="本题已处理完成!"]'): WebOp.shared_wd.find_element_by_css_selector( 'button.btn-default').click() # 点击返回 else: for Cnum in range(99): # 题目数量 if not Toolkit.IsElementPresentxpath( u'//tr//td[position()=6 and text()!="0"]' ): # 判断下有没有未标注的 break biaozhuEles = WebOp.shared_wd.find_elements_by_xpath( u'//tr//td[position()=6 and text()!="0"]/following-sibling::td//a//span[text()="标注"]' ) for biaozhuele in biaozhuEles: biaozhuele.click() WebOp.shared_wd.find_elements_by_xpath( u'//div[text()="过滤: "]//button')[1].click( ) # 获取所有的 过滤出来的答案 for num in range(99): WebOp.shared_wd.find_element_by_css_selector( 'button[ng-click="selectAll()"]').click() # 全选 WebOp.shared_wd.find_element_by_css_selector( 'i.fa-check').click() # 点击对号(这里判断不出到底对错,就都选对了) if Toolkit.IsElementPresentxpath( u'//div[text()="本题已处理完成!"]'): WebOp.shared_wd.find_element_by_css_selector( 'button.btn-default').click() # 点击返回 break break WebOp.shared_wd.find_element_by_css_selector( 'div.pull-right>button').click() # 点击返回 time.sleep(1)
def TuPianYuChuLi(self): if not Toolkit.IsElementPresentcss( 'tr[auth="paper_anchor||is_super"]>td>a.btn-success' ): # 判断第1步 图片预处理 是不是展开的 WebOp.shared_wd.find_element_by_css_selector( 'div[auth="paper_anchor||paper_indexing||is_super"]').click() WebOp.shared_wd.find_element_by_css_selector( 'tr[auth="paper_anchor||is_super"]>td>a.btn-success').click( ) # 定位点--处理按钮 if Toolkit.IsElementPresentxpath(u"//div[text()='没有数据']"): WebOp.shared_wd.find_element_by_css_selector( 'button.btn-default').click() else: pass # 过后补充这种情况
def TianKongTi(self): Toolkit.is_visible(u'//div[text()="第2B步 - 图片与成绩"]') if not Toolkit.IsElementPresentcss( 'tr[auth="paper_score||is_super"]>td.text-center>a' ): # 判断第2B步 图片与成绩 是不是展开的 WebOp.shared_wd.find_element_by_css_selector( 'div[auth="marking_choice||marking_blanks||blank_score||blank_tag||marking_correction||marking_writing||marking_scores||paper_score||is_super"]' ).click() if Toolkit.IsElementPresentcss( 'tr[auth="marking_blanks||blank_score||blank_tag||is_super"]' ): # 判断填空题是否存在 WebOp.shared_wd.find_element_by_css_selector( 'tr[auth="marking_blanks||blank_score||blank_tag||is_super"]>td>a.btn-success' ).click() if Toolkit.IsElementPresentxpath(u'//div[text()="本题已处理完成!"]'): WebOp.shared_wd.find_element_by_css_selector( 'button.btn-default').click() # 点击返回 else: for Cnum in range(99): if not Toolkit.IsElementPresentxpath( '//tr//td[position()=4 and text()!="0"]'): break biaozhuEles = WebOp.shared_wd.find_elements_by_xpath( u'//a[text()="标注"]') for biaozhuele in biaozhuEles: biaozhuele.click() if Toolkit.IsElementPresentcss( 'div.text-center>button.btn-primary' ): # 判断进入***题这个按钮是否存在 WebOp.shared_wd.find_element_by_css_selector( 'div.text-center>button.btn-primary').click() if Toolkit.IsElementPresentxpath( u'//div[text()="本题已处理完成!"]'): WebOp.shared_wd.find_element_by_css_selector( 'button.btn-default').click() # 点击返回 break for num in range(99): WebOp.shared_wd.find_element_by_css_selector( 'button[ng-click="selectAll()"]').click() # 全选 WebOp.shared_wd.find_element_by_css_selector( 'button[ng-click="submit()"]').click() # 提交 if Toolkit.IsElementPresentcss( 'div.text-center>button.btn-primary' ): # 判断进入**题这个按钮是否存在 WebOp.shared_wd.find_element_by_css_selector( 'div.text-center>button.btn-primary' ).click() # 点击进入**题 time.sleep(1) if Toolkit.IsElementPresentxpath( u'//div[text()="本题已处理完成!"]'): WebOp.shared_wd.find_element_by_css_selector( 'button.btn-default').click() # 点击返回 break break WebOp.shared_wd.find_elements_by_css_selector( '.text-left')[0].click() # 全选考试题 WebOp.shared_wd.find_element_by_css_selector( 'div.bg-grey>button').click() # 点击一建打分 time.sleep(1.5) # 不能显示等待因为元素之前是存在的 WebOp.shared_wd.find_element_by_xpath( '//div[@class="pull-right"]//button').click() # 点击返回