Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find subject list with IDs turned off #11

Open
matomatical opened this issue Dec 4, 2017 · 3 comments
Open

Can't find subject list with IDs turned off #11

matomatical opened this issue Dec 4, 2017 · 3 comments

Comments

@matomatical
Copy link

matomatical commented Dec 4, 2017

During the semester for aesthetic purposes I leave 'Subject id' display turned off in my LMS homepage subject list. Here's what it looks like:

no_id

With this setting, the script was not finding my list of subjects. Understandably! The getSubjectList function assumes all subject names will be formatted as if the setting is on, as shown here:

yes_id

To support both modes will require a way to find the links without the IDs there, or a completely alternative approach. I have a few thoughts, will post below.

@matomatical
Copy link
Author

  1. Look for the entire subject list 'panel' element by its id: it seems to be a div with id="module:_4_1". Once we have this element, it should be easy to find all subject links within (using relative xpaths or some other selectors). I'd like someone to support or dissent the reliability of this id attribute on their LMS (e.g. using the Chrome inspector).
  2. Look for the entire subject list panel by title (so by searching for a div element containing the <span class="moduleTitle">My Subjects</span> element within it). This panel name may be more reliable than the panel id across multiple accounts (however, it's possible that some accounts will use a different title. I have seen 'Subject List' in a few screenshots?). Once again, once we have the panel, it should be straight forward to find the relevant links within.
  3. Look for the subject list in a different tab! (After login, the LMS takes us to the 'My Home' tab, which may have one or more panels, each with a series of links. Further, these panels are customisable and may move around the page, or be hidden altogether!) The neighbouring 'Subjects' tab looks far more reliable: it seems to have a fixed set of panels. Display of IDs is still customisable (though I suspect not many students visit this tab, and the setting doesn't carry over from the home page), but the structure of the page is simpler and so it may be easier to scrape the links from this page.

Of the above, I think 3 is the most promising. On my LMS (staff and student) I can be reliably reach this tab via the direct link:

https://app.lms.unimelb.edu.au/webapps/portal/execute/tabs/tabAction?tab_tab_group_id=_5_1

(c.f. home page link which is the same but has tab_tab_group_id=_41_1) however clicking on the 'Subjects' button from the homepage would probably work too if this isn't actually reliable.

@matomatical
Copy link
Author

Also, I would just like to say the control structures in use in this 'find the subject links' section of the code are labyrinthine.

I'm looking forward to a much neater solution after a rewrite!

@banool
Copy link
Owner

banool commented Dec 4, 2017

I agree, option 3 seems the best. Even if the subjects page would generally be less subject to change than the home page, I do agree that the student should still have the option to hide the IDs regardless.

The logic is definitely more complex than it should be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants