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

Make JITAR disabled problems disabled without javascript. #2656

Merged

Conversation

drgrice1
Copy link
Member

There is no reason to use javascript for this. Just make the links disabled to begin with. Furthermore, there is no reason to use jQuery for this. I thought all webwork2 jQuery usage had already been removed, but this was missed.

To test this create a JITAR set with two or more problems (or really two or more nested sets of problems), and set "Restrict Problem Progression" to "Yes". Assign the set to a student user, and then log in as that student user. On the problem list page the latter prolems in the set should be grayed out, and clicking on them does nothing (that already works without javascript because these aren't even a tags, they are span tags). If you open the first problem, then the latter problems in the prroblems list in the site menu should be grayed out, and clicking on them does nothing. Currently, that uses jQuery javascript to disable those links. With this pull request, they are just disabled to begin with.

There is no reason to use javascript for this.  Just make the links
disabled to begin with.  Furthermore, there is no reason to use jQuery
for this.  I thought all webwork2 jQuery usage had already been removed,
but this was missed.

To test this create a JITAR set with two or more problems (or really two
or more nested sets of problems), and set "Restrict Problem Progression"
to "Yes".  Assign the set to a student user, and then log in as that
student user.  On the problem list page the latter prolems in the set
should be grayed out, and clicking on them does nothing (that already
works without javascript because these aren't even `a` tags, they are
`span` tags).  If you open the first problem, then the latter problems
in the prroblems list in the site menu should be grayed out, and
clicking on them does nothing. Currently, that uses jQuery javascript to
disable those links.  With this pull request, they are just disabled to
begin with.
@somiaj
Copy link
Contributor

somiaj commented Jan 23, 2025

Tested this and looks good. Just some questions, why does the ProblemSet page when showing a list of problems in the table just use span's for the disabled links while the sidebar menu (Which is updated here) use disabled links? Any reason why these should be different? Also just a very minor thing, but in my testing there are no additional classes added via <%= $linkClasses %> so the html has an extra space, very very minor issue, just something I noticed, <span class=" text-nowrap">.

Copy link
Contributor

@somiaj somiaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as intended. My previous comment were just some things I noticed, but this is fine as is too.

@drgrice1
Copy link
Member Author

The span works in the problem page, but a span does not work in a nav-item as a nav-link.

The space in the class doesn't matter. It has always been that way.

Copy link
Member

@pstaabp pstaabp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all seems to work.

@pstaabp pstaabp merged commit 3a18a63 into openwebwork:develop Jan 28, 2025
2 checks passed
@drgrice1 drgrice1 deleted the jitar-disabled-problem-no-jquery branch January 28, 2025 19:54
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

Successfully merging this pull request may close these issues.

3 participants