Step 18 – cmi.core.score._children and cmi.core.score.raw

After that last post, I think I’ll look at a nice easy one. The score for the course is stored in an element called cmi.core.score.raw. Actually, this is just one of a group of 3 elements that relate to the course score:

  • cmi.core.score.min
  • cmi.core.score.max
  • cmi.core.score.raw

but only cmi.core.score.raw is mandatory, so it’s the only one that I’ll worry about.

The way that the LMS tells the course that it only supports the cmi.core.score.raw element is to return the text string ‘raw’ when the course asks for the value of cmi.core.score._children. So I modify my getValue.php code to include the following:

  // cmi.core.score._children is always the same
  case "cmi.core.score._children":
    $varvalue = "raw";

The initial value for cmi.core.score.raw is an empty string which is what getValue.php returns by default if an element isn’t set. So that’s all I need to do for now. Moving on …

This entry was posted in Run Time Environment. Bookmark the permalink.

1 Response to Step 18 – cmi.core.score._children and cmi.core.score.raw

  1. Abhi says:

    ‘cmi.core.score.raw’ this variable is not setting by set method.
    Do I need to do any changes to get that and save in scormvar table?

Leave a Reply

Your email address will not be published. Required fields are marked *