예제 #1
0
        public MoodleCourse getCourse(string shortname)
        {
            MoodleCourse  mcourse = new MoodleCourse();
            UniverCourses courses = new UniverCourses();

            try
            {
                mcourse.id   = courses.getID(shortname);
                mcourse.name = shortname;
            }
            catch (System.Exception oe)
            {
                throw new Exception(string.Format("No existe el curso: {0}. {1}", shortname, oe.Message.ToString()));
            }

            return(mcourse);
        }
예제 #2
0
        public MoodleCourse getCourse(string shortname)
        {
            MoodleCourse mcourse  = new MoodleCourse();
            UniverCourses courses = new UniverCourses();

            try
            {
                mcourse.id = courses.getID(shortname);
                mcourse.name = shortname;
            }
            catch (System.Exception oe)
            {
                throw new Exception(string.Format("No existe el curso: {0}. {1}", shortname, oe.Message.ToString()));
            }

            return mcourse;
        }
예제 #3
0
 public bool EnrolUserToCourse(MoodleUser user, MoodleCourse course, int roleid, int? timestart, int? timeend, int? suspend)
 {
     string postData      = string.Format("enrolments[0][roleid]={0}&enrolments[0][userid]={1}&enrolments[0][courseid]={2}&enrolments[0][timestart]={3}&enrolments[0][timeend]={4}&enrolments[0][suspend]={5}", roleid, user.id, course.id, timestart, timeend, suspend);
     return this.executeWs(postData, "enrol_manual_enrol_users");
 }
예제 #4
0
 public bool createGroup(MoodleCourse course, string name, string description)
 {
     string postData = string.Format("groups[0][courseid]={0}&groups[0][name]={1}&groups[0][description]={2}", course.id, name, description);
     return this.executeWs(postData, "core_group_create_groups");
 }
예제 #5
0
        public bool createGroup(MoodleCourse course, string name, string description)
        {
            string postData = string.Format("groups[0][courseid]={0}&groups[0][name]={1}&groups[0][description]={2}", course.id, name, description);

            return(this.executeWs(postData, "core_group_create_groups"));
        }
예제 #6
0
        public bool EnrolUserToCourse(MoodleUser user, MoodleCourse course, int roleid, int?timestart, int?timeend, int?suspend)
        {
            string postData = string.Format("enrolments[0][roleid]={0}&enrolments[0][userid]={1}&enrolments[0][courseid]={2}&enrolments[0][timestart]={3}&enrolments[0][timeend]={4}&enrolments[0][suspend]={5}", roleid, user.id, course.id, timestart, timeend, suspend);

            return(this.executeWs(postData, "enrol_manual_enrol_users"));
        }