//设置当前题目的答题状态 private void reset_test_status(string question_id) { DataRow[] rows = this.dtQuestion_answer_record.Select(string.Format("question_id = '{0}'", question_id)); int total_student_count = MemoryTable.studentInfoTable.Rows.Count; int iAnswered = rows.Length; int iUnknown = total_student_count - iAnswered; NotifyFormToRefreshPie(this.getValueList(iUnknown, iAnswered), true); MiddleWareCore.set_mode(MiddleWareMode.课堂测验); Program.frmClassRoom.resetClassRoomState(); //设置教室座位 根据问题查找学生ID,然后根据ID查找位置 for (int i = 0; i < rows.Length; i++) { string studentID = (string)rows[i]["student_id"]; equipmentPosition ep = MemoryTable.getEquipmentInfoByEpc(studentID); Person psn = MemoryTable.getPersonByEpc(studentID); Program.frmClassRoom.changeChairState(ep.group, ep.formatedPosition(), DocumentFileState.Green); Program.frmClassRoom.changeChairState(ep.group, ep.formatedPosition(), psn.name); } }
private void setChairState(equipmentPosition ep, DocumentFileState dfs) { Program.frmClassRoom.changeChairState(ep.group, ep.formatedPosition(), dfs); }
private void handle_event() { IntelligentEvent evt = MiddleWareCore.get_a_event(); if (evt != null) { deleControlInvoke dele = delegate(object o) { IntelligentEvent p = (IntelligentEvent)o; string epcID = p.epcID; string remoteDeviceID = p.remoteDeviceID; string question_value = p.questionValue; int totalCount = MemoryTable.studentInfoTable.Rows.Count; Person person = MemoryTable.getPersonByEpc(epcID); equipmentPosition ep = MemoryTable.getEquipmentConfigMapInfoByDeviceID(remoteDeviceID); //如果只是重复发送,不需要做什么 if (p.event_unit_list.IndexOf(IntelligentEventUnit.repeat_epc) >= 0) { //如果重复发送之外,还改变了设备的ID if (p.event_unit_list.IndexOf(IntelligentEventUnit.epc_on_another_device) >= 0) { if (person != null && ep != null) { int groupIndex = ep.group; equipmentPosition ep_old = MemoryTable.getEquipmentInfoByEpc(epcID); Program.frmClassRoom.changeChairState(ep_old.group, ep_old.formatedPosition(), DocumentFileState.InitialState); Program.frmClassRoom.changeChairState(ep_old.group, ep_old.formatedPosition(), ""); MemoryTable.clearEquipmentAndStudentCombining(epcID); Program.frmClassRoom.changeChairState(groupIndex, ep.formatedPosition(), person.name); MemoryTable.setEquipmentInfoCombineStudentID(ep, person.epc); Program.frmClassRoom.changeChairState(groupIndex, ep.formatedPosition(), DocumentFileState.Green); } } //如果重复发送之外,还改变了问题的答案,按照设计,这里不需要更改饼图 if (p.event_unit_list.IndexOf(IntelligentEventUnit.change_answer) >= 0) { this.refreshAnswerRecord(person, question_value); } } else if (p.event_unit_list.IndexOf(IntelligentEventUnit.new_epc) >= 0) { //处理该事件需要更新数据和显示页面 if (person != null && ep != null) { MemoryTable.setEquipmentInfoCombineStudentID(ep, epcID); Program.frmClassRoom.changeChairState(ep.group, ep.formatedPosition(), DocumentFileState.Green); Program.frmClassRoom.changeChairState(ep.group, ep.formatedPosition(), person.name); } this.refreshAnswerRecord(person, question_value); this.refreshPie(); } }; this.Invoke(dele, evt); } }
private void setChairState(equipmentPosition ep, string text) { Program.frmClassRoom.changeChairState(ep.group, ep.formatedPosition(), text); }