Forum

Custom Plugin on Per Question Basis

Following the instructions https://hub.taotesting.com/articles/test-runner-plugins/enhance-the-user-experience-with-test-plugins I was able to develop two plugins. The issue is that by following the directions here to 'Register the plugin' the plugins are available for every question. I would like to add my plugins to the properties menu of items to enable and disable them on a per question basis. Any idea on how to achieve this?

Comments

  • Ended up finding a solution. Seems like the default plugins simply show/hide based on a 'category' trait that is assigned by those checkboxes in properties. There is a box in the backend to enter a custom category.

    You can then check if a question has a specific category to it with .getTestRunner().getTestMap(), and you can parse that JSON to find the categories of the current item with .testPartID .sectionId and .itemIdentifier of getTestRunner().getTestContext().

    Simply show or hide the plugin based on if it has the assigned category.

Sign In or Register to comment.

We use cookies on our website to support technical features that enhance your user experience. Cookie Policy Privacy Policy

×