欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

基于jQuery試卷自動(dòng)排版系統(tǒng)

 更新時(shí)間:2010年07月18日 23:16:20   作者:  
jQuery試卷自動(dòng)排版系統(tǒng),需要的朋友可以參考下。
需求
根據(jù)提供的試卷題目(是一個(gè)干凈的只有“數(shù)據(jù)”的HTML網(wǎng)頁(yè))生成一份多頁(yè)的試卷,用戶(hù)能執(zhí)行翻頁(yè)、具有答題時(shí)間限制,展示給用戶(hù)的試卷中題目需要占用盡量少的空間(比如選擇題中把兩條較短的選項(xiàng)由兩行合并到一行)、同一道題目不要跨頁(yè)面顯示以方便答題者,管理員能夠改變?cè)嚲淼臉邮剑ㄗ煮w、顏色、行距、頁(yè)面邊距,像字處理軟件一樣……),題目之間可以插入一些說(shuō)明性的文字(比如告知答題者作答的須知等等)。題目提干、選擇題的選項(xiàng)、說(shuō)明文字可以包含多媒體信息(文字、圖片、列表、表格、視頻等等……)。選擇題選項(xiàng)數(shù)目不限、單選多選不限。翻頁(yè)要有可訂制的動(dòng)畫(huà)效果

提供的試卷樣板類(lèi)似如下(Input):
復(fù)制代碼 代碼如下:

<ol id="olThePaper">
<div class="Desc">選擇題:說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。</div>
<div class="Problem" id="1">
<li>1.你認(rèn)為怎樣的老師是好老師?</li>
<div class="Choices">
<label><input type="radio" name="prob1" value="A" />和學(xué)生平等相處,能全面滿(mǎn)足學(xué)生各種需要</label>
<label><input type="radio" name="prob1" value="B" />所在教學(xué)班的成績(jī)優(yōu)于其他平行班</label>
<label><input type="radio" name="prob1" value="C" />嚴(yán)格管理學(xué)生、所帶的班級(jí)班風(fēng)良好</label>
<label><input type="radio" name="prob1" value="D" />父母般地關(guān)心學(xué)生的生活和情緒狀態(tài)</label>
</div>
</div>
<div class="Problem" id="2">
<li>2.一位有15年教齡的英語(yǔ)教師,教了多年高三,可謂學(xué)校的核心骨干。一次接受邀請(qǐng)到外校介紹教學(xué)經(jīng)驗(yàn),臺(tái)下有老師發(fā)表了觀(guān)點(diǎn)并問(wèn)到幾個(gè)英語(yǔ)教法發(fā)面的問(wèn)題,一下子把她給卡住了。這是因?yàn)?lt;/li>
<div class="Choices">
<label><input type="radio" name="prob2" value="A" />她最近工作太累,注意力不夠集中。</label>
<label><input type="radio" name="prob2" value="B" />提問(wèn)老師的觀(guān)點(diǎn)和她的有很大不同。</label>
<label><input type="radio" name="prob2" value="C" />由于長(zhǎng)時(shí)間在教學(xué)一線(xiàn)拼搏,她對(duì)教學(xué)理論問(wèn)題的關(guān)注度不高。</label>
<label><input type="radio" name="prob2" value="D" />對(duì)學(xué)科教學(xué)的歸納和思考少,一時(shí)加工不過(guò)來(lái)。</label>
</div>
</div>
<div class="Problem" id="3">
<li>3.哪張圖片最好看?</li>
<div class="Choices">
<label><input type="radio" name="prob3" value="A" />這一張<img src="img1.png" height="300px" width="400px" alt="img1"/>好看。</label>
<label><input type="radio" name="prob3" value="B" />這一張<img src="img2.png" height="300px" width="400px" alt="img2"/>好看。</label>
<label><input type="radio" name="prob3" value="C" />這一張<img src="img3.png" height="300px" width="400px" alt="img3"/>好看。</label>
<label><input type="radio" name="prob3" value="D" />這一張<img src="img4.png" height="300px" width="400px" alt="img4"/>好看。</label>
<label><input type="radio" name="prob3" value="E" />不知道。</label>
</div>
</div>
<div class="Desc">填空題和選擇題:一大堆的說(shuō)明文字。一大堆的說(shuō)明文字。一大堆的說(shuō)明文字。一大堆的說(shuō)明文字。一大堆的說(shuō)明文字。</div>
<div class="Problem" id="4">
<li>4.床前明月光,<input type="text" name="prob4" /></li>
</div>
<div class="Problem" id="5">
<li>5.你認(rèn)為怎樣的老師是好老師?</li>
<div class="Choices">
<label><input type="checkbox" name="prob6" value="D" />和</label>
<label><input type="checkbox" name="prob6" value="A" />所</label>
<label><input type="checkbox" name="prob6" value="B" />嚴(yán)</label>
<label><input type="checkbox" name="prob6" value="C" />父</label>
<label><input type="checkbox" name="prob6" value="E" />和班的成績(jī)班的成績(jī)班的成績(jī)班的成績(jī)班的成績(jī)</label>
<label><input type="checkbox" name="prob6" value="F" />所班的成績(jī)班的成績(jī)班的成績(jī)</label>
<label><input type="checkbox" name="prob6" value="G" />嚴(yán)班的班的成績(jī)班的成績(jī)班的成績(jī)班的成績(jī)</label>
<label><input type="checkbox" name="prob6" value="H" />啊</label>
</div>
</div>
</ol>

