派生自 projectDept/qhighschool

EricsHu
2023-06-06 f6c19ce9e8ec6ccbcc9f6eaa3d168b27bba214eb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
package com.qxueyou.scc.stucontroller;
 
import java.util.Date;
import java.util.Map;
 
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import com.qxueyou.scc.base.model.Result;
import com.qxueyou.scc.base.util.CollectionUtils;
 
/**
 * 学习端 作业前端控制器
 * 
 * @author chenjunliang
 *
 */
@RestController
@RequestMapping(value = "/stu/exercise")
public class StuExerciseController {
    /**
     * 学习端获取作业列表
     * 
     * @param classId
     *            班级id
     * @return type (状态说明: 0,试题。 1,上传。2,写作) percent(状态说明:0,草稿。1,待完成。2,已完成。3,逾期未交)
     *         reform(0,重做,1,不重做)
     * @param limit
     *            每页显示几条
     * @param pageNum
     *            页码
     * 
     */
    @GetMapping(value = "getExerciseInfoLst")
    public Result getExerciseLst(String classId, Integer limit, Integer pageNum) {
        Map<String, Object> exerciseOne = CollectionUtils.newObjectMap("exerciseInfoId", "1111", "name",
                "虚拟现实技术入门体检与制作", "type", 0, "percent", 0, "score", 30, "startTime", new Date(), "endTime", new Date(),
                "reform", 1);
        Map<String, Object> exerciseTwo = CollectionUtils.newObjectMap("exerciseInfoId", "2222", "exerciseName",
                "虚拟货币的前世今生1", "type", 1, "percent", 1, "reform", 0, "score", 30, "startTime", new Date(), "endTime",
                new Date());
        Map<String, Object> exerciseThree = CollectionUtils.newObjectMap("exerciseInfoId", "3333", "exerciseName",
                "虚拟货币的前世今生2", "type", 2, "percent", 2, "reform", 1, "score", 30, "startTime", new Date(), "endTime",
                new Date());
        Map<String, Object> exerciseFour = CollectionUtils.newObjectMap("exerciseInfoId", "4444", "exerciseName",
                "虚拟货币的前世今生3", "type", 2, "percent", 3, "reform", 1, "score", 30, "startTime", new Date(), "endTime",
                new Date());
        return new Result(true, "success",
                CollectionUtils.newObjectMap("exerciseInfoLst",
                        CollectionUtils.newList(exerciseOne, exerciseTwo, exerciseThree, exerciseFour),
                        "exerciseInfoCount", 4));
    }
 
    /**
     * 学习端 提交作业
     * 
     * @param exerciseInfoId
     *            作业id
     * @param urlPath
     *            上传文件路径(多个以逗号隔开)
     * @param desc
     *            作业描述
     * @param status
     *            提交状态(1,保存草稿。2,提交作业。)
     * @param answerItem
     *            [{"exerciseId":"11111","optionId":"4444,2222,3333"},{"exerciseId":"22222","optionId":"2222"},{"exerciseId":"33333","optionId":""}]
     */
    @PostMapping(value = "saveExerciseInfo")
    public Result saveExerciseInfo(String exerciseInfoId, String urlPath, String desc, Integer status, String answerItem) {
        return new Result(true, "success");
    }
 
    /**
     * 学习端 查看作业
     * 
     * @param exerciseInfoId
     *            作业id
     * @return percent (状态说明:0,草稿.1,待完成。2,已完成。) type (状态说明: 0,试卷。 1,上传。2,写作) 做作业
     * 
     * @param exerciseInfoId
     *            作业id
     * @param 分数说明
     *            totalScore 总分, passing 合格分,goal 得分 (没有数值即为null)commentContent 为评语
     */
    @GetMapping(value = "getHomeworkDetail")
    public Result getHomewordDetail(String exerciseInfoId) {
        Map<String, Object> typeOne = CollectionUtils.newObjectMap("type", 1, "count", 3);
        Map<String, Object> typeTwo = CollectionUtils.newObjectMap("type", 2, "count", 3);
        Map<String, Object> typeThree = CollectionUtils.newObjectMap("type", 3, "count", 3);
        return new Result(true, "success",
                CollectionUtils.newObjectMap("subjectName", "物流", "requireDesc", "请自行完成作答,勿翻看书本。", "startTime",
                        new Date(), "endTime", new Date(), "totalScore", 100, "passingScore", 60, "questionTypes",
                        CollectionUtils.newList(typeOne, typeTwo, typeThree), "exerciseName", "虚拟现实技术入门体验与制作",
                        "percent", 0, "type", 0, "itemCount", 3, "teacherName", "李老师", "goal", 97, "commentContent",
                        "老师说,你真有才"));
    }
 
