Beispiel #1
0
 def assign_get_grades(self):
     print "Input assigment ID: "
     Moodaux.show(self.m.get_grades(raw_input()))
Beispiel #2
0
 def get_component_strings(self):
     print "Input: component"
     Moodaux.show(self.m.get_component_strings(raw_input()))
Beispiel #3
0
 def down_file(self):
     print "Input: course ID"
     Moodaux.show(self.m.down_file(raw_input()))
Beispiel #4
0
 def enrolled_users(self):
     print "Input course ID: "
     Moodaux.show(self.m.enrolled_users(raw_input()))
Beispiel #5
0
 def get_assigments(self):
     print "Input: course ID, capabilities"
     Moodaux.show(self.m.get_assigments(raw_input(), raw_input()))
Beispiel #6
0
 def get_files(self):
     print "Input: context id, component, file area, item id, file path, file name"
     Moodaux.show(self.m.get_files(raw_input(),raw_input(),raw_input(),raw_input(),raw_input(),raw_input()))
Beispiel #7
0
 def get_user(self):
     print "Input user ID: "
     Moodaux.show(self.m.get_users_by_id(raw_input()))
Beispiel #8
0
 def get_courses(self, IDs):
     Moodaux.show(self.m.get_courses(IDs))
Beispiel #9
0
 def course_contents(self, ID):
     Moodaux.show(self.m.course_contents(ID))
Beispiel #10
0
 def get_site_info(self):
     Moodaux.show(self.m.get_site_info())
Beispiel #11
0
            result = m.course_contents(raw_input())
        elif function == "3":
            print "Input: context id, component, file area, item id, file path, file name"
            result = m.get_files(raw_input(),raw_input(),raw_input(),raw_input(),raw_input(),raw_input())
        elif function == "4":
            print "Input course ID: "
            result = m.get_courses(raw_input())
        elif function == "5":
            print "Input user ID: "
            result = m.get_users_by_id(raw_input())
        elif function == "6":
            print "Input course ID: "
            result = m.enrolled_users(raw_input())
        elif function == "7":
            print "Input: course ID, capabilities"
            result = m.get_assigments(raw_input(), raw_input())
        elif function == "8":
            print "Input: component"
            result = m.get_component_strings(raw_input())
        elif function == "9":
            print "Input: course ID"
            result = m.down_file(raw_input())
        elif function == "10":
            print "Input assigment ID: "
            result = m.get_grades(raw_input())
        else:
            print "Incorrect input, gettin all courses"
            result = m.get_courses()
        if function !="0":
            print Moodaux.show(result)
Beispiel #12
0
import MoodLib
from config import info

service='moodle_mobile_app'

if __name__ == "__main__":
    """
    Programa principal
    """
    m = MoodLib.MoodLib(info['web'], info['user'], info['pasw'], service)
    print m.get_token()
    function = ''
    while(function!='0'):
        print 'Select operation: 2 course contents/ 8 get component strings/ 0(exit)'
        function = raw_input()
        result = None
        if function=="0":
            m.close
            result = "Exiting..."
        elif function == "2":
            print "Input course ID: "
            result = m.course_contents(raw_input())
        elif function == "8":
            print "Input: component"
            result = m.get_component_strings(raw_input())
        else:
            print "Incorrect input, gettin all courses"
            result = m.get_courses()
        if function !="0":
            print MoodLib.show(result)