Foxtable(狐表)用户栏目专家坐堂 → [求助]如何分类统计答题错误信息


  共有2638人关注过本帖树形打印复制链接

主题:[求助]如何分类统计答题错误信息

帅哥哟,离线,有人找我吗?
大红袍
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/8/14 12:53:00 [显示全部帖子]

Dim dr As Row = Tables("客观题答案").Rows(0)
Dim lst1 As new List(of String)
Dim lst2 As new List(of String)
For Each r As Row In Tables("卷1答").Rows
    For Each c As Col In Tables("卷1答").Cols
        If r.IsNull(c.Name) Then Continue For
        If c.Name.StartsWith("客观题") Then
           
            lst1.Clear
            lst2.Clear
            Dim v As String = r(c.Name)
            For i As Integer = 0 To v.Length-1
                lst1.Add(v(i))
            Next
            v = dr(c.Name)
            For j As Integer = 0 To v.Length-1
                If lst1.Contains(v(j)) Then
                    lst1.Remove(v(j))
                Else
                    lst2.Add(v(j))
                End If
            Next
            lst1.AddRange(lst2.ToArray())
            For Each s As String In lst1
                Dim filter = "统计号 = '" & c.Name.Replace("客观题","") & s.ToUpper() & "'"
                Dim drt As DataRow = DataTables("卷1统").Find(filter)
                If drt("错误学生").Contains(r("姓名")) = False Then
                    drt("错误人数") = drt("错误人数")+1
                   
                    drt("错误学生") = (drt("错误学生") & "," & r("姓名")).trimstart(",")
                End If
            Next
        ElseIf c.Name.StartsWith("主观题") Then
            If r(c.Name) = "F" Then
                Dim filter = "统计号 = '" & c.Name.Replace("观题","") &  "'"
                Dim drt As DataRow = DataTables("卷1统").Find(filter)
                If drt("错误学生").Contains(r("姓名")) = False Then
                    drt("错误人数") = drt("错误人数")+1
                    drt("错误学生") = (drt("错误学生") & "," & r("姓名")).trimstart(",")
                end if
            End If
        End If
    Next
Next

 回到顶部