GithubHelp home page GithubHelp logo

Comments (4)

hexatester avatar hexatester commented on August 25, 2024

I'm glad to hear that.

For enrolling students from web service you might need to call enrol_manual_enrol_users moodle ws function.
Provided that the users and the courses are already in the system.
For more information check your moodle site ws documentation.

Thanks.

from moodlepy.

hexatester avatar hexatester commented on August 25, 2024

And if you want me to add it into moodlepy. Just sent me the function's docs, from your moodle site's web service documentation.

Example : https://pastebin.com/GqGP3s82

from moodlepy.

hexatester avatar hexatester commented on August 25, 2024

This is an example for manually enroling a user using webservice.

from datetime import datetime
from moodle.enrol.manual import Enrolment

m = Moodle.login('https://sandbox.moodledemo.net', 'admin', 'sandbox')
enrolment = Enrolment(
    roleid=1,  # Role to assign to the user
    userid=1,  # The user that is going to be enrolled
    courseid=1,  # The course to enrol the user role in
    timestart=datetime.now(),  # Timestamp when the enrolment start
    timeend=datetime(2021, 6, 1),  # Timestamp when the enrolment end (first June 2021)
    suspend=0,  # set to 1 to suspend the enrolment
)
enrolments = [enrolment]
m.enrol.manual.enrol_users(enrolments)  # enrol_manual_enrol_users

from moodlepy.

hexatester avatar hexatester commented on August 25, 2024

I closed this issue because the feature has been implemented, if you have more questions please create a new issue. Thank you!

from moodlepy.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.