Question Reset and Unlock

On this assignment a few questions are randomly generated, and all multiple choice questions are set to lock after 2 attempts. My question is, I want to set a button on the first slide that both unlocks and the randomly generated questions and regenerated them so that students who were locked out of those specific ones could have a second go at them. I dont want to unlock the non randomly generated questions though.

All my “generate new problem” buttons are called “but” on the problems. My idea was that those buttons would some how have their press count +1 and then the submit button press count would be reset to 0.

Here is the activity:

I think what you want is:

  • each randomized problem can generated independently by its own button
  • all randomized problems can be generated at once by one master button

If so, sure, just do something like this for your randomization scheme:

r=randomGenerator(but.pressCount,randAll.pressCount)

Here i’m just using a random number generator seeded by both the but button on each screen, and by the randAll button you can place wherever you want in the activity. Then changes in either property will cause the randomization to occur.

I think @Mike_Gleeson has a good solution. Looking at your CL (which appears you have updated since I last looked), the main reason it’s not working the way you intend is because of how your components are named.

CL follows some rules when referencing a component when there are duplicate names.

  1. It defaults to the component with that name on the current screen.
  2. It triggers an error if there is not a component with that name on the current screen.

It doesn’t/can’t assume you’re referring to a duplicate name connected with a certain screen just because you’re referring to another component on that screen.

That I know. (read that in a not snarky tone :grinning:). My issue is not with running into a naming error, nor is it trouble with having two buttons feed into a randomizer, its more of how to I reset my multiple choice question locking mechanism with each time I press the master button. I want the multiple choice questions (that generate) to lock after 2 failed attempts, but then if a student regenerates it, I need that press count to reset back to zero whenever the master rest button is pressed.

I hope that makes since.

I was thinking some how the press count would be set to:
disableChange: this.submitCount>=numericValue("2+${masterPress.script.pressCount}

Actually… That works. Got it running.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.