思路
面對(duì)這種需求該怎么辦呢?使用JavaScript了,看來(lái)。后來(lái)決定用jQuery,Aptana作IDE(雖然jQuery支持庫(kù)在Windows上死活裝不上去,換了個(gè)OS就好了,奇怪),格式么就用CSS了。

具體步驟:

導(dǎo)入試卷題目HTML
對(duì)所有選擇題進(jìn)行排版,把一行劃分為四個(gè)位置,使選項(xiàng)盡量適應(yīng)一個(gè)位置、兩個(gè)位置或四個(gè)位置(也就是一行四項(xiàng)、一行兩項(xiàng)或者一行一項(xiàng)的效果)
對(duì)所有題目進(jìn)行分頁(yè)
思路還是清晰的,但是由于瀏覽器眾多,還是比較麻煩的,并且我是新手,沒(méi)接觸過(guò)jQuery之前……

實(shí)現(xiàn)
頁(yè)面文件(和例子不同,但是格式一樣的)

復(fù)制代碼 代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>No title...</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="JavaScript" src="lib/jquery/jquery-1.4.2.js" type="text/javascript"></script>
<script language="JavaScript" src="lib/countdown/jquery.countdown.pack.js" type="text/javascript"></script>
<script language="JavaScript" src="TestPaperProcessor.js" type="text/javascript"></script>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="divToolbar">
<div id="divPrev">PrevPage</div>
<div id="divNext">NextPage</div>
<div id="divPageInfo">Loading the test...</div>
<div id="divTimer"></div>
</div>
<form id="formPaper" action="demo.html" method="post" accept-charset="utf-8">
<ul>
<div class="Display" id="divLeft">
left<!--the left page-->
</div>
<div class="Display" id="divRight">
right<!--the right page-->
</div>
</ul>
<ol id="olThePaper">
<div class="Desc">選擇題:說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。說(shuō)明文字。</div>
<div class="Problem" id="1">
<li>1你認(rèn)為怎樣的老師是好老師?</li>
<div class="Choices">
<label>
<input type="radio" name="prob1" value="D" />和學(xué)生平等相處,能全面滿(mǎn)足學(xué)生各種需要
</label>
<label>
<input type="radio" name="prob1" value="A" />所在教學(xué)班的成績(jī)優(yōu)于其他平行班
</label>
<label>
<input type="radio" name="prob1" value="B" />嚴(yán)格管理學(xué)生/所帶的班級(jí)班風(fēng)良好
</label>
<label>
<input type="radio" name="prob1" value="C" />父母般地關(guān)心學(xué)生的生活和情緒狀態(tài)
</label>
</div>
</div>
<div class="Problem" id="2">
<li>2你認(rèn)為怎樣的老師是好老師?</li>
<div class="Choices">
<label>
<input type="radio" name="prob2" value="D" />和學(xué)生平j(luò)lsdjklsdf生各種需要
</label>
<label>
<input type="radio" name="prob2" value="A" />所
</label>
<label>
<input type="radio" name="prob2" value="B" />嚴(yán)格好
</label>
<label>
<input type="radio" name="prob2" value="C" />父母關(guān)心學(xué)生的生活和情緒狀態(tài)
</label>
</div>
</div>
<div class="Problem" id="3">
<li>3你認(rèn)為怎樣的老師是好老師?</li>
<div class="Choices">
<label>
<input type="radio" name="prob3" value="D" />和學(xué)生平等相處,能全面滿(mǎn)足學(xué)生各種需要
</label>
<label>
<input type="radio" name="prob3" value="A" />所在教學(xué)班的成績(jī)優(yōu)于其他平行班
</label>
<label>
<input type="radio" name="prob3" value="B" />嚴(yán)格管理學(xué)生/所帶的班級(jí)班風(fēng)良好
</label>
<label>
<input type="radio" name="prob3" value="C" />父母般地關(guān)心學(xué)生的生活和情緒狀態(tài)
</label>
</div>
</div>
<div class="Problem" id="4">
<li>4你認(rèn)為怎樣的老師是好老師?</li>
<div class="Choices">
<label>
<input type="radio" name="prob4" value="D" />和學(xué)生平等相處,能全面滿(mǎn)足學(xué)和學(xué)生平等相處,能全面滿(mǎn)足學(xué)和學(xué)生平等相處,能全面滿(mǎn)足學(xué)和學(xué)生平等相處,能全面滿(mǎn)足學(xué)和學(xué)生平等相處,能全面滿(mǎn)足學(xué)和學(xué)生平等相處,能全面滿(mǎn)足學(xué)和學(xué)生平等相處,能全面滿(mǎn)足學(xué)和學(xué)生平等相處,能全面滿(mǎn)足學(xué)和學(xué)生平等相處,能全面滿(mǎn)足學(xué)生各種需要
</label>
<label>
<input type="radio" name="prob4" value="A" />所在教學(xué)班的成績(jī)優(yōu)于其他平行班
</label>
<label>
<input type="radio" name="prob4" value="B" />嚴(yán)格管理學(xué)生/所帶的班級(jí)班風(fēng)良好
</label>
<label>
<input type="radio" name="prob4" value="C" />父母般地關(guān)心學(xué)生的生活和情緒狀態(tài)
</label>
</div>
</div>
<div class="Desc">還是選擇題:一大堆的說(shuō)明文字。一大堆的說(shuō)明文字。一大堆的說(shuō)明文字。一大堆的說(shuō)明文字。一大堆的說(shuō)明文字。</div>
<div class="Problem" id="10">
<li>5你認(rèn)為怎樣的老師是好老師?</li>
<div class="Choices">
<label>
<input type="radio" name="prob5" value="D" />和10學(xué)生平等相處,能全面滿(mǎn)足學(xué)生各種需要
</label>
<label>
<input type="radio" name="prob5" value="A" />所10在教學(xué)班的成績(jī)優(yōu)于其他平行班
</label>
<label>
<input type="radio" name="prob5" value="B" />嚴(yán)10jhjhjhjhkljlkjjkljjkjjkllkjlkjljkjljlkj格管文字
</label>
<label>
<input type="radio" name="prob5" value="C" />父10母般地關(guān)心學(xué)生的生活和情緒狀態(tài)
</label>
</div>
</div>
<div class="Problem" id="5">
<li>5你認(rèn)為怎樣的老師是好老師?</li>
<div class="Choices">
<label>
<input type="radio" name="prob5" value="D" />和學(xué)生平等相處,能全面滿(mǎn)足學(xué)生各種需要
</label>
<label>
<input type="radio" name="prob5" value="A" />所在教學(xué)班的成績(jī)優(yōu)于其他平行班
</label>
<label>
<input type="radio" name="prob5" value="B" />嚴(yán)jhjhjhjhkljlkjjkljjkjjkllkjlkjljkjljlkj格管<img src="aaaa9.jpg" height="300px" width="400px" alt="pic"/>文字
</label>
<label>
<input type="radio" name="prob5" value="C" />父母般地關(guān)心學(xué)生的生活和情緒狀態(tài)
</label>
</div>
</div>
<div class="Problem" id="6">
<li>6你認(rèn)為怎樣的老師是好老師?</li>
<div class="Choices">
<label>
<input type="radio" name="prob6" value="D" />和
</label>
<label>
<input type="radio" name="prob6" value="A" />所
</label>
<label>
<input type="radio" name="prob6" value="B" />嚴(yán)
</label>
<label>
<input type="radio" name="prob6" value="C" />父
</label>
<label>
<input type="radio" name="prob6" value="E" />和班的成績(jī)班的成績(jī)班的成績(jī)班的成績(jī)班的成績(jī)
</label>
<label>
<input type="radio" name="prob6" value="F" />所班的成績(jī)班的成績(jī)班的成績(jī)
</label>
<label>
<input type="radio" name="prob6" value="G" />嚴(yán)班的班的成績(jī)班的成績(jī)班的成績(jī)班的成績(jī)
</label>
<label>
<input type="radio" name="prob6" value="H" />父
</label>
</div>
</div>
</ol>
</form>
</body>
</html>

