Merge pull request #60 from mindskip/alvis

成绩管理
This commit is contained in:
alvis 2021-02-03 09:32:11 +08:00 committed by GitHub
commit 7fe265c45d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 307 additions and 2 deletions

View File

@ -0,0 +1,5 @@
import { post } from '@/utils/request'
export default {
page: query => post('/api/admin/examPaperAnswer/page', query)
}

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1569065326528" class="icon" viewBox="0 0 1152 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3178" xmlns:xlink="http://www.w3.org/1999/xlink" width="225" height="200"><defs><style type="text/css"></style></defs><path d="M1023.584 0 128.416 0C57.472 0 0 57.504 0 128.416L0 767.584C0 838.496 57.472 896 128.416 896L192 896 192 985.856C192 1007.904 210.08 1024 230.112 1024 235.552 1024 241.12 1022.816 246.528 1020.256L480.544 908.48C497.76 900.256 516.608 896 535.68 896L1023.584 896C1094.496 896 1152 838.496 1152 767.584L1152 128.416C1152 57.504 1094.496 0 1023.584 0ZM319.9936 352C319.9936 334.32689 334.221792 320 352.021504 320L799.965696 320C817.654208 320 831.9936 334.203674 831.9936 352 831.9936 369.67311 817.765408 384 799.965696 384L352.021504 384C334.332992 384 319.9936 369.796326 319.9936 352ZM319.9936 544C319.9936 526.32689 334.221792 512 352.021504 512L799.965696 512C817.654208 512 831.9936 526.203674 831.9936 544 831.9936 561.67311 817.765408 576 799.965696 576L352.021504 576C334.332992 576 319.9936 561.796326 319.9936 544Z" p-id="3179"></path></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -187,6 +187,24 @@ const constantRoutes = [
}
]
},
{
path: '/answer',
component: Layout,
name: 'AnswerPage',
meta: {
title: '成绩管理',
icon: 'answer'
},
alwaysShow: true,
children: [
{
path: 'list',
component: () => import('@/views/answer/list'),
name: 'AnswerPageList',
meta: { title: '答卷列表', noCache: true }
}
]
},
{
path: '/message',
component: Layout,

View File

@ -0,0 +1,83 @@
<template>
<div class="app-container">
<el-form :model="queryParam" ref="queryForm" :inline="true">
<el-form-item label="学科:" >
<el-select v-model="queryParam.subjectId" clearable>
<el-option v-for="item in subjects" :key="item.id" :value="item.id" :label="item.name"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm">查询</el-button>
</el-form-item>
</el-form>
<el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%">
<el-table-column prop="id" label="Id" width="100" />
<el-table-column prop="paperName" label="试卷名称"/>
<el-table-column prop="userName" label="用户名称"/>
<el-table-column label="得分" width="100px" >
<template slot-scope="{row}">
{{row.userScore}} / {{row.paperScore}}
</template>
</el-table-column>
<el-table-column label="题目对错" width="80px" >
<template slot-scope="{row}">
{{row.questionCorrect}} / {{row.questionCount}}
</template>
</el-table-column>
<el-table-column prop="doTime" label="耗时" width="100px"/>
<el-table-column prop="createTime" label="提交时间" width="160px"/>
</el-table>
<pagination v-show="total>0" :total="total" :page.sync="queryParam.pageIndex" :limit.sync="queryParam.pageSize"
@pagination="search"/>
</div>
</template>
<script>
import { mapGetters, mapState, mapActions } from 'vuex'
import Pagination from '@/components/Pagination'
import examPaperAnswerApi from '@/api/examPaperAnwser'
export default {
components: { Pagination },
data () {
return {
queryParam: {
subjectId: null,
pageIndex: 1,
pageSize: 10
},
listLoading: false,
tableData: [],
total: 0
}
},
created () {
this.initSubject()
this.search()
},
methods: {
search () {
this.listLoading = true
examPaperAnswerApi.page(this.queryParam).then(data => {
const re = data.response
this.tableData = re.list
this.total = re.total
this.queryParam.pageIndex = re.pageNum
this.listLoading = false
})
},
submitForm () {
this.queryParam.pageIndex = 1
this.search()
},
...mapActions('exam', { initSubject: 'initSubject' })
},
computed: {
...mapGetters('enumItem', ['enumFormat']),
...mapGetters('exam', ['subjectEnumFormat']),
...mapState('exam', { subjects: state => state.subjects })
}
}
</script>

View File

@ -0,0 +1,54 @@
package com.mindskip.xzs.controller.admin;
import com.mindskip.xzs.base.BaseApiController;
import com.mindskip.xzs.base.RestResponse;
import com.mindskip.xzs.domain.ExamPaperAnswer;
import com.mindskip.xzs.domain.Subject;
import com.mindskip.xzs.domain.User;
import com.mindskip.xzs.service.*;
import com.mindskip.xzs.utility.DateTimeUtil;
import com.mindskip.xzs.utility.ExamUtil;
import com.mindskip.xzs.utility.PageInfoHelper;
import com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageResponseVM;
import com.mindskip.xzs.viewmodel.admin.paper.ExamPaperAnswerPageRequestVM;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController("AdminExamPaperAnswerController")
@RequestMapping(value = "/api/admin/examPaperAnswer")
public class ExamPaperAnswerController extends BaseApiController {
private final ExamPaperAnswerService examPaperAnswerService;
private final SubjectService subjectService;
private final UserService userService;
@Autowired
public ExamPaperAnswerController(ExamPaperAnswerService examPaperAnswerService, SubjectService subjectService, UserService userService) {
this.examPaperAnswerService = examPaperAnswerService;
this.subjectService = subjectService;
this.userService = userService;
}
@RequestMapping(value = "/page", method = RequestMethod.POST)
public RestResponse<PageInfo<ExamPaperAnswerPageResponseVM>> pageJudgeList(@RequestBody ExamPaperAnswerPageRequestVM model) {
PageInfo<ExamPaperAnswer> pageInfo = examPaperAnswerService.adminPage(model);
PageInfo<ExamPaperAnswerPageResponseVM> page = PageInfoHelper.copyMap(pageInfo, e -> {
ExamPaperAnswerPageResponseVM vm = modelMapper.map(e, ExamPaperAnswerPageResponseVM.class);
Subject subject = subjectService.selectById(vm.getSubjectId());
vm.setDoTime(ExamUtil.secondToVM(e.getDoTime()));
vm.setSystemScore(ExamUtil.scoreToVM(e.getSystemScore()));
vm.setUserScore(ExamUtil.scoreToVM(e.getUserScore()));
vm.setPaperScore(ExamUtil.scoreToVM(e.getPaperScore()));
vm.setSubjectName(subject.getName());
vm.setCreateTime(DateTimeUtil.dateFormat(e.getCreateTime()));
User user = userService.selectById(e.getCreateUser());
vm.setUserName(user.getUserName());
return vm;
});
return RestResponse.ok(page);
}
}

View File

@ -31,4 +31,5 @@ public interface ExamPaperAnswerMapper extends BaseMapper<ExamPaperAnswer> {
ExamPaperAnswer getByPidUid(@Param("pid") Integer paperId, @Param("uid") Integer uid);
List<ExamPaperAnswer> adminPage(com.mindskip.xzs.viewmodel.admin.paper.ExamPaperAnswerPageRequestVM requestVM);
}

View File

@ -48,4 +48,6 @@ public interface ExamPaperAnswerService extends BaseService<ExamPaperAnswer> {
Integer selectAllCount();
List<Integer> selectMothCount();
PageInfo<ExamPaperAnswer> adminPage(com.mindskip.xzs.viewmodel.admin.paper.ExamPaperAnswerPageRequestVM requestVM);
}

View File

@ -268,4 +268,11 @@ public class ExamPaperAnswerServiceImpl extends BaseServiceImpl<ExamPaperAnswer>
}
return examPaperAnswer;
}
@Override
public PageInfo<ExamPaperAnswer> adminPage(com.mindskip.xzs.viewmodel.admin.paper.ExamPaperAnswerPageRequestVM requestVM) {
return PageHelper.startPage(requestVM.getPageIndex(), requestVM.getPageSize(), "id desc").doSelectPageInfo(() ->
examPaperAnswerMapper.adminPage(requestVM));
}
}

