SchoolUtils / WebUntis

JavaScript WebUntis API Client
https://webuntis.noim.me/
MIT License
166 stars 21 forks source link

Is it possible to get a lesson's topic? #36

Closed jakob-kruse closed 3 years ago

jakob-kruse commented 3 years ago

I looked at the documentation and the outputs of for example getOwnClassTimetableForRange but cannot seem to find anything

TheNoim commented 3 years ago

Never heard of a lesson topic. Where can I find this in the user interface (App or WebUntis)?

jakob-kruse commented 3 years ago

Sorry for the late response. It is called Teaching Content. It comes up as a tab when you open a lesson

TheNoim commented 3 years ago

I know that there is the lesson text and substitution text. Is the teaching content new?

jakob-kruse commented 3 years ago

I dont know when it got added, sorry. Maybe this can help. Its the response i get in the browser when i open the details of a lesson.

elias-knodel commented 3 years ago

@jakob-kruse I didn't see this issue until now but a couple months ago i extended the WebUntis class and build a function to get the lesson topic. If you still need it here is my solution: https://gist.github.com/elias-knodel/68170188766956d9475cf99eeed9e260

jakob-kruse commented 3 years ago

Thats great! I found my own solution by "reversing the api" myself now, but maybe ill rewrite it with this

TheNoim commented 3 years ago

Maybe you can do a pull request :) ?

elias-knodel commented 3 years ago

I will try but first i looked over it with my friend and i found an issue in my code above: I accidentally hardcoded the "&elemid=10487" part (sorry for that 😅)

image

It is custom for everybody and if i find a way to make it customizable i will create a PR. 👍🏼

TheNoim commented 3 years ago

element type 5 is a student. I expect the element id just to be your own id. Example invocation: https://github.com/SchoolUtils/WebUntis/blob/134512baf906ee360a0722a394915e115eb73e27/index.js#L228 and https://github.com/SchoolUtils/WebUntis/blob/134512baf906ee360a0722a394915e115eb73e27/index.js#L309