GithubHelp home page GithubHelp logo

Comments (2)

taniwallach avatar taniwallach commented on August 20, 2024

Another use would be adding additional class names to an object. Might help MathQuill bypass a specific input element. See: openwebwork/webwork2#1071 (comment)

from pg.

taniwallach avatar taniwallach commented on August 20, 2024

This idea remains of interest, and it seem that there is some infrastructure in place which could be extended to implement the feature. Unfortunately, I have not had time to work on implementing anything yet.

I discovered (thanks to a forum post by Ping-Shun Chan at https://webwork.maa.org/moodle/mod/forum/discuss.php?d=4877#p14660) that NAMED_ANS_RULE (in macros/PGbasicmacros.pl) has existing support for a hash of options, and can handle an option called aria_label to provide a better aria label. It seems that getting all the standard methods to receive and pass on such an options hash would facilitate proving the sort of features envisioned.

The discussion at https://webwork.maa.org/moodle/mod/forum/discuss.php?d=4694 seems to also raise the idea of adding "hidden labels" in addition to the aria-labels based on information provided in the options.

Support for the options hash and for a provided value of an aria_label option seems somewhat incomplete:

  • NAMED_ANS_RULE supports it.
  • So do NAMED_ANS_RULE_EXTENSION, NAMED_ANS_BOX, NAMED_ANS_ARRAY_EXTENSION
  • So does ans_matrix in lib/Value/AnswerChecker.pm which is the underlying function for ans_array and named_ans_array.)
  • For some reason NAMED_ANS_RADIO_EXTENSION seems to handle that option and only uses a default when it is not set, but NAMED_ANS_RADIO and NAMED_ANS_RADIO_BUTTONS do not seem to handle such an option.
  • NAMED_ANS_CHECKBOX, NAMED_ANS_CHECKBOX_OPTION
    However, neither labeled_ans_rule nor ans_rule seems to be able to pass on such options.

Regarding the idea to use this feature specifically to add CSS styling code - an alternate approach was found using DIV/SPAN elements and CSS selectors and which seems to do pretty well. See: https://webwork.maa.org/moodle/mod/forum/discuss.php?d=4767 but ignore the first sample file with an older version of the code in the later posts.

from pg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.