Ejemplo n.º 1
0
 def test_p1_setshengyavideohomework_principal_appversion(self):
     """
     title: 使用地图校长布置到年级_生涯の视频内容,学生7.5.0以上查看作业列表是否收到
     url: /api/services/homeworkpromotion/homeworkpromotion/setxuekehomework
     author: 吴丽燕
     """
     teacher_web = teacher(web_client(username=principal_user['username']))
     res = teacher_web.career_getgradeandclassinfo()
     classlist = []
     for data in res['data']:
         if data['grade'] == grade:
             for classdetail in data['classlist']:
                 classlist.append(classdetail['classid'])
     res = teacher_web.hp_themehomeworkdetail(moduleid=promotion_moduleid_shengya, themeid=promotion_themeid)
     videoid = res['data']['videohomework']['videos'][0]['id']
     videokemuid = res['data']['videohomework']['videos'][0]['kemuid']
     homeworktitle = 'test{}'.format(random.randint(100000, 999999))
     res = teacher_web.hp_setshengyavideohomework(isgradehomework=True, gradeyear=expireyear,
                                                  classlist=classlist, videohomeworktitle=homeworktitle,
                                                  videoid=videoid, kemuid=videokemuid,
                                                  themeid=promotion_themeid, moduleid=promotion_moduleid_shengya)
     print(res)
     self.assertEqual(200, res['code'])
     time.sleep(30)
     student_app = teacher(app_client(username=student_user['username'], password=student_user['password']))
     res = student_app.get_app_myhomework(status=1, pagesize=100)
     homeworktitles = [i['title'] for i in res['data']['list']]
     self.assertIn(homeworktitle, homeworktitles)
Ejemplo n.º 2
0
 def test_p1_getreport_after_submit_sbr_homework(self):
     """
     title: 提交校本试卷后查看试卷报告
     url: /api/services/HomeworkService/homework/submitQuestionAnswers, /api/services/HomeworkService/homework/SubmitQuestionAnswerRating, /api/services/HomeworkService/homework/GetStudentSbrHomeworkReport
     author: 田彦涛
     """
     student_web = teacher(web_client(username=student09_user['username'], password=student09_user['password']))
     student_app = teacher(app_client(username=student09_user['username'], password=student09_user['password']))
     self.submit_sbr_paper(student_web)
     time.sleep(3)
     res = student_web.sbr_GetStudentSbrHomeworkReport(homeworkid=self.homeworkid)
     res2 = student_app.sbr_GetStudentSbrHomeworkReport(homeworkid=self.homeworkid)
     print(res)
     print(res2)
     self.assertEqual(res, res2)
     self.assertEqual(200, res['code'])
     self.assertEqual(self.homeworkid, res['data']['homeworkid'])
     self.assertEqual(sbr_paperid, res['data']['paperid'])
     self.assertEqual(47, res['data']['score'])
     self.assertEqual(2, res['data']['progress'])
     self.assertEqual(2, res['data']['ratingstate'])
     self.assertIn('{}://'.format(ConfigCase.PROTOCOL), res['data']['paperurl'])
     self.assertIn('{}://'.format(ConfigCase.PROTOCOL), res['data']['analysisurl'])
     print(res['data']['syllabuses'])
     print(report_expect)
     self.assertEqual(report_expect, res['data']['syllabuses'])
Ejemplo n.º 3
0
 def test_p1_app_submit_sbr_homework(self):
     """
     title: app提交校本试卷
     url: /api/services/HomeworkService/homework/submitQuestionAnswers, /api/services/HomeworkService/homework/SubmitQuestionAnswerRating
     author: 田彦涛
     """
     student_app = teacher(app_client(username=student03_user['username'], password=student03_user['password']))
     self.submit_sbr_paper(client1=student_app)
Ejemplo n.º 4
0
 def test_p1_get_my_homework(self):
     """
     title: 学生获取作业列表
     url: /app/v1/homework/myhomework
     author: 田彦涛
     """
     student_app = teacher(app_client(username=student_user['username'], password=student_user['password']))
     res = student_app.get_app_myhomework(status=0)
     print(res)
     self.assertEqual(200, res['code'])
     self.assertTrue(len(res['data']['list']) > 0)
Ejemplo n.º 5
0
 def test_p1_get_app_homeworkinfo(self):
     """
     title: app校本试卷作业的/homework/info
     url: /app/v1/homework/info
     author: 田彦涛
     """
     student_app = teacher(app_client(username=student_user['username'], password=student_user['password']))
     res = student_app.get_app_homework_info(cid=groupid_xingzheng, hid=self.homeworkid)
     print(res)
     self.assertEqual(200, res['code'])
     self.assertEqual(self.homeworkid, res['data']['homeworkid'])
     self.assertEqual(8, res['data']['type'])
     self.assertIn('{}://'.format(ConfigCase.PROTOCOL), res['data']['url'])
