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/exam") public class StuExamController { /** * »ñÈ¡¿¼ÊÔÁбí * * @param limit * ÿҳÏÔʾ¼¸Ìõ * @param pageNum * Ò³Âë * @param classId * °à¼¶id * * @return percent(״̬˵Ã÷£º0,²Ý¸å¡£1,´ýÍê³É¡£2,ÒÑÍê³É¡£3,ÓâÆÚδ½») */ @GetMapping(value = "getExamLst") public Result getExamLst(Integer limit, Integer pageNum, String classId) { return new Result(true, "success", CollectionUtils.newObjectMap("examLst", CollectionUtils.newList( CollectionUtils.newObjectMap("examId", "11111", "examName", "ÐéÄâÏÖʵ¼¼ÊõÈëÃÅÌå¼ìÓëÖÆ×÷1", "percent", 0, "startTime", new Date(), "endTime", new Date(), "score", 30), CollectionUtils.newObjectMap("examId", "2222", "examName", "ÐéÄâÏÖʵ¼¼ÊõÈëÃÅÌå¼ìÓëÖÆ×÷2", "percent", 1, "startTime", new Date(), "endTime", new Date(), "score", 30), CollectionUtils.newObjectMap("examId", "3333", "examName", "ÐéÄâÏÖʵ¼¼ÊõÈëÃÅÌå¼ìÓëÖÆ×÷3", "percent", 2, "startTime", new Date(), "endTime", new Date(), "score", 30), CollectionUtils.newObjectMap("examId", "4444", "examName", "ÐéÄâÏÖʵ¼¼ÊõÈëÃÅÌå¼ìÓëÖÆ×÷4", "percent", 3, "startTime", new Date(), "endTime", new Date(), "score", 30)), "examCount", 4)); } /** * »ñÈ¡¿¼ÊÔÏêÇé * * @param examId * ¿¼ÊÔid * * * */ @GetMapping(value = "getExamDetail") public Result getExamDetail(String examId) { Map typeOne = CollectionUtils.newObjectMap("type", 1, "count", 3); Map typeTwo = CollectionUtils.newObjectMap("type", 2, "count", 3); Map typeThree = CollectionUtils.newObjectMap("type", 3, "count", 3); return new Result(true, "success", CollectionUtils.newObjectMap("examName", "ÐéÄâÏÖʵ¼¼ÊõÈëÃÅ»ù´¡¿¼ÊÔ", "subjectName", "ÎïÁ÷", "duration", 30, "maxLateMin", "", "showType", 1, "showScore", 1, "startTime", new Date(), "endTime", new Date(), "totalScore", 100, "paperType", 1, "shouScoreDays", "", "difficultLevel", 5, "passingScore", 60, "questionTypes", CollectionUtils.newList(typeOne, typeTwo, typeThree), "percent", 0, "goal", 88)); } /** * ¿ªÊ¼¿¼ÊÔ»ñÈ¡¿¼ÊÔÌâÄ¿ */ @GetMapping(value = "getExamItems") public Result getItems(String examId) { Map optionA = CollectionUtils.newObjectMap("optionId", 1111, "content", "Ìå¼ìVRÑÛ¾¦µÄ²ÎÊý¹¦ÄÜ,Ðγɱ¨¸æA", "optionOrder", "A", "imgPath", "/web/path", "check", false); Map optionB = CollectionUtils.newObjectMap("optionId", 2222, "content", "Ìå¼ìVRÑÛ¾¦µÄ²ÎÊý¹¦ÄÜ,Ðγɱ¨¸æB", "optionOrder", "B", "imgPath", "/web/path", "check", false); Map optionC = CollectionUtils.newObjectMap("optionId", 3333, "content", "Ìå¼ìVRÑÛ¾¦µÄ²ÎÊý¹¦ÄÜ,Ðγɱ¨¸æC", "optionOrder", "C", "imgPath", "/web/path", "check", false); Map optionD = CollectionUtils.newObjectMap("optionId", 4444, "content", "Ìå¼ìVRÑÛ¾¦µÄ²ÎÊý¹¦ÄÜ,Ðγɱ¨¸æD", "optionOrder", "D", "imgPath", "/web/path", "check", false); // ÅжÏÌâ Map checkoptionA = CollectionUtils.newObjectMap("optionId", 5555, "content", "Àî°×ÊÇÀî°×Ëû°Ö°ÖÉúµÄ", "optionOrder", false, "imgPath", "/web/path", "check", false); Map checkoptionB = CollectionUtils.newObjectMap("optionId", 6666, "content", "Àî°×ÊÇÀî°×ËûÂèÂèÉúµÄ", "optionOrder", true, "imgPath", "/web/path", "check", false); // ÏÔʾÌâÄ¿ Áбí; Map two = CollectionUtils.newObjectMap("socre", 5, "exerciseId", "11111", "title", "ÕâÊǶàÑ¡Ìâ", "type", 2, "options", CollectionUtils.newList(optionA, optionB, optionC, optionD), "answer", "A,B", "analisis", "ÕâÊǴ𰸽âÎö", "isRight", true); Map one = CollectionUtils.newObjectMap("socre", 6, "exerciseId", "22222", "title", "ÕâÊǵ¥Ñ¡Ìâ", "type", 1, "options", CollectionUtils.newList(optionA, optionB, optionC, optionD), "answer", "A", "analisis", "ÕâÊǴ𰸽âÎö", "isRight", true); Map three = CollectionUtils.newObjectMap("socre", 8, "exerciseId", "33333", "title", "ÕâÊÇÅжÏÌâ", "type", 3, "options", CollectionUtils.newList(checkoptionA, checkoptionB), "answer", "A", "analisis", "ÕâÊǴ𰸽âÎö", "isRight", true); // fileType1 ͼƬ£» 2 Îĵµ 3 ÊÓÆµ 4 ÒôƵ,5 ѹËõ°ü return new Result(true, "success", CollectionUtils.newList( CollectionUtils.newObjectMap("examPaperSectionId", "1111", "sectionName", "µÚÒ»²¿·Ö", "sectionDesc", "¸ù¾ÝÌâÄ¿ÐÅϢѡÔñÕýÈ·´ð°¸", "itemLst", CollectionUtils.newList(one, two)), CollectionUtils.newObjectMap("examPaperSectionId", "2222", "sectionName", "µÚ¶þ²¿·Ö", "sectionDesc", "¸ù¾ÝÌâÄ¿ÐÅϢѡÔñÕýÈ·´ð°¸", "itemLst", CollectionUtils.newList(three)))); } /** * Ìá½»ÊÔ¾í * * @param answerItem * [{"exerciseId":"11111","optionId":"4444,2222,3333"},{"exerciseId":"22222","optionId":"2222"},{"exerciseId":"33333","optionId":""}] * @param status * Ìύ״̬(1,±£´æ²Ý¸å¡£2,Ìá½»×÷Òµ¡£) */ @PostMapping(value = "saveExam") public Result saveExam(String examId, String answerItem, Integer durationTime, Integer status) { return new Result(true, "success"); } }