Merge remote-tracking branch 'origin/develop' into develop
# Conflicts: # AES/src/main/java/com/example/aes/problem/dao/impl/ProblemDaoImpl.java
This commit is contained in:
commit
17213b11e7
|
|
@ -27,7 +27,6 @@ Node 安装 18 及以上
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pnpm dev
|
pnpm dev
|
||||||
```
|
|
||||||
|
|
||||||
### Build and Release
|
### Build and Release
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,4 +80,10 @@ export default {
|
||||||
deleteScoringRubric:(data)=>request.post('/problem/deleteScoringRubric',data),
|
deleteScoringRubric:(data)=>request.post('/problem/deleteScoringRubric',data),
|
||||||
deleteScoringStandard:(data)=>request.post('/problem/deleteScoringStandard',data),
|
deleteScoringStandard:(data)=>request.post('/problem/deleteScoringStandard',data),
|
||||||
findAllProblemByCourseId:(data)=>request.post('/problem/findAllProblemByCourseId',data),
|
findAllProblemByCourseId:(data)=>request.post('/problem/findAllProblemByCourseId',data),
|
||||||
|
findClassByCourseId:(data)=>request.post('/classes/findClassByCourseId',data),
|
||||||
|
findProblemById:(data)=>request.post('/problem/findProblemById',data),
|
||||||
|
postProblem:(data)=>request.post('/problem/postProblem',data),
|
||||||
|
findScoringStandardByProblemId: (data) => request.post('/problem/findScoringStandardByProblemId', data),
|
||||||
|
editProblem:(data) => request.post('/problem/editProblem', data),
|
||||||
|
deleteProblem:(data) => request.post('/problem/deleteProblem', data),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
const emit =
|
const emit =
|
||||||
defineEmits(['clickDelete','clickPost','clickDelete'])
|
defineEmits(['clickDelete','clickPost','clickEdit'])
|
||||||
const onEdit = ()=>{
|
const onEdit = ()=>{
|
||||||
emit('clickEdit')
|
emit('clickEdit')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<n-scrollbar x-scrollable style="max-height: 100vh">
|
<div style="display: flex;
|
||||||
<CommonPage show-footer>
|
justify-content: flex-end;margin-left: 30px">
|
||||||
|
|
||||||
<n-data-table
|
<n-data-table
|
||||||
remote
|
remote
|
||||||
:single-line="false"
|
:single-line="false"
|
||||||
|
|
@ -9,48 +8,51 @@
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="classList"
|
:data="classList"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:pagination="paginationReactive"
|
|
||||||
:row-key="rowKey"
|
:row-key="rowKey"
|
||||||
:scroll-x="900"
|
style="width: 700px;margin-top:5px"
|
||||||
style="width: 1180px;--n-td-padding:0px 5px;"
|
v-model:checked-row-keys="checkedRowKeys"
|
||||||
@update:page="onChangePage"
|
/> </div>
|
||||||
@update:page-size="onUpdatePageSize"
|
|
||||||
/>
|
|
||||||
<div style="display: flex;
|
<div style="display: flex;
|
||||||
justify-content: flex-end;margin-top: 30px">
|
justify-content: flex-end;margin-top:
|
||||||
|
5px;margin-left: 30px">
|
||||||
<n-button type="primary"
|
<n-button type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
style="margin-bottom:
|
style="margin-bottom:
|
||||||
10px" @click="confirm">确认
|
10px;margin-left: 30px"
|
||||||
|
@click="onAdd">确认
|
||||||
</n-button>
|
</n-button>
|
||||||
<n-button type="primary"
|
<!-- <n-button type="primary"-->
|
||||||
size="small" @click="cancel" style="margin-left: 30px">取消</n-button>
|
<!-- size="small" @click="cancel" style="margin-left: 30px">取消</n-button>-->
|
||||||
</div>
|
</div>
|
||||||
</CommonPage>
|
|
||||||
</n-scrollbar>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {ref, reactive, onMounted, watch} from 'vue'
|
import {ref, reactive, onMounted, watch} from 'vue'
|
||||||
import api from '@/api/admin';
|
import api from '@/api/admin';
|
||||||
import {formatDateTime} from '@/utils';
|
|
||||||
import {
|
import {
|
||||||
useTagsStore,
|
useTagsStore,
|
||||||
useUserStore
|
useUserStore
|
||||||
} from '@/store'
|
} from '@/store'
|
||||||
import { useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
const rules=ref(null)
|
const rules=ref(null)
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const classInfoRef = ref(null)
|
const route = useRoute()
|
||||||
|
const { courseId,problemId, history } = route.query
|
||||||
const loading = ref(true)
|
const loading = ref(true)
|
||||||
const classList =
|
const classList =
|
||||||
ref([{name:"班级1"},{name: "班级2"}])
|
ref([])
|
||||||
const options1=ref([])
|
const options1=ref([])
|
||||||
const role=userStore.getRole()
|
const role=userStore.getRole()
|
||||||
const teacherId=ref()
|
const teacherId=ref()
|
||||||
const tagsStore = useTagsStore()
|
const tagsStore = useTagsStore()
|
||||||
const path=ref('')
|
const path=ref('')
|
||||||
|
const checkedRowKeys = ref([])
|
||||||
|
const emit = defineEmits([ 'clickAdd']);
|
||||||
|
const onAdd=()=>{
|
||||||
|
emit('clickAdd',checkedRowKeys);
|
||||||
|
}
|
||||||
const paginationReactive = reactive({
|
const paginationReactive = reactive({
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 50,
|
pageSize: 50,
|
||||||
|
|
@ -66,9 +68,9 @@ const classInfoValue = ref({
|
||||||
id:0,
|
id:0,
|
||||||
teacherId:'',
|
teacherId:'',
|
||||||
});
|
});
|
||||||
const onAdd = ()=>{
|
// const onAdd = ()=>{
|
||||||
router.push({name: 'AdminClassAdd'})
|
// router.push({name: 'AdminClassAdd'})
|
||||||
}
|
// }
|
||||||
const cancel = ()=>{
|
const cancel = ()=>{
|
||||||
tagsStore.removeTag(path.value)
|
tagsStore.removeTag(path.value)
|
||||||
router.push({path: 'problem-post'})}
|
router.push({path: 'problem-post'})}
|
||||||
|
|
@ -95,45 +97,52 @@ watch(()=>classInfoValue.value.id,
|
||||||
options1.value=[]
|
options1.value=[]
|
||||||
queryByPage1(newVal)
|
queryByPage1(newVal)
|
||||||
})
|
})
|
||||||
let columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
key: 'name',
|
key: 'name',
|
||||||
title: '班级名称',
|
title: '班级名称',
|
||||||
width: '260',
|
width: '500px',
|
||||||
align:"center"
|
align:"center"
|
||||||
},
|
},
|
||||||
{ type: 'selection', width: 60 },
|
{ type: 'selection', width: "200px",align:
|
||||||
|
"center" },
|
||||||
|
|
||||||
]
|
]
|
||||||
|
const save = () => {
|
||||||
|
// console.log('保存的 ID 列表:',checkedRowKeys.value);
|
||||||
|
tagsStore.removeTag(path.value)
|
||||||
|
router.push({name: 'AdminProblemPost',query:{courseId:courseId,problemId:problemId}})
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
const queryByPage = async (currentPage)=>{
|
const queryByPage = async (currentPage)=>{
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
classInfoValue.value.pageSize=paginationReactive.pageSize
|
classInfoValue.value.pageSize=paginationReactive.pageSize
|
||||||
const res = await api.findAllClassPage(
|
const res = await api.findClassByCourseId(
|
||||||
{
|
{
|
||||||
...classInfoValue.value
|
courseId:courseId
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
console.log(res.data)
|
console.log(res.data)
|
||||||
if (userStore.getRole().some((r) => r === 'admin')){
|
// if (userStore.getRole().some((r) => r === 'admin')){
|
||||||
const res1=await api.findAllShoolsInAdminusers()
|
// const res1=await api.findAllShoolsInAdminusers()
|
||||||
const list1=res1.data
|
// const list1=res1.data
|
||||||
const transformedDatas=list1.map(item => ({
|
// const transformedDatas=list1.map(item => ({
|
||||||
label: item.name,
|
// label: item.name,
|
||||||
value: item.id,
|
// value: item.id,
|
||||||
}));
|
// }));
|
||||||
transformedDatas.unshift({
|
// transformedDatas.unshift({
|
||||||
label: '全部',
|
// label: '全部',
|
||||||
value: 0,
|
// value: 0,
|
||||||
});
|
// });
|
||||||
options.value=transformedDatas;
|
// options.value=transformedDatas;
|
||||||
}
|
// }
|
||||||
const {pageNum, pageSize, total, list} = res.data
|
// const {pageNum, pageSize, total, list} = res.data
|
||||||
paginationReactive.page = pageNum
|
// paginationReactive.page = pageNum
|
||||||
paginationReactive.pageSize = pageSize
|
// paginationReactive.pageSize = pageSize
|
||||||
paginationReactive.itemCount = total
|
// paginationReactive.itemCount = total
|
||||||
classList.value=list.map((item,i)=>{return item;})
|
classList.value=res.data
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
} finally {
|
} finally {
|
||||||
|
|
@ -145,7 +154,7 @@ const search=async ()=>{
|
||||||
try {
|
try {
|
||||||
if (userStore.getRole().some((r)=>r==='admin')){
|
if (userStore.getRole().some((r)=>r==='admin')){
|
||||||
const res=await api.findAllClassPage({
|
const res=await api.findAllClassPage({
|
||||||
...classInfoValue.value
|
courseId:courseId
|
||||||
})
|
})
|
||||||
const { pageNum, pageSize, total, list } = res.data
|
const { pageNum, pageSize, total, list } = res.data
|
||||||
paginationReactive.page = pageNum
|
paginationReactive.page = pageNum
|
||||||
|
|
@ -199,6 +208,7 @@ const onChangePage = (page) => {
|
||||||
}
|
}
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
queryByPage()
|
queryByPage()
|
||||||
|
path.value=router.currentRoute.value.fullPath
|
||||||
})
|
})
|
||||||
watch(
|
watch(
|
||||||
()=>router.currentRoute.value.fullPath,
|
()=>router.currentRoute.value.fullPath,
|
||||||
|
|
@ -40,9 +40,19 @@
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<div class="mb-10 mt-4 flex items-center">
|
<div class="mb-10 mt-4 flex items-center">
|
||||||
<h3 class="text-18">评分标准</h3>
|
<h3 class="text-18">评分标准</h3>
|
||||||
<n-button type="primary" size="small" @click="onAdd" style="margin-left: 12px">添加</n-button>
|
<!-- <n-button type="primary" size="small" @click="onAdd" style="margin-left: 12px">添加</n-button>-->
|
||||||
</div>
|
</div>
|
||||||
<StandardsList />
|
<n-data-table
|
||||||
|
remote
|
||||||
|
:single-line="false"
|
||||||
|
ref="table"
|
||||||
|
:columns="columns"
|
||||||
|
:data="ScoringStandardList"
|
||||||
|
:loading="loading"
|
||||||
|
:row-key="rowKey"
|
||||||
|
:scroll-x="900"
|
||||||
|
style="width: 1180px;--n-td-padding:0px 5px;"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</n-form>
|
</n-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -51,24 +61,46 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {useRouter} from "vue-router";
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import {ref} from "vue";
|
import {ref,onMounted} from "vue";
|
||||||
import api from "@/api/admin";
|
import api from "@/api/admin";
|
||||||
import { useTagsStore } from '@/store'
|
import { useTagsStore } from '@/store'
|
||||||
import StandardsList
|
|
||||||
from '@/views/admin/problem/components/StandardList.vue'
|
|
||||||
import RichTextEditor
|
import RichTextEditor
|
||||||
from '@/components/common/RichTextEditor.vue'
|
from '@/components/common/RichTextEditor.vue'
|
||||||
const tagsStore = useTagsStore()
|
const tagsStore = useTagsStore()
|
||||||
const path=ref('')
|
const path=ref('')
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const route = useRoute()
|
||||||
|
const loading = ref(true)
|
||||||
|
const {problemId, history } = route.query
|
||||||
const rules=ref(null)
|
const rules=ref(null)
|
||||||
const problemInfoValue = ref({
|
const problemInfoValue = ref({
|
||||||
name: ''
|
title: "",
|
||||||
|
description:"",
|
||||||
|
id:problemId
|
||||||
});
|
});
|
||||||
|
const ScoringStandardList=ref([])
|
||||||
const problemInfoRef = ref(null)
|
const problemInfoRef = ref(null)
|
||||||
const descEditorHeight = ref('160px')
|
const descEditorHeight = ref('160px')
|
||||||
|
let columns = [
|
||||||
|
{
|
||||||
|
key: 'dimension',
|
||||||
|
title: '维度',
|
||||||
|
width: '50',
|
||||||
|
align:'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'weight',
|
||||||
|
title: '权重',
|
||||||
|
width: '50',
|
||||||
|
align:'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'rubrics',
|
||||||
|
title: '评分细则',
|
||||||
|
width: '300',
|
||||||
|
}
|
||||||
|
]
|
||||||
const cancel = ()=>{
|
const cancel = ()=>{
|
||||||
tagsStore.removeTag(path.value)
|
tagsStore.removeTag(path.value)
|
||||||
router.push({path: 'problem-list'})
|
router.push({path: 'problem-list'})
|
||||||
|
|
@ -77,23 +109,50 @@ const onAdd = ()=>{
|
||||||
router.push({name: 'AdminProblemScoringStandard'})
|
router.push({name: 'AdminProblemScoringStandard'})
|
||||||
}
|
}
|
||||||
const submit =async ()=>{
|
const submit =async ()=>{
|
||||||
if(problemInfoValue.value.name!==''){
|
if(problemInfoValue.value.title!==''){
|
||||||
try {
|
try {
|
||||||
await api.Addproblem({
|
await api.editProblem({
|
||||||
...problemInfoValue.value
|
...problemInfoValue.value
|
||||||
})
|
})
|
||||||
$message.success("添加课程成功")
|
$message.success("编辑作业成功")
|
||||||
tagsStore.removeTag(path.value)
|
tagsStore.removeTag(path.value)
|
||||||
await router.push({name: 'AdminProblemList'})
|
// await router.push({name: 'AdminProblemList'})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
tagsStore.removeTag(path.value)
|
tagsStore.removeTag(path.value)
|
||||||
await router.push({name: 'AdminProblemList'})
|
// await router.push({name: 'AdminProblemList'})
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
$message.error("作业名称不能为空")
|
$message.error("作业名称不能为空")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const queryByPage = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const res = await api.findProblemById({
|
||||||
|
...problemInfoValue.value
|
||||||
|
})
|
||||||
|
problemInfoValue.value=res.data
|
||||||
|
} catch (err) {
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const queryByPage2 = async (currentPage)=>{
|
||||||
|
loading.value = true;
|
||||||
|
try {
|
||||||
|
const res = await
|
||||||
|
api.findScoringStandardByProblemId({
|
||||||
|
...problemInfoValue.value
|
||||||
|
})
|
||||||
|
ScoringStandardList.value=res.data
|
||||||
|
} catch (err) {
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
path.value = router.currentRoute.value.fullPath
|
path.value = router.currentRoute.value.fullPath
|
||||||
|
queryByPage()
|
||||||
|
queryByPage2()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ const queryByPage = async (currentPage)=>{
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
console.log(res.data)
|
console.log(res.data)
|
||||||
if (userStore.getRole().some((r) => r === 'admin')){
|
// if (userStore.getRole().some((r) => r === 'admin')){
|
||||||
// const res1=await api.findAllShoolsInAdminusers()
|
// const res1=await api.findAllShoolsInAdminusers()
|
||||||
// const list1=res1.data
|
// const list1=res1.data
|
||||||
// const transformedDatas=list1.map(item => ({
|
// const transformedDatas=list1.map(item => ({
|
||||||
|
|
@ -265,7 +265,7 @@ const queryByPage = async (currentPage)=>{
|
||||||
// value: 0,
|
// value: 0,
|
||||||
// });
|
// });
|
||||||
// options.value=transformedDatas;
|
// options.value=transformedDatas;
|
||||||
}
|
// }
|
||||||
const {pageNum, pageSize, total, list} = res.data
|
const {pageNum, pageSize, total, list} = res.data
|
||||||
paginationReactive.page = pageNum
|
paginationReactive.page = pageNum
|
||||||
paginationReactive.pageSize = pageSize
|
paginationReactive.pageSize = pageSize
|
||||||
|
|
|
||||||
|
|
@ -11,65 +11,76 @@
|
||||||
label-width="100px"
|
label-width="100px"
|
||||||
:show-require-mark="false"
|
:show-require-mark="false"
|
||||||
>
|
>
|
||||||
<div class="exam-name-div">
|
|
||||||
<n-h2
|
|
||||||
class="show-problem-name">
|
|
||||||
{{ problemName }}
|
|
||||||
</n-h2>
|
|
||||||
<div class="grid md:grid-cols-2 md:gap-x-30">
|
|
||||||
<n-form-item label="发放对象:" path="class">
|
|
||||||
<n-button type="primary" size="small"
|
|
||||||
@click="onAdd"
|
|
||||||
style="margin-left: 5px">
|
|
||||||
添加对象</n-button>
|
|
||||||
</n-form-item>
|
|
||||||
|
|
||||||
</div>
|
<div class="grid md:grid-cols-2 md:gap-x-30">
|
||||||
|
<n-form-item
|
||||||
|
style='margin-left: 30px;margin-bottom: -10px'><n-h2>
|
||||||
|
{{problemInfoValue.title}}
|
||||||
|
</n-h2></n-form-item></div>
|
||||||
<div class="grid md:grid-cols-3 md:gap-x-30">
|
<div class="grid md:grid-cols-3 md:gap-x-30">
|
||||||
<n-form-item label="有效时段:"
|
<n-form-item label="有效时段:">
|
||||||
path="timeFrom">
|
|
||||||
<n-date-picker
|
<n-date-picker
|
||||||
v-model:formatted-value="problemInfoValue.timeFrom"
|
v-model:formatted-value="problemInfoValue.startTime"
|
||||||
style="width: 350px"
|
style="width: 350px"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
input-readonly
|
input-readonly
|
||||||
placeholder="请选择开始时间"
|
placeholder="请选择开始时间"
|
||||||
format="yyyy-MM-dd HH:mm"
|
format="yyyy-MM-dd HH:mm:ss"
|
||||||
update-value-on-close
|
update-value-on-close
|
||||||
:actions="['confirm']"
|
:actions="['confirm']"
|
||||||
/>
|
/>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item label="到:" path="timeTo">
|
<n-form-item label="到:">
|
||||||
<n-date-picker
|
<n-date-picker
|
||||||
v-model:formatted-value="problemInfoValue.timeTo"
|
v-model:formatted-value="problemInfoValue.endTime"
|
||||||
style="width: 300px"
|
style="width: 300px"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
input-readonly
|
input-readonly
|
||||||
placeholder="请选择结束时间"
|
placeholder="请选择结束时间"
|
||||||
format="yyyy-MM-dd HH:mm"
|
format="yyyy-MM-dd HH:mm:ss"
|
||||||
update-value-on-close
|
update-value-on-close
|
||||||
:actions="['confirm']"
|
:actions="['confirm']"
|
||||||
/>
|
/>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid md:grid-cols-4 md:gap-x-30">
|
<div style="display: flex">
|
||||||
|
<n-form-item label="发放对象:" path="class">
|
||||||
|
<n-button type="primary" size="small"
|
||||||
|
@click="onAddClass=!onAddClass"
|
||||||
|
style="margin-left: 5px">
|
||||||
|
添加对象 </n-button>
|
||||||
|
</n-form-item>
|
||||||
<n-form-item label="允许补交:"
|
<n-form-item label="允许补交:"
|
||||||
path="allow">
|
path="allow"
|
||||||
|
style='margin-left: 60px'>
|
||||||
<n-checkbox
|
<n-checkbox
|
||||||
v-model:checked="problemInfoValue.allow"
|
v-model:checked="problemInfoValue.allow"
|
||||||
@update="allow"
|
@update="allow"
|
||||||
></n-checkbox>
|
></n-checkbox>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div flex>
|
<div flex>
|
||||||
|
<n-form-item style="margin-left: 30px">
|
||||||
<n-button type="primary"
|
<n-button type="primary"
|
||||||
size="small" @click="submit" style='margin-left:
|
size="small" @click="post"
|
||||||
30px'>发布
|
>发布
|
||||||
</n-button>
|
</n-button></n-form-item>
|
||||||
|
<n-form-item style="margin-left: 10px">
|
||||||
<n-button type="primary"
|
<n-button type="primary"
|
||||||
size="small" @click="cancel" style='margin-left:
|
size="small" @click="cancel" style='margin-left:
|
||||||
20px'>取消
|
20px'>取消
|
||||||
</n-button></div>
|
</n-button></n-form-item>
|
||||||
|
</div>
|
||||||
|
<div flex>
|
||||||
|
</div>
|
||||||
|
<div class="grid md:grid-cols-2 md:gap-x-30">
|
||||||
|
<n-form-item>
|
||||||
|
<view-classes-post v-if='onAddClass'
|
||||||
|
@clickAdd="handleAdd"
|
||||||
|
></view-classes-post></n-form-item>
|
||||||
</div>
|
</div>
|
||||||
</n-form>
|
</n-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -78,52 +89,79 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {useRouter} from "vue-router";
|
import {ref, reactive, onMounted, watch} from 'vue'
|
||||||
import {ref} from "vue";
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import api from "@/api/admin";
|
import api from "@/api/admin";
|
||||||
import { useTagsStore } from '@/store'
|
import { useTagsStore } from '@/store'
|
||||||
import StandardsList
|
import ViewClassesPost
|
||||||
from '@/views/admin/problem/components/StandardList.vue'
|
from '@/views/admin/problem/components/view-classes-post.vue'
|
||||||
import RichTextEditor
|
|
||||||
from '@/components/common/RichTextEditor.vue'
|
|
||||||
const tagsStore = useTagsStore()
|
const tagsStore = useTagsStore()
|
||||||
const path=ref('')
|
const path=ref('')
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const route = useRoute()
|
||||||
|
const loading = ref(true)
|
||||||
|
const { courseId,problemId, history } = route.query
|
||||||
const problemPostRules=ref(null)
|
const problemPostRules=ref(null)
|
||||||
const problemInfoValue = ref({
|
const problemInfoValue = ref({
|
||||||
name: '',
|
title: '',
|
||||||
timeFrom: [],
|
startTime: [],
|
||||||
timeTo: [],
|
endTime: [],
|
||||||
allow:true
|
allow:false,
|
||||||
|
classList:{}
|
||||||
});
|
});
|
||||||
|
const handleAdd=(list)=>{
|
||||||
|
// console.log("选中的班级列表",list.value)
|
||||||
|
problemInfoValue.value.classList=list.value
|
||||||
|
console.log(problemInfoValue.value)
|
||||||
|
onAddClass.value=false
|
||||||
|
}
|
||||||
const problemInfoRef = ref(null)
|
const problemInfoRef = ref(null)
|
||||||
const descEditorHeight = ref('160px')
|
const descEditorHeight = ref('160px')
|
||||||
const problemName = ref('作业标题')
|
|
||||||
const cancel = ()=>{
|
const cancel = ()=>{
|
||||||
tagsStore.removeTag(path.value)
|
tagsStore.removeTag(path.value)
|
||||||
router.push({path: 'problem-list'})
|
router.push({path: 'problem-list'})
|
||||||
}
|
}
|
||||||
const onAdd = ()=>{
|
const queryByPage = async ()=>{
|
||||||
router.push({name: 'AdminProblemPostClass'})
|
loading.value = true;
|
||||||
}
|
// ProblemInfoValue.value.pageNum=currentPage
|
||||||
const submit =async ()=>{
|
// ProblemInfoValue.value.pageSize=paginationReactive.pageSize
|
||||||
if(problemInfoValue.value.name!==''){
|
|
||||||
try {
|
try {
|
||||||
await api.Addproblem({
|
const res = await
|
||||||
|
api.findProblemById(
|
||||||
|
{
|
||||||
|
id:problemId
|
||||||
|
}
|
||||||
|
);
|
||||||
|
problemInfoValue.value=res.data
|
||||||
|
} catch (err) {
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const onAddClass =ref(false)
|
||||||
|
const post =async ()=>{
|
||||||
|
if(problemInfoValue.value.startTime!==''&&problemInfoValue.value.endTime!==''){
|
||||||
|
try {
|
||||||
|
await api.postProblem({
|
||||||
...problemInfoValue.value
|
...problemInfoValue.value
|
||||||
})
|
})
|
||||||
$message.success("添加课程成功")
|
$message.success("发布作业成功")
|
||||||
tagsStore.removeTag(path.value)
|
tagsStore.removeTag(path.value)
|
||||||
await router.push({name: 'AdminProblemList'})
|
// await router.push({name:
|
||||||
|
// 'AdminProblemStore'})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
tagsStore.removeTag(path.value)
|
tagsStore.removeTag(path.value)
|
||||||
await router.push({name: 'AdminProblemList'})
|
// await router.push({name:
|
||||||
|
// 'AdminProblemStore'})
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
$message.error("作业名称不能为空")
|
$message.error("时间范围不能为空")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
path.value=router.currentRoute.value.fullPath
|
path.value=router.currentRoute.value.fullPath
|
||||||
|
queryByPage()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ const handleDescEditorFocus = once(() => {
|
||||||
})
|
})
|
||||||
const cancel = ()=>{
|
const cancel = ()=>{
|
||||||
tagsStore.removeTag(path.value)
|
tagsStore.removeTag(path.value)
|
||||||
router.push({path: 'problem-scoring-standard',query:{courseId:courseId}})
|
// router.push({path: 'problem-scoring-standard',query:{courseId:courseId}})
|
||||||
}
|
}
|
||||||
const submit =async ()=>{
|
const submit =async ()=>{
|
||||||
if(problemInfoValue.value.lowerLimit!==''&&problemInfoValue.value.upperLimit!==''&&problemInfoValue.value.description!==''){
|
if(problemInfoValue.value.lowerLimit!==''&&problemInfoValue.value.upperLimit!==''&&problemInfoValue.value.description!==''){
|
||||||
|
|
@ -93,10 +93,10 @@ const submit =async ()=>{
|
||||||
})
|
})
|
||||||
$message.success("添加评分细则成功")
|
$message.success("添加评分细则成功")
|
||||||
tagsStore.removeTag(path.value)
|
tagsStore.removeTag(path.value)
|
||||||
await router.push({name: 'AdminProblemScoringStandard',query:{courseId:courseId}})
|
// await router.push({name: 'AdminProblemScoringStandard',query:{courseId:courseId}})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
tagsStore.removeTag(path.value)
|
tagsStore.removeTag(path.value)
|
||||||
await router.push({name: 'AdminProblemScoringStandard',query:{courseId:courseId}})
|
// await router.push({name: 'AdminProblemScoringStandard',query:{courseId:courseId}})
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
$message.error("评分细则不能为空")
|
$message.error("评分细则不能为空")
|
||||||
|
|
|
||||||
|
|
@ -73,8 +73,8 @@ const problemInfoRef = ref(null)
|
||||||
const cancel = async () => {
|
const cancel = async () => {
|
||||||
await api.deleteScoringRubric({})
|
await api.deleteScoringRubric({})
|
||||||
tagsStore.removeTag(path.value)
|
tagsStore.removeTag(path.value)
|
||||||
await router.push({name:
|
// await router.push({name:
|
||||||
'AdminProblemAdd',query:{courseId:courseId}})
|
// 'AdminProblemAdd',query:{courseId:courseId}})
|
||||||
}
|
}
|
||||||
const onAdd = ()=>{
|
const onAdd = ()=>{
|
||||||
router.push({name:
|
router.push({name:
|
||||||
|
|
@ -88,15 +88,15 @@ const submit =async ()=>{
|
||||||
})
|
})
|
||||||
$message.success("添加评分标准成功")
|
$message.success("添加评分标准成功")
|
||||||
tagsStore.removeTag(path.value)
|
tagsStore.removeTag(path.value)
|
||||||
await router.push({name:
|
// await router.push({name:
|
||||||
'AdminProblemAdd', query: {
|
// 'AdminProblemAdd', query: {
|
||||||
courseId: courseId
|
// courseId: courseId
|
||||||
}})
|
// }})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
tagsStore.removeTag(path.value)
|
tagsStore.removeTag(path.value)
|
||||||
await router.push({name: 'AdminProblemAdd', query: {
|
// await router.push({name: 'AdminProblemAdd', query: {
|
||||||
courseId: courseId
|
// courseId: courseId
|
||||||
}})
|
// }})
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
$message.error("维度或权重不能为空")
|
$message.error("维度或权重不能为空")
|
||||||
|
|
|
||||||
|
|
@ -52,15 +52,10 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import {ref, reactive, onMounted, watch} from 'vue'
|
import {ref, reactive, onMounted, watch} from 'vue'
|
||||||
import api from '@/api/admin';
|
import api from '@/api/admin';
|
||||||
import ProblemActions from
|
|
||||||
'./components/ProblemActions.vue';
|
|
||||||
import {formatDateTime} from '@/utils';
|
|
||||||
import { useUserStore } from '@/store';
|
import { useUserStore } from '@/store';
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import ProblemActions2
|
import ProblemActions2
|
||||||
from '@/views/admin/problem/components/ProblemActions2.vue'
|
from '@/views/admin/problem/components/ProblemActions2.vue'
|
||||||
import problem
|
|
||||||
from '@/views/user/problem/index.vue'
|
|
||||||
const rules=ref(null)
|
const rules=ref(null)
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
@ -90,7 +85,7 @@ const ProblemInfoValue = ref({
|
||||||
title:""
|
title:""
|
||||||
});
|
});
|
||||||
const onAdd = ()=>{
|
const onAdd = ()=>{
|
||||||
router.push({name: 'AdminProblemAdd'})
|
router.push({name: 'AdminProblemAdd',query:{courseId:courseId}})
|
||||||
}
|
}
|
||||||
const queryByPage1=async (value)=>{
|
const queryByPage1=async (value)=>{
|
||||||
if (userStore.getRole().some((r) => r === 'admin')) {
|
if (userStore.getRole().some((r) => r === 'admin')) {
|
||||||
|
|
@ -200,15 +195,15 @@ const onAssistantProblem = async (problemid)=>{
|
||||||
await router.push({name: 'AdminProblemAssistant', params: {clId: id}})
|
await router.push({name: 'AdminProblemAssistant', params: {clId: id}})
|
||||||
}
|
}
|
||||||
const onEditProblem = async (problemid)=>{
|
const onEditProblem = async (problemid)=>{
|
||||||
// const {id} = problemid
|
const {id} = problemid
|
||||||
const {id} =1
|
await router.push({name: 'AdminProblemEdit',
|
||||||
await router.push({name: 'AdminProblemEdit', params: {clId: id}})
|
query: {problemId: id}})
|
||||||
}
|
}
|
||||||
const onPostProblem = async (problemid)=>{
|
const onPostProblem = async (problemid)=>{
|
||||||
// const {id} = problemid
|
const {id} = problemid
|
||||||
const {id} =1
|
|
||||||
await router.push({name: 'AdminProblemPost',
|
await router.push({name: 'AdminProblemPost',
|
||||||
params: {clId: id}})
|
query:
|
||||||
|
{courseId:courseId,problemId: id}})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSearchSchool = async (query) => {
|
const handleSearchSchool = async (query) => {
|
||||||
|
|
@ -257,7 +252,7 @@ watch(
|
||||||
()=>router.currentRoute.value.fullPath,
|
()=>router.currentRoute.value.fullPath,
|
||||||
()=>{
|
()=>{
|
||||||
if
|
if
|
||||||
(router.currentRoute.value.fullPath==='/admin/problem/problem-list') {
|
(router.currentRoute.value.fullPath==='/admin/problem/problem-store') {
|
||||||
queryByPage(paginationReactive.page)
|
queryByPage(paginationReactive.page)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -156,19 +156,6 @@ export default {
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'AdminProblemTest',
|
|
||||||
path: 'problem-test',
|
|
||||||
isHidden: true,
|
|
||||||
component: () => import('@/views/admin/problem/test.vue'),
|
|
||||||
meta: {
|
|
||||||
title: '测试页',
|
|
||||||
icon: 'ic:baseline-add',
|
|
||||||
role: ['admin', 'teacher'],
|
|
||||||
requireAuth: true,
|
|
||||||
keepAlive: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'AdminProblemStore',
|
name: 'AdminProblemStore',
|
||||||
path: 'problem-store',
|
path: 'problem-store',
|
||||||
|
|
@ -208,18 +195,6 @@ export default {
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'AdminProblemPostClass',
|
|
||||||
path: 'view-classes-post',
|
|
||||||
isHidden: true,
|
|
||||||
component: () => import('./problem/view-classes-post.vue'),
|
|
||||||
meta: {
|
|
||||||
title: '添加对象',
|
|
||||||
role: ['admin', 'teacher', 'assistant'],
|
|
||||||
requireAuth: true,
|
|
||||||
keepAlive: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,43 @@ public class ProblemController {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@PostMapping(
|
||||||
|
"/findScoringStandardByProblemId")
|
||||||
|
public RespBean findScoringStandardByProblemId(@RequestBody PMProblem pmProblem) {
|
||||||
|
List<UScoringStandard> uScoringStandardList=
|
||||||
|
problemServiceI.findScoringStandardByProblemId(pmProblem.getId());
|
||||||
|
if (uScoringStandardList != null) {
|
||||||
|
return RespBean.ok("获取评分标准列表成功!",
|
||||||
|
uScoringStandardList);
|
||||||
|
} else {
|
||||||
|
return RespBean.error("获取评分标准列表失败!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@PostMapping("/editProblem")
|
||||||
|
public RespBean editProblem(@RequestBody PMProblem pmProblem) {
|
||||||
|
Integer id= pmProblem.getId();
|
||||||
|
String title= pmProblem.getTitle();
|
||||||
|
String description= pmProblem.getDescription();
|
||||||
|
if(problemServiceI.findProblemByTitle(title,id)=="true"){
|
||||||
|
return RespBean.ok("作业名称重复");
|
||||||
|
}
|
||||||
|
boolean result =
|
||||||
|
problemServiceI.editProblem(title,
|
||||||
|
description,id);
|
||||||
|
if (result == true) {
|
||||||
|
return RespBean.ok("编辑作业成功", result);
|
||||||
|
} else {
|
||||||
|
return RespBean.error("编辑作业失败",
|
||||||
|
result);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@PostMapping("/deleteProblem")
|
||||||
|
public RespBean deleteCourse(@RequestBody PMProblem pmProblem) {
|
||||||
|
problemServiceI.deleteProblem(pmProblem.getId());
|
||||||
|
return RespBean.ok("删除成功");
|
||||||
|
}
|
||||||
@PostMapping("/deleteScoringRubric")
|
@PostMapping("/deleteScoringRubric")
|
||||||
public RespBean deleteScoringRubric(){
|
public RespBean deleteScoringRubric(){
|
||||||
problemServiceI.deleteScoringRubric();
|
problemServiceI.deleteScoringRubric();
|
||||||
|
|
@ -116,6 +153,24 @@ public class ProblemController {
|
||||||
problemServiceI.findProblemByCourseId(pmProblem);
|
problemServiceI.findProblemByCourseId(pmProblem);
|
||||||
return RespBean.ok("查询作业库成功",dataGrid);
|
return RespBean.ok("查询作业库成功",dataGrid);
|
||||||
|
|
||||||
|
}
|
||||||
|
@PostMapping("/findProblemById")
|
||||||
|
public RespBean findProblemById(@RequestBody PMProblem pmProblem){
|
||||||
|
List<Problem> problems=
|
||||||
|
problemServiceI.findProblemById(pmProblem.getId());
|
||||||
|
return RespBean.ok("查询作业标题成功",
|
||||||
|
problems.get(0));
|
||||||
|
|
||||||
|
}
|
||||||
|
@PostMapping("/postProblem")
|
||||||
|
public RespBean postProblem(@RequestBody PMPostProblem pmPostProblem){
|
||||||
|
List<Integer> classList=
|
||||||
|
pmPostProblem.getClassList();
|
||||||
|
for(Integer classId:classList){
|
||||||
|
problemServiceI.postProblem(pmPostProblem,classId);
|
||||||
|
}
|
||||||
|
return RespBean.ok("发布作业成功");
|
||||||
|
|
||||||
}
|
}
|
||||||
//获取作业列表
|
//获取作业列表
|
||||||
@GetMapping("/getExamList")
|
@GetMapping("/getExamList")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.example.aes.problem.dao;
|
||||||
|
|
||||||
|
import com.example.aes.problem.model.PMPostProblem;
|
||||||
|
import com.example.aes.problem.model.PostProblem;
|
||||||
|
import com.example.aes.user.dao.BaseDaoI;
|
||||||
|
|
||||||
|
public interface PostProblemDaoI extends BaseDaoI<PostProblem> {
|
||||||
|
public void postProblem(PMPostProblem pmPostProblem, Integer classId);
|
||||||
|
}
|
||||||
|
|
@ -8,6 +8,7 @@ import com.example.aes.problem.model.ReportSubmitted;
|
||||||
import com.example.aes.user.dao.BaseDaoI;
|
import com.example.aes.user.dao.BaseDaoI;
|
||||||
import com.example.aes.user.model.Classstudents;
|
import com.example.aes.user.model.Classstudents;
|
||||||
import com.example.aes.user.model.Course;
|
import com.example.aes.user.model.Course;
|
||||||
|
import com.example.aes.user.model.DataGrid;
|
||||||
import com.example.aes.user.model.PMCourse;
|
import com.example.aes.user.model.PMCourse;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -22,10 +23,14 @@ public interface ProblemDaoI extends BaseDaoI<Problem> {
|
||||||
List<ReportSubmitted> findPMProblemStatusesByStudentIdAndProblemsIds(List<Integer> problemIds, Integer studentId);
|
List<ReportSubmitted> findPMProblemStatusesByStudentIdAndProblemsIds(List<Integer> problemIds, Integer studentId);
|
||||||
|
|
||||||
public String findProblemByTitle(String title);
|
public String findProblemByTitle(String title);
|
||||||
|
public String findProblemByTitle(String title,Integer id);
|
||||||
public List<Problem> findProblemIdByTitle(String title);
|
public List<Problem> findProblemIdByTitle(String title);
|
||||||
public void addProblem(Problem problem);
|
public void addProblem(Problem problem);
|
||||||
public long getAllProblemsNum(int courseId);
|
public long getAllProblemsNum(int courseId);
|
||||||
List<Problem> getProblemsByPage(Integer courseId,String title,
|
List<Problem> getProblemsByPage(Integer courseId,String title,
|
||||||
int page, int rows);
|
int page, int rows);
|
||||||
|
public List<Problem> findProblemById(int id);
|
||||||
|
public boolean editProblem(String title,
|
||||||
|
String description,Integer id);
|
||||||
|
public void deleteProblem(Integer id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,4 +11,5 @@ public interface ScoringStandardDaoI extends BaseDaoI<ScoringStandard> {
|
||||||
public List<ScoringStandard> getStandardIdNoProblemId();
|
public List<ScoringStandard> getStandardIdNoProblemId();
|
||||||
public List<ScoringStandard> getStandardIdNoProblemIdDesc();
|
public List<ScoringStandard> getStandardIdNoProblemIdDesc();
|
||||||
public void updateProblemId(int problemId);
|
public void updateProblemId(int problemId);
|
||||||
|
public List<ScoringStandard> getStandardByProblemId(Integer problemId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.example.aes.problem.dao.impl;
|
||||||
|
|
||||||
|
import com.example.aes.problem.dao.PostProblemDaoI;
|
||||||
|
import com.example.aes.problem.model.PMPostProblem;
|
||||||
|
import com.example.aes.problem.model.PostProblem;
|
||||||
|
import com.example.aes.user.dao.impl.BaseDaoImpl;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository("PostProblemDao")
|
||||||
|
public class PostProblemDaoImpl extends BaseDaoImpl<PostProblem> implements PostProblemDaoI {
|
||||||
|
@Override
|
||||||
|
public void postProblem(PMPostProblem pmPostProblem, Integer classId){
|
||||||
|
PostProblem postProblem=new PostProblem();
|
||||||
|
postProblem.setProblemId(pmPostProblem.getId());
|
||||||
|
postProblem.setClassId(classId);
|
||||||
|
postProblem.setTeacherId(pmPostProblem.getAdminuserId());
|
||||||
|
postProblem.setStartTime(pmPostProblem.getStartTime());
|
||||||
|
postProblem.setEndTime(pmPostProblem.getEndTime());
|
||||||
|
if(pmPostProblem.getAllow()==true)
|
||||||
|
postProblem.setAllow(1);
|
||||||
|
else postProblem.setAllow(0);
|
||||||
|
this.save(postProblem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -6,11 +6,13 @@ import com.example.aes.problem.model.PMProblem;
|
||||||
import com.example.aes.problem.model.PMScoringRubric;
|
import com.example.aes.problem.model.PMScoringRubric;
|
||||||
import com.example.aes.problem.model.Problem;
|
import com.example.aes.problem.model.Problem;
|
||||||
import com.example.aes.problem.model.ReportSubmitted;
|
import com.example.aes.problem.model.ReportSubmitted;
|
||||||
|
import com.example.aes.problem.model.ReportSubmitted;
|
||||||
import com.example.aes.user.dao.BaseDaoI;
|
import com.example.aes.user.dao.BaseDaoI;
|
||||||
import com.example.aes.user.dao.impl.BaseDaoImpl;
|
import com.example.aes.user.dao.impl.BaseDaoImpl;
|
||||||
import com.example.aes.user.model.Classstudents;
|
import com.example.aes.user.model.Classstudents;
|
||||||
import com.example.aes.user.model.Course;
|
import com.example.aes.user.model.Course;
|
||||||
import com.example.aes.user.model.PMCourse;
|
import com.example.aes.user.model.PMCourse;
|
||||||
|
import org.hibernate.Query;
|
||||||
import com.ibm.jvm.trace.format.api.TraceContext;
|
import com.ibm.jvm.trace.format.api.TraceContext;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.dao.DataAccessException;
|
import org.springframework.dao.DataAccessException;
|
||||||
|
|
@ -21,6 +23,7 @@ import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
@ -60,7 +63,6 @@ public class ProblemDaoImpl extends BaseDaoImpl<Problem> implements ProblemDaoI{
|
||||||
|
|
||||||
return problems;
|
return problems;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
// 根据学生ID和作业ID列表查询提交报告状态
|
// 根据学生ID和作业ID列表查询提交报告状态
|
||||||
public List<ReportSubmitted> findPMProblemStatusesByStudentIdAndProblemsIds(List<Integer> problemIds, Integer studentId) {
|
public List<ReportSubmitted> findPMProblemStatusesByStudentIdAndProblemsIds(List<Integer> problemIds, Integer studentId) {
|
||||||
|
|
@ -98,6 +100,8 @@ public class ProblemDaoImpl extends BaseDaoImpl<Problem> implements ProblemDaoI{
|
||||||
return queryResults;
|
return queryResults;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String findProblemByTitle(String title){
|
public String findProblemByTitle(String title){
|
||||||
String hql =
|
String hql =
|
||||||
|
|
@ -110,6 +114,18 @@ public class ProblemDaoImpl extends BaseDaoImpl<Problem> implements ProblemDaoI{
|
||||||
return "false";
|
return "false";
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
public String findProblemByTitle(String title,Integer id){
|
||||||
|
String hql =
|
||||||
|
"from Problem where title=" +
|
||||||
|
"'" + title + "' and " +
|
||||||
|
"id!="+id;
|
||||||
|
List<Problem> problemList = this.find(hql);
|
||||||
|
if(problemList.size()>0)
|
||||||
|
return "true";
|
||||||
|
else
|
||||||
|
return "false";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
public List<Problem> findProblemIdByTitle(String title){
|
public List<Problem> findProblemIdByTitle(String title){
|
||||||
String hql =
|
String hql =
|
||||||
"from Problem where title=" +
|
"from Problem where title=" +
|
||||||
|
|
@ -128,9 +144,17 @@ public class ProblemDaoImpl extends BaseDaoImpl<Problem> implements ProblemDaoI{
|
||||||
this.find(hql,page,rows);
|
this.find(hql,page,rows);
|
||||||
return problemList;
|
return problemList;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void addScoringRubric(PMScoringRubric pmScoringRubric) {}
|
public List<Problem> findProblemById(int id){
|
||||||
|
String hql="from Problem where id="+id;
|
||||||
|
return this.find(hql);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void deleteProblem(Integer id){
|
||||||
|
String hql =
|
||||||
|
"delete from Problem where id=" + id;
|
||||||
|
this.executeHql(hql);
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public void addProblem(Problem problem) {
|
public void addProblem(Problem problem) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
@ -148,4 +172,21 @@ public class ProblemDaoImpl extends BaseDaoImpl<Problem> implements ProblemDaoI{
|
||||||
long count=this.count(hql);
|
long count=this.count(hql);
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public boolean editProblem(String title,
|
||||||
|
String description,Integer id){
|
||||||
|
StringBuilder hql = new StringBuilder();
|
||||||
|
hql.append("update Problem set " +
|
||||||
|
"title=:title," +
|
||||||
|
"description=:description where id=:id");
|
||||||
|
Query q = this.getCurrentSession().createQuery(hql.toString());
|
||||||
|
q.setParameter("title", title);
|
||||||
|
q.setParameter("description",description);
|
||||||
|
q.setParameter("id", id);
|
||||||
|
int num = q.executeUpdate();
|
||||||
|
if (num != 0)
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,13 @@ public class ScoringStandardDaoImpl extends BaseDaoImpl<ScoringStandard> impleme
|
||||||
return this.find(sql);
|
return this.find(sql);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
public List<ScoringStandard> getStandardByProblemId(Integer problemId){
|
||||||
|
String sql="from " +
|
||||||
|
"ScoringStandard where " +
|
||||||
|
"problemId="+problemId;
|
||||||
|
return this.find(sql);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
public List<ScoringStandard> getStandardIdNoProblemIdDesc(){
|
public List<ScoringStandard> getStandardIdNoProblemIdDesc(){
|
||||||
String sql="from " +
|
String sql="from " +
|
||||||
"ScoringStandard where " +
|
"ScoringStandard where " +
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.example.aes.problem.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PMPostProblem{
|
||||||
|
private int id;
|
||||||
|
private int adminuserId;
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime endTime;
|
||||||
|
private List<Integer> classList;
|
||||||
|
private Boolean allow;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.example.aes.problem.model;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.persistence.criteria.CriteriaBuilder;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "postproblem",catalog = "aes")
|
||||||
|
public class PostProblem {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "id", unique = true, nullable = false)
|
||||||
|
private Integer id;
|
||||||
|
@Column(name = "problemId")
|
||||||
|
private Integer problemId;
|
||||||
|
@Column(name = "classId")
|
||||||
|
private Integer classId;
|
||||||
|
@Column(name = "adminuserId")
|
||||||
|
private Integer teacherId;
|
||||||
|
@Column(name = "startTime")
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
@Column(name = "endTime")
|
||||||
|
private LocalDateTime endTime;
|
||||||
|
@Column(name = "allow")
|
||||||
|
private Integer allow;
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.example.aes.problem.service.Impl;
|
package com.example.aes.problem.service.Impl;
|
||||||
|
|
||||||
|
import com.example.aes.problem.dao.PostProblemDaoI;
|
||||||
import com.example.aes.problem.dao.ProblemDaoI;
|
import com.example.aes.problem.dao.ProblemDaoI;
|
||||||
import com.example.aes.problem.dao.ScoringRubricDaoI;
|
import com.example.aes.problem.dao.ScoringRubricDaoI;
|
||||||
import com.example.aes.problem.dao.ScoringStandardDaoI;
|
import com.example.aes.problem.dao.ScoringStandardDaoI;
|
||||||
|
|
@ -27,6 +28,12 @@ public class ProblemServiceImpl implements ProblemServiceI {
|
||||||
private ScoringRubricDaoI scoringRubricDao;
|
private ScoringRubricDaoI scoringRubricDao;
|
||||||
private ScoringStandardDaoI scoringStandardDao;
|
private ScoringStandardDaoI scoringStandardDao;
|
||||||
private AdminusersDaoI adminusersDao;
|
private AdminusersDaoI adminusersDao;
|
||||||
|
private PostProblemDaoI postProblemDao;
|
||||||
|
@Autowired
|
||||||
|
public void setPostProblemDao(PostProblemDaoI postProblemDao) {
|
||||||
|
this.postProblemDao = postProblemDao;
|
||||||
|
}
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public void setAdminusersDao(AdminusersDaoI adminusersDao) {
|
public void setAdminusersDao(AdminusersDaoI adminusersDao) {
|
||||||
this.adminusersDao = adminusersDao;
|
this.adminusersDao = adminusersDao;
|
||||||
|
|
@ -192,6 +199,27 @@ public class ProblemServiceImpl implements ProblemServiceI {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UScoringStandard> findScoringStandardByProblemId(Integer problemId){
|
||||||
|
List<UScoringStandard> uScoringStandardList=new ArrayList<>();
|
||||||
|
|
||||||
|
List<ScoringStandard> scoringStandardList=scoringStandardDao.getStandardByProblemId(problemId);
|
||||||
|
for(ScoringStandard scoringStandard:scoringStandardList){
|
||||||
|
List<ScoringRubric> scoringRubricList=
|
||||||
|
scoringRubricDao.getScoringRubricByStandardId(scoringStandard.getId());
|
||||||
|
UScoringStandard uScoringStandard=
|
||||||
|
new UScoringStandard();
|
||||||
|
uScoringStandard.setDimension(scoringStandard.getDimension());
|
||||||
|
uScoringStandard.setWeight(scoringStandard.getWeight());
|
||||||
|
StringBuffer strb=new StringBuffer();
|
||||||
|
for(ScoringRubric scoringRubric:scoringRubricList){
|
||||||
|
strb.append(scoringRubric.getLowerLimit()+"~"+scoringRubric.getUpperLimit()+":"+scoringRubric.getDescription().replaceAll("<\\/?.*?>", "").trim()+";");
|
||||||
|
}uScoringStandard.setRubrics(strb.toString());
|
||||||
|
uScoringStandardList.add(uScoringStandard);
|
||||||
|
}
|
||||||
|
|
||||||
|
return uScoringStandardList;
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public void updateStandardId(Integer standardId){
|
public void updateStandardId(Integer standardId){
|
||||||
scoringRubricDao.updateStandardId(standardId);
|
scoringRubricDao.updateStandardId(standardId);
|
||||||
|
|
@ -220,12 +248,22 @@ public class ProblemServiceImpl implements ProblemServiceI {
|
||||||
return problemDao.findProblemByTitle(title);
|
return problemDao.findProblemByTitle(title);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
public String findProblemByTitle(String title,Integer id){
|
||||||
|
return problemDao.findProblemByTitle(title,id);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
public List<Problem> findProblemIdByTitle(String title){
|
public List<Problem> findProblemIdByTitle(String title){
|
||||||
|
|
||||||
return problemDao.findProblemIdByTitle(title);
|
return problemDao.findProblemIdByTitle(title);
|
||||||
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
public boolean editProblem(String title,
|
||||||
|
String description,Integer id){
|
||||||
|
return problemDao.editProblem(title,
|
||||||
|
description,id);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
public DataGrid findProblemByCourseId(PMProblem pmProblem){
|
public DataGrid findProblemByCourseId(PMProblem pmProblem){
|
||||||
DataGrid dg = new DataGrid();
|
DataGrid dg = new DataGrid();
|
||||||
int totalLines;
|
int totalLines;
|
||||||
|
|
@ -255,6 +293,20 @@ public class ProblemServiceImpl implements ProblemServiceI {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
public List<Problem> findProblemById(int id){
|
||||||
|
List<Problem> problems=
|
||||||
|
problemDao.findProblemById(id);
|
||||||
|
return problems;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void postProblem(PMPostProblem pmPostProblem, Integer classId){
|
||||||
|
postProblemDao.postProblem(pmPostProblem,classId);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void deleteProblem(Integer id){
|
||||||
|
problemDao.deleteProblem(id);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
public void addProblem(Problem problem) {
|
public void addProblem(Problem problem) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
problemDao.addProblem(problem);
|
problemDao.addProblem(problem);
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.example.aes.problem.model.*;
|
||||||
import com.example.aes.problem.model.DataGrid;
|
import com.example.aes.problem.model.DataGrid;
|
||||||
import com.example.aes.user.model.*;
|
import com.example.aes.user.model.*;
|
||||||
|
|
||||||
|
import javax.persistence.criteria.CriteriaBuilder;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface ProblemServiceI {
|
public interface ProblemServiceI {
|
||||||
|
|
@ -13,16 +14,25 @@ public interface ProblemServiceI {
|
||||||
public void addScoringRubric(PMScoringRubric pmscoringRubric);
|
public void addScoringRubric(PMScoringRubric pmscoringRubric);
|
||||||
public List<UScoringRubric> findScoringRubricNoStandardId();
|
public List<UScoringRubric> findScoringRubricNoStandardId();
|
||||||
public List<UScoringStandard> findScoringStandardNoProblemId();
|
public List<UScoringStandard> findScoringStandardNoProblemId();
|
||||||
|
public List<UScoringStandard> findScoringStandardByProblemId(Integer problemId);
|
||||||
|
|
||||||
public void addScoringStandard(PMScoringStandard pmScoringStandard);
|
public void addScoringStandard(PMScoringStandard pmScoringStandard);
|
||||||
public List<ScoringStandard> findStandardIdNoProblemId();
|
public List<ScoringStandard> findStandardIdNoProblemId();
|
||||||
public void updateStandardId(Integer standardId);
|
public void updateStandardId(Integer standardId);
|
||||||
public String findProblemByTitle(String title);
|
public String findProblemByTitle(String title);
|
||||||
|
public String findProblemByTitle(String title, Integer id);
|
||||||
|
public boolean editProblem(String title,
|
||||||
|
String description,
|
||||||
|
Integer id);
|
||||||
public List<Problem> findProblemIdByTitle(String title);
|
public List<Problem> findProblemIdByTitle(String title);
|
||||||
public void addProblem(Problem problem);
|
public void addProblem(Problem problem);
|
||||||
public void updateProblemId(int problemId);
|
public void updateProblemId(int problemId);
|
||||||
public void deleteScoringRubric();
|
public void deleteScoringRubric();
|
||||||
public void deleteScoringStandard();
|
public void deleteScoringStandard();
|
||||||
public DataGrid findProblemByCourseId(PMProblem pmProblem);
|
public DataGrid findProblemByCourseId(PMProblem pmProblem);
|
||||||
|
public List<Problem> findProblemById(int id);
|
||||||
|
public void postProblem(PMPostProblem pmPostProblem, Integer classId);
|
||||||
|
public void deleteProblem(Integer id);
|
||||||
|
|
||||||
DataGrid dataGrid(List<PMProblem> pMproblems, PMProblem pMproblem);
|
DataGrid dataGrid(List<PMProblem> pMproblems, PMProblem pMproblem);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,12 @@ public class ClassesController{
|
||||||
return RespBean.ok("查询所有班级信息成功", dataGrid);
|
return RespBean.ok("查询所有班级信息成功", dataGrid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@PostMapping("findClassByCourseId")
|
||||||
|
public RespBean findClassByCourseId(@RequestBody UClass uClass){
|
||||||
|
List<Classes> classes=
|
||||||
|
classesServiceI.findClassByCourseId(uClass.getCourseId());
|
||||||
|
return RespBean.ok("查找该课程所有班级成功",classes);
|
||||||
|
}
|
||||||
@PostMapping("/deleteClass")
|
@PostMapping("/deleteClass")
|
||||||
public RespBean deleteClass(@RequestBody PMClasses pmclasses) {
|
public RespBean deleteClass(@RequestBody PMClasses pmclasses) {
|
||||||
int id = pmclasses.getId();
|
int id = pmclasses.getId();
|
||||||
|
|
|
||||||
|
|
@ -95,15 +95,13 @@ public class CourseCotroller {
|
||||||
int id = pmcourse.getId();
|
int id = pmcourse.getId();
|
||||||
Course course =
|
Course course =
|
||||||
courseServiceI.findCourseById(id);
|
courseServiceI.findCourseById(id);
|
||||||
return RespBean.ok("查询章节成功", course);
|
return RespBean.ok("查询课程成功", course);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除章节
|
// 删除章节
|
||||||
@PostMapping("/deleteCourse")
|
@PostMapping("/deleteCourse")
|
||||||
public RespBean deleteCourse(@RequestBody PMCourse pmcourse) {
|
public RespBean deleteCourse(@RequestBody PMCourse pmcourse) {
|
||||||
int id = pmcourse.getId(); // id
|
int id = pmcourse.getId(); // id
|
||||||
Course course =
|
|
||||||
courseServiceI.findCourseById(id);
|
|
||||||
courseServiceI.deleteCourse(id); // 删除
|
courseServiceI.deleteCourse(id); // 删除
|
||||||
return RespBean.ok("删除成功", id);
|
return RespBean.ok("删除成功", id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,4 +47,5 @@ public interface ClassesDaoI extends BaseDaoI<Classes> {
|
||||||
public boolean editClassMessage(int id,
|
public boolean editClassMessage(int id,
|
||||||
String className, int teacherId);
|
String className, int teacherId);
|
||||||
public List<Classstudents>findClassIdByStudentId(int studentId);//根据班级id查找学生id
|
public List<Classstudents>findClassIdByStudentId(int studentId);//根据班级id查找学生id
|
||||||
|
public List<Classes> findClassByCourseId(int courseId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -564,6 +564,12 @@ public class ClassesDaoImpl extends BaseDaoImpl<Classes> implements ClassesDaoI
|
||||||
Query q = this.getCurrentSession().createQuery(hql);
|
Query q = this.getCurrentSession().createQuery(hql);
|
||||||
return q.list();
|
return q.list();
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public List<Classes> findClassByCourseId(int courseId){
|
||||||
|
String hql = "from Classes where " +
|
||||||
|
"courseId="+courseId;
|
||||||
|
return this.find(hql);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,4 +29,5 @@ public interface ClassesServiceI {
|
||||||
public DataGrid findClassNotInCourse(int courseId, int teacherId, int pageNum, int pageSize, boolean history); // 获取未参加课程的班级
|
public DataGrid findClassNotInCourse(int courseId, int teacherId, int pageNum, int pageSize, boolean history); // 获取未参加课程的班级
|
||||||
|
|
||||||
public List<Classstudents> findClassIdByStudentId(int studentId); // 根据学生id查找班级id
|
public List<Classstudents> findClassIdByStudentId(int studentId); // 根据学生id查找班级id
|
||||||
|
public List<Classes> findClassByCourseId(int courseId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -250,6 +250,9 @@ public void setclassstudentsDao(ClassstudentsDaoI classstudentsDao) {
|
||||||
public List<Classstudents> findClassIdByStudentId(int studentId){
|
public List<Classstudents> findClassIdByStudentId(int studentId){
|
||||||
return classesDao.findClassIdByStudentId(studentId);
|
return classesDao.findClassIdByStudentId(studentId);
|
||||||
};
|
};
|
||||||
|
@Override
|
||||||
|
public List<Classes> findClassByCourseId(int courseId){
|
||||||
|
return classesDao.findClassByCourseId(courseId);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue