Featured Categories
-
Lectora®
Lectora® is the most trusted authoring tool in the world. Rock out your creativity! Author courses any way you like. Lectora adheres to best practices for Accessibility and Web Content Accessibility Guidelines (WCAG), offers responsive authoring for eLearning, and publishes to any LMS (Learning Management System).
-
CenarioVR®
Experience virtual reality through CenarioVR®, our training and virtual reality (VR) authoring software that allows you to create immersive learning in minutes! No coding required!
-
Rockstar Learning Platform®
Our Rockstar Learning Platform® has all the features you’ll love. Help your employees be better at their jobs, more valuable to your company, and most effective in servicing your customers.
-
The Training Arcade®
Level up your learner engagement with the Training Arcade®! The Training Arcade is a library of fun, mobile-ready, casual games that can be rapidly customized with your content to create effective gaming!
-
ELB Learning Content
Did you know that our AssetLibrary™ has over 120 million engaging, interactive, and awe-inspiring templates and assets to help you become an eLearning Rockstar®?
Limiting checkboxes in a quiz

I am attempting to follow the steps outlined in the blog post to limit the number of selections that can be done by a learner.
$(‘input’).click(check_and_limit); function check_and_limit() { if ($(‘input:checked’).length == 3) { $(‘input:not(:checked)’).attr(‘disabled’, true) } else { $(‘input’).attr(‘disabled’, false) } }I continually get the error below.

I attempted using other lines of code to double check that it isn't me, but i get the same error message.
I am using IE11 due to our dependency on the Harman Flash Plugin for continued support until all of our learning products are transitioned.
Developing content since 2010 using a mixed bag of tools.
Best Answer
-
wheels Community Member, Administrator, Moderator, Rockstar Manager Posts: 695 eLearning ROCKSTAR Admin TeamI've attached an example.
You will need to download the attached zip, then remove the .zip extension. The file is a PKG file but interestingly our forum doesn't support that format (we'll have to fix that!).
The example can be imported and will work in Desktop or Online. For Lectora Online you have to update the JavaScript action named OnShowRunJS there are comments as to what to update.
The example shows how to set "known" names for objects and then use the Lectora Object API to do things like disable / enable buttons and to show or hide text blocks.
You will also see that triv$ is used, if you have a current version of desktop or if you use online then that is how you can access the built in jQuery object.
Additionally you will see the use of getDisplayWindow() and getDisplayDocument() which are necessary to support our seamless play publish option.
Hope this helps show some possibilities with scripting in Lectora.2
Answers
-
Hi, @andrew-robertson - You've stumbled on an article from our archives. Lectora has gotten a lot smarter since that was written!
If you use one of the standard question types available in Lectora you can double click the ? icon in the Explorer, and set attempts like this:
----------------------------------------------
Chris Willis, Product Director, Lectora
◖⚆ᴥ⚆◗ "Where there's a Willis, There's a Way!"0 -
Thanks @chris_willis for the rapid response; however, I am looking to put checks/balances in place so that we are truly testing the learner fairly. For example, if I were to ask the following question with multiple responses....
What colour are the leaves in the tree? Select 3.
a) Red
b) Green
c) Yellow
d) Purple
And then have JQuery do the following for me...
1. Not allow the user to click a 4th option if they've already selected 3, and display a message saying they've already selected 3 if they go for a 4th option.
2. Keep the SUBMIT button disabled until they've selected 3 options.Andrew R.
Developing content since 2010 using a mixed bag of tools.0 -
@wheels & @chris_willis - you two are amazing. Appreciate the support. If could buy you a coffee (or beer), I would. Cheers and enjoy the impending weekend.Andrew R.
Developing content since 2010 using a mixed bag of tools.2 -
@andrew-robertson - Lectora users like you help us better understand how to make Lectora the most powerful and versatile eLearning authoring tool available!
That (and the aforementioned coffee) is what gets me up in the morning. As for the weekend ...
Cheers!----------------------------------------------
Chris Willis, Product Director, Lectora
◖⚆ᴥ⚆◗ "Where there's a Willis, There's a Way!"1
Categories
- 35.9K All Categories
- 110 ✫ Announcements
- 33.1K Lectora®
- 31.1K Lectora Discussions
- 29K Lectora Desktop
- 2K Lectora Online
- 2K Lectora Feature Requests
- 71 Lectora User Groups
- 27 ELB Learning Content
- 27 ELB Learning Content Discussions
- 343 CenarioVR®
- 204 CenarioVR Discussions
- 139 CenarioVR Feature Requests
- 44 Rockstar Learning Platform®
- 41 Rockstar Learning Platform Discussions
- 108 CourseMill®
- 108 CourseMill Discussions
- 48 ReviewLink®
- 48 ReviewLink Discussions
- 7 The Training Arcade®
- 7 The Training Arcade Discussions
- 938 All Things eLearning
- 39 eLearning Development
- 546 Learning Management System (LMS) Integration
- 333 Web Accessibility
- 1.2K ♪ The Green Room
- 9 Additional Learning Products