Ejemplo n.º 6
0
 def test_p1_get_app_myhomework_version_type99(self):
     """
     title: 非注册会员在app作业列表可以收到校本试卷作业
     url: /app/v1/homework/myhomework
     author: 田彦涛
     """
     student_app = teacher(app_client(username=student02_user['username'], password=student02_user['password']))
     res = student_app.get_app_myhomework(status=1, tid=8, pagesize=40)
     print(res)
     self.assertTrue(res['code'] == 200)
     self.assertTrue(res['data']['list'][0]['homeworkid'] > 0)
     homeworkids = [i['homeworkid'] for i in res['data']['list']]
     self.assertIn(self.homeworkid, homeworkids)
Ejemplo n.º 7
0
 def test_SubmitSubjectiveFileUrls(self):
     """
     title: 提交校本试卷主观题图片
     url: /api/services/HomeworkService/homework/SubmitSubjectiveFileUrls
     author: 田彦涛
     """
     tmp = self.get_answerCardId_and_paperId(homeworkid=337437)
     answercardid = tmp[0]
     paperid = tmp[1]
     questionAnswers = [{"questionId": 1466, "fileUrls": ["study.ewt360.com/UpLoadFile/Course/2016/1/1452528392.jpg",
                                                          "static.test.mistong.com/pic/384961595233353728"]}]
     student_app = teacher(app_client(username=student_user['username'], password=student_user['password']))
     res = student_app.sbr_SubmitSubjectiveFileUrls(answerCardId=answercardid, paperId=paperid, questionAnswers=questionAnswers)
     print(res)
Ejemplo n.º 8
0
 def test_p1_get_app_getsbrpaperquestioncard(self):
     """
     title: app校本试卷作业答题卡获取
     url: /api/services/HomeworkService/homework/getSbrHomeworkInfo4Answer
     author: 田彦涛
     """
     student_app = teacher(app_client(username=student_user['username'], password=student_user['password']))
     res = student_app.sbr_getSbrHomeworkInfo4Answer(homeworkid=self.homeworkid)
     print(res)
     self.assertEqual(200, res['code'])
     self.assertEqual(self.homeworkid, res['data']['homeworkid'])
     print(res['data']['syllabuses'])
     self.assertEqual(syllabuses_expect, res['data']['syllabuses'])
     self.assertEqual(sbr_paperid, res['data']['paperid'])
Ejemplo n.º 9
0
 def test_p1_step08_submit_by_app(self):
     """
     title: 学生在app上获取新测评的作业id并且提交测评(第10个学生)
     url: /app/v1/homework/info
     author: 田彦涛
     """
     student_app = teacher(
         app_client(username=student10_user['username'],
                    password=student10_user['password']))
     for homeworkid in homeworkids:
         res = student_app.get_app_homework_info(cid=groupid_xingzheng,
                                                 hid=homeworkid)
         print(res)
         self.assertEqual(200, res['code'])
         self.assertIn('orderNo=', str(res))
         orderNo = re.findall(
             "(?<=orderNo=).*?(?=&)",
             res['data']['psydata']['newevaluationlink'])[0]
         self.__submit_new_evaluation(user=student10_user, orderNo=orderNo)
Ejemplo n.º 10
0
 def test_p1_step06_get_by_app(self):
     """
     title: 学生在app上作业列表收到此测评
     url: /app/v1/homework/myhomework
     author: 田彦涛
     """
     student_app = teacher(
         app_client(username=student10_user['username'],
                    password=student10_user['password']))
     res = student_app.get_app_myhomework(status=1, tid=6)
     print(res)
     self.assertEqual(200, res['code'])
     self.assertIn("新测评test", str(res))
     global homeworkids
     homeworkids = [
         i['homeworkid'] for i in res['data']['list']
         if i['title'] == '新测评test'
     ]
     homeworkids = sorted(homeworkids)
     self.assertTrue(len(homeworkids) > 1)
