2 questions in a Pool of 8 questions random

Solved!
Thanks Toan!!!

1 Like

Hi @ToanLS ,
if in a question I would to insert an image (as title of the question or as option of answer).
how could I proceed, without create a new layer?

Thanks

Hi,

It’s not possible to insert images into a Multiple Choice question.
But you can insert images as separated layers and update the script as follows:

  1. Add array of image objects’ names to the question data, for example:
  {
    title: 'Q1_P1_Title',
    question: 'Q1_P1',
    images: ['Q1_P1_Img1', 'Q1_P1_Img2']
  }
  1. Add script to show/hide images in myShowQuestion function
  prez.myShowQuestion = function(show) {
    if (!this.myShowingQuestion)
      return;
    var images = this.myShowingQuestion.images;
    if (images) {
      for (var i = 0; i < images.length; ++i) {
        var imageObject = this.object(images[i]);
        if (show)
          imageObject.show();
        else
          imageObject.hide();
      }
    }
    //..... (original code from if (show) {
};

Regards

I have solved! Thanks

1 Like

Dear @ToanLS,
I bought 3 licenses of the software.
Now, the script works fine.
The only problem is:
(example)
If I set a range for the a poll of questions from 0.10 to 0.15 sec
and I don’t pause or restart the video before this range, all works good.
But if I pause the video before the range or restart the video, the range pool appears before.

What is the problem in the script?

Hi,

Can you please let me know your order reference number or the email your placed the order?

My script use setTimeout function for showing the question randomly so it’ll not work correctly if you pause or seek (e.g. restart, go to another slide) the presentation.

Regards

@ToanLS
I have already write at support@atomisystems.com could You answer me there?

I’ve replied to your email and also updated the script in my answer in this thread.

Regards

Hi Toan,
It works!

Thanks

Hi @ToanLS,
Could I set for the random question a timeout of 30 seconds for the student?

I cannot find the timeout option.

Thanks

Hi,

Unfortunately, timeout option in the editor is not available for initially hidden questions.
You can add the following script to the end of myShowQuestion function to show next section or restart current section when timeout occurs:

prez.myShowQuestion = function(show) {
  /*
   original code....
  */
  // add more for timeout
  if (show) { // set timeout when showing the question
    this.myQuestionTimeoutTimer = setTimeout(function() {
      // show next section
      prez.myShowNextSection();  // prez.myRestartSection(); if you want to restart current section
    }, 30000);  // 30s
  } else { // clear timeout when hiding the question
    if (this.myQuestionTimeoutTimer) {
      clearTimeout(this.myQuestionTimeoutTimer);
      delete this.myQuestionTimeoutTimer;
    }
  }
};

Regards

Hi @ToanLS,
thanks for your reply.
It works, but if the 30 seconds ends, the user must to see a timeout message and return at the beginning of the video.

Hi,

To save the time please list all requirements clearly at once.

Regards

Hi @ToanLS
You are right, sorry.
I need only to fix these last 2 problems:

This:

And this:
Another problem is that when you minimize the window, the video go on, and so the random question not appears correctly.

This one is a big problem, the video must to be stopped when minimize the window.

Hi,

Please check this sample: recreate-random-questions-at-random-time-3.approj (3.5 MB)
You’ll need to:

  • Update the script in Project Event

  • Add action Execute JavaScript: prez.myClearQuestionTimeout(); add the beginning of On Correct / On Incorrect event of each question
    image

  • Change the On Click actions of the Continue button in Timeout feedback
    image

Regarding the issue #2, it’s due to recent changes in Chromium based browsers. We’ll fix it soon.
To make sure, please verify that it works well on Firefox browser.

Regards

Hi @ToanLS,
thanks for your reply.
Issue #1 solved, thanks again.
Issue #2 I confirm in Firefox not happens the error, but in Chrome and Safari there is the issue and considering Chromium based browsers are used from most people, it will be very useful if you fix very soon this issue.
We will wait your update, please notify us when fixed and what we do to fix this active presenter project.
Thanks

Hi,

I’ll let you know when the issue #2 is fixed, hopefully at the end of this week.

Regards

Hi @ToanLS,
Very thanks.
We Will wait your fix.

Thanks again.

Hi,

We’ve just released ActivePresenter 8.3.0 that fixes this issue.
You can update your ActivePresenter from Help tab > Check Updates, or download this version from the download page.

Regards

Hi @ToanLS,
Very thanks! It fix the issue, but there is a problem after.
When a video is completed, if you click play button, the video go on…
Why?

Schermata 2020-12-04 alle 20.40.55