devdocs icon indicating copy to clipboard operation
devdocs copied to clipboard

[docs] Improve academy metadata

Open andrewnicols opened this issue 2 years ago • 8 comments

For links to the Moodle Academy we need to improve, and find a way to maintain the metadata.

@jgramp has suggested that we should also add:

  • [ ] Estimated completion time (e.g. 4 hours, 2 days, 1 week)
  • [ ] Level (Beginner to Advanced)

I wonder whether we can have this json generated on the Moodle Academy, with the above fields set as Course custom fields. If Academy can define these as custom fields, and then provide us with a PHP endpoint to generate the JSON content, then we can fetch this periodically (i.e. every sunday or on manual request) and commit it to the repository, and then use it during builds.

andrewnicols avatar Apr 19 '22 15:04 andrewnicols

Hi Andrew. Yes. These are already course custom fields. Not sure how do provide you with a PHP end point to generate the JSON. I do have the configurable reports plugin (https://moodle.org/plugins/block_configurable_reports) installed which we can use to generate JSON files periodically. But I've not done this before. I'd be happy to investigate this though. You can see our reports course on Moodle Academy now you are site admin where we keep all our reports. It'll be easy to create a new report with the SQL to export the data you need about our courses. Including these custom fields. I just don't know how we can share this with you dynamically.

jgramp avatar Apr 19 '22 23:04 jgramp

@sarjona can I ask you to look at this one since you’re one of the maintainers of that report and may have an idea of how we can achieve this.

Essentially we want to pull in the course data that’s currently in https://github.com/moodle/devdocs/blob/main/src/academyCourses.js into a new file in data/ and update academyCourses.js to use that data.

andrewnicols avatar Apr 20 '22 08:04 andrewnicols

The configurable_reports plugin has a WS (block_configurable_reports_get_report_data) that we can use to get these information. It returns the data of a given report id. And then, we could call this WS from devdocs project to update the data/academyCourses.js with these information :-)

sarjona avatar Apr 20 '22 15:04 sarjona

Thanks @sarjona What's a WS? I'm terrible with acronyms! Web Service? What would we need to do on Academy to get this working, once the report is setup in the configurable reports block?

jgramp avatar Apr 21 '22 00:04 jgramp

Hi @jgramp ,

Yup - WS = Web Service. We just need to write a report and then we should be able to automate the data fetch. We'll have to do a couple of other changes (make the code on our end more robust, change some UI, etc).

Should be a pretty simple change on our end once we've written the report. The sql on the other hand is a little more challening because of the way in which custom course fields are defined. I'll spend some time on that later once my head is in a different place (unless someone else knows the magic already).

andrewnicols avatar Apr 21 '22 05:04 andrewnicols

We'll need to configure Moodle Academy Web services and get access to them to get this information: https://docs.moodle.org/en/Using_web_services

(If required, I'll be more than happy to help you to configure it) ;-)

sarjona avatar Apr 21 '22 06:04 sarjona

Thanks @sarjona - can we enable web services on Moodle Academy without enabling the app?

jgramp avatar Apr 22 '22 00:04 jgramp

Hi @jgramp! Yes, it's possible to enable only the web services that we need for that. I think Andrew is planning to take a look at this during the next few days (@andrewnicols let me know if I can help you someway).

sarjona avatar Apr 22 '22 06:04 sarjona