예제 #1
0
 def test_page_query_question_by_pointid(self):
     """
     title: 题库挑题-知识点挑题
     url: /api/homeworkprod/resource/question/pageQueryQuesAtChapterOrPoint
     author: 田彦涛
     """
     teacher_web = teacher(
         web_client(teacher_user['username'], teacher_user['password']))
     subjectEn = CaseServices.get_subjectId_and_subjectEn(teacher_web)[1]
     pointid = CaseServices.get_point_id_by_subjectEn(
         teacher_web, subjectEn)
     data = {
         "select": 2,
         "subject": subjectEn,
         "quesChapter": "",
         "quesBook": "",
         "quesKnowledge": pointid,
         "quesType": "",
         "quesCategory": "",
         "degreeId": "",
         "quesSource": "",
         "quesYear": "",
         "regionId": "",
         "pageIndex": 1,
         "pageSize": 10,
         "schoolId": schoolid
     }
     res = teacher_web.homeworkprod_pageQueryQuesAtChapterOrPoint(
         post_data=data)
     print(res)
     self.assertEqual("200", res['code'])
     self.assertTrue(res['success'])
     self.assertTrue(len(res['data']) > 0)
예제 #2
0
 def test_p1_oaclass_getSchoolClassList(self):
     """
     title:  获取学校下的班级列表(行政班)
     url: /api/eteacherproduct/oa/classManage/getSchoolClassList
     author: 章志君
     """
     get_classlist = self.oa.oaclass_getSchoolClassList()
     print(get_classlist)
     self.assertNotEqual(200, get_classlist['code'])
     self.assertEqual("200", get_classlist['code'])
     self.assertIn(CaseServices.get_expireyear()[0],
                   [item['gradeYear'] for item in get_classlist['data']])
     self.assertIn(CaseServices.get_expireyear()[1],
                   [item['gradeYear'] for item in get_classlist['data']])
     self.assertIn(CaseServices.get_expireyear()[2],
                   [item['gradeYear'] for item in get_classlist['data']])
예제 #3
0
 def test_get_question_chapter_by_book(self):
     """
     title: 题库挑题-获取章节目录
     url: /api/homeworkprod/resource/question/getQuestionChapterByBook
     author: 田彦涛
     """
     teacher_web = teacher(
         web_client(teacher_user['username'], teacher_user['password']))
     subjectEn = CaseServices.get_subjectId_and_subjectEn(teacher_web)[1]
     bookid = CaseServices.get_bookId_by_subjectEn(teacher_web, subjectEn)
     res = teacher_web.homeworkprod_getQuestionChapterByBook(
         schoolId=schoolid, bookId=bookid, subjectEn=subjectEn)
     print(res)
     self.assertEqual("200", res['code'])
     self.assertTrue(res['success'])
     self.assertTrue(len(res['data']) > 0)
예제 #4
0
 def test_p1_step01_type13_analogtea_submithomework(self):
     """
     title: 验证教师端提交模拟选科问卷,查看布置成功模拟选科信息_高一3+3 固定套餐
     url: /api/teacher/analogselectionfortea/submithomework,/api/teacher/analogselectionfortea/getsuccesshomeworkdetail
     author: 章志君
     """
     teacher_web = teacher(web_client(username=principal_user['username']))
     title = '高一3+3 固定套餐模拟选科问卷'
     groups = []
     res = teacher_web.analogtea_getquestionnaireinfo(grade=1, type=3)
     for i in res['data']['subjectlist']:
         groups.append(i['id'])
     res = teacher_web.analogtea_submithomework(
         grade=1,
         type=3,
         title=title,
         subjectgroups=groups,
         endtime=CaseServices.get_deadlinetime())
     print(res)
     self.assertEqual(200, res['code'])
     self.assertEqual("执行成功", res['msg'])
     self.assertTrue(res['data'] > 1)
     # homeworkids_type[3] = res['data']
     res2 = teacher_web.analogtea_getsuccesshomeworkdetail(
         homeworkid=res['data'])
     print(res2)
     self.assertEqual(200, res2['code'])
     self.assertEqual("执行成功", res2['msg'])
     self.assertEqual(3, res2['data']['type'])
     self.assertEqual(title, res2['data']['title'])
     # self.assertEqual(tomorrow_time, res2['data']['endtime'])
     self.assertTrue(res2['data']['peoplenum'] >= 2)
