探果题库

main
tamguo 7 years ago
parent 17faaf8054
commit 27db8e217e

@ -0,0 +1,14 @@
package com.tamguo.dao;
import java.util.List;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.tamguo.config.dao.SuperMapper;
import com.tamguo.model.QuestionEntity;
public interface QuestionMapper extends SuperMapper<QuestionEntity>{
List<QuestionEntity> findPage(String chapterId, Pagination page);
}

@ -19,7 +19,7 @@ public class CourseEntity extends SuperEntity<CourseEntity> implements Serializa
private String name;
private BigInteger subjectId;
private String subjectId;
private BigInteger pointNum;
@ -50,11 +50,11 @@ public class CourseEntity extends SuperEntity<CourseEntity> implements Serializa
this.name = name;
}
public BigInteger getSubjectId() {
public String getSubjectId() {
return this.subjectId;
}
public void setSubjectId(BigInteger subjectId) {
public void setSubjectId(String subjectId) {
this.subjectId = subjectId;
}

@ -0,0 +1,172 @@
package com.tamguo.model;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.tamguo.config.dao.SuperEntity;
/**
* The persistent class for the tiku_question database table.
*
*/
@TableName(value="tiku_question")
public class QuestionEntity extends SuperEntity<QuestionEntity> implements Serializable {
private static final long serialVersionUID = 1L;
private String analysis;
private String paperId;
private String answer;
private String chapterId;
private String questionType;
private String content;
private String subjectId;
private String courseId;
private String reviewPoint;
private String year;
private Integer score;
private String auditStatus;
@TableField(exist=false)
private String courseName;
@TableField(exist=false)
private String chapterName;
@TableField(exist=false)
private String subjectName;
public QuestionEntity() {
}
public String getAnalysis() {
return this.analysis;
}
public void setAnalysis(String analysis) {
this.analysis = analysis;
}
public String getAnswer() {
return this.answer;
}
public void setAnswer(String answer) {
this.answer = answer;
}
public String getChapterId() {
return this.chapterId;
}
public void setChapterId(String chapterId) {
this.chapterId = chapterId;
}
public String getQuestionType() {
return this.questionType;
}
public void setQuestionType(String questionType) {
this.questionType = questionType;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getReviewPoint() {
return reviewPoint;
}
public void setReviewPoint(String reviewPoint) {
this.reviewPoint = reviewPoint;
}
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year;
}
public Integer getScore() {
return score;
}
public void setScore(Integer score) {
this.score = score;
}
public String getPaperId() {
return paperId;
}
public void setPaperId(String paperId) {
this.paperId = paperId;
}
public String getCourseId() {
return courseId;
}
public void setCourseId(String courseId) {
this.courseId = courseId;
}
public String getCourseName() {
return courseName;
}
public void setCourseName(String courseName) {
this.courseName = courseName;
}
public String getChapterName() {
return chapterName;
}
public void setChapterName(String chapterName) {
this.chapterName = chapterName;
}
public String getSubjectId() {
return subjectId;
}
public void setSubjectId(String subjectId) {
this.subjectId = subjectId;
}
public String getSubjectName() {
return subjectName;
}
public void setSubjectName(String subjectName) {
this.subjectName = subjectName;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
}

@ -0,0 +1,9 @@
package com.tamguo.service;
import com.baomidou.mybatisplus.plugins.Page;
import com.tamguo.model.QuestionEntity;
public interface IQuestionService {
Page<QuestionEntity> findPage(String chapterId , Page<QuestionEntity> page);
}

@ -0,0 +1,22 @@
package com.tamguo.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.plugins.Page;
import com.tamguo.dao.QuestionMapper;
import com.tamguo.model.QuestionEntity;
import com.tamguo.service.IQuestionService;
@Service
public class QuestionService implements IQuestionService{
@Autowired
QuestionMapper questionMapper;
@Override
public Page<QuestionEntity> findPage(String chapterId, Page<QuestionEntity> page) {
return page.setRecords(questionMapper.findPage(chapterId , page));
}
}

@ -1,14 +1,41 @@
package com.tamguo.web;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.baomidou.mybatisplus.plugins.Page;
import com.tamguo.model.QuestionEntity;
import com.tamguo.service.IQuestionService;
import com.tamguo.util.Result;
@Controller
public class QuestionController {
@RequestMapping(path= {"question","/"})
public String index() {
@Autowired
IQuestionService iQuestionService;
@RequestMapping(path= {"question/{subjectId}/{chapterId}-{current}-{size}"})
public String index(@PathVariable String subjectId , @PathVariable String chapterId ,
@PathVariable String current ,@PathVariable String size ,
ModelAndView model) {
model.addObject("chapterId", chapterId);
model.addObject("current" , current);
model.addObject("size", size);
return "question";
}
@RequestMapping(path= {"question/{subjectId}/{chapterId}-{current}-{size}"} , method=RequestMethod.POST)
@ResponseBody
public Result getQuestion(@PathVariable String chapterId ,
@PathVariable Integer current ,@PathVariable Integer size ,
ModelAndView model) {
Page<QuestionEntity> page = new Page<QuestionEntity>(current, size);
return Result.successResult(iQuestionService.findPage(chapterId, page));
}
}

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tamguo.dao.QuestionMapper">
<select id="findPage" resultType="QuestionEntity">
SELECT
q.uid,
q.analysis,
q.answer,
q.chapter_id,
q.content,
q.question_type,
q.course_id,
q.review_point,
q.year,
q.score,
q.subject_id,
q.audit_status
FROM
tiku_question q
WHERE
q.chapter_id = #{chapterId}
Order By q.uid desc
</select>
</mapper>

@ -3,16 +3,25 @@ var vm = new Vue({
data : {
courseList:[],
chapterList:[],
secondLevelChapterList:[],
thirdLevelChapterList:[],
docked: false,
open: true,
position: 'left',
panel: ''
panel: '',
index:1,
secondLevelName:null,
thirdLevelName:null,
mainHttp:mainHttp
},
methods:{
findCourseList(subjectId){
axios({method: 'post',url: mainHttp + 'chapter/findCourseList.html?subjectId='+subjectId}).then(function(response){
if(response.data.code == 0){
vm.courseList = response.data.result;
for(var i=0 ; i<vm.courseList.length ; i++){
vm.courseList[i].url = mainHttp + "chapter/" + vm.courseList[i].subjectId+"/"+vm.courseList[i].uid+".html";
}
}
});
},
@ -22,6 +31,20 @@ var vm = new Vue({
vm.chapterList = response.data.result;
}
});
},
toSecondLevelChapterList(chapter){
vm.index = 2;
vm.secondLevelChapterList = chapter.childChapterList;
vm.secondLevelName = chapter.name
},
toThirdLevelChapterList(chapter){
vm.index = 3;
vm.thirdLevelChapterList = chapter.childChapterList;
vm.thirdLevelName = chapter.name;
for(var i=0 ; i<vm.thirdLevelChapterList.length ; i++){
vm.thirdLevelChapterList[i].url = mainHttp + 'question/'+subjectId+'/'+vm.thirdLevelChapterList[i].uid+'-1-1.html';
}
}
}
});

@ -0,0 +1,54 @@
var vm = new Vue({
el:'#app',
data : {
docked: false,
open: false,
position: 'left',
panel: '',
total:0,
question:{},
topUrl:"",
nextUrl:null,
warnOpen:false,
warnMessage:'',
courseList:[]
},
methods:{
findCourseList(subjectId){
axios({method: 'post',url: mainHttp + 'chapter/findCourseList.html?subjectId='+subjectId}).then(function(response){
if(response.data.code == 0){
vm.courseList = response.data.result;
for(var i=0 ; i<vm.courseList.length ; i++){
vm.courseList[i].url = mainHttp + "chapter/" + vm.courseList[i].subjectId+"/"+vm.courseList[i].uid+".html";
}
}
});
},
getQuestion(chapterId , current , size){
axios({method: 'post',url: mainHttp + 'question/'+subjectId+'/'+chapterId+'-'+current+'-'+size+'.html'}).then(function(response){
if(response.data.code == 0){
if(response.data.result.records.length > 0){
vm.question = response.data.result.records[0];
}
vm.total = response.data.result.total;
// 处理上一页下一页
var previous = parseInt(current)-1;
var next = parseInt(current)+1;
if(previous <= 0){
previous = 1;
}
if(next >= vm.total){
next = vm.total;
}
vm.topUrl = mainHttp + 'question/'+subjectId+'/'+chapterId+'-'+previous+'-'+size+'.html';
vm.nextUrl = mainHttp + 'question/'+subjectId+'/'+chapterId+'-'+next+'-'+size+'.html';
}
});
}
}
});
vm.findCourseList(subjectId);
vm.getQuestion(chapterId , current , size);

@ -9,10 +9,20 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/muse-ui@3.0.0-rc.5/dist/muse-ui.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic">
<link rel="stylesheet" href="https://cdn.bootcss.com/material-design-icons/3.0.1/iconfont/material-icons.css">
<style type="text/css">
.mu-appbar-header {
position: fixed;
left: 0;
right: 0;
top: 0;
z-index: 101;
overflow: hidden
}
</style>
</head>
<body>
<div id="app">
<mu-appbar style="width: 100%;" color="primary">
<mu-appbar style="width: 100%;" color="primary" class="mu-appbar-header">
<mu-button icon slot="left" @click="open = true">
<mu-icon value="menu"></mu-icon>
</mu-button>
@ -23,39 +33,60 @@
</mu-appbar>
<mu-container style="margin-top:80px;">
<mu-container>
<mu-container>
<mu-breadcrumbs divider="—">
<mu-icon value="chevron_right" slot="divider"></mu-icon>
<mu-breadcrumbs-item :disabled="true">当前位置</mu-breadcrumbs-item>
<mu-breadcrumbs-item :disabled="true">理科数学</mu-breadcrumbs-item>
<mu-breadcrumbs divider="—" v-show="index == 1">
<mu-breadcrumbs-item>理科数学</mu-breadcrumbs-item>
</mu-breadcrumbs>
<mu-breadcrumbs divider="—" v-show="index == 2">
<mu-breadcrumbs-item>理科数学</mu-breadcrumbs-item>
<mu-breadcrumbs-item>{{secondLevelName}}</mu-breadcrumbs-item>
</mu-breadcrumbs>
<mu-breadcrumbs divider="—" v-show="index == 3">
<mu-breadcrumbs-item>理科数学</mu-breadcrumbs-item>
<mu-breadcrumbs-item>{{secondLevelName}}</mu-breadcrumbs-item>
<mu-breadcrumbs-item>{{thirdLevelName}}</mu-breadcrumbs-item>
</mu-breadcrumbs>
</mu-container>
<mu-list textline="three-line">
<div v-for="chapter in chapterList">
<mu-sub-header>{{chapter.name}}</mu-sub-header>
<mu-divider></mu-divider>
<mu-list-item avatar :ripple="true" button href="question" v-for="cha in chapter.childChapterList">
<mu-list-item-content>
{{cha.name}}</mu-list-item-title>
<mu-list-item-sub-title>
{{cha.name}}
</mu-list-item-sub-title>
</mu-list-item-content>
<mu-list v-show="index == 1">
<mu-list-item button :ripple="true" v-for="chapter in chapterList" @click="toSecondLevelChapterList(chapter)">
<mu-list-item-title>{{chapter.name}}</mu-list-item-title>
<mu-list-item-action>
<mu-badge content="12" circle color="secondary">
<mu-button icon>
<mu-icon value="help"></mu-icon>
</mu-button>
</mu-badge>
<mu-icon value="keyboard_arrow_right"></mu-icon>
</mu-list-item-action>
</mu-list-item>
</mu-list>
<mu-list v-show="index == 2">
<mu-list-item button :ripple="true" v-for="chapter in secondLevelChapterList" @click="toThirdLevelChapterList(chapter)">
<mu-list-item-title>{{chapter.name}}</mu-list-item-title>
<mu-list-item-action>
<mu-icon value="keyboard_arrow_right"></mu-icon>
</mu-list-item-action>
</mu-list-item>
</mu-list>
<mu-list v-show="index == 3">
<mu-list-item button :href="chapter.url" @click="toQuestion(chapter)" :ripple="true" v-for="chapter in thirdLevelChapterList" >
<mu-list-item-title>{{chapter.name}} 题目数:{{chapter.questionNum}}</mu-list-item-title>
<mu-list-item-action>
<mu-icon value="keyboard_arrow_right"></mu-icon>
</mu-list-item-action>
</mu-list-item>
</div>
</mu-list>
<mu-drawer :open.sync="open" :docked="docked" :right="position === 'right'">
<mu-list>
<mu-list-item button v-for="course in courseList" @click="open = false">
<mu-list-item :href="mainHttp" button>
<mu-list-item-title>首页</mu-list-item-title>
</mu-list-item>
<mu-list-item button v-for="course in courseList" :href="course.url" @click="open = false">
<mu-list-item-title>{{course.name}}</mu-list-item-title>
</mu-list-item>

@ -43,37 +43,33 @@
<mu-container>
<mu-card style="width: 100%;margin-top: 80px;margin-bottom:80px;" raised="true">
<mu-card-text>
<mu-card-text v-html="question.content">
<p> <span> 如图圆O </span> <span class="ext_valign_sub"> 1 </span> <span> 与圆O </span> <span class="ext_valign_sub"> 2 </span> <span> 内切于点A其半径分别为r </span> <span class="ext_valign_sub"> 1 </span> <span> 与r </span> <span class="ext_valign_sub"> 2 </span> <span> (r </span> <span class="ext_valign_sub"> 1 </span> <span> &gt;r </span> <span class="ext_valign_sub"> 2 </span> <span> ).圆O </span> <span class="ext_valign_sub"> 1 </span> <span> 的弦AB交圆O </span> <span class="ext_valign_sub"> 2 </span> <span> 于点C(O </span> <span class="ext_valign_sub"> 1 </span> <span> 不在AB上)。 </span> </p>
<p> <img src="http://www.tamguo.com//files/20180706/FP161217.jpg" width="189px" height="171px" class="scale-img"> </p>
<p class="ext_text-align_left"> 求证ABAC为定值。 </p>
</mu-card-text>
<mu-card-title sub-title="答案"></mu-card-title>
<mu-card-text>
<mu-card-text v-html="question.answer">
<span> B </span>
</mu-card-text>
<mu-card-title sub-title="解析"></mu-card-title>
<mu-card-text>
<mu-card-text v-html="question.analysis">
<p> 苯巴比妥属于巴比妥类镇静催眠药;佐匹克隆属于环吡咯酮类镇静催眠药;阿普唑仑属于苯二氮䓬类镇静催眠药,同类药物还有地西泮等,苯妥英钠属于乙内酰脲类抗癫痫药。 </p>
</mu-card-text>
</mu-card>
<mu-drawer :open.sync="open" :docked="docked" :right="position === 'right'">
<mu-list>
<mu-list-item button>
<mu-list-item-title>理科数学</mu-list-item-title>
</mu-list-item>
<mu-list-item button>
<mu-list-item-title>文科数学</mu-list-item-title>
</mu-list-item>
<mu-list-item button>
<mu-list-item-title>物理</mu-list-item-title>
<mu-list-item :href="mainHttp" button>
<mu-list-item-title>首页</mu-list-item-title>
</mu-list-item>
<mu-list-item button>
<mu-list-item-title>英语</mu-list-item-title>
<mu-list-item button v-for="course in courseList" :href="course.url" @click="open = false">
<mu-list-item-title>{{course.name}}</mu-list-item-title>
</mu-list-item>
<mu-list-item @click="open = false" button>
<mu-list-item-title>关闭</mu-list-item-title>
</mu-list-item>
@ -82,18 +78,22 @@
<mu-container>
<mu-bottom-nav class="mu-appbar-footer">
<mu-bottom-nav-item title="上一题" icon="keyboard_arrow_left"></mu-bottom-nav-item>
<mu-bottom-nav-item title="此章节共10题"></mu-bottom-nav-item>
<mu-bottom-nav-item title="下一题" icon="keyboard_arrow_right"></mu-bottom-nav-item>
<mu-bottom-nav-item title="上一题" icon="keyboard_arrow_left" :href="topUrl"></mu-bottom-nav-item>
<mu-bottom-nav-item :title="current+'/'+total+'题'"></mu-bottom-nav-item>
<mu-bottom-nav-item title="下一题" icon="keyboard_arrow_right" :href="nextUrl" :disabled="true"></mu-bottom-nav-item>
</mu-bottom-nav>
</div>
</body>
<!-- 引入 Vue -->
<script type="text/javascript" th:inline="javascript">
var mainHttp = [[${setting.domain}]];
var subjectId = [[${subjectId}]];
var chapterId = [[${chapterId}]];
var current = [[${current}]];
var size = [[${size}]];
</script>
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16"></script>
<script src="https://cdn.jsdelivr.net/npm/muse-ui@3.0.0-rc.5/dist/muse-ui.min.js"></script>
<script type="text/javascript">
new Vue({data:{docked: false,
open: false,
position: 'left',panel: ''}}).$mount('#app')
</script>
<script src="https://cdn.jsdelivr.net/npm/axios@0.18.0/dist/axios.min.js"></script>
<script th:src="${setting.domain + 'js/question/main.js'}"></script>
</html>
Loading…
Cancel
Save