Example #1
0
 public cls_globalQuType(cls_YACRSResponse_part parent)
 {
     __parent = parent;
     if (__parent == null)
     {
         __owner = null;
     }
     else
     {
         __owner = __parent.getOwner();
     }
     m_globalQuType = "";
 }
Example #2
0
 public cls_serverInfo(cls_YACRSResponse_part parent)
 {
     __parent = parent;
     if (__parent == null)
     {
         __owner = null;
     }
     else
     {
         __owner = __parent.getOwner();
     }
     m_globalQuType = new List <cls_globalQuType>();
 }
Example #3
0
 public cls_optionInfo(cls_YACRSResponse_part parent)
 {
     __parent = parent;
     if (__parent == null)
     {
         __owner = null;
     }
     else
     {
         __owner = __parent.getOwner();
     }
     m_title     = "";
     m_isCorrect = null;
 }
Example #4
0
 public cls_YACRSResponse(cls_YACRSResponse_part parent)
 {
     __parent = parent;
     if (__parent == null)
     {
         __owner = this;
     }
     else
     {
         __owner = __parent.getOwner();
     }
     messageName = null;
     m_error     = new List <string>();
     m_data      = new cls_data(this);
 }
Example #5
0
 public cls_sessionInfo(cls_YACRSResponse_part parent)
 {
     __parent = parent;
     if (__parent == null)
     {
         __owner = null;
     }
     else
     {
         __owner = __parent.getOwner();
     }
     m_ownerID = "";
     m_title   = "";
     m_created = "";
 }
Example #6
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>();
 }
 public cls_questionResponseInfo(cls_YACRSResponse_part parent)
 {
     __parent = parent;
     if (__parent == null)
     {
         __owner = null;
     }
     else
     {
         __owner = __parent.getOwner();
     }
     questionClass   = null;
     displayURL      = null;
     m_responseCount = null;
     m_timeToGo      = null;
     m_timeGone      = null;
     m_optionInfo    = new List <cls_optionInfo>();
 }
 internal void setParent(cls_YACRSResponse_part n_parent)
 {
     __parent = n_parent;
 }
Example #9
0
        public cls_YACRSResponse parseIn(string source)
        {
            XmlTextReader parser;
            string        elementname;
            StringReader  sr = new StringReader(source);

            parser            = new XmlTextReader(sr);
            the_YACRSResponse = null;
            try
            {
                while (parser.Read())
                {
                    switch (parser.NodeType)
                    {
                    case XmlNodeType.XmlDeclaration:
                        break;

                    case XmlNodeType.Element:
                        elementname = parser.LocalName;
                        int elementid = LookupElementID(elementname);
                        containerids.Push(elementid);
                        Dictionary <string, string> atts2 = new Dictionary <string, string>();
                        if (parser.HasAttributes)
                        {
                            while (parser.MoveToNextAttribute())
                            {
                                atts2.Add(parser.Name, parser.Value);
                            }
                            parser.MoveToElement();
                        }
                        if (elementid == ID_YACRSResponse)
                        {
                            tmpPart = new cls_YACRSResponse();
                            tmpPart.parseAttributes(atts2);
                        }
                        else
                        {
                            if (tmpPart != null)
                            {
                                tmpPart = tmpPart.startElement(elementid, atts2, parser.NamespaceURI, elementname);
                            }
                        }
                        if ((parser.IsEmptyElement) && (elementname.Equals(tmpPart.getElementName())))
                        {
                            containerids.Pop();
                            tmpPart.endElement(elementname);
                            tmpPart = tmpPart.getParent();
                        }
                        break;

                    case XmlNodeType.EndElement:
                        containerids.Pop();
                        elementname = parser.LocalName;
                        tmpPart.endElement(elementname);
                        if ((tmpPart.getParent() == null) && (tmpPart.getElementName().Equals("YACRSResponse")) && (elementname.Equals(tmpPart.getElementName())))
                        {
                            the_YACRSResponse = (cls_YACRSResponse)tmpPart;
                            tmpPart           = null;
                        }
                        else if (elementname.Equals(tmpPart.getElementName()))
                        {
                            tmpPart = tmpPart.getParent();
                        }
                        break;

                    case XmlNodeType.Whitespace:
                    case XmlNodeType.Text:
                        if (tmpPart != null)
                        {
                            tmpPart.content(parser.Value, containerids.Peek());
                        }
                        break;

                    default:
                        Console.Out.WriteLine("Node: " + parser.NodeType.ToString());
                        break;
                    }
                }
                return(the_YACRSResponse);
            }
            catch (Exception e)
            {
                return(null);
            }
        }