| Línea 572... |
Línea 572... |
| 572 |
throw new coding_exception('Unsuitable expectiontion: '.get_class($expectation));
|
572 |
throw new coding_exception('Unsuitable expectiontion: '.get_class($expectation));
|
| 573 |
}
|
573 |
}
|
| 574 |
$dom = new DOMDocument();
|
574 |
$dom = new DOMDocument();
|
| 575 |
$dom->loadHTML($html);
|
575 |
$dom->loadHTML($html);
|
| 576 |
$selects = $dom->getElementsByTagName('select');
|
576 |
$selects = $dom->getElementsByTagName('select');
|
| - |
|
577 |
$this->assertGreaterThanOrEqual(1, $selects->count(), 'There is no <select> in the output.');
|
| 577 |
foreach ($selects as $select) {
|
578 |
foreach ($selects as $select) {
|
| 578 |
if ($select->getAttribute('name') == $expectation->name) {
|
579 |
if ($select->getAttribute('name') == $expectation->name) {
|
| 579 |
$options = $select->getElementsByTagName('option');
|
580 |
$options = $select->getElementsByTagName('option');
|
| 580 |
foreach ($options as $key => $option) {
|
581 |
foreach ($options as $key => $option) {
|
| 581 |
if ($key == 0) {
|
582 |
if ($key == 0) {
|
| Línea 877... |
Línea 878... |
| 877 |
|
878 |
|
| 878 |
protected function manual_grade($comment, $mark, $commentformat = null) {
|
879 |
protected function manual_grade($comment, $mark, $commentformat = null) {
|
| 879 |
$this->quba->manual_grade($this->slot, $comment, $mark, $commentformat);
|
880 |
$this->quba->manual_grade($this->slot, $comment, $mark, $commentformat);
|
| Línea 880... |
Línea 881... |
| 880 |
}
|
881 |
}
|
| 881 |
|
882 |
|
| 882 |
protected function save_quba(moodle_database $db = null) {
|
883 |
protected function save_quba(?moodle_database $db = null) {
|
| Línea 883... |
Línea 884... |
| 883 |
question_engine::save_questions_usage_by_activity($this->quba, $db);
|
884 |
question_engine::save_questions_usage_by_activity($this->quba, $db);
|
| 884 |
}
|
885 |
}
|
| 885 |
|
886 |
|
| Línea 886... |
Línea 887... |
| 886 |
protected function load_quba(moodle_database $db = null) {
|
887 |
protected function load_quba(?moodle_database $db = null) {
|
| 887 |
$this->quba = question_engine::load_questions_usage_by_activity($this->quba->get_id(), $db);
|
888 |
$this->quba = question_engine::load_questions_usage_by_activity($this->quba->get_id(), $db);
|