樣式文件(CSS)
復(fù)制代碼 代碼如下:

/* YahooUI CSS Reset */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td { padding: 0; margin: 0; }
table { border-collapse: collapse; border-spacing: 0; }
fieldset,img { border: 0; }
address,caption,cite,code,dfn,em,strong,th,var { font-weight: normal; font-style: normal; }
ol,ul { list-style: none; }
caption,th { text-align: left; }
h1,h2,h3,h4,h5,h6 { font-weight: normal; font-size: 100%; }
q:before,q:after { content:''; }
abbr,acronym { border: 0;}

label { padding: 0; margin: 0; }

/* My css */
.Choices { line-height: 150%; margin: 5px 0; }
.Page { height: 500px; border: solid 1px gray; }
#olThePaper, .Display { padding: 0; width: 500px; }
/* NOTICE: the width of .Display and #olThePaper should be the SAME. */
.Display { float: left; }

#divToolbar { height: 35px; }
#divPrev, #divNext { float: left; width: 100px; height: 30px; border: solid 1px green; background-color: #999999; }
#divPageInfo { float: left; width: 100px; height: 30px; }
#divTimer { float: left; width: 500px; height: 30px; }


/*for debugging... perhaps for non-IE only*/
/**label { outline: dotted 1px red; background-color: gray; }**/
/**div {outline: dashed 1px blue;}**/