Ejemplo n.º 11
0
 def test_p1_setxuekevideohomework_headteacher(self):
     """
     title: 使用地图班主任布置到班级_提分の视频内容,学生查看作业列表是否收到
     url: /api/services/homeworkpromotion/homeworkpromotion/setxuekehomework
     author: 吴丽燕
     """
     teacher_web = teacher(web_client(username=headteacher_user['username']))
     res = teacher_web.hp_themehomeworkdetail(moduleid=promotion_moduleid_xueke, themeid=promotion_themeid)
     videoid = res['data']['videohomework']['videos'][0]['id']
     videokemuid = res['data']['videohomework']['videos'][0]['kemuid']
     homeworktitle = 'test{}'.format(random.randint(100000, 999999))
     res = teacher_web.hp_setxuekevideohomework(isgradehomework=False, gradeyear=expireyear,
                                                classlist=[groupid_xingzheng], videohomeworktitle=homeworktitle,
                                                videoid=videoid, kemuid=videokemuid, deadline=CaseServices.get_deadlinetime(),
                                                themeid=promotion_themeid, moduleid=promotion_moduleid_xueke)
     print(res)
     self.assertEqual(200, res['code'])
     time.sleep(40)
     student_app = teacher(app_client(username=student_user['username'], password=student_user['password']))
     res = student_app.get_app_myhomework(status=1, pagesize=100)
     print(res)
     homeworktitles = [i['title'] for i in res['data']['list']]
     self.assertIn(homeworktitle, homeworktitles)
Ejemplo n.º 12
0
 def test_p1_evaluation_homework_for_monitor(self):
     """
     title: 心理老师布置测评作业,学生app收到并作答,老师查看完成情况
     url: /api/services/HomeworkService/evaluation/GradeClassStateInfo, /api/services/HomeworkService/evaluation/SetHomework
     author: 田彦涛
     """
     # 心理老师获取测评作业可布置范围
     teacher_web = teacher(
         web_client(username=psychologicalteacher_user['username'],
                    password=psychologicalteacher_user['password']))
     res = teacher_web.evaluation_GradeClassStateInfo(
         evaluationId=new_evalution_id)
     # print(res)
     self.assertEqual(200, res['code'])
     self.assertTrue(len(res['data']) > 2)
     self.assertIn(str(groupid_xingzheng), str(res))
     self.assertNotIn(str(groupid_jiaoxue), str(res))
     self.assertNotIn(str(groupid_isdeleted), str(res))
     for i in res['data']:
         for j in i['classlist']:
             if j['classid'] == groupid_xingzheng:
                 self.assertEqual(1, j['homeworksetstate'])
     # 心理老师布置测评作业到班级
     res = teacher_web.evaluation_sethomework(
         evaluationid=new_evalution_id,
         scopetype=2,
         deadlinetime=CaseServices.get_deadlinetime(),
         gradescope=expireyear,
         classscope=[groupid_xingzheng],
         title='monitor_test')
     print(res)
     self.assertEqual(200, res['code'])
     self.assertTrue(res['data'])
     # 学生从app作业列表获取测评作业
     time.sleep(10)
     student_app = teacher(
         app_client(username=student10_user['username'],
                    password=student10_user['password']))
     res = student_app.get_app_myhomework(status=1, tid=6)
     print(res)
     self.assertEqual(200, res['code'])
     self.assertIn("monitor_test", str(res))
     homeworkids = [
         i['homeworkid'] for i in res['data']['list']
         if i['title'] == 'monitor_test'
     ]
     homeworkids = sorted(homeworkids)
     self.assertTrue(len(homeworkids) > 0)
     homeworkid = homeworkids[-1]
     # 学生获取心理测评作业info
     res = student_app.get_app_homework_info(cid=groupid_xingzheng,
                                             hid=homeworkid)
     print(res)
     self.assertEqual(200, res['code'])
     self.assertIn('orderNo=', str(res))
     orderNo = re.findall("(?<=orderNo=).*?(?=&)",
                          res['data']['psydata']['newevaluationlink'])[0]
     # 学生提交测评作业
     self.__submit_new_evaluation(user=student10_user, orderNo=orderNo)
     # 行政班班主任查看测评作业记录
     time.sleep(3)  # 主从同步等待
     teacher_web = teacher(
         web_client(username=headteacher_user['username'],
                    password=headteacher_user['password']))
     res = teacher_web.evaluation_GetHomeworkLogList(homeworkstatus=1,
                                                     pagesize=50)
     print(res)
     self.assertEqual(200, res['code'])
     self.assertIn("monitor_test", str(res))
     homeworkids = [
         i['homeworkid'] for i in res['data']['records']
         if i['homeworkname'] == 'monitor_test'
     ]
     self.assertIn(homeworkid, homeworkids)
     participatecount = [
         i['participatecount'] for i in res['data']['records']
         if i['homeworkid'] == homeworkid
     ]
     self.assertEqual([1], participatecount)
Ejemplo n.º 13
0
 def get_answerCardId_and_paperId(self, homeworkid):
     student_app = teacher(app_client(username=student_user['username'], password=student_user['password']))
     res = student_app.sbr_getSbrHomeworkInfo4Answer(homeworkid=homeworkid)
     answercardid = res['data']['answercardid']
     paperid = res['data']['paperid']
     return answercardid, paperid