View File

@ -0,0 +1,94 @@
package com.mindskip.xzs.viewmodel.admin.paper;
public class ExamAnswerResponseVM {
private Integer id;
private String name;
private Integer questionCount;
private Integer score;
private String createTime;
private Integer createUser;
private Integer subjectId;
private Integer paperType;
private Integer frameTextContentId;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getQuestionCount() {
return questionCount;
}
public void setQuestionCount(Integer questionCount) {
this.questionCount = questionCount;
}
public Integer getScore() {
return score;
}
public void setScore(Integer score) {
this.score = score;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public Integer getCreateUser() {
return createUser;
}
public void setCreateUser(Integer createUser) {
this.createUser = createUser;
}
public Integer getSubjectId() {
return subjectId;
}
public void setSubjectId(Integer subjectId) {
this.subjectId = subjectId;
}
public Integer getPaperType() {
return paperType;
}
public void setPaperType(Integer paperType) {
this.paperType = paperType;
}
public Integer getFrameTextContentId() {
return frameTextContentId;
}
public void setFrameTextContentId(Integer frameTextContentId) {
this.frameTextContentId = frameTextContentId;
}
}

View File

@ -0,0 +1,15 @@
package com.mindskip.xzs.viewmodel.admin.paper;
import com.mindskip.xzs.base.BasePage;
public class ExamPaperAnswerPageRequestVM extends BasePage {
private Integer subjectId;
public Integer getSubjectId() {
return subjectId;
}
public void setSubjectId(Integer subjectId) {
this.subjectId = subjectId;
}
}

View File

@ -28,6 +28,8 @@ public class ExamPaperAnswerPageResponseVM {
private String paperName;
private String userName;
public Integer getId() {
return id;
}
@ -131,4 +133,13 @@ public class ExamPaperAnswerPageResponseVM {
public void setPaperName(String paperName) {
this.paperName = paperName;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
}

View File

@ -251,4 +251,16 @@
limit 1
</select>
<select id="adminPage" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.paper.ExamPaperAnswerPageRequestVM">
SELECT
<include refid="Base_Column_List"/>
FROM t_exam_paper_answer
<where>
<if test="subjectId != null">
and subject_id = #{subjectId}
</if>
</where>
</select>
</mapper>

View File

@ -13,4 +13,4 @@
hm.src = 'https://hm.baidu.com/hm.js?cd8218cd51f800ed2b73e5751cb3f4f9'
var s = document.getElementsByTagName('script')[0]
s.parentNode.insertBefore(hm, s)
})()</script><link href="static/css/chunk-066bbd34.c306629d.css" rel="prefetch"><link href="static/css/chunk-111f3671.d650a2aa.css" rel="prefetch"><link href="static/css/chunk-157f9069.c306629d.css" rel="prefetch"><link href="static/css/chunk-2e16d177.89936c18.css" rel="prefetch"><link href="static/css/chunk-360c43ba.c306629d.css" rel="prefetch"><link href="static/css/chunk-3f483335.7fbe318e.css" rel="prefetch"><link href="static/css/chunk-42236473.c306629d.css" rel="prefetch"><link href="static/css/chunk-5bc3d75d.c306629d.css" rel="prefetch"><link href="static/css/chunk-65f8ca6f.c306629d.css" rel="prefetch"><link href="static/css/chunk-7c62808c.c306629d.css" rel="prefetch"><link href="static/css/chunk-873a42e2.1951fa25.css" rel="prefetch"><link href="static/css/chunk-a85d3c1e.c8588555.css" rel="prefetch"><link href="static/css/chunk-a9d03770.c306629d.css" rel="prefetch"><link href="static/css/chunk-bab2e2c4.c306629d.css" rel="prefetch"><link href="static/js/chunk-066bbd34.03ed6de3.js" rel="prefetch"><link href="static/js/chunk-111f3671.7754c916.js" rel="prefetch"><link href="static/js/chunk-157f9069.1d42f391.js" rel="prefetch"><link href="static/js/chunk-16f9edc1.9837f037.js" rel="prefetch"><link href="static/js/chunk-2d0c138b.b2c3b9ee.js" rel="prefetch"><link href="static/js/chunk-2d221bd2.c5c84d2c.js" rel="prefetch"><link href="static/js/chunk-2d2300ef.54e785b8.js" rel="prefetch"><link href="static/js/chunk-2d230fe7.3bd3f709.js" rel="prefetch"><link href="static/js/chunk-2e16d177.9260cb17.js" rel="prefetch"><link href="static/js/chunk-360c43ba.4ddda9e0.js" rel="prefetch"><link href="static/js/chunk-3f483335.8e5f48c2.js" rel="prefetch"><link href="static/js/chunk-42236473.c16f55dd.js" rel="prefetch"><link href="static/js/chunk-5bc3d75d.75653935.js" rel="prefetch"><link href="static/js/chunk-65f8ca6f.994f0890.js" rel="prefetch"><link href="static/js/chunk-733c35b2.3b3a554e.js" rel="prefetch"><link href="static/js/chunk-75f11c77.8356b661.js" rel="prefetch"><link href="static/js/chunk-78234ca2.9331a306.js" rel="prefetch"><link href="static/js/chunk-793f0082.3de9a403.js" rel="prefetch"><link href="static/js/chunk-7c62808c.6c074e60.js" rel="prefetch"><link href="static/js/chunk-873a42e2.e15b262c.js" rel="prefetch"><link href="static/js/chunk-a85d3c1e.c337e6c3.js" rel="prefetch"><link href="static/js/chunk-a9d03770.1b93bda8.js" rel="prefetch"><link href="static/js/chunk-bab2e2c4.9c58688c.js" rel="prefetch"><link href="static/js/chunk-d0753fda.d9accd34.js" rel="prefetch"><link href="static/css/chunk-vendors.ee57d822.css" rel="preload" as="style"><link href="static/css/index.9dc49bd0.css" rel="preload" as="style"><link href="static/js/chunk-vendors.d6404b06.js" rel="preload" as="script"><link href="static/js/index.81fff637.js" rel="preload" as="script"><link href="static/css/chunk-vendors.ee57d822.css" rel="stylesheet"><link href="static/css/index.9dc49bd0.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but vue-demo doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="static/js/chunk-vendors.d6404b06.js"></script><script src="static/js/index.81fff637.js"></script></body></html>
})()</script><link href="static/css/chunk-066bbd34.c306629d.css" rel="prefetch"><link href="static/css/chunk-111f3671.d650a2aa.css" rel="prefetch"><link href="static/css/chunk-157f9069.c306629d.css" rel="prefetch"><link href="static/css/chunk-19291efa.c306629d.css" rel="prefetch"><link href="static/css/chunk-2e16d177.89936c18.css" rel="prefetch"><link href="static/css/chunk-360c43ba.c306629d.css" rel="prefetch"><link href="static/css/chunk-3f483335.7fbe318e.css" rel="prefetch"><link href="static/css/chunk-42236473.c306629d.css" rel="prefetch"><link href="static/css/chunk-5bc3d75d.c306629d.css" rel="prefetch"><link href="static/css/chunk-65f8ca6f.c306629d.css" rel="prefetch"><link href="static/css/chunk-7c62808c.c306629d.css" rel="prefetch"><link href="static/css/chunk-873a42e2.1951fa25.css" rel="prefetch"><link href="static/css/chunk-a85d3c1e.c8588555.css" rel="prefetch"><link href="static/css/chunk-a9d03770.c306629d.css" rel="prefetch"><link href="static/css/chunk-bab2e2c4.c306629d.css" rel="prefetch"><link href="static/js/chunk-066bbd34.03ed6de3.js" rel="prefetch"><link href="static/js/chunk-111f3671.7754c916.js" rel="prefetch"><link href="static/js/chunk-157f9069.1d42f391.js" rel="prefetch"><link href="static/js/chunk-16f9edc1.9837f037.js" rel="prefetch"><link href="static/js/chunk-19291efa.c885cf14.js" rel="prefetch"><link href="static/js/chunk-2d0c138b.b2c3b9ee.js" rel="prefetch"><link href="static/js/chunk-2d221bd2.c5c84d2c.js" rel="prefetch"><link href="static/js/chunk-2d2300ef.54e785b8.js" rel="prefetch"><link href="static/js/chunk-2d230fe7.3bd3f709.js" rel="prefetch"><link href="static/js/chunk-2e16d177.9260cb17.js" rel="prefetch"><link href="static/js/chunk-360c43ba.4ddda9e0.js" rel="prefetch"><link href="static/js/chunk-3f483335.8e5f48c2.js" rel="prefetch"><link href="static/js/chunk-42236473.c16f55dd.js" rel="prefetch"><link href="static/js/chunk-5bc3d75d.75653935.js" rel="prefetch"><link href="static/js/chunk-65f8ca6f.994f0890.js" rel="prefetch"><link href="static/js/chunk-733c35b2.3b3a554e.js" rel="prefetch"><link href="static/js/chunk-75f11c77.8356b661.js" rel="prefetch"><link href="static/js/chunk-78234ca2.9331a306.js" rel="prefetch"><link href="static/js/chunk-793f0082.3de9a403.js" rel="prefetch"><link href="static/js/chunk-7c62808c.6c074e60.js" rel="prefetch"><link href="static/js/chunk-873a42e2.e15b262c.js" rel="prefetch"><link href="static/js/chunk-a85d3c1e.c337e6c3.js" rel="prefetch"><link href="static/js/chunk-a9d03770.1b93bda8.js" rel="prefetch"><link href="static/js/chunk-bab2e2c4.9c58688c.js" rel="prefetch"><link href="static/js/chunk-d0753fda.d9accd34.js" rel="prefetch"><link href="static/css/chunk-vendors.ee57d822.css" rel="preload" as="style"><link href="static/css/index.9dc49bd0.css" rel="preload" as="style"><link href="static/js/chunk-vendors.d6404b06.js" rel="preload" as="script"><link href="static/js/index.8bbb1f58.js" rel="preload" as="script"><link href="static/css/chunk-vendors.ee57d822.css" rel="stylesheet"><link href="static/css/index.9dc49bd0.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but vue-demo doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="static/js/chunk-vendors.d6404b06.js"></script><script src="static/js/index.8bbb1f58.js"></script></body></html>

View File

@ -0,0 +1 @@
.pagination-container[data-v-90fd946a]{background:#fff}.pagination-container.hidden[data-v-90fd946a]{display:none}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long