如何使用PHP对表单上的多项选择题评分
董事会上的人是我认识的最聪明的人,所以我在这里寻求一些支持 我不是一个非常精通网络的人,但我是一名社会研究教师,我正试图建立一个网站,让我的学生在家里完成在线测试 我不是程序员,所以我买了一个初学者网址,上面有一个网站设计工具包,这样我就可以创建一个表单形式的测试 我希望学生们观看视频,然后回答有关我放入表格中的视频的问题 我的问题是——因为大多数问题都是T/F或多项选择题,我如何设置,以便当学生的测试提交给我时,任何可以通过计算机评分的问题都已经被评分了,这样我只需要对填表题和作文题评分 这是我在网站上的一个测试表格的例子,有16个问题--如何使用PHP对表单上的多项选择题评分,php,Php,董事会上的人是我认识的最聪明的人,所以我在这里寻求一些支持 我不是一个非常精通网络的人,但我是一名社会研究教师,我正试图建立一个网站,让我的学生在家里完成在线测试 我不是程序员,所以我买了一个初学者网址,上面有一个网站设计工具包,这样我就可以创建一个表单形式的测试 我希望学生们观看视频,然后回答有关我放入表格中的视频的问题 我的问题是——因为大多数问题都是T/F或多项选择题,我如何设置,以便当学生的测试提交给我时,任何可以通过计算机评分的问题都已经被评分了,这样我只需要对填表题和作文题评分 这是
第1步有3个视频
观看每个视频后,您需要回答有关该视频的问题。完成所有3个视频的问题后,点击“提交”,您的答案将被发送出去进行评分。
使用这3个视频回答问题1-16,然后提交供审查。
输入您的用户ID#*
分配给您的用户ID#
(雅)
电子邮件*
视频#1
视频#1问题
1) 你学习了两种信条——它们是什么*
A) 内部信条
B) 行为信条
C) 情感信条
D) 知识分子信条
2) 哪种信条是做出正确决策的最理想信条*
A) 内部信条
B) 行为信条
C) 知识分子信条
D) 所有这些
E) 以上都没有
3) 我们在做决定时通常使用哪种信条*
A) 情感信条
B) 行为信条
C) 知识分子信条
D) 所有这些
E) A&;B
4) 为什么自我评估和意识每天都很重要*
5) 当Benzio博士说我们需要做维护工作来防止危机工作时,这意味着什么*
6) 通过观看这段视频,你学到的最重要的东西是什么*
视频#2
视频#2个问题
7) 人们害怕未知,因为他们是习惯性的生物*
A) 真的
B) 假的
8) 你想改变你的生活吗?为什么*
9) 我们能把生命分解成的最小的部分是什么*
A) 分子
B) 日子
C) 会议记录
D) 决定
10) 本齐奥博士把什么称为“生命的钥匙”*
11) 这门课程到底是关于什么的*
A) 如何摆脱困境
B) 如何在考试中获得更高的分数
C) 做出更好的决定
D) 想办法让人们更喜欢你
视频#3
视频#3个问题
12) 这些脑部SPECT扫描显示了什么*
A) 一个人多么聪明啊
B) 一个人能有多聪明
C) 大脑活动-什么';大脑里实际上在发生什么
D) 还要多久才能吃下一顿饭
13) 大脑化学成分在短短8天内会发生巨大变化——对还是错*
A) 真的
B) 假的
14) 一旦脑细胞受损,它们就永远无法修复——对还是错*
A) 真的
B) 假的
15) 根据SPECT扫描,治疗后受损的大脑发生了什么*
A) 大脑的化学反应保持不变
B) 大脑化学反应有所改善
C) 大脑的化学反应变得更糟了
16) 我们的大脑处于一个不断变化的阶段,无论是积极的还是消极的——对还是错*
A) 真的
B) 假的
那一页乱七八糟。你的网站设计工具包似乎真的喜欢随机数
无论如何,重要的是每个
元素的名称属性。例如,用户ID输入框的名称为545537524713528365
。同样,第二个问题的所有五个单选按钮的名称均为\u u48324016863160132
,并且只有值不同,因为只会选择其中一个
既然您将问题标记为“php”,我假设您计划用php编写这个自动评分程序。
标签上写着method=“POST”
,因此每个学生提交的内容都可以作为表单的$\u POST['name']
属性所引用的PHP程序中的$\u POST['name']
进行访问
例如,变量$\u POST['''u u545537524713528365']
将包含用户ID,变量$\u POST[''u u48324016863160132']
将包含学生选择的单选按钮的值
属性中的任何内容。一旦PHP程序中有了所有这些数据,就只需逐一将其与正确答案进行比较。(所有这些随机数都变得非常不方便,这就是为什么您应该为表单元素提供人类可读的名称。)
你在那之后做什么取决于你自己。也许你的程序会计算正确答案的数量,然后通过电子邮件发送给你,保存在数据库中,等等。但所有这些都完全超出了这里一个答案所能提供的范围。StackOverflow对于那些想找到特定问题答案的人来说是一个很好的资源,但是如果你试图使用这个网站学习一种全新的编程语言,你可能会失望。这样做有更好的资源
同时,你也可以问自己一些其他问题:
这件事要花几十个小时,如果不是几百个小时的话。想象一下,用这种方式编写每个问题需要多少时间。
<div id="content">
<div id='wsite-content' class='wsite-not-footer'>
<div class='wsite-not-footer'>
<div class="paragraph editable-text"><font size="2"><span style="font-weight: bold;"><br /><font style="color: rgb(0, 0, 0);" color="#33ccff">There are 3 videos that go with Step 1. </font></span></font><font style="color: rgb(0, 0, 0);" color="#33ccff"><br /><span></span><br /><span style="font-weight: bold;">After you watch each video there will be questions that you will need to answer about that video. Once you have completed the questions for all 3 videos, then hit 'SUBMIT' and your answers will be sent out to be graded.</span></font><br /><br /></div>
<div >
<form enctype="multipart/form-data" action="http://www.dragndropbuilder.com/editor/apps/formSubmit.php" method="POST" id="form-775529455932787620">
<div id="775529455932787620-form-parent" class="wsite-form-container" style="margin-top:10px;">
<ul class="formlist" id="775529455932787620-form-list">
<h2 style=" text-align: center; "><FONT size=2>Use the 3 videos to answer questions 1-16 and then submit them for review.</FONT></h2>
<div ><div class="wsite-form-field" style="margin:5px 0px 5px 0px;">
<label class="wsite-form-label" for="input-545537524713528365">Enter your User ID# <span class="form-required">*</span></label>
<div class="wsite-form-input-container">
<input id="input-545537524713528365" class="wsite-form-input wsite-input" type="text" name="_u545537524713528365" style="width:100px;" />
</div>
<div id="instructions-545537524713528365" class="wsite-form-instructions" style="display:none;">The User ID# that was assigned to you
(YA#)</div>
</div></div>
<div ><div class="wsite-form-field" style="margin:5px 0px 5px 0px;">
<label class="wsite-form-label" for="input-712144062427340201">Email <span class="form-required">*</span></label>
<div class="wsite-form-input-container">
<input id="input-712144062427340201" class="wsite-form-input wsite-input" type="text" name="_u712144062427340201" style="width:370px;" />
</div>
<div id="instructions-712144062427340201" class="wsite-form-instructions" style="display:none;"></div>
</div></div>
<h2 style=" text-align: center; "><br /><span></span>Video #1</h2>
<div style=" margin-top: 10px; margin-bottom: 10px; "><div style="text-align: center;"><object width="300" height="247"><param name="movie" value="http://www.youtube.com/v/rT3QOqttWj4"></param><param name="wmode" value="transparent"></param><param name="allownetworking" value="internal"></param><embed src="http://www.youtube.com/v/rT3QOqttWj4" type="application/x-shockwave-flash" allownetworking="internal" wmode="transparent" width="300" height="247"></embed></object></div></div>
<h2 style=" text-align: center; "><br /><span></span>Video #1 Questions</h2>
<div ><div class="wsite-form-field" style="margin:5px 0px 0px 0px;">
<label class="wsite-form-label" for="input-186019324657526747">1) You learned about 2 types of creeds- what were they? <span class="form-required">*</span></label>
<div class="wsite-form-radio-container">
<span class='form-radio-container'><input type='checkbox' name='_u186019324657526747[A) Internal Creed]' value='1' /><label>A) Internal Creed</label></span>
<span class='form-radio-container'><input type='checkbox' name='_u186019324657526747[B) Behavioral Creed]' value='1' /><label>B) Behavioral Creed</label></span>
<span class='form-radio-container'><input type='checkbox' name='_u186019324657526747[C) Emotional Creed]' value='1' /><label>C) Emotional Creed</label></span>
<span class='form-radio-container'><input type='checkbox' name='_u186019324657526747[D) Intellectual Creed]' value='1' /><label>D) Intellectual Creed</label></span>
</div>
<div id="instructions-1) You learned about 2 types of creeds- what were they? " class="wsite-form-instructions" style="display:none;"></div>
</div></div>
<div ><div class="wsite-form-field" style="margin:5px 0px 0px 0px;">
<label class="wsite-form-label" for="input-483240168633160132">2) Which creed is the most ideal for making good decisions? <span class="form-required">*</span></label>
<div class="wsite-form-radio-container">
<span class='form-radio-container'><input type='radio' name='_u483240168633160132' value='A) Internal Creed' /><label>A) Internal Creed</label></span>
<span class='form-radio-container'><input type='radio' name='_u483240168633160132' value='B) Behavioral Creed' /><label>B) Behavioral Creed</label></span>
<span class='form-radio-container'><input type='radio' name='_u483240168633160132' value='C) Intellectual Creed' /><label>C) Intellectual Creed</label></span>
<span class='form-radio-container'><input type='radio' name='_u483240168633160132' value='D) All of the above' /><label>D) All of the above</label></span>
<span class='form-radio-container'><input type='radio' name='_u483240168633160132' value='E) None of the above' /><label>E) None of the above</label></span>
</div>
<div id="instructions-2) Which creed is the most ideal for making good decisions?" class="wsite-form-instructions" style="display:none;"></div>
</div></div>
<div ><div class="wsite-form-field" style="margin:5px 0px 0px 0px;">
<label class="wsite-form-label" for="input-746217096361999826">3) Which creed is the one that we usually use when we make decisions? <span class="form-required">*</span></label>
<div class="wsite-form-radio-container">
<span class='form-radio-container'><input type='radio' name='_u746217096361999826' value='A) Emotional Creed' /><label>A) Emotional Creed</label></span>
<span class='form-radio-container'><input type='radio' name='_u746217096361999826' value='B) Behavioral Creed' /><label>B) Behavioral Creed</label></span>
<span class='form-radio-container'><input type='radio' name='_u746217096361999826' value='C) Intellectual Creed' /><label>C) Intellectual Creed</label></span>
<span class='form-radio-container'><input type='radio' name='_u746217096361999826' value='D) All of the above' /><label>D) All of the above</label></span>
<span class='form-radio-container'><input type='radio' name='_u746217096361999826' value='E) Both A & B' /><label>E) Both A & B</label></span>
</div>
<div id="instructions-3) Which creed is the one that we usually use when we make decisions?" class="wsite-form-instructions" style="display:none;"></div>
</div></div>
<div ><div class="wsite-form-field" style="margin:5px 0px 5px 0px;">
<label class="wsite-form-label" for="input-434256132673880428">4) Why is self-assessment & awareness important on a daily basis? <span class="form-required">*</span></label>
<div class="wsite-form-input-container">
<input id="input-434256132673880428" class="wsite-form-input wsite-input" type="text" name="_u434256132673880428" style="width:370px;" />
</div>
<div id="instructions-434256132673880428" class="wsite-form-instructions" style="display:none;"></div>
</div></div>
<div ><div class="wsite-form-field" style="margin:5px 0px 5px 0px;">
<label class="wsite-form-label" for="input-444728886557485101">5) What does it mean when Dr. Benzio says that we need to do maintenance work to prevent crisis work? <span class="form-required">*</span></label>
<div class="wsite-form-input-container">
<input id="input-444728886557485101" class="wsite-form-input wsite-input" type="text" name="_u444728886557485101" style="width:370px;" />
</div>
<div id="instructions-444728886557485101" class="wsite-form-instructions" style="display:none;"></div>
</div></div>
<div ><div class="wsite-form-field" style="margin:5px 0px 5px 0px;">
<label class="wsite-form-label" for="input-547180780270073494">6) What stands out as the most important thing that you learned by watching this video? <span class="form-required">*</span></label>
<div class="wsite-form-input-container">
<input id="input-547180780270073494" class="wsite-form-input wsite-input" type="text" name="_u547180780270073494" style="width:370px;" />
</div>
<div id="instructions-547180780270073494" class="wsite-form-instructions" style="display:none;"></div>
</div></div>
<h2 style=" text-align: center; "><br /><span></span>Video #2</h2>
<div style=" margin-bottom: 10px; margin-top: 10px; "><div style="text-align: center;"><object width="300" height="247"><param name="movie" value="http://www.youtube.com/v/WYE123qP6dc"></param><param name="wmode" value="transparent"></param><param name="allownetworking" value="internal"></param><embed src="http://www.youtube.com/v/WYE123qP6dc" type="application/x-shockwave-flash" allownetworking="internal" wmode="transparent" width="300" height="247"></embed></object></div></div>
<h2 style=" text-align: center; "><br /><span></span>Video #2 Questions</h2>
<div ><div class="wsite-form-field" style="margin:5px 0px 0px 0px;">
<label class="wsite-form-label" for="input-329313228349741149">7) People have a fear of the unknown because they are creatures of habit. <span class="form-required">*</span></label>
<div class="wsite-form-radio-container">
<span class='form-radio-container'><input type='radio' name='_u329313228349741149' value='A) True' /><label>A) True</label></span>
<span class='form-radio-container'><input type='radio' name='_u329313228349741149' value='B) False' /><label>B) False</label></span>
</div>
<div id="instructions-7) People have a fear of the unknown because they are creatures of habit." class="wsite-form-instructions" style="display:none;"></div>
</div></div>
<div ><div class="wsite-form-field" style="margin:5px 0px 5px 0px;">
<label class="wsite-form-label" for="input-775199879195536251">8) Do you want change to happen in your life? Why or why not? <span class="form-required">*</span></label>
<div class="wsite-form-input-container">
<input id="input-775199879195536251" class="wsite-form-input wsite-input" type="text" name="_u775199879195536251" style="width:370px;" />
</div>
<div id="instructions-775199879195536251" class="wsite-form-instructions" style="display:none;"></div>
</div></div>
<div ><div class="wsite-form-field" style="margin:5px 0px 0px 0px;">
<label class="wsite-form-label" for="input-251551848140163874">9) What is the smallest piece that we can break down life into? <span class="form-required">*</span></label>
<div class="wsite-form-radio-container">
<span class='form-radio-container'><input type='radio' name='_u251551848140163874' value='A) Molecules' /><label>A) Molecules</label></span>
<span class='form-radio-container'><input type='radio' name='_u251551848140163874' value='B) Days' /><label>B) Days</label></span>
<span class='form-radio-container'><input type='radio' name='_u251551848140163874' value='C) Minutes' /><label>C) Minutes</label></span>
<span class='form-radio-container'><input type='radio' name='_u251551848140163874' value='D) Decisions' /><label>D) Decisions</label></span>
</div>
<div id="instructions-9) What is the smallest piece that we can break down life into?" class="wsite-form-instructions" style="display:none;"></div>
</div></div>
<div ><div class="wsite-form-field" style="margin:5px 0px 5px 0px;">
<label class="wsite-form-label" for="input-903706497668752803">10) What does Dr. Benzio refer to as the "key to life"? <span class="form-required">*</span></label>
<div class="wsite-form-input-container">
<input id="input-903706497668752803" class="wsite-form-input wsite-input" type="text" name="_u903706497668752803" style="width:370px;" />
</div>
<div id="instructions-903706497668752803" class="wsite-form-instructions" style="display:none;"></div>
</div></div>
<div ><div class="wsite-form-field" style="margin:5px 0px 0px 0px;">
<label class="wsite-form-label" for="input-350633213472754726">11) What is this course really about? <span class="form-required">*</span></label>
<div class="wsite-form-radio-container">
<span class='form-radio-container'><input type='radio' name='_u350633213472754726' value='A) How to get out of trouble' /><label>A) How to get out of trouble</label></span>
<span class='form-radio-container'><input type='radio' name='_u350633213472754726' value='B) How to score higher on tests' /><label>B) How to score higher on tests</label></span>
<span class='form-radio-container'><input type='radio' name='_u350633213472754726' value='C) Making better decisions' /><label>C) Making better decisions</label></span>
<span class='form-radio-container'><input type='radio' name='_u350633213472754726' value='D) Figuring out ways that people will like you better' /><label>D) Figuring out ways that people will like you better</label></span>
</div>
<div id="instructions-11) What is this course really about?" class="wsite-form-instructions" style="display:none;"></div>
</div></div>
<h2 style=" text-align: center; "><br /><span></span>Video #3</h2>
<div style=" margin-bottom: 10px; margin-top: 10px; "><div style="text-align: center;"><object width="300" height="247"><param name="movie" value="http://www.youtube.com/v/TVRr5HHRUhk"></param><param name="wmode" value="transparent"></param><param name="allownetworking" value="internal"></param><embed src="http://www.youtube.com/v/TVRr5HHRUhk" type="application/x-shockwave-flash" allownetworking="internal" wmode="transparent" width="300" height="247"></embed></object></div></div>
<h2 style=" text-align: center; "><br /><span></span>Video #3 Questions</h2>
<div ><div class="wsite-form-field" style="margin:5px 0px 0px 0px;">
<label class="wsite-form-label" for="input-415479768763719608">12) What do these SPECT scans of the brain show us? <span class="form-required">*</span></label>
<div class="wsite-form-radio-container">
<span class='form-radio-container'><input type='radio' name='_u415479768763719608' value='A) How smart a person is' /><label>A) How smart a person is</label></span>
<span class='form-radio-container'><input type='radio' name='_u415479768763719608' value='B) How smart a person COULD BE' /><label>B) How smart a person COULD BE</label></span>
<span class='form-radio-container'><input type='radio' name='_u415479768763719608' value='C) Brain activity- What's actually going on in the brain' /><label>C) Brain activity- What's actually going on in the brain</label></span>
<span class='form-radio-container'><input type='radio' name='_u415479768763719608' value='D) How long until the next meal is necessary' /><label>D) How long until the next meal is necessary</label></span>
</div>
<div id="instructions-12) What do these SPECT scans of the brain show us? " class="wsite-form-instructions" style="display:none;"></div>
</div></div>
<div ><div class="wsite-form-field" style="margin:5px 0px 0px 0px;">
<label class="wsite-form-label" for="input-517463426874736495">13) Brain chemistry can change dramatically in just 8 days- True or False? <span class="form-required">*</span></label>
<div class="wsite-form-radio-container">
<span class='form-radio-container'><input type='radio' name='_u517463426874736495' value='A) True' /><label>A) True</label></span>
<span class='form-radio-container'><input type='radio' name='_u517463426874736495' value='B) False' /><label>B) False</label></span>
</div>
<div id="instructions-13) Brain chemistry can change dramatically in just 8 days- True or False? " class="wsite-form-instructions" style="display:none;"></div>
</div></div>
<div ><div class="wsite-form-field" style="margin:5px 0px 0px 0px;">
<label class="wsite-form-label" for="input-886916715838687323">14) Once brain cells are damaged, they can never be repaired- True or False? <span class="form-required">*</span></label>
<div class="wsite-form-radio-container">
<span class='form-radio-container'><input type='radio' name='_u886916715838687323' value='A) True' /><label>A) True</label></span>
<span class='form-radio-container'><input type='radio' name='_u886916715838687323' value='B) False' /><label>B) False</label></span>
</div>
<div id="instructions-14) Once brain cells are damaged, they can never be repaired- True or False?" class="wsite-form-instructions" style="display:none;"></div>
</div></div>
<div ><div class="wsite-form-field" style="margin:5px 0px 0px 0px;">
<label class="wsite-form-label" for="input-192117433637760155">15) What happened to the damaged brains after treatment according to SPECT scans? <span class="form-required">*</span></label>
<div class="wsite-form-radio-container">
<span class='form-radio-container'><input type='radio' name='_u192117433637760155' value='A) The brain chemistry stayed the same' /><label>A) The brain chemistry stayed the same</label></span>
<span class='form-radio-container'><input type='radio' name='_u192117433637760155' value='B) The brain chemistry improved' /><label>B) The brain chemistry improved</label></span>
<span class='form-radio-container'><input type='radio' name='_u192117433637760155' value='C) The brain chemistry got worse' /><label>C) The brain chemistry got worse</label></span>
</div>
<div id="instructions-15) What happened to the damaged brains after treatment according to SPECT scans?" class="wsite-form-instructions" style="display:none;"></div>
</div></div>
<div ><div class="wsite-form-field" style="margin:5px 0px 0px 0px;">
<label class="wsite-form-label" for="input-846595324763565200">16) Our brains are in a constant stage of change, both positive and negative- True or False? <span class="form-required">*</span></label>
<div class="wsite-form-radio-container">
<span class='form-radio-container'><input type='radio' name='_u846595324763565200' value='A) True' /><label>A) True</label></span>
<span class='form-radio-container'><input type='radio' name='_u846595324763565200' value='B) False' /><label>B) False</label></span>
</div>
<div id="instructions-16) Our brains are in a constant stage of change, both positive and negative- True or False?" class="wsite-form-instructions" style="display:none;"></div>
</div></div>
</ul>
</div>
<div style="display:none; visibility:hidden;">
<input type="text" name="wsite_subject" />
</div>
<div style="text-align:left; margin-top:10px; margin-bottom:10px;">
<input type="hidden" name="form_version" value="2" />
<input type="hidden" name="wsite_approved" id="wsite-approved" value="approved" />
<input type="hidden" name="ucfid" value="775529455932787620" />
<input type="submit" name="submit" value="Submit" />
</div>
</form>
</div>