-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
86 changed files
with
1,898 additions
and
5,463 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
code/GDES/GDES-SERVICE/src/main/java/com/gdes/GDES/service/HistorytestpaperService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.gdes.GDES.service; | ||
|
||
import com.gdes.GDES.model.Historytestpaper; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* 历史试题 | ||
* Created by Allen on 2018/5/19. | ||
*/ | ||
public interface HistorytestpaperService { | ||
/** | ||
* 根据学生主键查询历史列表 | ||
* @param idS | ||
* @return | ||
*/ | ||
public List<Historytestpaper> queryByStudentid(String idS); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
*/ | ||
|
||
public interface KnowledgepointService { | ||
//TODO:知识点添加修改删除 | ||
//知识点添加修改删除 | ||
|
||
/** | ||
* 查询所有知识点 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
code/GDES/GDES-SERVICE/src/main/java/com/gdes/GDES/service/QuestionsoptionService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.gdes.GDES.service; | ||
|
||
|
||
import com.gdes.GDES.model.Questionsoption; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* 试题选项--针对选择题 | ||
* Created by Allen on 2018/5/16. | ||
*/ | ||
|
||
public interface QuestionsoptionService { | ||
/** | ||
* 根据试题编号查询试题选项 | ||
* @param idQ | ||
* @return | ||
* @throws Exception | ||
*/ | ||
public List<Questionsoption> queryByidQ(String idQ)throws Exception; | ||
} |
29 changes: 29 additions & 0 deletions
29
...ES/GDES-SERVICE/src/main/java/com/gdes/GDES/service/impl/HistorytestpaperServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.gdes.GDES.service.impl; | ||
|
||
import com.gdes.GDES.dao.HistorytestpaperMapper; | ||
import com.gdes.GDES.model.Historytestpaper; | ||
import com.gdes.GDES.model.HistorytestpaperExample; | ||
import com.gdes.GDES.service.HistorytestpaperService; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import javax.annotation.Resource; | ||
import java.util.List; | ||
|
||
/** | ||
* 历史试卷 | ||
* Created by Allen on 2018/5/19. | ||
*/ | ||
@Repository | ||
public class HistorytestpaperServiceImpl implements HistorytestpaperService { | ||
@Resource | ||
private HistorytestpaperMapper htpm; | ||
|
||
public List<Historytestpaper> queryByStudentid(String idS) { | ||
HistorytestpaperExample htpe=new HistorytestpaperExample(); | ||
HistorytestpaperExample.Criteria criteria=htpe.createCriteria(); | ||
|
||
criteria.andIdSEqualTo(idS); | ||
|
||
return htpm.selectByExample(htpe); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...DES/GDES-SERVICE/src/main/java/com/gdes/GDES/service/impl/QuestionsoptionServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.gdes.GDES.service.impl; | ||
|
||
|
||
import com.gdes.GDES.dao.QuestionsoptionMapper; | ||
import com.gdes.GDES.model.Questionsoption; | ||
import com.gdes.GDES.model.QuestionsoptionExample; | ||
import com.gdes.GDES.model.Questionspoint; | ||
import com.gdes.GDES.service.QuestionsoptionService; | ||
import com.gdes.GDES.service.QuestionspointService; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import javax.annotation.Resource; | ||
import java.util.List; | ||
|
||
/** | ||
* 试题类型 | ||
* Created by Allen on 2018/5/16. | ||
*/ | ||
@Repository | ||
public class QuestionsoptionServiceImpl implements QuestionsoptionService{ | ||
|
||
@Resource | ||
private QuestionsoptionMapper qpm; | ||
|
||
public List<Questionsoption> queryByidQ(String idQ) throws Exception { | ||
QuestionsoptionExample qoe=new QuestionsoptionExample(); | ||
QuestionsoptionExample.Criteria criteria=qoe.createCriteria(); | ||
criteria.andIdQEqualTo(idQ); | ||
|
||
return qpm.selectByExample(qoe); | ||
} | ||
} |
73 changes: 73 additions & 0 deletions
73
code/GDES/GDES-WEB/src/main/java/com/gdes/GDES/controller/StudentController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package com.gdes.GDES.controller; | ||
|
||
import com.gdes.GDES.model.Historytestpaper; | ||
import com.gdes.GDES.model.Questions; | ||
import com.gdes.GDES.service.HistorytestpaperService; | ||
import com.gdes.GDES.service.QuestionsService; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.ui.Model; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestMethod; | ||
import org.springframework.web.bind.annotation.ResponseBody; | ||
|
||
import javax.annotation.Resource; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Random; | ||
|
||
/** | ||
* 学生控制器 | ||
* Created by Allen on 2018/5/19. | ||
*/ | ||
@Controller | ||
@RequestMapping("/student/") | ||
public class StudentController { | ||
@Resource | ||
private HistorytestpaperService htps; | ||
|
||
@Resource | ||
private QuestionsService qs; | ||
|
||
//学生发送做题请求 | ||
//练习测评,从题库中选取未做过的试题进行计算,时间不写入 | ||
//TODO:考虑选择知识点进行测评 | ||
@RequestMapping(value = "examlianxi") | ||
private String examlianxi(String idS, Model model)throws Exception{ | ||
//TODO:练习测评出题算法 | ||
List<Questions> qlist=qs.queryAllQusetion(); | ||
List<Questions> reslist=new ArrayList<>(); | ||
List<Historytestpaper> htplist=htps.queryByStudentid(idS); | ||
for(Historytestpaper htp:htplist){ | ||
for(Questions q:qlist){ | ||
if(!htp.getIdQ().equals(q.getIdQ())){ | ||
//未做过的试题 | ||
reslist.add(q); | ||
} | ||
} | ||
} | ||
//从reslist当中随机选择5道 | ||
if(reslist.size()<5){ | ||
reslist.addAll(qlist.subList(0,5)); | ||
} | ||
List<Questions> res=new ArrayList<>(); | ||
for(int i=0;i<5;i++){ | ||
int rand= (int)(Math.random()*reslist.size()); | ||
res.add(reslist.get(rand)); | ||
reslist.remove(rand); | ||
} | ||
|
||
model.addAttribute("examlist",res); | ||
|
||
|
||
return "/student/addtest"; | ||
} | ||
|
||
//正式测评,从题库中随机选取试题进行计算,计入时间 | ||
//随机:获取题目长度,然后抽取5道试题 | ||
@RequestMapping("examzhengshi") | ||
private String examzhengshi(String idS,Model model){ | ||
|
||
|
||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.