class CompoundProcessor in Opigno module 3.x
Same name and namespace in other branches
- 8 ActivityTypes/opigno_h5p/src/TypeProcessors/CompoundProcessor.php \Drupal\opigno_h5p\TypeProcessors\CompoundProcessor
Class FillInProcessor.
Processes and generates HTML report for 'fill-in' interaction type.
Hierarchy
- class \Drupal\opigno_h5p\TypeProcessors\TypeProcessor
- class \Drupal\opigno_h5p\TypeProcessors\CompoundProcessor
Expanded class hierarchy of CompoundProcessor
File
- ActivityTypes/
opigno_h5p/ src/ TypeProcessors/ CompoundProcessor.php, line 12
Namespace
Drupal\opigno_h5p\TypeProcessorsView source
class CompoundProcessor extends TypeProcessor {
/**
* Determines options for interaction, generates a human readable HTML report.
*
* @inheritdoc
*/
public function generateHTML($description, $crp, $response, $extras, $scoreSettings = NULL) {
// We need some style for our report.
$this
->setStyle('opigno_h5p/opigno_h5p.compound');
$H5PReport = H5PReport::getInstance();
$reports = '';
if (isset($extras->children)) {
foreach ($extras->children as $childData) {
$reports .= '<div class="h5p-result">' . $H5PReport
->generateReport($childData, NULL, $this->disableScoring) . '</div>';
}
}
// Do not display description when children is empty.
if (!empty($reports) && !empty($description)) {
$reports = '<p class="h5p-reporting-description h5p-compound-task-description">' . $description . '</p>' . $reports;
}
if (!empty($reports)) {
return '<div class="h5p-reporting-container h5p-compound-container">' . $reports . '</div>';
}
else {
return NULL;
}
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CompoundProcessor:: |
public | function |
Determines options for interaction, generates a human readable HTML report. Overrides TypeProcessor:: |
|
TypeProcessor:: |
protected | property | ||
TypeProcessor:: |
private | property | ||
TypeProcessor:: |
protected | property | ||
TypeProcessor:: |
public | function | Generate HTML for report. | |
TypeProcessor:: |
protected | function | Generate score html. | |
TypeProcessor:: |
protected | function | Decode and retrieve Correct Responses Pattern from xAPI data. | |
TypeProcessor:: |
protected | function | Decode and retrieve 'en-US' description from xAPI data. | |
TypeProcessor:: |
protected | function | Decode extras from xAPI data. | |
TypeProcessor:: |
protected | function | Decode and retrieve user response from xAPI data. | |
TypeProcessor:: |
protected | function | Get score settings. | |
TypeProcessor:: |
public | function | Get style used by processor if used. | |
TypeProcessor:: |
protected | function | Set style used by the processor. |