下面是重點(diǎn),TTestPaperProcessor.js:
復(fù)制代碼 代碼如下:

/**
*
* @param {String} PaperOlId the id value of the ol tags indicating pages.
* @param {String} ProblemClass the css class name for problem area.
* @param {String} DescClass the css class name for description area.
* @param {String} ChoicesClass the css class name for choices area.
* @param {String} LeftPageId the id of the left page.
* @param {String} RightPageId the id of the right page.
* @author ExSystem<exsystemchina@gmail.com>
*/
function TTestPaperProcessor(PaperOlId, ProblemClass, DescClass, ChoicesClass, LeftPageId, RightPageId) {
this.FPaperOlId = PaperOlId;
this.FProblemClass = ProblemClass;
this.FDescClass = DescClass;
this.FChoicesClass = ChoicesClass;
this.FLeftPageId = LeftPageId;
this.FRightPageId =RightPageId;
$('#' + this.FLeftPageId).html('');
$('#' + this.FRightPageId).html('');
this._FormatProblemOptions();
this._DivideIntoPages();
this.setCurrPage(1);
}

TTestPaperProcessor.prototype = {
FPaperOlId: '', //the id property of the ol tag contains the whole test paper.
FProblemClass: '', //the css class name for problem area.
FDescClass: '', //the css class name for description area.
FChoicesClass: '', //the css class name for choices area.
FLeftPageId: '', //the left page.
FRightPageId: '', //the right page.
CPageClass: 'Page',
FIsDisplayTableSupported: null, //whether the browser is the EVIL M$IE6,7 that does not support display: table(-cell).
FCurrPage: 0, //start from 1, 0 for no page has been displayed yet.
FPageCount: 0, //page count.
// /**
// * Get external css stylesheet info.
// * @param {String} Selector The selector in the css style sheet.
// * @param {String} Property The property name.
// * @return {String} The value of the property, or null for undefined property.
// */
// _GetCssInfo: function(Selector, Property) {
// var mCss = document.styleSheets[0].cssRules || document.styleSheets[0].rules;
// for (var mIndex = 0; mIndex < mCss.length; ++mIndex) {
// if (mCss[mIndex].selectorText.toLowerCase() == Selector) {
// return mCss[mIndex].style[Property];
// }
// }
// return null;
// },

/**
* @return {Boolean}
*/
_IsDisplayTableSupported: function() {
if (this.FIsDisplayTableSupported != null) {
return this.FIsDisplayTableSupported;
}

this.FIsDisplayTableSupported = !(jQuery.browser.msie && jQuery.browser.version < 8.0);
return this.FIsDisplayTableSupported;
},

/**
* Formats radios and checkboxes for the Choices quiz.
*/
_FormatProblemOptions: function() {
var mThis = this;
var mSelector = '.' + this.FProblemClass + ' .' + this.FChoicesClass;
$(mSelector).each(function() {
//Rearrange the options for each problem ordered by offsetWidth of the label tag.
var mLabels = new Array();
mLabels = jQuery.makeArray($('label', this));
mLabels.sort(function(First, Second) {
return $(Second).outerWidth(true) > $(First).outerWidth(true);
});
$(mLabels).appendTo(this);

//Layout the options into the appropreate form.
var mSlots = -1; //Force to create a new row, inside the while() loop.
var mSlotWidth = $(mSelector).width() / 4.0;
var mCellSize = 0;
if (mThis._IsDisplayTableSupported()) {
while (mLabels.length > 0) {
//alert($(mLabels[0]).outerWidth(true) + '::' + $(mLabels[0]).outerHeight(true) + '::' + $(mLabels[0]).html());
if (mSlots <= 0) { //If no empty slot, create a new row.
mCurrRow = $('<div class="___table" style="display: table;"></div>');
mCurrRow.appendTo(this);
mSlots = 4;
mCellSize = 0;

var mRealCellWidth = $(mLabels[0]).outerWidth(true);
if (mRealCellWidth < mSlotWidth) {
mCellSize = 1;
}
if (mRealCellWidth >= mSlotWidth && mRealCellWidth < mSlotWidth * 2) {
mCellSize = 2;
}
if (mRealCellWidth >= mSlotWidth * 2) {
mCellSize = 4;
}
}
mSlots -= mCellSize;
if (mSlots >= 0) { //If empty slots exists, put the cell into the row.
mLabel = mLabels.shift();
$(mLabel).addClass('___cell');
$(mLabel).css('display', 'table-cell');
$(mLabel).appendTo(mCurrRow);
}
}
$('.___table').each(function() { //Align all the tables and cells.
$(this).css('width', '100%');
var mCellWidth = 100 / $('.___cell', this).length;
$('.___cell', this).css('width', mCellWidth + '%');
});
}
else { // for the evil M$IE6, use table, tr, td tags.
while (mLabels.length > 0) {
if (mSlots <= 0) { //If no empty slot, create a new row.
mCurrRow = $('<table class="___table" cellspacing="0" cellpadding="0"></table>');
mRow = $('<tr></tr>');
mRow.appendTo(mCurrRow);
mCurrRow.appendTo(this);
mSlots = 4;
mCellSize = 0;

var mRealCellWidth = $(mLabels[0]).attr('offsetWidth');
//The EVIL IE only:
//be sure to use this css reset: table { border-collapse: collapse; border-spacing: 0; }
//otherwise, 2 lines will be occupied by some long problem options instead of 1.
//or use this code instead: var mRealCellWidth = $(mLabels[0]).attr('offsetWidth') * 1.3;
if (mRealCellWidth <= mSlotWidth) {
mCellSize = 1;
}
if (mRealCellWidth > mSlotWidth && mRealCellWidth <= mSlotWidth * 2) {
mCellSize = 2;
}
if (mRealCellWidth > mSlotWidth * 2) {
mCellSize = 4;
}
}
mSlots -= mCellSize;
if (mSlots >= 0) { //If empty slots exists, put the cell into the row.
mLabel = mLabels.shift();
mCell = $('<td class="___cell"></td>');
$(mLabel).appendTo(mCell);
mCell.appendTo($('tr', mCurrRow)[0]);
}
}
$('.___table').each(function() { //Align all the tables and cells.
$(this).css('width', '100%');
var mCellWidth = 100 / $('tbody tr .___cell', this).length;
$('tbody tr .___cell', this).css('width', mCellWidth + '%');
});
}
});
},

/**
* Create a new page, and add it to the paper.
* @return {jQuery} the new page.
*/
_CreateNewPage: function() {
++this.FPageCount;

mPage = $('<div class="' + this.CPageClass + '" id="___page_' + this.FPageCount + '"></div>');
mPage.appendTo($('#' + this.FPaperOlId));

return mPage;
},

/**
*
* @param {Number} PageNumber
* @return {jQuery}
*/
_GetPage: function(PageNumber) {
if (PageNumber < 1 || PageNumber > this.FPageCount) {
throw new Error('invalid page number: ' + PageNumber + '.');
}
return $('#___page_' + PageNumber);
},

/**
*
*/
_DivideIntoPages: function() {
var mProblems = $('.' + this.FProblemClass + ', .' + this.FDescClass);
var mProblemsCount = mProblems.length;
var mCurrPage = this._CreateNewPage();
//var mPageHeight = mCurrPage.attr('offsetHeight'); chrome: sometimes 0. safari: always 0, IF PUTTED IN $(window).ready().
var mPageHeight = mCurrPage.outerHeight(true); //the same as the code above. FIX: PUT IT INTO $(window).load().
var mUsedPageHeight = 0;
for (var mCurrProblem = 0; mCurrProblem < mProblemsCount; ++mCurrProblem) {
if (mUsedPageHeight + $(mProblems[mCurrProblem]).outerHeight(true) > mPageHeight) {
mCurrPage.hide();
mCurrPage = this._CreateNewPage();
mPageHeight = mCurrPage.outerHeight(true);
mUsedPageHeight = 0;
}
$(mProblems[mCurrProblem]).appendTo(mCurrPage);
mUsedPageHeight += $(mProblems[mCurrProblem]).outerHeight(true);
}
mCurrPage.hide();
},
/**
* Get the current page of the left side, started from 1.
* @return {Number} The current page.
*/
getCurrPage: function() {
if (this.FPageCount == 0) {
throw new Error('No page has been created yet.');
}
return this.FCurrPage;
},
/**
* Trun to a specific page in the left side.
* @param {Number} Value The page number.
*/
setCurrPage: function(Value) {
if (Value < 1 || Value > this.FPageCount) {
throw new Error('No such page: ' + Value + '.');
}
this.FCurrPage = parseInt(Value / 2) * 2 + 1; // to get an odd number.
$('#' + this.FLeftPageId + ' .' + this.CPageClass).hide();
$('#' + this.FRightPageId + ' .' + this.CPageClass).hide();
if (this.FCurrPage >= 0) {
$('#___page_' + this.FCurrPage).appendTo($('#' + this.FLeftPageId));
$('#___page_' + this.FCurrPage).show('fast');
if (this.FCurrPage < this.FPageCount) {
++this.FCurrPage;
$('#___page_' + this.FCurrPage).appendTo($('#' + this.FRightPageId));
$('#___page_' + this.FCurrPage).show('fast');
--this.FCurrPage;
}
}
},
/**
* @retrun {Number}
*/
getPageCount: function() {
return this.FPageCount;
},
/**
*
*/
Prev: function() {
this.setCurrPage(this.FCurrPage - 2);
},
/**
*
*/
Next: function() {
this.setCurrPage(this.FCurrPage + 2);
}
};

