Пример #1
0
        private string MatrixRadioOtherStatHtml(int sqId, int spiId)
        {
            StringBuilder strSb = new StringBuilder();

            strSb.Append("<div class=\"jiXh\"><ul id=\"faq\" class=\"clearfix\">");
            Entities.QuerySurveyMatrixTitle query = new Entities.QuerySurveyMatrixTitle();
            query.SQID = sqId;
            int       totalCount = 0;
            DataTable dt         = BLL.SurveyMatrixTitle.Instance.GetSurveyMatrixTitle(query, "", 1, 1000, out totalCount);

            if (dt != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    strSb.Append("<li><dl><dt onclick='OptionStatShowHide(this)'>(" + (i + 1) + ")" + dt.Rows[i]["TitleName"] + "<span title=\"收缩\" style=\"margin-left:50px; color:#CCC8C0\">∧</span></dt>");
                    strSb.Append("<dd><div class=\"left chartC\"><table  width=\"100%\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
                    DataTable dtResult        = BLL.SurveyMatrixTitle.Instance.StatOptionForMatrixRadio(int.Parse(dt.Rows[i]["SMTID"].ToString()), spiId);
                    int       surveyPersonNum = BLL.SurveyAnswer.Instance.GetAnswerUserCountBySQID(sqId, spiId);
                    if (dtResult != null && dtResult.Rows.Count > 0)
                    {
                        strSb.Append("<thead  style=\"background:#F2F2F2;\"><th width=\"50%\">选项</th><th width=\"23%\">小计</th><th width=\"27%\">比例</th></thead>");
                        foreach (DataRow dr in dtResult.Rows)
                        {
                            strSb.Append("<tr>");

                            strSb.Append("<td>" + dr["OptionName"].ToString() + "</td>");
                            int num = int.Parse(dr["ExamNum"].ToString());
                            strSb.Append("<td>" + num.ToString() + "</td>");
                            decimal perOf = 0;
                            if (surveyPersonNum > 0)
                            {
                                perOf = ((decimal)num / (decimal)surveyPersonNum) * 100;
                            }
                            strSb.Append("<td>" + perOf.ToString("0.00") + "%</td>");

                            strSb.Append("</tr>");
                        }

                        strSb.Append("<tr style=\"background:#F2F2F2;\"><td style=\"font-weight:bold\">本题有效填写人次</td><td>" + surveyPersonNum + "</td><td>&nbsp;</td></tr></table>");
                    }

                    strSb.Append(" </table></div><div class=\"right chart\"></div></dd></dl></li>");
                }
            }
            strSb.Append("</ul></div>");

            return(strSb.ToString());
        }
Пример #2
0
        protected void rpQuestionList_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                int    intVal     = 0;
                int    totalCount = 0;
                string Sqid       = "";

                #region 取问题ID

                HtmlInputHidden InputID = (HtmlInputHidden)e.Item.FindControl("hidItemSQID");
                if (InputID != null)
                {
                    Sqid = InputID.Value;
                }

                #endregion

                if (Sqid != "" && int.TryParse(Sqid, out intVal))
                {
                    #region 绑定选项

                    Entities.QuerySurveyOption optionQuery = new Entities.QuerySurveyOption();
                    optionQuery.SQID   = int.Parse(Sqid);
                    optionQuery.Status = 0;
                    DataTable optionDt = BLL.SurveyOption.Instance.GetSurveyOption(optionQuery, " OrderNum ", 1, 999, out totalCount);

                    foreach (DataRow dr in optionDt.Rows)
                    {
                        if (dr["linkid"].ToString() != "0")
                        {
                            string linkid = dr["linkid"].ToString();

                            DataTable questDt = (DataTable)this.rpQuestionList.DataSource;
                            for (int i = 0; i < questDt.Rows.Count; i++)
                            {
                                if (questDt.Rows[i]["SQID"].ToString() == linkid)
                                {
                                    dr["linkid"] = i + 1;
                                    break;
                                }
                            }
                        }
                    }
                    if (totalCount > 0)
                    {
                        Repeater rpOptionList = e.Item.FindControl("rpOptionList") as Repeater;
                        if (rpOptionList != null)
                        {
                            rpOptionList.DataSource = optionDt;
                            rpOptionList.DataBind();
                        }
                    }

                    #endregion

                    #region 绑定矩阵

                    Entities.QuerySurveyMatrixTitle matrixQuery = new Entities.QuerySurveyMatrixTitle();
                    matrixQuery.SQID   = int.Parse(Sqid);
                    matrixQuery.Status = 0;

                    DataTable matrixDt = BLL.SurveyMatrixTitle.Instance.GetSurveyMatrixTitle(matrixQuery, " CreateTime ", 1, 999, out totalCount);
                    if (totalCount > 0)
                    {
                        Repeater rpMatrixTitleList = e.Item.FindControl("rpMatrixTitleList") as Repeater;
                        if (rpMatrixTitleList != null)
                        {
                            rpMatrixTitleList.DataSource = matrixDt;
                            rpMatrixTitleList.DataBind();
                        }
                    }

                    #endregion
                }
            }
        }