예제 #5
0
 def test_query_question_detail(self):
     """
     title: 题库挑题-获取题目解析
     url: /api/homeworkprod/resource/question/queryQuestionDetail
     author: 田彦涛
     """
     teacher_web = teacher(
         web_client(teacher_user['username'], teacher_user['password']))
     subjectEn = CaseServices.get_subjectId_and_subjectEn(teacher_web)[1]
     question_id = CaseServices.get_questionid_and_relationId(
         teacher_web)[1]
     res = teacher_web.homeworkprod_queryQuestionDetail(
         subjectEn=subjectEn,
         questionId=question_id,
         queryType=1,
         schoolid=schoolid)
     print(res)
     self.assertEqual("200", res['code'])
     self.assertTrue(res['success'])
     self.assertTrue(len(res['data']) > 0)
예제 #6
0
 def __analogtea_submithomework(self, type):
     teacher_web = teacher(web_client(username=principal_user['username']))
     title = '模拟选科问卷type{}'.format(type)
     groups = []
     res = teacher_web.analogtea_getquestionnaireinfo(grade=1, type=type)
     for i in res['data']['subjectlist']:
         groups.append(i['id'])
     res = teacher_web.analogtea_submithomework(
         grade=1,
         type=type,
         title=title,
         subjectgroups=groups,
         endtime=CaseServices.get_deadlinetime())
     return res['data']
예제 #7
0
 def test_get_wrong_question_points(self):
     """
     title: 题库挑题-学生错题-获取知识点目录
     url: /api/homeworkprod/resource/wrongQuestion/getWrongQuestionPoints
     author: 田彦涛
     """
     teacher_web = teacher(
         web_client(teacher_user['username'], teacher_user['password']))
     subjectid, subjectEn = CaseServices.get_subjectId_and_subjectEn(
         teacher_web)
     res = teacher_web.homeworkprod_getWrongQuestionPoints(
         subjectId=subjectid, subjectEn=subjectEn, schoolId=schoolid)
     print(res)
     self.assertEqual("200", res['code'])
     self.assertTrue(res['success'])
예제 #8
0
 def test_get_question_point_by_subject(self):
     """
     title: 题库挑题-获取知识点目录树
     url: /api/homeworkprod/resource/question/getQuestionPointBySubject
     author: 田彦涛
     """
     teacher_web = teacher(
         web_client(teacher_user['username'], teacher_user['password']))
     subjectEn = CaseServices.get_subjectId_and_subjectEn(teacher_web)[1]
     res = teacher_web.homeworkprod_getQuestionPointBySubject(
         schoolId=schoolid, subjectEn=subjectEn)
     print(res)
     self.assertEqual("200", res['code'])
     self.assertTrue(res['success'])
     self.assertTrue(len(res['data']) > 0)
예제 #9
0
 def test_get_paper_info(self):
     """
     title: 试卷挑题-根据试卷id获取试卷详情
     url: /api/homeworkprod/resource/paper/getPaperInfo
     author: 田彦涛
     """
     teacher_web = teacher(
         web_client(teacher_user['username'], teacher_user['password']))
     paperid = CaseServices.get_paper_id(teacher_web)
     res = teacher_web.homeworkprod_getPaperInfo(paperId=paperid,
                                                 schoolId=schoolid)
     print(res)
     self.assertEqual("200", res['code'])
     self.assertTrue(res['success'])
     self.assertTrue(len(res['data']) > 0)
     self.assertTrue(len(res['data']['questionList']) > 0)
예제 #10
0
    def test_p2_homeworkurgestate(self):
        """
        title: 验证督学系统:催交及催交状态
        url: /api/eteacherproduct/routine/urge,/api/eteacherproduct/routine/urgeState
        author: 吴丽燕
        """
        teacher_principal = teacher(
            web_client(username=principal_user['username'],
                       password=principal_user['password']))
        components = [{
            "type": "1",
            "title": "testauto_video",
            "resourceIds": lesson_ids
        }]
        gradeClasses = [{
            "grade": grade,
            "expireYear": expireyear,
            "classList": [groupid_jiaoxue]
        }]
        res = teacher_principal.sethomework(
            components=components,
            gradeClasses=gradeClasses,
            deadline=CaseServices.get_deadlinetime(),
            arrangeType=0,
            classType=2,
            expireYears=[],
            isGradeHomework=False,
            subject='1')

        hid = res['data'][0]
        teacher_web = teacher(web_client(username=principal_user['username']))
        homeworkurgestateres = teacher_web.homeworkurgestate(homeworkId=hid)
        print(homeworkurgestateres)
        self.assertEqual('200', homeworkurgestateres['code'])
        self.assertEqual(0, homeworkurgestateres['data'])
        res = teacher_web.homeworkurge(homeworkId=hid)
        print(res)
        self.assertEqual('200', res['code'])
        self.assertTrue(res['data'] > 0)
        time.sleep(5)
        homeworkurgestateres = teacher_web.homeworkurgestate(homeworkId=hid)
        self.assertEqual(-1, homeworkurgestateres['data'])