Comments (4)
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.
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.
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.
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)
- [Question] Are all types manually written? HOT 2
- [Feature Request ✨] Send Assignement
- [Feature Request ✨] mod_book
- [BUG 🐞] add_cohort_members parameters result in invalid_parameter_exception
- How to use get_users
- core.cohort.add_cohort_members
- moodlepy v1 Roadmap!
- mod_page_view_page HOT 3
- [Doc Request ✨] HOT 2
- [BUG 🐞] HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moodlepy.