




已阅读5页,还剩10页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1.要求2.代码3.流程图4.图片1. 要求Second coursework A website for online examCoursework Requirements:Establish an online exam website using knowledge of JavaScript and XHTML learned in our course. The detailed functional requirements are listed as follows:1. A question library for exam is needed, which should contain at least 20 questions and correct answers (a question can have several correct answers).2. An exam should be generated with five questions and corresponding choices with answers. These questions and corresponding choices are randomly selected or generated from the question library.3. Before starting the exam, people can set the score threshold, which determines the “pass” or “fail” of the exam. Such threshold can not be changed after starting the exam.4. The exam is limited within 2 minutes. Two buttons are need to control the exam “Start” and “Submit”. When people press “Start”, it means the exam begins. When “Submit” is pressed, the score can be calculated automatically.5. If people pass or fail the exam within above timeframe, a corresponding message is delivered to people. The exam is over with statistical report and detailed analysis report, see 7.6. If people pass the exam overtime with score A, a re-exam can be taken with the same timeframe and same score threshold (The “Start” button should be changed to “Re-start” button accordingly). The regulation for the re-exam is same as for the exam, see 4. However, only one opportunity is provided to take such re-exam. If people pass the re-exam with score B, the final score is generated by following equation:Score is used to determine the final status of the whole exam: pass or fail. The exam is over with statistical report and detailed analysis report, see 7.7. Two kinds of exam reports need to be generated for the whole exam (including re-exam activities). One is focusing on the statistical analysis, while the other should give the detailed analysis report for each question and corresponding answer.Additional requirements for the coursework: Language: English Naming your variables and functions with meaningful identification. Flowcharts used for requirement analysis should be generated and delivered together with the online quiz website.Coursework grading rule:Key pointScore Functional requirements60 Question library10 Question generation10 Exam control10 First exam logic10 Re-exam logic10 Report generation10 Additional requirements30 Coding manner10 Flowchart20 Consistency10 Consistency between flowchart and application10 Total1002. 代码(有一些小问题没解决,第一次打开时题目可能显示不全,再次打开就没问题了)【TestOnline.html】(MainLogo.jpg见最下方,放在“images”文件夹中)TestOnlinevar testtimes =0;var testscore =0;var questions ;var answer; var correctanswers ;function getscorethreshold()var scorethreshold =document.setscorethreshold.scorethreshold.value;return scorethreshold;function Start()if(testtimes2)questions =, ;answer =, unchoose,unchoose,unchoose,unchoose,;correctanswers =0,0,0,0,0,0,0,0,0,0;testtimes =testtimes+1;window.open( TestPage.html,); startSet.startButton.disabled = true; else window.alert( Sorry.You have no chance to have test); testscore2.Restart.disabled = true; function TestReport()window.open( TestReport.html,);setTimeout(top.moveTo(0,0),5);setTimeout(top.resizeTo(screen.availWidth,screen.availHeight),5);StatementThere are 5 questions about mathematics in this online test. You will have 50seconds to finish them. If your score is lower than the score threshold, youwould fail the test.Only if your score is higher than the score threshold butovertime, youd have one more chance to pass the test within the time given. Please enter the score threshold:%Your score is:【TestPage.html】Testingvar question= new Array(20);for (var i=0;i0,(A/2+B/4+C/16) is approximately equal to 6.4,A/2+B/4+C/16=?;question51=6.4;question52=6.375 or 6.4375;question53=1;question60=Taking m/n=ab,(n not=0) as given,which of the following is right?;question61=nb;question62=an;question63=0;question70=947-599+76*64=?;question71=5412;question72=5212;question73=1;question80=Taking x2+3*x-2=3 as given,2*x2+6*x-5=?;question81=5;question82=-5;question83=0;question90=If 2 is one root of x2-c=0, then c=?;question91=4;question92=-4;question93=0;question100=37.85-(7.85+6.4)*30=?;question101=706;question102=708;question103=1;question110=Factorize 2a2-4a=?;question111=2a(a-2);question112=2a(a-1);question113=0;question120=3(-1)=?;question121=1/3;question122=3;question123=0;question130=156*107-7729=?;question131=8963;question132=8973;question133=0;question140=Which of the following is right?;question141=x2+x2=x4;question142=x2*x=x3;question143=1;question150=|-2|=?;question151=-2;question152=2;question153=1;question160=3.45*0.6*2.8=?;question161=5.596;question162=5.796;question163=1;question170=If there are 3 obtuse angles in a polygons interior angles,how many edges does the polygon have at most?;question171=6;question172=5;question173=0;question180=3+2=?;question181=5;question182=4;question183=0;question190=(0.75*42.7+57.3-0.573*25)/3*72=?;question191=1600;question192=1800;question193=1;var Questionnumber =Q0,Q1,Q2,Q3,Q4; var Answernumber =A,B;var keys =0,0,0,0,0;var scorethreshold =window.opener.getscorethreshold();var times =window.opener.testtimes;var lastscore =window.opener.testscore;var initseconds =50;var settime=0; var time =0;document.write();for(var i=0;i=4;i+)var current=Math.floor(Math.random()*20-1);var Questionlabel=1.,2.,3.,4.,5.;keysi = questioncurrent3;window.opener.questionsi = questioncurrent0; document.write(+Questionlabeli+questioncurrent0+);for(var j=1;j=2;j+)document.write( + +Answernumberj-1 +.+questioncurrentj +);for(var i=0;i=4;i+)window.opener.answer0i =Answernumberkeysi;window.opener.answer10 =myQuiz.Q0keys0.value;window.opener.answer11 =myQuiz.Q1keys1.value;window.opener.answer12 =myQuiz.Q2keys2.value;window.opener.answer13 =myQuiz.Q3keys3.value;window.opener.answer14 =myQuiz.Q4keys4.value;document.write(The time left: 50 s);document.write();document.write();function checkAnswers() var score = 0; var usedTime = time; if(myQuiz.Q0keys0.checked) score = score + 20; if(myQuiz.Q1keys1.checked) score = score + 20; if(myQuiz.Q2keys2.checked) score = score + 20; if(myQuiz.Q3keys3.checked) score = score + 20; if(myQuiz.Q4keys4.checked) score = score + 20; for(var i=0;i= 1;i+) if(myQuiz.Q0i.checked) window.opener.correctanswers00 =Answernumberi;window.opener.correctanswers10 =myQuiz.Q0i.value; for(var i=0; i= 1;i+) if(myQuiz.Q1i.checked) window.opener.correctanswers01 =Answernumberi; window.opener.correctanswers11 =myQuiz.Q1i.value; for(var i = 0; i = 1; i+) if(myQuiz.Q2i.checked) window.opener.correctanswers02 =Answernumberi; window.opener.correctanswers12 =myQuiz.Q2i.value; for(var i=0; i=1; i+) if(myQuiz.Q3i.checked)window.opener.correctanswers03 =Answernumberi;window.opener.correctanswers13 =myQuiz.Q3i.value; for(vari=0;i= scorethreshold) if(usedTime = settime) window.opener.testscore2.innerText =pass; else window.opener.testscore2.innerHTML =Sorry,time runs out.You have to try it again. + ; else window.opener.testscore2.innerText =fail; else score =(score + lastscore)/2); window.opener.testscore1.innerText =score; if(score = scorethreshold) window.opener.testscore2.innerText =pass; else window.opener.testscore2.innerText =fail; window.opener.focus(); window.close();function timeCount()initseconds = initseconds-1;time = Math.floor(initseconds); document.getElementById(countdownseconds).innerHTML = time; window.onload=function()setInterval(timeCount
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 老厂退休考试题及答案
- 教师招聘之《幼儿教师招聘》能力提升试题打印含答案详解(典型题)
- 2025年教师招聘之《幼儿教师招聘》题库试题含答案详解(b卷)
- 课程改革考试题及答案
- 绢纺精炼操作工主管竞选考核试卷及答案
- 咖啡学徒考试题及答案
- 课件无法播放显示要登陆问题
- 警示标识考试题及答案
- 课件文案制作指南
- 集群通信系统机务员专业知识考核试卷及答案
- 肝性脑病(课件)
- 【名校】《三思而后行》 完整版课件
- 公司内部程序文件(格式模版)
- 泛光施工招标文件
- 旅游策划实务整套课件完整版电子教案课件汇总(最新)
- DB23∕T 2661-2020 地热能供暖系统技术规程
- 人工挖孔桩施工监测监控措施
- 国家职业技能标准 (2021年版) 6-18-01-07 多工序数控机床操作调整工
- 办公楼加层改造施工组织设计(100页)
- 渗透检测培训教材(1)
- 空调专业常用英文词汇
评论
0/150
提交评论