Giter Club home page Giter Club logo

Comments (7)

C0D3D3V avatar C0D3D3V commented on May 28, 2024

That would be fine, but it is very unusual to download courses in which you are not enrolled.

Especially because by default you can't see the course content without registering, the admin has to change some settings to make this possible.

Currently I don't have time to implement this, but you can currently try to force the downloader to download a course by modifying the following code.
In this file moodle_connector/moodle_service.py

There, in line 90, all courses you are enrolled in are selected.
courses = results_handler.fetch_courses(userid)

You can add courses manually immediately afterwards.

Like this:

courses = results_handler.fetch_courses(userid)
courses.append(Course(2342, 'Ein Kurs', []))

Where the first parameter of Course is the id of the course, the second the name of the course and the 3rd must be an empty list.

This should work as long as you have read access to the course.

from moodle-dl.

sds100 avatar sds100 commented on May 28, 2024

from moodle-dl.

C0D3D3V avatar C0D3D3V commented on May 28, 2024

You can have a look in results_handler.fetch_courses and make a similar function for all courses...

You get a list of all courses in your moodle by calling:

https://moodle.uni.de/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_course_get_courses_by_field&wstoken=c3703dcyour_token2e2eb46ba942a0

If there are a lot of courses on your moodle, it will not make you happy... because it takes a very long time.

To filter the list, you should first ask for the catagories... and then filter by category.

https://moodle.uni.de/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_course_get_categories&wstoken=c3703dcyour_token2e2eb46ba942a0

https://moodle.uni.de/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_course_get_courses_by_field&wstoken=c3703dcyour_token2e2eb46ba942a0&field=category&value=437

With the help of the enrollmentmethods you can see if you can read the course content.

from moodle-dl.

C0D3D3V avatar C0D3D3V commented on May 28, 2024

First steps have been taken for this issue :D
Check out Issue #71 for related work.

from moodle-dl.

sds100 avatar sds100 commented on May 28, 2024

Cool! 😀

from moodle-dl.

C0D3D3V avatar C0D3D3V commented on May 28, 2024

you can now use moodle-dl --add-all-visible-courses
It is released, you are welcome :)

from moodle-dl.

C0D3D3V avatar C0D3D3V commented on May 28, 2024

Is that okay or did you imagine it differently?

from moodle-dl.

Related Issues (20)

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.