Browse Source

3.3.1 update

xiaofei 1 year ago
parent
commit
4bae098c1d
15 changed files with 81 additions and 54 deletions
  1. 3 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/DownloadServiceImpl.java
  2. 5 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/DownloadController.java
  3. 5 5
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamDetailController.java
  4. 2 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPrintPlanController.java
  5. 2 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskApplyController.java
  6. 4 4
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskAuditController.java
  7. 2 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskController.java
  8. 5 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskQueryController.java
  9. 4 0
      distributed-print/src/main/java/com/qmth/distributed/print/api/mark/MarkArchiveController.java
  10. 5 1
      distributed-print/src/main/java/com/qmth/distributed/print/api/mark/MarkEntranceController.java
  11. 17 4
      distributed-print/src/main/java/com/qmth/distributed/print/api/mark/MarkSettingController.java
  12. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/archivescore/ArchiveScoreQuery.java
  13. 1 1
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/document/ArchivePaperQuery.java
  14. 0 3
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkUserGroupServiceImpl.java
  15. 25 25
      teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml

+ 3 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/DownloadServiceImpl.java

@@ -69,6 +69,9 @@ public class DownloadServiceImpl implements DownloadService {
 
     @Override
     public IPage<ExamTaskDetailDto> page(Long examId, String courseCode, String paperNumber, Long orgId, String userParam, Integer pageNumber, Integer pageSize) {
+        if(examId == null){
+            throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
+        }
         Page<ExamTaskDetailDto> page = new Page<>(pageNumber, pageSize);
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(requestUser.getSchoolId(), requestUser.getId(), ServletUtil.getRequest().getServletPath());

+ 5 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/DownloadController.java

@@ -8,6 +8,7 @@ import com.qmth.distributed.print.business.templete.execute.AsyncDownloadPaperFi
 import com.qmth.teachcloud.common.bean.result.TaskListResult;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.TBTask;
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.TaskTypeEnum;
 import com.qmth.teachcloud.common.util.ResultUtil;
 import io.swagger.annotations.*;
@@ -43,14 +44,13 @@ public class DownloadController {
     @ApiOperation(value = "分页查询")
     @RequestMapping(value = "/page", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "分页查询", response = TaskListResult.class)})
-    public Object page(@ApiParam(value = "考试ID", required = true) @RequestParam() Long examId,
+    public Object page(@ApiParam(value = "考试ID") @RequestParam(required = false) Long examId,
                        @ApiParam(value = "课程开课机构ID") @RequestParam(required = false) Long orgId,
                        @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
                        @ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber,
                        @ApiParam(value = "命题老师工号/姓名") @RequestParam(required = false) String userParam,
                        @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                        @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-
         return ResultUtil.ok(downloadService.page(examId, courseCode, paperNumber, orgId, userParam, pageNumber, pageSize));
     }
 
@@ -70,6 +70,9 @@ public class DownloadController {
     @RequestMapping(value = "/download_batch", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "批量下载", response = TaskListResult.class)})
     public Object downloadBatch(@Valid @RequestBody DownloadPaperFileParam downloadPaperFileParam, BindingResult bindingResult) throws Exception {
+        if (downloadPaperFileParam.getExamId() == null) {
+            throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
+        }
         if (bindingResult.hasErrors()) {
             return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
         }

+ 5 - 5
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamDetailController.java

@@ -87,9 +87,6 @@ public class ExamDetailController {
                                        @ApiParam(value = "考试日期-终止") @RequestParam(required = false) Long endDate,
                                        @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                                        @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        if (semesterId == null) {
-            throw ExceptionResultEnum.ERROR.exception("请选择学期");
-        }
         if (examId == null) {
             throw ExceptionResultEnum.ERROR.exception("请选择考试");
         }
@@ -144,8 +141,8 @@ public class ExamDetailController {
                                         @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                                         @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
 
-        if (semesterId == null) {
-            throw ExceptionResultEnum.ERROR.exception("请选择学期");
+        if(examId == null){
+            throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
         }
         if (Objects.isNull(printPlanIdList)) {
             printPlanIdList = new ArrayList<>();
@@ -221,6 +218,9 @@ public class ExamDetailController {
                              @ApiParam(value = "卷袋号") @RequestParam(required = false) String packageCode,
                              @ApiParam(value = "考试日期-起始") @RequestParam(required = false) Long startDate,
                              @ApiParam(value = "考试日期-终止") @RequestParam(required = false) Long endDate) {
+        if(examId == null){
+            throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
+        }
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission();
         if (Objects.isNull(printPlanIdList)) {
             printPlanIdList = new ArrayList<>();

+ 2 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPrintPlanController.java

@@ -69,8 +69,8 @@ public class ExamPrintPlanController {
                                     @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                                     @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
 
-        if (semesterId == null) {
-            throw ExceptionResultEnum.ERROR.exception("请选择学期");
+        if(examId == null){
+            throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
         }
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         if (Objects.isNull(printPlanIdList)) {

+ 2 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskApplyController.java

@@ -96,8 +96,8 @@ public class ExamTaskApplyController {
                                 @RequestParam(value = "userName", required = false) String userName,
                                 @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                                 @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        if (semesterId == null) {
-            throw ExceptionResultEnum.ERROR.exception("请选择学期");
+        if (examId == null) {
+            throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
         }
         return ResultUtil.ok(examTaskService.listTaskApply(semesterId, examId, auditStatus, SystemConstant.convertIdToLong(cardRuleId), courseCode, paperNumber, startTime, endTime, userName, pageNumber, pageSize));
     }

+ 4 - 4
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskAuditController.java

@@ -107,8 +107,8 @@ public class ExamTaskAuditController {
                                           @RequestParam(value = "createName", required = false) String createName,
                                           @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                                           @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        if (semesterId == null) {
-            throw ExceptionResultEnum.ERROR.exception("请选择学期");
+        if(examId == null){
+            throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
         }
         return ResultUtil.ok(examTaskService.listTaskReviewUnaudited(semesterId, examId, courseCode, paperNumber, userId, SystemConstant.convertIdToLong(cardRuleId), startTime, endTime, startCreateTime, endCreateTime, createName, pageNumber, pageSize));
     }
@@ -145,8 +145,8 @@ public class ExamTaskAuditController {
                                         @RequestParam(value = "createName", required = false) String createName,
                                         @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                                         @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        if (semesterId == null) {
-            throw ExceptionResultEnum.ERROR.exception("请选择学期");
+        if(examId == null){
+            throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
         }
         return ResultUtil.ok(examTaskService.listTaskReviewAudited(semesterId, examId, reviewStatus, courseCode, paperNumber, userId, SystemConstant.convertIdToLong(cardRuleId), startTime, endTime, startCreateTime, endCreateTime, createName, pageNumber, pageSize));
     }

+ 2 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskController.java

@@ -95,8 +95,8 @@ public class ExamTaskController {
                        @RequestParam(required = false) String createName,
                        @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                        @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        if (semesterId == null) {
-            throw ExceptionResultEnum.ERROR.exception("请选择学期");
+        if(examId == null){
+            throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
         }
         return ResultUtil.ok(examTaskService.list(SystemConstant.convertIdToLong(semesterId), SystemConstant.convertIdToLong(examId), enable, status, SystemConstant.convertIdToLong(cardRuleId), courseCode, paperNumber, startTime, endTime, userName, createName, pageNumber, pageSize));
     }

+ 5 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskQueryController.java

@@ -79,8 +79,8 @@ public class ExamTaskQueryController {
                                 @RequestParam(value = "cardRuleId", required = false) String cardRuleId,
                                 @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                                 @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        if (semesterId == null) {
-            throw ExceptionResultEnum.ERROR.exception("请选择学期");
+        if(examId == null){
+            throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
         }
         return ResultUtil.ok(examTaskService.listTaskPaper(semesterId, examId, courseCode, paperNumber, startTime, endTime, makeMethod, SystemConstant.convertIdToLong(cardRuleId), pageNumber, pageSize));
     }
@@ -169,6 +169,9 @@ public class ExamTaskQueryController {
                                        @RequestParam(value = "makeMethod", required = false) MakeMethodEnum makeMethod,
                                        @RequestParam(value = "startTime", required = false) Long startTime,
                                        @RequestParam(value = "endTime", required = false) Long endTime) {
+        if(examId == null){
+            throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
+        }
         TBTask tbTask = examTaskService.taskDownloadPdf(semesterId, examId, courseCode, paperNumber, cardRuleId, makeMethod, startTime, endTime);
         return Objects.nonNull(tbTask) ? ResultUtil.ok(new EditResult(tbTask.getId())) : ResultUtil.error("创建任务失败");
     }

+ 4 - 0
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/MarkArchiveController.java

@@ -3,6 +3,7 @@ package com.qmth.distributed.print.api.mark;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -53,6 +54,9 @@ public class MarkArchiveController {
     @ApiOperation(value = "成绩管理列表")
     @RequestMapping(value = "score/list", method = RequestMethod.POST)
     public Result scoreList(@Validated ArchiveScoreQuery query) {
+        if(query.getExamId() == null){
+            throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
+        }
         return ResultUtil.ok(markPaperService.scoreList(query));
     }
 

+ 5 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/MarkEntranceController.java

@@ -3,6 +3,7 @@ package com.qmth.distributed.print.api.mark;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.qmth.boot.api.constant.ApiConstant;
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.mark.dto.mark.entrance.MarkEntranceDto;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.util.Result;
@@ -41,11 +42,14 @@ public class MarkEntranceController {
      */
     @ApiOperation(value = "查询")
     @RequestMapping(value = "/list", method = RequestMethod.POST)
-    public Result list(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
+    public Result list(@ApiParam(value = "考试ID") @RequestParam(required = false) Long examId,
                        @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
                        @ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber,
                        @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                        @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
+        if(examId == null){
+            throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
+        }
         IPage<MarkEntranceDto> markEntranceDtoIPage = markUserGroupService.listEntranceGroup(examId, courseCode, paperNumber, pageNumber, pageSize);
         return ResultUtil.ok(markEntranceDtoIPage);
     }

+ 17 - 4
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/MarkSettingController.java

@@ -11,6 +11,7 @@ import com.qmth.teachcloud.common.annotation.OperationLogDetail;
 import com.qmth.teachcloud.common.bean.dto.mark.MarkSettingDto;
 import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;
 import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.TaskTypeEnum;
 import com.qmth.teachcloud.common.enums.log.CustomizedOperationTypeEnum;
 import com.qmth.teachcloud.common.util.ExamTaskUtil;
@@ -67,9 +68,12 @@ public class MarkSettingController {
      */
     @ApiOperation(value = "评卷设置数据列表")
     @RequestMapping(value = "/list", method = RequestMethod.POST)
-    public Result list(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId, @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
+    public Result list(@ApiParam(value = "考试ID") @RequestParam(required = false) Long examId, @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
                        @ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber, @ApiParam(value = "提交状态") @RequestParam(required = false) Boolean groupStatus,
                        @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber, @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
+        if(examId == null){
+            throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
+        }
         IPage<MarkSettingDto> markSettingDtoIPage = markPaperService.listPaperSetting(examId, courseCode, paperNumber,
                 groupStatus, pageNumber, pageSize);
         for (MarkSettingDto record : markSettingDtoIPage.getRecords()) {
@@ -109,9 +113,12 @@ public class MarkSettingController {
      */
     @ApiOperation(value = "评卷管理数据列表")
     @RequestMapping(value = "/summary", method = RequestMethod.POST)
-    public Result summary(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId, @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
+    public Result summary(@ApiParam(value = "考试ID") @RequestParam(required = false) Long examId, @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
                           @ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber, @ApiParam(value = "完成进度") @RequestParam(required = false) Boolean progressStatus,
                           @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber, @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
+        if(examId == null){
+            throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
+        }
         IPage<MarkManageDto> markManageDtoIPage = markTaskService.listPaperManage(examId, courseCode, paperNumber,
                 progressStatus, pageNumber, pageSize);
         return ResultUtil.ok(markManageDtoIPage);
@@ -122,8 +129,11 @@ public class MarkSettingController {
      */
     @ApiOperation(value = "导出评卷员工作量")
     @RequestMapping(value = "/export_marker", method = RequestMethod.POST)
-    public void exportMarker(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId, @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
+    public void exportMarker(@ApiParam(value = "考试ID") @RequestParam(required = false) Long examId, @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
                              @ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber, HttpServletResponse response) {
+        if(examId == null){
+            throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
+        }
         markTaskService.exportMarker(examId, courseCode, paperNumber, response);
     }
 
@@ -132,9 +142,12 @@ public class MarkSettingController {
      */
     @ApiOperation(value = "成绩检查数据列表")
     @RequestMapping(value = "/scoreList", method = RequestMethod.POST)
-    public Result scoreList(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId, @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
+    public Result scoreList(@ApiParam(value = "考试ID") @RequestParam(required = false) Long examId, @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
                             @ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber, @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                             @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
+        if(examId == null){
+            throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
+        }
         IPage<CheckScoreListDto> scoreListDtoIPage = markPaperService.listStudentScoreList(examId, courseCode,
                 paperNumber, pageNumber, pageSize);
         return ResultUtil.ok(scoreListDtoIPage);

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/archivescore/ArchiveScoreQuery.java

@@ -5,7 +5,7 @@ import javax.validation.constraints.NotNull;
 import com.qmth.teachcloud.mark.utils.PagerQuery;
 
 public class ArchiveScoreQuery extends PagerQuery {
-	@NotNull(message = "考试Id不能为空")
+	@NotNull(message = "请选择考试")
 	private Long examId;
 	
 	private String courseCode;

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/bean/document/ArchivePaperQuery.java

@@ -5,7 +5,7 @@ import javax.validation.constraints.NotNull;
 import com.qmth.teachcloud.mark.utils.PagerQuery;
 
 public class ArchivePaperQuery extends PagerQuery {
-	@NotNull(message = "考试Id不能为空")
+	@NotNull(message = "请选择考试")
 	private Long examId;
 	
 	private String courseCode;

+ 0 - 3
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkUserGroupServiceImpl.java

@@ -69,9 +69,6 @@ public class MarkUserGroupServiceImpl extends ServiceImpl<MarkUserGroupMapper, M
 
     @Override
     public IPage<MarkEntranceDto> listEntranceGroup(Long examId, String courseCode, String paperNumber, Integer pageNumber, Integer pageSize) {
-        if (Objects.isNull(examId)) {
-            throw ExceptionResultEnum.EXAM_ID_IS_NULL.exception();
-        }
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         Page<MarkUserGroup> page = new Page<>(pageNumber, pageSize);
         IPage<MarkEntranceDto> markEntranceDtoIPage = this.baseMapper.listEntranceGroup(page, examId, courseCode, paperNumber, sysUser.getId(), MarkPaperStatus.FORMAL.name());

+ 25 - 25
teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml

@@ -416,14 +416,14 @@
                        else 0 end)                                                                      actualCount,
                sum(case when s.is_absent = 1 or s.omr_absent = 1 then 1 else 0 end)                     absentCount,
                sum(case when s.is_breach = 1 then 1 else 0 end)                                         breachCount,
-               avg(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) avgScore,
-               max(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) maxScore,
-               min(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) minScore,
+               avg(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) avgScore,
+               max(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) maxScore,
+               min(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) minScore,
                sum(case
-                       when s.objective_score + s.subjective_score >= t.total_score * t.pass_score / 100 then 1
+                       when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.pass_score / 100 then 1
                        else 0 end)                                                                      passCount,
                sum(case
-                       when s.objective_score + s.subjective_score >= t.total_score * t.excellent_score / 100 then 1
+                       when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.excellent_score / 100 then 1
                        else 0 end)                                                                      excellentCount
         FROM mark_student s
                  left join mark_paper t on s.exam_id = t.exam_id
@@ -445,14 +445,14 @@
         SELECT s.college,
                count(*)                                                                                 studentCount,
                sum(case when s.is_absent = 1 then 1 else 0 end)                                         absentCount,
-               avg(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) avgScore,
-               max(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) maxScore,
-               min(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) minScore,
+               avg(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) avgScore,
+               max(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) maxScore,
+               min(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) minScore,
                sum(case
-                       when s.objective_score + s.subjective_score >= t.total_score * t.pass_score / 100 then 1
+                       when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.pass_score / 100 then 1
                        else 0 end)                                                                      passCount,
                sum(case
-                       when s.objective_score + s.subjective_score >= t.total_score * t.excellent_score / 100 then 1
+                       when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.excellent_score / 100 then 1
                        else 0 end)                                                                      excellentCount
         FROM mark_student s
                  left join mark_paper t on s.exam_id = t.exam_id
@@ -468,14 +468,14 @@
         SELECT s.class_name,
                count(*)                                                                                 studentCount,
                sum(case when s.is_absent = 1 then 1 else 0 end)                                         absentCount,
-               avg(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) avgScore,
-               max(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) maxScore,
-               min(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) minScore,
+               avg(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) avgScore,
+               max(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) maxScore,
+               min(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) minScore,
                sum(case
-                       when s.objective_score + s.subjective_score >= t.total_score * t.pass_score / 100 then 1
+                       when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.pass_score / 100 then 1
                        else 0 end)                                                                      passCount,
                sum(case
-                       when s.objective_score + s.subjective_score >= t.total_score * t.excellent_score / 100 then 1
+                       when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.excellent_score / 100 then 1
                        else 0 end)                                                                      excellentCount
         FROM mark_student s
                  left join mark_paper t on s.exam_id = t.exam_id
@@ -491,14 +491,14 @@
         SELECT s.teacher,
                count(*)                                                                                 studentCount,
                sum(case when s.is_absent = 1 then 1 else 0 end)                                         absentCount,
-               avg(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) avgScore,
-               max(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) maxScore,
-               min(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) minScore,
+               avg(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) avgScore,
+               max(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) maxScore,
+               min(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) minScore,
                sum(case
-                       when s.objective_score + s.subjective_score >= t.total_score * t.pass_score / 100 then 1
+                       when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.pass_score / 100 then 1
                        else 0 end)                                                                      passCount,
                sum(case
-                       when s.objective_score + s.subjective_score >= t.total_score * t.excellent_score / 100 then 1
+                       when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.excellent_score / 100 then 1
                        else 0 end)                                                                      excellentCount
         FROM mark_student s
                  left join mark_paper t on s.exam_id = t.exam_id
@@ -559,14 +559,14 @@
                s.class_name,
                count(*)                                                                                 studentCount,
                sum(case when s.is_absent = 1 then 1 else 0 end)                                         absentCount,
-               avg(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) avgScore,
-               max(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) maxScore,
-               min(case when s.is_absent !=1 then s.objective_score + s.subjective_score else null end) minScore,
+               avg(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) avgScore,
+               max(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) maxScore,
+               min(case when s.is_absent !=1 then ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) else null end) minScore,
                sum(case
-                       when s.objective_score + s.subjective_score >= t.total_score * t.pass_score / 100 then 1
+                       when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.pass_score / 100 then 1
                        else 0 end)                                                                      passCount,
                sum(case
-                       when s.objective_score + s.subjective_score >= t.total_score * t.excellent_score / 100 then 1
+                       when ifnull(s.objective_score,0) + ifnull(s.subjective_score,0) >= t.total_score * t.excellent_score / 100 then 1
                        else 0 end)                                                                      excellentCount
         FROM mark_student s
                  left join mark_paper t on s.exam_id = t.exam_id