• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

<CP - Advanced actions - Expressions> shows "0"

New Here ,
Mar 28, 2023 Mar 28, 2023

Copy link to clipboard

Copied

Hello all, 

CP version - 11.5.5.553

My calculation by using Expressions doesn't work at all - the result shows "0". The purpose is to display the total number of questions before the actual Question slide.

 

I tried:

  • remove the varialbe and adv action and then re-create
  • rename the varialbe and adv action to ensure the title is unque

 

Did I miss any? Thank you for any suggestions/feedback

 

Varialbe - v_Qcount

Yolanda24562028k535_0-1680063630172.png

Adv Actions - "6" is the total number of those non-question slides

Yolanda24562028k535_1-1680063771159.png

After publishing the project..... it always shows "0"

Yolanda24562028k535_2-1680063886811.png

 

 

Views

337

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Community Expert , Mar 29, 2023 Mar 29, 2023

That's how you display the variable. 

That won't automatically trigger the Advanced Action to do its job.  For that you need a trigger event of some kind.  If you don't trigger the action it won't do anything.

In your case I would suggest you will want it to be triggered by the On Slide Enter event of one of the first slides in the project.  

Votes

Translate

Translate
Community Expert , Mar 29, 2023 Mar 29, 2023

You need to trigger it on Enter for the first slide. For more flexibility I would not use the literal 6 but the system variable cpQuizInfoTotalQuestionsPerProject:

  Expression v_QCount = cpInfoSlideCount - cpQuizInfoTotalQuestionsPerProject

How did you test it? If this is a non-responsive project use only F11, Preview HTML in Browser. That is not needed for a responsive project, and you will only find that option when you have upgraded to 11.8.1. BTW the Preview Project in that most recent vers

...

Votes

Translate

Translate
Community Expert ,
Mar 28, 2023 Mar 28, 2023

Copy link to clipboard

Copied

Which event are you using to trigger the Advanced Action?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 28, 2023 Mar 28, 2023

Copy link to clipboard

Copied

Hello Rod, 

Thank you for responding my issue. 

I insert the varialbe directly in the text box. 

Yolanda24562028k535_0-1680067846688.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 29, 2023 Mar 29, 2023

Copy link to clipboard

Copied

That's how you display the variable. 

That won't automatically trigger the Advanced Action to do its job.  For that you need a trigger event of some kind.  If you don't trigger the action it won't do anything.

In your case I would suggest you will want it to be triggered by the On Slide Enter event of one of the first slides in the project.  

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 29, 2023 Mar 29, 2023

Copy link to clipboard

Copied

Rod was asking how you did trigger the action SMEQTotal?  That action needs to be done before the slide where you inserted the variable in a text. If you insert the variable before it got its value using the Expression command, it will have its initial value which is set at 0.

Looking at the Expression, it is dynamic, because it depends on the system variable cpInfoCurrentSlide which is a counter starting with index 1. I think something is wrong with the logic. If you explained what you want to show exactly? Do you mean to use  the value of cpQuizInfoTotalQuestionsPerProject instead of cpQuizInfoCurrentSlide? 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 29, 2023 Mar 29, 2023

Copy link to clipboard

Copied

I intend to tell users how many questions in this assessment. That's why I use <"cpIntoSlideCount" - 6>..  

note: 6 means the total number of instruction slides and the result slide

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 29, 2023 Mar 29, 2023

Copy link to clipboard

Copied

You need to trigger it on Enter for the first slide. For more flexibility I would not use the literal 6 but the system variable cpQuizInfoTotalQuestionsPerProject:

  Expression v_QCount = cpInfoSlideCount - cpQuizInfoTotalQuestionsPerProject

How did you test it? If this is a non-responsive project use only F11, Preview HTML in Browser. That is not needed for a responsive project, and you will only find that option when you have upgraded to 11.8.1. BTW the Preview Project in that most recent version is identical to F11, no difference.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 29, 2023 Mar 29, 2023

Copy link to clipboard

Copied

Thank you both~~ Now, I have a huge progress - I set up a trigger as your suggestion. The number is correct but if I use "cpQuizInfoTotalQuestionsPerProject", v_QCount will be qual to cpInfoSlideCount... it seems "cpQuizInfoTotalQuestionsPerProject" actions as "0". My questions are all in Question Pool.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 29, 2023 Mar 29, 2023

Copy link to clipboard

Copied

You didn't tell these were random questions... Indeed, in that case the value of that system variable is not updated correctly.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 29, 2023 Mar 29, 2023

Copy link to clipboard

Copied

I was not aware that matters. Now I learned more about adv. actions. Thank you

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 30, 2023 Mar 30, 2023

Copy link to clipboard

Copied

There are more limitations to random questions as I explored them in this rather popular blog post:

https://blog.lilybiri.com/random-questions-dos-and-donts

If you want to discover more about advanced and shared actions (too much ignored), scroll through my blog. It often appears when using ChatGPT4 with Captivate questions, to my surprise.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 30, 2023 Mar 30, 2023

Copy link to clipboard

Copied

LATEST

Thanks for sharing it. It's great to have the resource

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources