public void AddXiti(string answer, string result) { string[] szItem = result.Split(','); Stat_XitiItem item = new Stat_XitiItem(); item.index = ++xiti.count; if (result.Length > 0) { item.count = szItem.Length; } else { item.count = 0; } item.ratioAnswer = Math.Round((double)100 * item.count / Global.g_Studentlist.Count, 2); int nright = 0; foreach (string buf in szItem) { string[] szP = buf.Split(':'); string _answer = szP[1]; if (_answer == answer && answer.Length > 0) { nright++; } } item.countRight = nright; item.ratioRight = Math.Round((double)100 * nright / Global.g_Studentlist.Count, 2); xiti.list.Add(item); }
public static string getStat() { //提问 总次数,总参与率,每次提问的参与率 //点名 点名次数,覆盖率,排序 //奖励 奖励次数,覆盖率,排序 Stat stat = m_stat.Clone(); //只保留12个 while (stat.handon.list.Count < 12) { Stat_HandonItem item = new Stat_HandonItem(); item.index = stat.handon.list.Count + 1; stat.handon.list.Add(item); } while (stat.xiti.list.Count < 12) { Stat_XitiItem item = new Stat_XitiItem(); item.index = stat.xiti.list.Count + 1; stat.xiti.list.Add(item); } return(stat.toJson()); }