如何生成在线测试结果 [英] How do I generateresult for online test

查看:95
本文介绍了如何生成在线测试结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

i am developing online test system using as.net. i have used repeater control and within repeater label for question and radiobuttons for option i.e mcq opion , i am not able to access those radiobutton to create final report(result),also i have bound those radiobutton with database using eval method ,and my datbase contaion column as col1:question,col2: optiona col3:optionb, col4:optionc col5:optiond col5:correctoption so i want to compare the value of selected radio button with column correctoption to generate report my aspx code:
Hide   Expand    Copy Code
<asp:Repeater ID="Repeater1" runat="server">
   <HeaderTemplate>

   </HeaderTemplate>
   <ItemTemplate>
   <div align="left">
   <table >
   <tr >
   <td>
       <asp:Label ID="Label1" runat="server" Text='<%# Eval("Question") %>' CssClass="label-primary" Font-Size="Small"></asp:Label>
    <br /></td>
    </tr>
    <tr>
    <td class="pull-left">
        <asp:RadioButton ID="RadioButton1" runat="server" OnCheckedChanged="check"  Text='<%# Eval("optiona") %>'  GroupName="group"/>
       <br /></td></tr>
       <tr>
       <td class="pull-left">
       <asp:RadioButton ID="RadioButton2" runat="server" OnCheckedChanged="check" Text='<%# Eval("optionb") %>'  GroupName="group"/>
       <br />
       </td>
             </tr>
       <tr>
       <td class="pull-left">
       <asp:RadioButton ID="RadioButton3" runat="server" OnCheckedChanged="check" Text='<%# Eval("optionc") %>'  GroupName="group"/>
       <br /></td></tr>
       <tr>
       <td class="pull-left">
       <asp:RadioButton ID="RadioButton4" runat="server"  OnCheckedChanged="check" Text='<%# Eval("optiond") %>'  GroupName="group"/>
   </td>
   </tr>
   </table>
   </div>
   </ItemTemplate>
   <SeparatorTemplate>
   <br /><hr /><br />
   </SeparatorTemplate>
   <FooterTemplate>
   <table>
   <tr><td>
       <asp:LinkButton ID="SubmitAnswers" runat="server" CssClass="alert-link" Font-Bold="true" Font-Size="X-Large" OnClick="lnk_click">submit</asp:LinkButton></td><td width="15px"></td><td>
           <asp:LinkButton ID="LinkButton2" runat="server" CssClass="alert-link" Font-Bold="true" Font-Size="X-Large">Cancel</asp:LinkButton></td></tr>
   </table>
   </FooterTemplate>
   </asp:Repeater>
creating report means i have show the result the counting of the marks that end user scored.so for that i have to compare the value which end user has selected i.e radiobutton he/she has selected with the correct ans which i have stored in database with table name test my database table test questionID int question nvarchar(255) optiona  varchar(255)    optionb varchar(255)    optionc varchar(255)    optiond varchar(255)    correctans varchar(255) questioncat varchar(255)    thank you for your concern and reply. :)

推荐答案

我认为你在寻找 - 如何在转发器中选择radiobutton id? [ ^ ]。

I think you are looking for - How get selected radiobutton id in repeater?[^].
string rdValues="";
foreach (RepeaterItem ri in RepDetails.Items)
{
    RadioButton rd = (RadioButton)ri.FindControl("rdioId1");

    if (rd.Checked == true)
    {
        rdValues=rdValues+rd.Text;
    }
}


这篇关于如何生成在线测试结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