Пример #3
0
        //矩阵下拉
        private string StatQuestionForMatrixDropdown(int sqId, int spiId)
        {
            StringBuilder strSB = new StringBuilder();
            DataTable     dt    = BLL.SurveyQuestion.Instance.StatQuestionForMatrixDropdown(sqId, spiId);

            strSB.Append("<table  width=\"100%\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
            Entities.QuerySurveyMatrixTitle query = new Entities.QuerySurveyMatrixTitle();
            query.SQID = sqId;
            query.Type = 2;
            int       totalCount = 0;
            DataTable dtOption   = BLL.SurveyMatrixTitle.Instance.GetSurveyMatrixTitle(query, "", 1, 1000, out totalCount);

            strSB.Append("<thead  style=\"background:#F2F2F2;\">");
            strSB.Append("<th>题目\\选项</th>");
            foreach (DataRow dr in dtOption.Rows)
            {
                strSB.Append("<th>" + dr["TitleName"] + "</th>");
            }
            strSB.Append("<th>列平均</th><th>列小计</th></thead>");
            int j        = 0;
            int totalNum = BLL.SurveyAnswer.Instance.GetAnswerUserCountBySQID(sqId, spiId);
            int colCount = dt.Columns.Count;

            decimal[] rolSumArry = new decimal[colCount - 1];
            foreach (DataRow dr in dt.Rows)
            {
                if (j % 2 == 0)
                {
                    strSB.Append("<tr>");
                }
                else
                {
                    strSB.Append("<tr style='background:#F2F2F2;'>");
                }

                decimal colSum = 0;

                for (int i = 0; i < colCount; i++)
                {
                    if (i > 0)
                    {
                        decimal perOf = 0;
                        if (totalNum > 0)
                        {
                            perOf  = decimal.Parse(dr[i].ToString()) / (decimal)totalNum;
                            colSum = colSum + perOf;
                        }
                        strSB.Append("<td>" + perOf.ToString("0.00") + "</td>");
                        for (int r = 0; r < rolSumArry.Length; r++)
                        {
                            if ((i - 1) == r)
                            {
                                rolSumArry[r] = rolSumArry[r] + perOf;
                            }
                        }
                    }
                    else
                    {
                        strSB.Append("<td>" + dr[i] + "</td>");
                    }
                }
                decimal colPerOf = colSum / (decimal)(colCount - 1);
                strSB.Append("<td>" + colPerOf.ToString("0.00") + "</td><td>" + colSum.ToString("0.00") + "</td></tr>");

                j++;
            }
            //行平均
            strSB.Append("<tr><td>行平均</td>");
            decimal sum = 0;

            for (int i = 0; i < rolSumArry.Length; i++)
            {
                sum = sum + rolSumArry[i];
                decimal rolPerOf = (rolSumArry[i] / (decimal)(dt.Rows.Count));
                strSB.Append("<td>" + rolPerOf.ToString("0.00") + "</td>");
            }
            strSB.Append("<td style='background-color:red;'>" + ((sum / (decimal)(dt.Rows.Count)) / (decimal)(colCount - 1)).ToString("0.00") + "</td><td>N/A</td></tr>");
            //行小计
            strSB.Append("<tr><td>行小计</td>");
            for (int i = 0; i < rolSumArry.Length; i++)
            {
                strSB.Append("<td>" + rolSumArry[i].ToString("0.00") + "</td>");
            }
            strSB.Append("<td>N/A</td><td style='background-color:red;'>" + sum.ToString("0.00") + "</td></tr>");
            strSB.Append("</table>");
            return(strSB.ToString());
        }
Пример #4
0
        private string GetAnswerDetailResultTableStr()
        {
            int           spiid      = 0;
            StringBuilder sbTableStr = new StringBuilder();

            if (int.TryParse(SPIID, out spiid))
            {
                Entities.SurveyProjectInfo info = BLL.SurveyProjectInfo.Instance.GetSurveyProjectInfo(spiid);
                if (info != null)
                {
                    Entities.QuerySurveyOption queryAllOption = new Entities.QuerySurveyOption();
                    queryAllOption.SIID   = info.SIID;
                    queryAllOption.Status = 0;
                    int totalAllOption = 0;
                    //获取试题下所有选项
                    DataTable dtAllOption = BLL.SurveyOption.Instance.GetSurveyOption(queryAllOption, "", 1, -1, out totalAllOption);

                    sbTableStr.Append("<table style='BORDER-COLLAPSE: collapse' borderColor=#000000 height=40 cellPadding=1 align=center border=1>");
                    DataTable dt = BLL.SurveyAnswer.Instance.GetAnswerDetailBySPIID(spiid);
                    if (dt.Rows.Count > 0)
                    {
                        //记录非矩阵题的选项个数
                        int totalCount = 0;
                        //记录单选题选项个数
                        int scoreQuestionCount = 0;
                        int scoreOptionCount   = 0;
                        //记录单选题选项个数
                        int radioQuestionCount = 0;
                        int radioOptionCount   = 0;
                        //记录多选题选项个数
                        int checkQuestionCount = 0;
                        int checkOptionCount   = 0;
                        //记录文本题选项个数
                        int textQuestionCount = 0;
                        //记录矩阵单选选项个数
                        int matrixRadioQuestionCount = 0;
                        int matrixRadioOptionCount   = 0;

                        //记录矩阵下拉横坐标个数
                        int matrixDQuestionCount = 0;
                        int matrixDOptionCount   = 0;

                        #region 输出试题名称
                        sbTableStr.Append("<tr>");
                        sbTableStr.Append("<td>姓名</td><td>时间</td>");

                        Entities.QuerySurveyQuestion queryQuestion = new Entities.QuerySurveyQuestion();
                        queryQuestion.SIID          = (int)info.SIID;
                        queryQuestion.AskCategory   = 1;
                        queryQuestion.IsStatByScore = 1;
                        queryQuestion.Status        = 0;
                        DataTable dtScoreQuestion = BLL.SurveyQuestion.Instance.GetSurveyQuestion(queryQuestion, " SQID asc", 1, -1, out scoreQuestionCount);

                        //单选试题名称行(按分数统计)
                        foreach (DataRow dr in dtScoreQuestion.Rows)
                        {
                            //int optionCount= BLL.SurveyOption.Instance.GetSurveyOptionCountBySQID(int.Parse(dr["SQID"].ToString()));
                            sbTableStr.Append("<td align='center'>" + (int.Parse(dr["OrderNum"].ToString()) + 1) + "、" + dr["Ask"].ToString() + "</td>");
                        }
                        scoreOptionCount = scoreQuestionCount;
                        totalCount      += scoreOptionCount;

                        queryQuestion.AskCategory   = 1;
                        queryQuestion.IsStatByScore = 0;
                        DataTable dtRadioQuestion = BLL.SurveyQuestion.Instance.GetSurveyQuestion(queryQuestion, " SQID asc", 1, -1, out radioQuestionCount);

                        //单选试题名称行(不按分数统计)
                        foreach (DataRow dr in dtRadioQuestion.Rows)
                        {
                            //int optionCount = BLL.SurveyOption.Instance.GetSurveyOptionCountBySQID(int.Parse(dr["SQID"].ToString()));
                            sbTableStr.Append("<td align='center'>" + (int.Parse(dr["OrderNum"].ToString()) + 1) + "、" + dr["Ask"].ToString() + "</td>");
                        }

                        radioOptionCount = radioQuestionCount;
                        totalCount      += radioOptionCount;

                        queryQuestion.AskCategory = 2;
                        DataTable dtCheckQuestion = BLL.SurveyQuestion.Instance.GetSurveyQuestion(queryQuestion, " SQID asc", 1, -1, out checkQuestionCount);

                        //拼接多选试题名称行
                        foreach (DataRow dr in dtCheckQuestion.Rows)
                        {
                            int optionCount = BLL.SurveyOption.Instance.GetSurveyOptionCountBySQID(int.Parse(dr["SQID"].ToString()));
                            checkOptionCount += optionCount;
                            sbTableStr.Append("<td colspan='" + optionCount + "' align='center'>" + (int.Parse(dr["OrderNum"].ToString()) + 1) + "、" + dr["Ask"].ToString() + "</td>");
                            totalCount += checkOptionCount;
                        }

                        queryQuestion.AskCategory = 3;
                        DataTable dtTextQuestion = BLL.SurveyQuestion.Instance.GetSurveyQuestion(queryQuestion, " SQID asc", 1, -1, out textQuestionCount);
                        totalCount += textQuestionCount;
                        //拼接文本试题名称行
                        foreach (DataRow dr in dtTextQuestion.Rows)
                        {
                            sbTableStr.Append("<td align='center'>" + (int.Parse(dr["OrderNum"].ToString()) + 1) + "、" + dr["Ask"].ToString() + "</td>");
                        }

                        queryQuestion.AskCategory = 4;
                        DataTable dtMatrixRQuestion = BLL.SurveyQuestion.Instance.GetSurveyQuestion(queryQuestion, " SQID asc", 1, -1, out matrixRadioQuestionCount);
                        int       rTitleCount       = 0;
                        //拼接矩阵单选试题名称行
                        foreach (DataRow dr in dtMatrixRQuestion.Rows)
                        {
                            rTitleCount = BLL.SurveyMatrixTitle.Instance.GetSurveyMatrixTitleCount(int.Parse(dr["SQID"].ToString()), 1);
                            sbTableStr.Append("<td colspan='" + rTitleCount + "' align='center'>" + (int.Parse(dr["OrderNum"].ToString()) + 1) + "、" + dr["Ask"].ToString() + "</td>");
                            matrixRadioOptionCount += rTitleCount;
                        }

                        queryQuestion.AskCategory = 5;
                        DataTable dtMatrixDQuestion = BLL.SurveyQuestion.Instance.GetSurveyQuestion(queryQuestion, " SQID asc", 1, -1, out matrixDQuestionCount);
                        int       dTitleCount       = 0;
                        //拼接矩阵下拉试题名称行
                        foreach (DataRow dr in dtMatrixDQuestion.Rows)
                        {
                            int optionCount = BLL.SurveyMatrixTitle.Instance.GetSurveyMatrixTitleCount(int.Parse(dr["SQID"].ToString()), 2);
                            matrixDOptionCount += optionCount;
                            dTitleCount         = BLL.SurveyMatrixTitle.Instance.GetSurveyMatrixTitleCount(int.Parse(dr["SQID"].ToString()), 1);
                            sbTableStr.Append("<td colspan='" + (optionCount * dTitleCount) + "' align='center'>" + (int.Parse(dr["OrderNum"].ToString()) + 1) + "、" + dr["Ask"].ToString() + "</td>");
                        }
                        matrixDOptionCount = matrixDOptionCount * dTitleCount;
                        sbTableStr.Append("</tr>");
                        #endregion

                        #region 输出矩阵纵坐标选项
                        if (matrixRadioQuestionCount > 0 || matrixDQuestionCount > 0)
                        {
                            int spanLength = scoreOptionCount + radioOptionCount + checkOptionCount + textQuestionCount + 2;
                            sbTableStr.Append("<tr>");
                            sbTableStr.Append("<td colspan='" + spanLength + "'></td>");
                            foreach (DataRow dr in dtMatrixRQuestion.Rows)
                            {
                                int optionCount = BLL.SurveyOption.Instance.GetSurveyOptionCountBySQID(int.Parse(dr["SQID"].ToString()));
                                int titleCount  = BLL.SurveyMatrixTitle.Instance.GetSurveyMatrixTitleCount(int.Parse(dr["SQID"].ToString()), 1);
                                Entities.QuerySurveyMatrixTitle matrixTitleQuery = new Entities.QuerySurveyMatrixTitle();
                                matrixTitleQuery.SQID   = int.Parse(dr["SQID"].ToString());
                                matrixTitleQuery.Type   = 1;
                                matrixTitleQuery.Status = 0;
                                int       matrixTitleCount = 0;
                                DataTable dtMatrixTitle    = BLL.SurveyMatrixTitle.Instance.GetSurveyMatrixTitle(matrixTitleQuery, "SMTID asc", 1, -1, out matrixTitleCount);
                                foreach (DataRow row in dtMatrixTitle.Rows)
                                {
                                    sbTableStr.Append("<td  align='center'>" + row["TitleName"].ToString() + "</td>");
                                }
                            }
                            foreach (DataRow dr in dtMatrixDQuestion.Rows)
                            {
                                int optionCount = BLL.SurveyMatrixTitle.Instance.GetSurveyMatrixTitleCount(int.Parse(dr["SQID"].ToString()), 2);
                                int titleCount  = BLL.SurveyMatrixTitle.Instance.GetSurveyMatrixTitleCount(int.Parse(dr["SQID"].ToString()), 1);
                                Entities.QuerySurveyMatrixTitle matrixTitleQuery = new Entities.QuerySurveyMatrixTitle();
                                matrixTitleQuery.SQID   = int.Parse(dr["SQID"].ToString());
                                matrixTitleQuery.Type   = 1;
                                matrixTitleQuery.Status = 0;
                                int       matrixTitleCount = 0;
                                DataTable dtMatrixTitle    = BLL.SurveyMatrixTitle.Instance.GetSurveyMatrixTitle(matrixTitleQuery, "SMTID asc", 1, -1, out matrixTitleCount);
                                foreach (DataRow row in dtMatrixTitle.Rows)
                                {
                                    sbTableStr.Append("<td colspan='" + optionCount + "' align='center'>" + row["TitleName"].ToString() + "</td>");
                                }
                            }
                            sbTableStr.Append("</tr>");
                        }
                        #endregion

                        #region 输出选项
                        sbTableStr.Append("<tr><td></td><td></td>");
                        //按分数统计的单选题
                        foreach (DataRow dr in dtScoreQuestion.Rows)
                        {
                            sbTableStr.Append("<td></td>");
                        }
                        //不按分数统计的单选题
                        foreach (DataRow dr in dtRadioQuestion.Rows)
                        {
                            sbTableStr.Append("<td></td>");
                        }
                        //多选题
                        foreach (DataRow dr in dtCheckQuestion.Rows)
                        {
                            List <Entities.SurveyOption> list = BLL.SurveyOption.Instance.GetSurveyOptionListBySQID(int.Parse(dr["SQID"].ToString()));
                            foreach (Entities.SurveyOption optionInfo in list)
                            {
                                sbTableStr.Append("<td>" + optionInfo.OptionName + "</td>");
                            }
                        }
                        //文本题
                        foreach (DataRow dr in dtTextQuestion.Rows)
                        {
                            sbTableStr.Append("<td></td>");
                        }

                        //矩阵单选题
                        foreach (DataRow dr in dtMatrixRQuestion.Rows)
                        {
                            Entities.QuerySurveyMatrixTitle queryMatrixTitle = new Entities.QuerySurveyMatrixTitle();
                            queryMatrixTitle.SQID   = int.Parse(dr["SQID"].ToString());
                            queryMatrixTitle.Type   = 1;
                            queryMatrixTitle.Status = 0;
                            int       totalTitle     = 0;
                            DataTable dtCMatrixTitle = BLL.SurveyMatrixTitle.Instance.GetSurveyMatrixTitle(queryMatrixTitle, "SMTID asc", 1, -1, out totalTitle);
                            foreach (DataRow drTitle in dtCMatrixTitle.Rows)
                            {
                                sbTableStr.Append("<td></td>");
                            }
                        }
                        //矩阵下拉
                        foreach (DataRow dr in dtMatrixDQuestion.Rows)
                        {
                            Entities.QuerySurveyMatrixTitle queryRMatrixTitle = new Entities.QuerySurveyMatrixTitle();
                            queryRMatrixTitle.SQID   = int.Parse(dr["SQID"].ToString());
                            queryRMatrixTitle.Type   = 2;
                            queryRMatrixTitle.Status = 0;
                            int       totalTitle     = 0;
                            DataTable dtRMatrixTitle = BLL.SurveyMatrixTitle.Instance.GetSurveyMatrixTitle(queryRMatrixTitle, "SMTID asc", 1, -1, out totalTitle);

                            Entities.QuerySurveyMatrixTitle queryCMatrixTitle = new Entities.QuerySurveyMatrixTitle();
                            queryCMatrixTitle.SQID   = int.Parse(dr["SQID"].ToString());
                            queryCMatrixTitle.Type   = 1;
                            queryCMatrixTitle.Status = 0;
                            DataTable dtCMatrixTitle = BLL.SurveyMatrixTitle.Instance.GetSurveyMatrixTitle(queryCMatrixTitle, "SMTID asc", 1, -1, out totalTitle);

                            foreach (DataRow cTitle in dtCMatrixTitle.Rows)
                            {
                                foreach (DataRow rTitle in dtRMatrixTitle.Rows)
                                {
                                    sbTableStr.Append("<td>" + rTitle["TitleName"] + "</td>");
                                }
                            }
                        }
                        sbTableStr.Append("</tr>");
                        #endregion

                        #region 输出答题情况
                        DataTable dtResult = BLL.SurveyAnswer.Instance.GetAnswerDetailBySPIID(info.SPIID);
                        if (dtResult.Rows.Count > 0)
                        {
                            int colCount = dtResult.Columns.Count;
                            for (int i = 0; i < dtResult.Rows.Count; i++)
                            {
                                sbTableStr.Append("<tr>");
                                for (int j = 0; j < colCount; j++)
                                {
                                    if (j == 0)
                                    {
                                        string userName = dtResult.Rows[i][j].ToString();
                                        if (!string.IsNullOrEmpty(dtResult.Rows[i][j].ToString()))
                                        {
                                            int userId = int.Parse(dtResult.Rows[i][j].ToString());
                                            userName = BitAuto.YanFa.SysRightManager.Common.UserInfo.GerTrueName(userId);
                                        }
                                        //int userId=int.Parse()
                                        sbTableStr.Append("<td>" + userName + "</td>");
                                    }
                                    else if (j == 1)
                                    {
                                        sbTableStr.Append("<td>" + dtResult.Rows[i][j].ToString() + "</td>");
                                    }
                                    //单选按分数统计
                                    else if (j > 2 && j < scoreOptionCount + 3)
                                    {
                                        sbTableStr.Append("<td>" + dtResult.Rows[i][j].ToString() + "</td>");
                                    }
                                    //单选不按分数统计
                                    else if (j > scoreOptionCount + 3 && j < scoreOptionCount + radioOptionCount + 4)
                                    {
                                        string resultStr = dtResult.Rows[i][j].ToString();
                                        if (!string.IsNullOrEmpty(resultStr))
                                        {
                                            DataRow[] drSelects = dtAllOption.Select(" SOID=" + int.Parse(resultStr));
                                            if (drSelects.Length > 0)
                                            {
                                                if (drSelects[0]["IsBlank"].ToString() == "1")//如果是填空的回答,找答案
                                                {
                                                    resultStr = BLL.SurveyAnswer.Instance.getAnswerBySQID(" spiid=" + spiid + " and siid=" + drSelects[0]["siid"].ToString() + " and CreateUserID=" + dtResult.Rows[i]["cuserID"].ToString() + " and soid=" + drSelects[0]["soid"].ToString());
                                                }
                                                else
                                                {
                                                    resultStr = drSelects[0]["OptionName"].ToString();
                                                }
                                            }
                                        }
                                        sbTableStr.Append("<td>" + resultStr + "</td>");
                                    }
                                    //多选题
                                    else if (j > scoreOptionCount + radioOptionCount + 4 && j < scoreOptionCount + radioOptionCount + checkOptionCount + 5)
                                    {
                                        string resultStr = dtResult.Rows[i][j].ToString();
                                        if (!string.IsNullOrEmpty(resultStr))
                                        {
                                            DataRow[] drSelects = dtAllOption.Select(" SOID=" + int.Parse(resultStr));
                                            if (drSelects.Length > 0)
                                            {
                                                if (drSelects[0]["IsBlank"].ToString() == "1")//如果是填空的回答,找答案
                                                {
                                                    resultStr = BLL.SurveyAnswer.Instance.getAnswerBySQID(" spiid=" + spiid + " and siid=" + drSelects[0]["siid"].ToString() + " and CreateUserID=" + dtResult.Rows[i]["cuserID"].ToString() + " and soid=" + drSelects[0]["soid"].ToString());
                                                }
                                                else
                                                {
                                                    resultStr = drSelects[0]["OptionName"].ToString();
                                                }
                                            }
                                        }
                                        sbTableStr.Append("<td>" + resultStr + "</td>");
                                    }
                                    //文本题
                                    else if (j > scoreOptionCount + radioOptionCount + checkOptionCount + 5 && j < scoreOptionCount + radioOptionCount + checkOptionCount + textQuestionCount + 6)
                                    {
                                        sbTableStr.Append("<td>" + dtResult.Rows[i][j].ToString() + "</td>");
                                    }
                                    //矩阵单选题
                                    else if (j > scoreOptionCount + radioOptionCount + checkOptionCount + textQuestionCount + 6 && j < scoreOptionCount + radioOptionCount + checkOptionCount + textQuestionCount + matrixRadioOptionCount + 7)
                                    {
                                        string resultStr = dtResult.Rows[i][j].ToString();
                                        if (!string.IsNullOrEmpty(resultStr))
                                        {
                                            DataRow[] drSelects = dtAllOption.Select(" SOID=" + int.Parse(resultStr));
                                            if (drSelects.Length > 0)
                                            {
                                                resultStr = drSelects[0]["OptionName"].ToString();
                                            }
                                        }
                                        sbTableStr.Append("<td>" + resultStr + "</td>");
                                    }
                                    //矩阵下拉
                                    else if (j > scoreOptionCount + radioOptionCount + checkOptionCount + textQuestionCount + matrixRadioOptionCount + 7 && j < scoreOptionCount + radioOptionCount + checkOptionCount + textQuestionCount + matrixRadioOptionCount + matrixDOptionCount + 8)
                                    {
                                        sbTableStr.Append("<td>" + dtResult.Rows[i][j].ToString() + "</td>");
                                    }
                                }
                                sbTableStr.Append("</tr>");
                            }
                        }
                        #endregion
                    }

                    sbTableStr.Append("</table>");
                }
            }

            return(sbTableStr.ToString());
        }