Picture of Rob Mausser
Autocomplete stress test
by Rob Mausser - Thursday, 20 July 2023, 7:22 PM
 

We are trying to stress test our LMS so I have taken a function from the DevTools, "onCompleteMenu" to automatically complete the course on load.

I have added the function to the top of devtools.js as this:

initialize: function () {
this.render();
this.onCompleteMenu();
},

However, it only works when you open the Devtools in the drawer, not on the loading of the course. It appears that devtools needs to be rendered on the display for the initialize function to happen. 

Is there anywhere I can put a script that will process immediately on load of the course? I would probably put a timeout to let everything settle but I still want it to happen automatically.

 

Cheers

 

Picture of Ignacio Cinalli
Re: Autocomplete stress test
by Ignacio Cinalli - Tuesday, 25 July 2023, 5:53 PM
 

Hi Rob, perhaps the best option is for you to create your own extension to perform the tests you need.

Otherwise, if it's a single test, you can place it inside the src/theme/adapt-contrib-vanilla/js/theme.j.

For example, in the onDataReady function add the following code:

function onDataReady() {
    Adapt.components.forEach((component) => {
      if (component.get('_isQuestionType')) {
        component.set({
          _isCorrect: true,
          _isSubmitted: true,
          _score: 1
        });
        component.set('_attemptsLeft', Math.max(0, component.set('_attempts') - 1));
      }
      component.set('_isComplete', true);
      component.set(component.has('_isInteractionsComplete') ? '_isInteractionsComplete' : '_isInteractionComplete', true);
    });
  }

Picture of Rob Mausser
Re: Autocomplete stress test
by Rob Mausser - Wednesday, 26 July 2023, 7:21 PM
 

Hi thanks

I tested this in Adapt 5 and it works but unfortunately, we need to use this for Adapt 4 and I don't see the onDataReady function or theme.js in the Adapt 4 theme.

 

Any suggestions on were it would go in that case?


Thanks

Picture of Ignacio Cinalli
Re: Autocomplete stress test
by Ignacio Cinalli - Wednesday, 26 July 2023, 7:53 PM
 

You could do it in a similar way:

  Adapt.on('app:dataReady', function () {
    Adapt.components.forEach((component) => {
      if (component.get('_isQuestionType')) {
        component.set({
          _isCorrect: true,
          _isSubmitted: true,
          _userAnswer: '',
          _score: 1
        });
        component.set('_attemptsLeft', Math.max(0, component.set('_attempts') - 1));
      }
      component.set('_isComplete', true);
      component.set(component.has('_isInteractionsComplete') ? '_isInteractionsComplete' : '_isInteractionComplete', true);
    });
  });

Picture of Rob Mausser
Re: Autocomplete stress test
by Rob Mausser - Wednesday, 26 July 2023, 8:31 PM
 

Thanks. While this works, the issue is that this kind of goes about offering a bad stress test, because in the console it only sends a single call, the suspend data.

SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1111111-1111111111----111111111111-1111111111111111-1111-11111111-1","questions":"","_isCourseComplete":true,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.core.lesson_status') value: completed

The devtools version sends a call every time for every component, which is much closer to what an actual course would do:

