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 exerciseOne = CollectionUtils.newObjectMap("exerciseInfoId", "1111", "name", "ÐéÄâÏÖʵ¼¼ÊõÈëÃÅÌå¼ìÓëÖÆ×÷", "type", 0, "percent", 0, "score", 30, "startTime", new Date(), "endTime", new Date(), "reform", 1); Map exerciseTwo = CollectionUtils.newObjectMap("exerciseInfoId", "2222", "exerciseName", "ÐéÄâ»õ±ÒµÄǰÊÀ½ñÉú1", "type", 1, "percent", 1, "reform", 0, "score", 30, "startTime", new Date(), "endTime", new Date()); Map exerciseThree = CollectionUtils.newObjectMap("exerciseInfoId", "3333", "exerciseName", "ÐéÄâ»õ±ÒµÄǰÊÀ½ñÉú2", "type", 2, "percent", 2, "reform", 1, "score", 30, "startTime", new Date(), "endTime", new Date()); Map 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 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("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 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", true); // ÅжÏÌâ 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", false); Map 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))); } }