Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'MDL-49666_28' of git://github.com/timhunt/moodle into M…
…OODLE_28_STABLE
  • Loading branch information
danpoltawski committed Mar 31, 2015
2 parents 32623b4 + 8d7fa47 commit bbc9f54
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion question/behaviour/informationitem/renderer.php
Expand Up @@ -36,7 +36,7 @@
*/
class qbehaviour_informationitem_renderer extends qbehaviour_renderer {
public function controls(question_attempt $qa, question_display_options $options) {
if ($qa->get_state() != question_state::$todo) {
if ($options->readonly || $qa->get_state() != question_state::$todo) {
return '';
}

Expand Down
11 changes: 9 additions & 2 deletions question/behaviour/informationitem/tests/walkthrough_test.php
Expand Up @@ -49,10 +49,17 @@ public function test_informationitem_feedback_description() {
$this->check_current_state(question_state::$todo);
$this->check_current_mark(null);
$this->check_current_output($this->get_contains_question_text_expectation($description),
new question_contains_tag_with_attributes('input', array('type' => 'hidden',
'name' => $this->quba->get_field_prefix($this->slot) . '-seen', 'value' => 1)),
$this->get_contains_hidden_expectation(
$this->quba->get_field_prefix($this->slot) . '-seen', 1),
$this->get_does_not_contain_feedback_expectation());

// Check no hidden input when read-only.
$this->displayoptions->readonly = true;
$this->check_current_output($this->get_contains_question_text_expectation($description),
$this->get_does_not_contain_hidden_expectation(
$this->quba->get_field_prefix($this->slot) . '-seen', 1));
$this->displayoptions->readonly = false;

// Process a submission indicating this question has been seen.
$this->process_submission(array('-seen' => 1));

Expand Down

0 comments on commit bbc9f54

Please sign in to comment.