|
@@ -1,462 +0,0 @@
|
|
-<template>
|
|
|
|
- <div class="auto-create-wrap">
|
|
|
|
-
|
|
|
|
- <div class="select-box">
|
|
|
|
- <vuescroll>
|
|
|
|
- <div class="type-title">
|
|
|
|
- <h1 style="color:#dcdee2">个人题库</h1>
|
|
|
|
- </div>
|
|
|
|
- <div class="question-condition-wrap">
|
|
|
|
- <div class="question-condition-item question-num-item" v-for="(items,indexs) in quePerson" :key="indexs">
|
|
|
|
- <span class="condition-label">{{items.name}}:</span>
|
|
|
|
- <span class="question-difficulty-label">难度</span>
|
|
|
|
- <Select v-model="items.level" style="width:90px" size="small" >
|
|
|
|
- <Option v-for="(item,index) in difficultyList" :value="item.value" :key="index">{{ item.label }}</Option>
|
|
|
|
- </Select>
|
|
|
|
- <span class="input-tag-text total-text-tag">共</span>
|
|
|
|
- <InputNumber v-model="items.count" placeholder="0" style="width: 40px" size="small" />
|
|
|
|
- <span class="input-tag-text">道</span>
|
|
|
|
- </div>
|
|
|
|
- <div class="question-condition-item" style="margin-top:0px;">
|
|
|
|
- <span class="condition-label">知识点:</span>
|
|
|
|
- <Tag closable color="#404040" v-for="(item,index) in checkedPoints" :key="index">{{item.name}}</Tag>
|
|
|
|
- <Icon type="md-add-circle" color="white" size="18" style="margin-left:15px;cursor:pointer;" @click="selectPoints" />
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </vuescroll>
|
|
|
|
- </div>
|
|
|
|
- <div class="select-box" v-if='$store.state.userInfo.schoolCode != ""'>
|
|
|
|
- <vuescroll>
|
|
|
|
- <div class="type-title">
|
|
|
|
- <h1 style="color:#dcdee2">校本题库</h1>
|
|
|
|
- </div>
|
|
|
|
- <div class="question-condition-wrap">
|
|
|
|
- <div class="question-condition-item">
|
|
|
|
- <span class="condition-label">适用学段:</span>
|
|
|
|
- <RadioGroup v-model="autoCreateFilter.periodCode" style="display:inline-block;">
|
|
|
|
- <Radio v-for="(item,index) in $store.state.user.schoolProfile.school_base.period" :label="item.id" :key="index" style="margin-right:30px;"> {{item.name}}</Radio>
|
|
|
|
- </RadioGroup>
|
|
|
|
- </div>
|
|
|
|
- <div class="question-condition-item question-num-item " v-if="schoolBaseInfo.length > 0">
|
|
|
|
- <span class="condition-label">适用科目:</span>
|
|
|
|
- <Select style="width:90px" size="small" v-model="autoCreateFilter.subjectId">
|
|
|
|
- <Option v-for="(item,index) in schoolBaseInfo[Number(autoCreateFilter.periodCode) - 1].subjects" :value="item.id" :key="index">{{item.name }}</Option>
|
|
|
|
- </Select>
|
|
|
|
- </div>
|
|
|
|
- <div class="question-condition-item question-num-item" v-if="schoolBaseInfo.length > 0">
|
|
|
|
- <span class="condition-label">适用年級:</span>
|
|
|
|
- <Select multiple style="min-width:90px;max-width:200px" size="small" v-model="autoCreateFilter.gradesId">
|
|
|
|
- <Option v-for="(item,index) in schoolBaseInfo[Number(autoCreateFilter.periodCode)].grades" :value="item.id" :key="index">{{item.name }}</Option>
|
|
|
|
- </Select>
|
|
|
|
- </div>
|
|
|
|
- <div class="question-condition-item question-num-item" v-for="(items,indexs) in queSchool" :key="indexs">
|
|
|
|
- <span class="condition-label">{{items.name}}:</span>
|
|
|
|
- <span class="question-difficulty-label">难度</span>
|
|
|
|
- <Select v-model="items.level" style="width:90px" size="small">
|
|
|
|
- <Option v-for="(item,index) in difficultyList" :value="item.value" :key="index">{{ item.label }}</Option>
|
|
|
|
- </Select>
|
|
|
|
- <span class="input-tag-text total-text-tag">共</span>
|
|
|
|
- <InputNumber v-model="items.count" placeholder="0" style="width: 40px" size="small" />
|
|
|
|
- <span class="input-tag-text">道</span>
|
|
|
|
- </div>
|
|
|
|
- <div class="question-condition-item" style="margin-top:0px;">
|
|
|
|
- <span class="condition-label">知识点:</span>
|
|
|
|
- <Tag closable color="#404040" v-for="(item,index) in checkedPoints" :key="index">{{item.name}}</Tag>
|
|
|
|
- <Icon type="md-add-circle" color="white" size="18" style="margin-left:15px;cursor:pointer;" @click="selectPoints" />
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- </div>
|
|
|
|
- </vuescroll>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- <div>
|
|
|
|
- <Button type="info" class="button-style" @click="handleFilterData">{{isLoading ? '组卷成功将自动跳转到预览页面,组卷中...':'开始组卷'}}</Button>
|
|
|
|
- </div>
|
|
|
|
- <Modal v-model="selectPointsStatus"
|
|
|
|
- title="设置知识点"
|
|
|
|
- width="700"
|
|
|
|
- class-name="dark-iview-modal points-component-wrap"
|
|
|
|
- @on-ok="confirmSelectPoints"
|
|
|
|
- @on-cancel="cancelSelectPoints">
|
|
|
|
- <BasePoints @onCheckChange="getCheckedPoints"></BasePoints>
|
|
|
|
- </Modal>
|
|
|
|
- </div>
|
|
|
|
-</template>
|
|
|
|
-<script>
|
|
|
|
- import BasePoints from '@/view/evaluation/components/BasePoints.vue'
|
|
|
|
- export default {
|
|
|
|
- components: {
|
|
|
|
- BasePoints
|
|
|
|
- },
|
|
|
|
- props: {
|
|
|
|
- subjectCode: {
|
|
|
|
- type: String,
|
|
|
|
- default: ''
|
|
|
|
- },
|
|
|
|
- periodCode: {
|
|
|
|
- type: String,
|
|
|
|
- default: ''
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- data() {
|
|
|
|
- return {
|
|
|
|
- isSchool: false,
|
|
|
|
- checkedPoints: [],
|
|
|
|
- isLoading: false,
|
|
|
|
- activePointTab: 1,
|
|
|
|
- pointsInBlockList: [],
|
|
|
|
- pointBlockList: [],
|
|
|
|
- pointTab: 'pioints',
|
|
|
|
- selectPointsStatus: false,
|
|
|
|
- quePerson: [
|
|
|
|
- {
|
|
|
|
- id: 1,
|
|
|
|
- name: '单选题',
|
|
|
|
- count: 0,
|
|
|
|
- level: -1,
|
|
|
|
- type:'single'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: 2,
|
|
|
|
- name: '多选题',
|
|
|
|
- count: 0,
|
|
|
|
- level: -1,
|
|
|
|
- type: "multiple"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: 3,
|
|
|
|
- name: '判断题',
|
|
|
|
- count: 0,
|
|
|
|
- level: -1,
|
|
|
|
- type: "judge"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: 4,
|
|
|
|
- name: '填空题',
|
|
|
|
- count: 0,
|
|
|
|
- level: -1,
|
|
|
|
- type: "complete"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: 5,
|
|
|
|
- name: '问答题',
|
|
|
|
- count: 0,
|
|
|
|
- level: -1,
|
|
|
|
- type:'subjective'
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: 6,
|
|
|
|
- name: '综合题',
|
|
|
|
- count: 0,
|
|
|
|
- level: -1,
|
|
|
|
- type: 'compose'
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- queSchool: [
|
|
|
|
- {
|
|
|
|
- id: 1,
|
|
|
|
- name: '单选题',
|
|
|
|
- count: 0,
|
|
|
|
- level: -1,
|
|
|
|
- type:'single'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: 2,
|
|
|
|
- name: '多选题',
|
|
|
|
- count: 0,
|
|
|
|
- level: -1,
|
|
|
|
- type: "multiple"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: 3,
|
|
|
|
- name: '判断题',
|
|
|
|
- count: 0,
|
|
|
|
- level: -1,
|
|
|
|
- type: "judge"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: 4,
|
|
|
|
- name: '填空题',
|
|
|
|
- count: 0,
|
|
|
|
- level: -1,
|
|
|
|
- type: "complete"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: 5,
|
|
|
|
- name: '问答题',
|
|
|
|
- count: 0,
|
|
|
|
- level: -1,
|
|
|
|
- type:'subjective'
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: 6,
|
|
|
|
- name: '综合题',
|
|
|
|
- count: 0,
|
|
|
|
- level: -1,
|
|
|
|
- type: 'compose'
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- autoCreateFilter: {
|
|
|
|
- code: [],
|
|
|
|
- periodCode: '1',
|
|
|
|
- subjectId: '',
|
|
|
|
- gradesId:[],
|
|
|
|
- questionType: ['single'],
|
|
|
|
- points: []
|
|
|
|
- },
|
|
|
|
- difficultyList: [
|
|
|
|
- {
|
|
|
|
- level: 'random',
|
|
|
|
- label: '随机',
|
|
|
|
- value: -1
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- level: 'average',
|
|
|
|
- label: '平均分配',
|
|
|
|
- value: 0
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- level: 'relativeEasy',
|
|
|
|
- label: '较易',
|
|
|
|
- value: 1
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- level: 'easy',
|
|
|
|
- label: '容易',
|
|
|
|
- value: 2
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- level: 'common',
|
|
|
|
- label: '一般',
|
|
|
|
- value: 3
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- level: 'difficulty',
|
|
|
|
- label: '困难',
|
|
|
|
- value: 4
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- level: 'relativeDifficulty',
|
|
|
|
- label: '较难',
|
|
|
|
- value: 5
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
- schoolBaseInfo:[]
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- async getData() {
|
|
|
|
- await this.$store.dispatch('user/getSchoolProfile').then(
|
|
|
|
- (res) => {
|
|
|
|
- this.schoolBaseInfo = this.$store.state.user.schoolProfile.school_base.period
|
|
|
|
- if (res.code == 2) {
|
|
|
|
- alert('数据为空!')
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- (err) => {
|
|
|
|
- this.$Message.error('API error!')
|
|
|
|
- }
|
|
|
|
- )
|
|
|
|
- },
|
|
|
|
- cancel() {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- /**获取已选的知识点 */
|
|
|
|
- getCheckedPoints(val, list) {
|
|
|
|
- let checkedPoints = [...val]
|
|
|
|
- this.getPointObject(checkedPoints)
|
|
|
|
- },
|
|
|
|
- selectPointScope(index) {
|
|
|
|
- this.activePointTab = index
|
|
|
|
- },
|
|
|
|
- // 获取知识点完整对象数据 ID换对象
|
|
|
|
- getPointObject(arr) {
|
|
|
|
- let params = {
|
|
|
|
- collectionName: 'Knowledge',
|
|
|
|
- queryDict: {
|
|
|
|
- id: arr
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.$api.FindCollection(params).then(res => {
|
|
|
|
- if (!res.error && res.result.data) {
|
|
|
|
- this.checkedPoints = res.result.data
|
|
|
|
- } else {
|
|
|
|
- this.$Message.warning('获取数据失败')
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- getOpenKeys(data) {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- getCurrentIndex(points) {
|
|
|
|
- this.getPointObject(points)
|
|
|
|
- },
|
|
|
|
- //获取知识点数据
|
|
|
|
- getPointsData() {
|
|
|
|
- let requestData = {
|
|
|
|
- code: 'hbcn',
|
|
|
|
- periodId: this.periodCode,
|
|
|
|
- school_code: "hbcn",
|
|
|
|
- type: 0,
|
|
|
|
- subjectId: this.subjectCode
|
|
|
|
- }
|
|
|
|
- this.$api.knowledge.GetSchoolPoints(requestData).then(res => {
|
|
|
|
- if (!res.error && res.result.data) {
|
|
|
|
- this.pointBlockList = res.result.data
|
|
|
|
- } else {
|
|
|
|
- this.$Message.warning('获取数据失败')
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- confirmSelectPoints() {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- cancelSelectPoints() {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- selectPoints() {
|
|
|
|
- this.selectPointsStatus = true
|
|
|
|
- this.getPointsData()
|
|
|
|
- },
|
|
|
|
- getCount(data) {
|
|
|
|
- return data.easy + data.relativeEasy + data.common + data.relativeDifficulty + data.difficulty
|
|
|
|
- },
|
|
|
|
- getNumber(num) {
|
|
|
|
- if (num == undefined) {
|
|
|
|
- return 0
|
|
|
|
- } else {
|
|
|
|
- return num
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- //处理题目结构数据
|
|
|
|
- setQueInfo(data) {
|
|
|
|
- let queInfo = []
|
|
|
|
- if (data.length !== 0) {
|
|
|
|
- for (let i = 0; i < data.length; i++) {
|
|
|
|
- let res = {}
|
|
|
|
- res.type = data[i].type
|
|
|
|
- res.count = data[i].count
|
|
|
|
- if (data[i].level !== -1 && data[i].level !==0 && data[i].level !== "") {
|
|
|
|
- let temp = {}
|
|
|
|
- res.policy = "custom"
|
|
|
|
- res.custom = []
|
|
|
|
- temp.level = data[i].level
|
|
|
|
- temp.count = data[i].count
|
|
|
|
- res.custom.push(temp)
|
|
|
|
- } else if (data[i].level === -1) {
|
|
|
|
- res.policy = "random"
|
|
|
|
- } else if (data[i].level === 0) {
|
|
|
|
- res.policy = "average"
|
|
|
|
- }
|
|
|
|
- if (res.count !== 0) {
|
|
|
|
- queInfo.push(res)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return queInfo
|
|
|
|
- },
|
|
|
|
- //提交组卷数据
|
|
|
|
- handleFilterData() {
|
|
|
|
- let requestData = []
|
|
|
|
- let filterData = {
|
|
|
|
- code: 'Item-' + this.$store.state.userInfo.TEAMModelId.replace('#', '') ,
|
|
|
|
- scope:"pravite",
|
|
|
|
- period: "",
|
|
|
|
- points: this.autoCreateFilter.points,
|
|
|
|
- quInfos: this.setQueInfo(this.quePerson)
|
|
|
|
- }
|
|
|
|
- requestData.push(filterData)
|
|
|
|
- if (this.autoCreateFilter.periodCode !== '') {
|
|
|
|
- let temp = JSON.parse(JSON.stringify(filterData))
|
|
|
|
- temp.code = 'Item-' + this.$store.state.userInfo.schoolCode
|
|
|
|
- temp.scope = 'school'
|
|
|
|
- temp.gradesId = this.autoCreateFilter.gradesId
|
|
|
|
- temp.subject = this.autoCreateFilter.subjectId
|
|
|
|
- temp.period = this.autoCreateFilter.periodCode
|
|
|
|
- temp.quInfos = this.setQueInfo(this.queSchool)
|
|
|
|
- requestData.push(temp)
|
|
|
|
- }
|
|
|
|
- this.isLoading = true
|
|
|
|
- let requestDatas = []
|
|
|
|
- for (let i = 0; i < requestData.length; i++) {
|
|
|
|
- if (requestData[i].quInfos.length > 0) {
|
|
|
|
- requestDatas.push(requestData[i])
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.$api.learnActivity.Automatic(requestDatas).then(
|
|
|
|
- res => {
|
|
|
|
- if (res.length > 0) {
|
|
|
|
- setTimeout(() => {
|
|
|
|
- this.isLoading = false
|
|
|
|
- this.$emit('getExercises', res)
|
|
|
|
- let arr = []
|
|
|
|
- for (let i = 0; i < res.length; i++) {
|
|
|
|
- arr = arr.concat(res[i].item)
|
|
|
|
- }
|
|
|
|
- this.$emit('autoQuestions', arr)
|
|
|
|
- }, 2000)
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
- this.$Message.error('未能匹配满足条件的题目!')
|
|
|
|
- setTimeout(() => {
|
|
|
|
- this.isLoading = false
|
|
|
|
- }, 1000)
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- err => {
|
|
|
|
- this.$Message.error('API ERROR!')
|
|
|
|
- setTimeout(() => {
|
|
|
|
- this.isLoading = false
|
|
|
|
- }, 1000)
|
|
|
|
- }
|
|
|
|
- )
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- mounted() {
|
|
|
|
- this.getData()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-</script>
|
|
|
|
-<style lang="less" scoped>
|
|
|
|
- @import "./AutoCreate.less";
|
|
|
|
-</style>
|
|
|
|
-<style>
|
|
|
|
- .points-component-wrap .ivu-tabs {
|
|
|
|
- color: white;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .points-component-wrap {
|
|
|
|
- color: white;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .question-num-item .ivu-input {
|
|
|
|
- background: none;
|
|
|
|
- text-align: center;
|
|
|
|
- color: white;
|
|
|
|
- font-size: 18px;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .question-num-item .ivu-select-selection {
|
|
|
|
- background: none;
|
|
|
|
- color: white;
|
|
|
|
- border-color: #dcdee2;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .question-num-item .ivu-input-number-handler-wrap {
|
|
|
|
- display: none;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .question-num-item .ivu-input-number, .question-num-item .ivu-input-number-small input {
|
|
|
|
- background: none;
|
|
|
|
- text-align: center;
|
|
|
|
- font-size: 16px;
|
|
|
|
- color: white;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .question-num-item .ivu-input-number-input {
|
|
|
|
- padding: 0px;
|
|
|
|
- }
|
|
|
|
-</style>
|
|
|