Ejemplo n.º 1
0
        public override cls_YACRSResponse_part startElement(int elementid, Dictionary <string, string> atts, string nsuri, string elementname)
        {
            switch (elementid)
            {
            case YACRSResponse_parser.ID_sessionInfo:
                cls_sessionInfo tmp_sessionInfo = new cls_sessionInfo(this);
                tmp_sessionInfo.parseAttributes(atts);
                m_sessionInfo.Add(tmp_sessionInfo);
                return(tmp_sessionInfo);

            //break;
            case YACRSResponse_parser.ID_questionResponseInfo:
                cls_questionResponseInfo tmp_questionResponseInfo = new cls_questionResponseInfo(this);
                tmp_questionResponseInfo.parseAttributes(atts);
                m_questionResponseInfo.Add(tmp_questionResponseInfo);
                return(tmp_questionResponseInfo);

            //break;
            case YACRSResponse_parser.ID_sessionDetail:
                m_sessionDetail = new cls_sessionDetail(this);
                m_sessionDetail.parseAttributes(atts);
                return(m_sessionDetail);

            //break;
            case YACRSResponse_parser.ID_serverInfo:
                m_serverInfo = new cls_serverInfo(this);
                m_serverInfo.parseAttributes(atts);
                return(m_serverInfo);
                //break;
            }
            return(this);
        }
Ejemplo n.º 2
0
 public void newSession()
 {
     currentSessionDetail = new cls_sessionDetail();
     currentSessionDetail.M_questionMode = cls_sessionDetail.qmode.teacherled;
     currentSessionDetail.M_ublogRoom    = cls_sessionDetail.ublogmode.none;
     currentSessionDetail.M_title        = DateTime.Now.ToString("yyyy/MM/dd");
 }
Ejemplo n.º 3
0
 public cls_data(cls_YACRSResponse_part parent)
 {
     __parent = parent;
     if (__parent == null)
     {
         __owner = null;
     }
     else
     {
         __owner = __parent.getOwner();
     }
     m_sessionInfo          = new List <cls_sessionInfo>();
     m_questionResponseInfo = new List <cls_questionResponseInfo>();
     m_sessionDetail        = null;
     m_serverInfo           = null;
     m_qid = new List <int>();
 }
Ejemplo n.º 4
0
        public bool getSessionDetail(int id)
        {
            NameValueCollection formData = new NameValueCollection();

            formData.Add("action", "sessiondetail");
            formData.Add("id", id.ToString());
            string xml = httpRequest(formData, null, null, null);
            //MessageBox.Show(xml);
            cls_YACRSResponse r = responseParser.parseIn(xml);

            if (r != null)
            {
                currentSessionDetail = r.M_data.M_sessionDetail;
                return(!(currentSessionDetail == null));
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 5
0
        public int updateSession()
        {
            NameValueCollection formData = new NameValueCollection();

            formData.Add("action", "sessiondetail");
            if (currentSessionDetail.M_id > 0)
            {
                formData.Add("id", currentSessionDetail.M_id.ToString());
            }
            formData.Add("title", currentSessionDetail.M_title.ToString());
            formData.Add("courseIdentifier", currentSessionDetail.M_courseIdentifier.ToString());
            formData.Add("allowGuests", currentSessionDetail.M_allowGuests?"1":"0");
            formData.Add("visible", currentSessionDetail.M_visible ? "1" : "0");
            formData.Add("questionMode", ((int)currentSessionDetail.M_questionMode).ToString());
            formData.Add("defaultQuActiveSecs", currentSessionDetail.M_defaultQuActiveSecs.ToString());
            formData.Add("allowQuReview", currentSessionDetail.M_allowQuReview ? "1" : "0");
            formData.Add("ublogRoom", ((int)currentSessionDetail.M_ublogRoom).ToString());
            formData.Add("maxMessagelength", currentSessionDetail.M_maxMessagelength.ToString());
            formData.Add("allowTeacherQu", currentSessionDetail.M_allowTeacherQu ? "1" : "0");
            string xml = httpRequest(formData, null, null, null);
            //MessageBox.Show(xml);
            cls_YACRSResponse r = responseParser.parseIn(xml);

            if (r != null)
            {
                currentSessionDetail = r.M_data.M_sessionDetail;
                if (currentSessionDetail == null)
                {
                    return(0);
                }
                else
                {
                    return(currentSessionDetail.M_id);
                }
            }
            else
            {
                return(0);
            }
        }