public function MatchingProcessor::generateHTML in Opigno module 3.x
Same name and namespace in other branches
- 8 ActivityTypes/opigno_h5p/src/TypeProcessors/MatchingProcessor.php \Drupal\opigno_h5p\TypeProcessors\MatchingProcessor::generateHTML()
Processes xAPI data and returns a human readable HTML report.
@inheritdoc
Overrides TypeProcessor::generateHTML
File
- ActivityTypes/
opigno_h5p/ src/ TypeProcessors/ MatchingProcessor.php, line 25
Class
- MatchingProcessor
- Class MatchingProcessor.
Namespace
Drupal\opigno_h5p\TypeProcessorsCode
public function generateHTML($description, $crp, $response, $extras = NULL, $scoreSettings = NULL) {
// We need some style for our report.
$this
->setStyle('opigno_h5p/opigno_h5p.matching');
$dropzones = $this
->getDropzones($extras);
$draggables = $this
->getDraggables($extras);
$mappedCRP = $this
->mapPatternIDsToIndexes($crp[0], $dropzones, $draggables);
$mappedResponse = $this
->mapPatternIDsToIndexes($response, $dropzones, $draggables);
if (empty($mappedCRP) && empty($mappedResponse)) {
return '';
}
$header = $this
->generateHeader($description, $scoreSettings);
$tableHTML = $this
->generateTable($mappedCRP, $mappedResponse, $dropzones, $draggables);
$container = '<div class="h5p-reporting-container h5p-matching-container">' . $header . $tableHTML . '</div>';
return $container;
}