Skip to content

Commit

Permalink
Merge pull request #2656 from drgrice1/jitar-disabled-problem-no-jquery
Browse files Browse the repository at this point in the history
Make JITAR disabled problems disabled without javascript.
  • Loading branch information
pstaabp authored Jan 28, 2025
2 parents 6fbdae6 + 643debd commit 3a18a63
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
5 changes: 0 additions & 5 deletions htdocs/js/Problem/problem.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,4 @@
const bsToast = new bootstrap.Toast(toast, { delay: 5000 });
bsToast.show();
});

// Prevent problems which are disabled from acting as links
$('.problem-list .disabled-problem')
.addClass('disabled')
.on('click', (e) => e.preventDefault());
})();
7 changes: 4 additions & 3 deletions lib/WeBWorK/ContentGenerator/Problem.pm
Original file line number Diff line number Diff line change
Expand Up @@ -797,9 +797,10 @@ sub siblings ($c) {
{
push(
@items,
$c->link_to(
$c->maketext('Problem [_1]', join('.', @seq)) => '#',
class => $class . ' disabled-problem',
$c->tag(
'a',
class => $class . ' disabled',
$c->maketext('Problem [_1]', join('.', @seq))
)
);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
% )
% {
% # If the problem is jitar restricted, then show it greyed out.
<span class="<%= $linkClasses %> disabled-problem text-nowrap">
<span class="<%= $linkClasses %> text-nowrap">
<%= maketext('Problem [_1]', $problemNumber) %>
</span>
% } else {
Expand Down

0 comments on commit 3a18a63

Please sign in to comment.