Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ErrorInfo"></param>
        /// <param name="AspectGuids">Either</param>
        /// <param name="StudentGuids">Either</param>
        /// <param name="ResultSetGuids">Either</param>
        /// <param name="Start">Mandatory</param>
        /// <param name="End">Mandatory</param>
        /// <returns></returns>
        public static XmlDocument GetResults(ref string ErrorInfo, string ResultSetGuid, string StudentGuid, string AspectGUID)
        {
            DateTime Start = DateTime.Parse("2016-09-01");
            DateTime End   = DateTime.Today;

            XmlDocument d = new XmlDocument();
            // Create a request document
            SIMSAssessmentMessage       sdo          = new SIMSAssessmentMessage();
            Dictionary <string, string> paramOptions = sdo.GetParamOptions(SIMSAssessmentMessage.LEARNERASSESSMENTRESULT);
            // Create and populate the filter
            Dictionary <string, string[]> selections = new Dictionary <string, string[]>();

            // Do we have any r
            if (AspectGUID != "")
            {
                selections.Add("AssessmentComponentRefId", new string[1] {
                    AspectGUID
                });
            }
            if (ResultSetGuid != "")
            {
                selections.Add("AssessmentSessionRefId", new string[1] {
                    ResultSetGuid
                });
            }
            if (StudentGuid != "")
            {
                selections.Add("LearnerPersonalRefId", new string[1] {
                    StudentGuid
                });
            }
            // We must have a date range for this call.
            string dRange = Start.ToShortDateString() + ";" + End.ToShortDateString();

            selections.Add("AchievementDate", dRange.Split(';'));
            // Make the request
            XmlDocument request = SIMSAssessmentMessage.GenerateRequestDoc(selections, SIMSAssessmentMessage.LEARNERASSESSMENTRESULT, DefaultSource, DefaultDestination);
            XmlDocument data    = sdo.Export(request);

            // Display the results
            d.InnerXml = sdo.ToXmlString();
            // Display the errors
            ErrorInfo = sdo.ErrorDocument.InnerXml;
            XmlDocument rc = new XmlDocument();

            if (ErrorInfo == "")
            {
                foreach (XmlNode n in d.SelectNodes("SIMSAssessmentMessage/DataObjects/LearnerAssessmentResult"))
                {
                    if (n["LearnerPersonalRefId"].InnerXml == StudentGuid)
                    {
                        // This is one of the results we need
                        rc.AppendChild(n);
                    }
                }
            }
            return(rc);
        }
Пример #2
0
        public static XmlDocument GetGradeSets(ref string ErrorInfo)
        {
            // Need to create a request document.
            SIMSAssessmentMessage       sdo          = new SIMSAssessmentMessage();
            Dictionary <string, string> paramOptions = sdo.GetParamOptions(SIMSAssessmentMessage.ASSESSMENTRESULTGRADESET);
            // This one asks for them all - it is possible to filter them.
            Dictionary <string, string[]> selections = new Dictionary <string, string[]>();
            // Request Grade sets
            XmlDocument request = SIMSAssessmentMessage.GenerateRequestDoc(selections, SIMSAssessmentMessage.ASSESSMENTRESULTGRADESET, DefaultSource, DefaultDestination);
            XmlDocument data    = sdo.Export(request);
            // Display response
            XmlDocument d = new XmlDocument();

            d.InnerXml = sdo.ToXmlString();
            // Display errors
            ErrorInfo = sdo.ErrorDocument.InnerXml;
            return(d);
        }
Пример #3
0
        public static XmlDocument GetResultSets(ref string ErrorInfo)
        {
            // Create the request
            SIMSAssessmentMessage       sdo          = new SIMSAssessmentMessage();
            Dictionary <string, string> paramOptions = sdo.GetParamOptions(SIMSAssessmentMessage.LEARNERASSESSMENTRESULTSET);
            // No filter
            Dictionary <string, string[]> selections = new Dictionary <string, string[]>();
            //Actual request
            XmlDocument request = SIMSAssessmentMessage.GenerateRequestDoc(selections, SIMSAssessmentMessage.LEARNERASSESSMENTRESULTSET, DefaultSource, DefaultDestination);
            XmlDocument data    = sdo.Export(request);
            // Display the results
            XmlDocument d = new XmlDocument();

            d.InnerXml = sdo.ToXmlString();
            // Display the errors
            ErrorInfo = sdo.ErrorDocument.InnerXml;
            return(d);
        }
Пример #4
0
        public static XmlDocument GetAspects(ref string ErrorInfo)
        {
            XmlDocument d = new XmlDocument();
            // Need to generate a request for aspects data as follows
            SIMSAssessmentMessage       sdo          = new SIMSAssessmentMessage();
            Dictionary <string, string> paramOptions = sdo.GetParamOptions(SIMSAssessmentMessage.ASSESSMENTRESULTCOMPONENT);
            // Blank set of dictionary objects are used for full extract - it is possible to filter the request
            // but that type of operation would suggest a 'coversation with the VLE'
            // This is quite possible but developers are reminfed that SIMS is NOT multi threaded!
            Dictionary <string, String[]> selections = new Dictionary <string, String[]>();
            //  OK - We can now ask for the aspects.
            XmlDocument request = SIMSAssessmentMessage.GenerateRequestDoc(selections, SIMSAssessmentMessage.ASSESSMENTRESULTCOMPONENT, DefaultSource, DefaultDestination);
            XmlDocument data    = sdo.Export(request);

            // We now have them and will display them in a rich text box.  Clearly VLE code would need to do something more
            // positive - like call their web service.
            d.InnerXml = sdo.ToXmlString();
            // Display the errors (if any)
            ErrorInfo = sdo.ErrorDocument.InnerXml;
            return(d);
        }