SCORM.data.set('cmi.core.lesson_location') value:
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----10-00-01000--0000000-0000000010----000000000000-0000000000000010-0000-00001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----10-00-01000--0000000-0000000010----100000000000-0000000000000010-0000-00001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----10-00-01000--0000000-0000000010----110000000000-0000000000000010-0000-00001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----10-00-01000--0000000-0000000010----110001000000-0000000000000010-0000-00001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----10-00-01000--0000000-0000000010----111001000000-0000000000000010-0000-00001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----10-00-01000--0000000-0000000010----111101000000-0000000000000010-0000-00001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----10-00-01000--0000000-0000000010----111111000000-0000000000000010-0000-00001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-00-01000--0000000-0000000010----111111000000-0000000000000010-0000-00001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-00-01000--0000000-0000000010----111111010000-0000000000000010-0000-00001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-10-01000--0000000-0000000010----111111010000-0000000000000010-0000-00001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-01000--0000000-0000000010----111111010000-0000000000000010-0000-00001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11000--0000000-0000000010----111111010000-0000000000000010-0000-00001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11000--0000000-0000000010----111111110000-0000000000000010-0000-00001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11000--0000000-0000000010----111111110000-0000000000000010-0000-10001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11000--0000000-0000000010----111111111000-0000000000000010-0000-10001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11000--0000000-0000000010----111111111100-0000000000000010-0000-10001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11000--0000000-0000000010----111111111110-0000000000000010-0000-10001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11100--0000000-0000000010----111111111110-0000000000000010-0000-10001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11110--0000000-0000000010----111111111110-0000000000000010-0000-10001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--0000000-0000000010----111111111110-0000000000000010-0000-10001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--0000000-0000000010----111111111110-0000010000000010-0000-10001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--0000000-0000000010----111111111111-0000010000000010-0000-10001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--0000000-0000000010----111111111111-0000011000000010-0000-10001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--0000000-0000000010----111111111111-0000011000000010-1000-10001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--0000000-0000000010----111111111111-1000011000000010-1000-10001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--0000000-0000000010----111111111111-1100011000000010-1000-10001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--0000000-0000000010----111111111111-1110011000000010-1000-10001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--0000000-0000000010----111111111111-1110011000000010-1100-10001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--0000000-0000000010----111111111111-1111011000000010-1100-10001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--0000000-0000000010----111111111111-1111111000000010-1100-10001100-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--0000000-0000000010----111111111111-1111111000000010-1100-10001110-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1000000-0000000010----111111111111-1111111000000010-1100-10001110-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1000000-0000000010----111111111111-1111111000000010-1100-10001111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1000000-0000000010----111111111111-1111111000000010-1110-10001111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1000000-0000000010----111111111111-1111111100000010-1110-10001111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1000000-0000000010----111111111111-1111111110000010-1110-10001111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1000000-0000000010----111111111111-1111111110000010-1110-11001111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1000000-0000000010----111111111111-1111111111000010-1110-11001111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1000000-0000000010----111111111111-1111111111000010-1110-11101111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1000000-0000000010----111111111111-1111111111100010-1110-11101111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1000000-0000000010----111111111111-1111111111100010-1111-11101111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1000000-0000000010----111111111111-1111111111110010-1111-11101111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1000000-0000000010----111111111111-1111111111111010-1111-11101111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1000000-0000000010----111111111111-1111111111111010-1111-11111111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1000000-0000000010----111111111111-1111111111111110-1111-11111111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1100000-0000000010----111111111111-1111111111111110-1111-11111111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1110000-0000000010----111111111111-1111111111111110-1111-11111111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1111000-0000000010----111111111111-1111111111111110-1111-11111111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1111100-0000000010----111111111111-1111111111111110-1111-11111111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1111110-0000000010----111111111111-1111111111111110-1111-11111111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1111111-0000000010----111111111111-1111111111111110-1111-11111111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1111111-0000000110----111111111111-1111111111111110-1111-11111111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1111111-1000000110----111111111111-1111111111111110-1111-11111111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1111111-1100000110----111111111111-1111111111111110-1111-11111111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1111111-1110000110----111111111111-1111111111111110-1111-11111111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1111111-1111000110----111111111111-1111111111111110-1111-11111111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1111111-1111100110----111111111111-1111111111111110-1111-11111111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1111111-1111110110----111111111111-1111111111111110-1111-11111111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1111111-1111111110----111111111111-1111111111111110-1111-11111111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1111111-1111111110----111111111111-1111111111111111-1111-11111111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1111111-1111111111----111111111111-1111111111111111-1111-11111111-1","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.suspend_data') value: {"lang":"en","a11y":false,"completion":"----11-11-11111--1111111-1111111111----111111111111-1111111111111111-1111-11111111-1","questions":"","_isCourseComplete":true,"_isAssessmentPassed":false}
SCORM_API_wrapper.js:914 SCORM.data.set('cmi.core.lesson_status') value: completed

 

So, great code but too good, as we want it to be inefficient to tax the server.

Thanks though. 

Picture of Ignacio Cinalli
Re: Autocomplete stress test
by Ignacio Cinalli - Wednesday, 26 July 2023, 11:14 PM
 

Rob,

Attached you'll find a zip file containing the sample JavaScript file. There, you can see multiple API SCORM calls, forcing the commit so that your LMS stores it on the server.
Hope this helps.

 

Picture of Rob Mausser
Re: Autocomplete stress test
by Rob Mausser - Thursday, 27 July 2023, 8:07 PM
 

wow youre too kind, thanks!