//client code goes here...
$(window).load(function() {
var obj = new TTestPaperProcessor('olThePaper', 'Problem', 'Desc', 'Choices', 'divLeft', 'divRight');
$('#divPrev').click(function() {
try {
obj.Prev();
$('#divPageInfo').text(obj.getCurrPage() + ' of ' + obj.getPageCount());
}
catch (e) {
alert('No such page!');
}
});
$('#divNext').click(function() {
try {
obj.Next();
$('#divPageInfo').text(obj.getCurrPage() + ' of ' + obj.getPageCount());
}
catch (e) {
alert('No such page!');
}
});
//USAGE: http://keith-wood.name/countdown.html
function TimeUp() {
$('#formPaper').submit();
}
$('#divTimer').countdown({
until: '+90m',
compact: true,
format: 'HMS',
description: '',
onExpiry: TimeUp
});
$('#divPageInfo').text(obj.getCurrPage() + ' of ' + obj.getPageCount());
});


嘿嘿,其實(shí)這是一個(gè)俺們學(xué)校一位博導(dǎo)老師的項(xiàng)目的一部分~~托給我做了。馬上要出門(mén)了,回來(lái)放源文件下載,就可以看到效果了~~昨天回來(lái)太晚了,現(xiàn)在放出源代碼文件下載:點(diǎn)擊此處
/201007/yuanma/TestPaperProcessor.rar

相關(guān)文章

最新評(píng)論