    /**
     * 作业获取题目列表
     * 
     * @param exerciseInfoId
     *            作业id
     * @param type
     *            type (状态说明: 0,试卷。 1,上传。2,写作) 做作业
     */
    @GetMapping(value = "getItemLst")
    public Result getItemLst(String exerciseInfoId, Integer type) {
        // 判断type 如果为写作和上传类型的话 itemList 就为null; 如果为试卷类型 title 和 score filetype 为 null
        // optionList选择题
        Map<String, Object> optionA = CollectionUtils.newObjectMap("optionId", "1111", "content", "体检VR眼睛的参数功能,形成报告A",
                "optionOrder", "A", "imgPath", "/web/path", "check", false);
        Map<String, Object> optionB = CollectionUtils.newObjectMap("optionId", "2222", "content", "体检VR眼睛的参数功能,形成报告B",
                "optionOrder", "B", "imgPath", "/web/path", "check", false);
        Map<String, Object> optionC = CollectionUtils.newObjectMap("optionId", "3333", "content", "体检VR眼睛的参数功能,形成报告C",
                "optionOrder", "C", "imgPath", "/web/path", "check", false);
        Map<String, Object> optionD = CollectionUtils.newObjectMap("optionId", "4444", "content", "体检VR眼睛的参数功能,形成报告D",
                "optionOrder", "D", "imgPath", "/web/path", "check", true);
        // 判断题
        Map<String, Object> checkoptionA = CollectionUtils.newObjectMap("optionId", "5555", "content", "李白是李白他爸爸生的",
                "optionOrder", false, "imgPath", "/web/path", "check", false);
        Map<String, Object> checkoptionB = CollectionUtils.newObjectMap("optionId", "6666", "content", "李白是李白他妈妈生的",
                "optionOrder", true, "imgPath", "/web/path", "check", false);
 
        // 显示题目 列表;
        Map<String, Object> two = CollectionUtils.newObjectMap("socre", 5, "exerciseId", "11111", "title", "这是多选题",
                "type", 2, "options", CollectionUtils.newList(optionA, optionB, optionC, optionD), "answer", "A,B",
                "analisis", "这是答案解析", "isRight", true);
        Map<String, Object> one = CollectionUtils.newObjectMap("socre", 6, "exerciseId", "22222", "title", "这是单选题",
                "type", 1, "options", CollectionUtils.newList(optionA, optionB, optionC, optionD), "answer", "A",
                "analisis", "这是答案解析", "isRight", false);
 
        Map<String, Object> three = CollectionUtils.newObjectMap("socre", 8, "exerciseId", "33333", "title", "这是判断题",
                "type", 3, "options", CollectionUtils.newList(checkoptionA, checkoptionB), "answer", true, "analisis",
                "这是答案解析", "isRight", true);
        // fileType1 图片; 2 文档 3 视频 4 音频,5 压缩包
 
        return new Result(true, "success",
                CollectionUtils.newObjectMap("itemDetail",
                        CollectionUtils.newObjectMap("title", "拍摄一个关于VR的科普视频", "desc", "学生之前写的内容", "fileLst",
                                CollectionUtils.newList(
                                        CollectionUtils.newObjectMap("fileName", "文件1", "fileId", "1111", "coverUrl",
                                                "static/img/img.jpg"),
                                        CollectionUtils.newObjectMap("fileName", "文件2", "fileId", "2222", "coverUrl",
                                                "static/img/img.jpg")),
                                "filetype", 3),
                        "itemList", CollectionUtils.newList(one, two, three)));
    }
 
}