护理考试
by 兵兵 王
HTML
<script src="http://libs.baidu.com/jquery/1.10.2/jquery.js"></script>
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.3.0.js"></script>
<div id="select">
<ul>
</ul>
</div>
<div id="questions">
<div></div>
</div>
<span id="retestBtn">重新测试</span>
<span id="showAnswerBtn">显示答案</span>
CSS
/* * * html5doctor.com Reset Stylesheet v1.6.1 (http://html5doctor.com/html-5-reset-stylesheet/) * Richard Clark (http://richclarkdesign.com) * http://cssreset.com */
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
body {
line-height: 1;
}
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display: block;
}
nav ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after, q:before, q:after {
content: '';
content: none;
}
a {
margin: 0;
padding: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
/* change colours to suit your needs */
ins {
background-color: #ff9;
color: #000;
text-decoration: none;
}
/* change colours to suit your needs */
mark {
background-color: #ff9;
color: #000;
font-style: italic;
font-weight: bold;
}
del {
text-decoration: line-through;
}
abbr[title], dfn[title] {
border-bottom: 1px dotted;
cursor: help;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/* change border colour to suit your needs */
hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #cccccc;
margin: 1em 0;
padding: 0;
}
input, select {
vertical-align: middle;
}
* {
font-family: 微软雅黑;
}
ul, ol, li {
list-style: none;
}
html, body {
height: 100%;
}
#select {
width: 20%;
float: left;
padding-bottom: 140px;
overflow-y: scroll;
height: calc(100% - 140px);
}
#questions {
width: 80%;
float: left;
height: 100%;
overflow-y:...
JavaScript
(function() {
/*
,{
title:'',
singleChoiceQ: [],
multipleChoiceQ: []
}
*/
/*
var a = '';
a = a.replace(/(/g,'(').replace(/)/g,')').replace(/﹙/g,'(').replace(/﹚/g,')')
var b = a.split(/\d{1,}\s{0,}、\s{0,}/);
b.shift();
var returnArr=[];
_.each(b,function(txt){
txt = txt.replace(/(\(\s*[A-Za-z]{1,}\s*\))/,'()');
var answer = RegExp.$1.replace(/\(|\)/g,'').trim();
var indexA,indexB,indexC,indexD,indexE;
indexA = txt.search(/(\s{1,}A\s{0,}\.{0,})/);
txt = txt.replace(/(\s{1,}A\s{0,}\.{0,})/,'');
indexB = txt.search(/(\s{1,}B\s{0,}\.{0,})/);
txt = txt.replace(/(\s{1,}B\s{0,}\.{0,})/,'');
indexC = txt.search(/(\s{1,}C\s{0,}\.{0,})/);
txt = txt.replace(/(\s{1,}C\s{0,}\.{0,})/,'');
indexD = txt.search(/(\s{1,}D\s{0,}\.{0,})/);
txt = txt.replace(/(\s{1,}D\s{0,}\.{0,})/,'');
indexE = txt.search(/(\s{1,}E\s{0,}\.{0,})/);
txt = txt.replace(/(\s{1,}E\s{0,}\.{0,})/,'');
if(indexE>-1) {
returnArr.push({
q:txt.substring(0,indexA),
c:[txt.substring(indexA,indexB),txt.substring(indexB,indexC),txt.substring(indexC,indexD),txt.substring(indexD,indexE),txt.substring(indexE,txt.length)],
a:answer
})
} else {
returnArr.push({
q:txt.substring(0,indexA),
c:[txt.substring(indexA,indexB),txt.substring(indexB,indexC),txt.substring(indexC,indexD),txt.substring(indexD,txt.length)],
a:answer
})
}
})
console.log(returnArr.length)
console.log(JSON.stringify(returnArr).replace(/"/g,"'").replace(/'q':/g,'q:').replace(/'c':/g,'c:').replace(/'a':/g,'a:'))
*/
var questions = [{
title: '风湿系统',
singleChoiceQ: [{
q: '糖皮质激素类药物不能减量过快,目的是为防止()',
c: ['向心性肥胖', '血压升高', '疗效差', '反跳']
}, {
q: '长期服用糖皮质激素尽量于早晨7:00~8:00服务,其目的是防止()',
c: ['骨质疏松', '影响血糖波动', '反跳', '减少肾上腺皮质功能下降甚至皮质萎缩的不良后果']
}, {
q: '痛风患者每日饮水须达到()ml',
c: ['大于1500', '2000~3000', '大于3000', '前一天的尿液+500']
}, {
q: '类风湿性关节炎典型的临床表现为()',
c: ['对称性多关节炎', '非对称性大关节炎', '非对称性小关节炎', '游走性疼痛']
}],
multipleChoiceQ: [{
q: '类风湿关节炎的关节表现为()',
c: ['多侵犯小关节', '具有不对称性', '具有游走性',...