Skip to main content
Participating Frequently
January 13, 2017
Question

only the question numbers of the questions missed

  • January 13, 2017
  • 4 replies
  • 1043 views

In Adobe Captivate I would like to create a custom results page for my quiz that lists only the question numbers of the questions missed.

By creating one user variable per question userAnswer1, userAnswer2, userAnswer3, etc. and each time assigning that user variable to the system variable of cpQuizInfoAnswerChoice I'm able to have enough data to create a list of only the question numbers of the questions missed on the quiz results page.

The problem is when I choose "Submit All" in the quiz settings preferences then my user variables don't get any value placed in them. They end up with empty values. My client wants students to be able to go backward and forward through the quiz changing their answers and then making the submission at the end.  The client doesn't want students to submit their answer each question, just one time for all the question at the end. So I choose "Submit All" the in quiz settings preferences, but the problem is my user variables then end up with empty values.

Is it possible in Adobe Captivate to have a custom results page for a quiz, with "Select All" chosen in the quiz settings preferences, that lists only the question numbers of the questions missed?

Thank you for any tips or advice in the right direction.

This topic has been closed for replies.

4 replies

TLCMediaDesign
Inspiring
January 20, 2017

As I said earlier, this script will NOT work with swf.

I'll try to come up with a script that will work for both later.

In my test this works perfectly for HTML5.

Participating Frequently
January 20, 2017

Thank you TLCMediaDesign,

I appreciate all the help you have given me, I'm not sure why my above script doesn't work.

Yes, thank you, an example script that works for SWF would be awesome.

--Travis Rex Brian

TLCMediaDesign
Inspiring
January 20, 2017

It doesn't work because none of the variables exist in a SWF project, Only HTML5.

TLCMediaDesign
Inspiring
January 19, 2017

Are you using HTML5?

To make this work for SWF and HTML5 it will need different code.

If this is for HTML5, I would need to see your published index.html contents.

Participating Frequently
January 19, 2017

I've been trying to make this happen anyway possible. I've been trying with HTML5 and SWF. My preference would be SWF.

This is my index.html:

<!-- Copyright [2008] Adobe Systems Incorporated.  All rights reserved -->

<!-- saved from url=(0013)about:internet -->

<!doctype html>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title></title>

<script src="standard.js" type="text/javascript"></script>

<!-- ************* -->

<!-- This is the code you gave me -->

<script type="text/javascript">

var incorrectArray = [ ];

function getAnswers()

{

for ( var i = 0; i < cp.movie.questionObjs.length; i++ )

{

  if ( cp.movie.questionObjs[ i ].wasJudged )

  {

   if ( cp.movie.questionObjs[ i ].m_questionScore.m_answeredCorrectly != true )

   {

    incorrectArray.push( i + 1 );

   }

  }

}

window.incorrectAnswers = incorrectArray.toString();

}

</script>

<!-- ************* -->

<!-- ************* -->

</head>

  <link rel="stylesheet" type="text/css" href="captivate.css" />

<body   bgcolor="#ffffff">

<!-- ************* -->

<!-- this probably isn't needed but I've placed it in as I go through trying everything -->

<button onclick="getAnswers()">Click me</button>

<!-- ************* -->

<!-- ************* -->

     

  <div id="CaptivateContent"> 

  </div>

  <script type="text/javascript">

  var strURLFull = window.document.location.toString();

  var intTemp = strURLFull.indexOf("?");

  var strURLParams = "";

  if(intTemp != -1)

  {

  strURLParams = strURLFull.substring(intTemp + 1, strURLFull.length);

  }

     var so = new SWFObject("backForward.swf", "Captivate", "100%", "100%", "11.0", "#CCCCCC");

  so.addParam("quality", "high");

  so.addParam("name", "Captivate");

  so.addParam("id", "Captivate");

  so.addParam("wmode", "window");

  so.addParam("bgcolor","#ffffff");

  so.addParam("seamlesstabbing","true");

  so.addParam("menu", "false");

  so.addParam("AllowScriptAccess","always");

  so.addVariable("variable1", "value1");

  if(strURLParams != "")

  {

  so.addVariable("flashvars",strURLParams);

  }

  so.setAttribute("redirectUrl", "http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash");

  so.write("CaptivateContent");

  </script>  

  <script type="text/javascript">

  document.getElementById('Captivate').focus();

  document.Captivate.focus();

  </script>

</body>

</html>

TLCMediaDesign
Inspiring
January 15, 2017

You will need to execute this JavaScript externally for it to work. You can put this script in the head of the index.html and when you want the answers, execute JavaScript; getAnswers();

Create a variable in Captivate to display the incorrect answers ( incorrectAnswers )

var incorrectArray = [ ];

function getAnswers()

{

for ( var i = 0; i < cp.movie.questionObjs.length; i++ )

{

  if ( cp.movie.questionObjs[ i ].wasJudged )

  {

   if ( cp.movie.questionObjs[ i ].m_questionScore.m_answeredCorrectly != true )

   {

    incorrectArray.push( i + 1 );

   }

  }

}

window.incorrectAnswers = incorrectArray.toString();

}

Participating Frequently
January 17, 2017

Thank you!, I'm going to try this out today.

TLCMediaDesign
Inspiring
January 17, 2017

This is going to return a string that looks like:

1,4,5,7,12

Lilybiri
Legend
January 13, 2017

The quizzing system var cpQuizInfoAnswerChoice is not populated when you use the feature Submit All. I'm sorry, cannot offer you more help, that feature is restricting so much and the design of quiz slides has many strict rules. Since all answers are submitted at once when the button Submit all is clicked, none of the other reused quizzing system vars will not be of any help neither. In this case, I would choose to create custom question slides, unless some JS guru can give you another solution.