Skip to content
Snippets Groups Projects
Commit 33401095 authored by Chris Sangwin's avatar Chris Sangwin
Browse files

Tidy comments and change input comparison.

parent be486cac
No related branches found
No related tags found
No related merge requests found
......@@ -150,8 +150,8 @@ class qtype_stack_question extends question_graded_automatically_with_countback
/**
* The next three fields cache the results of some expensive computations.
* The chache is only vaid for a particular response, so we store the current
* response, so that we can clearn the cached information in the result changes.
* The chache is only valid for a particular response, so we store the current
* response, so that we can learn the cached information in the result changes.
* See {@link validate_cache()}.
* @var array
*/
......@@ -201,7 +201,7 @@ class qtype_stack_question extends question_graded_automatically_with_countback
/**
* @return bool do any of the inputs in this question require the student
* validat the input.
* validate the input.
*/
protected function any_inputs_require_validation() {
foreach ($this->inputs as $name => $input) {
......@@ -467,7 +467,6 @@ class qtype_stack_question extends question_graded_automatically_with_countback
*/
public function get_input_state($name, $response, $rawinput=false) {
$this->validate_cache($response, null);
if (array_key_exists($name, $this->inputstates)) {
return $this->inputstates[$name];
}
......@@ -715,7 +714,6 @@ class qtype_stack_question extends question_graded_automatically_with_countback
*/
protected function get_prt_input($index, $response, $acceptvalid) {
$prt = $this->prts[$index];
$prtinput = array();
foreach ($prt->get_required_variables(array_keys($this->inputs)) as $name) {
$state = $this->get_input_state($name, $response);
......
......@@ -581,7 +581,7 @@ abstract class stack_input {
if (!$valid) {
$status = self::INVALID;
} else if ($this->get_parameter('mustVerify', true) && $validator != $this->contents_to_maxima($contents)) {
} else if ($this->get_parameter('mustVerify', true) && !($validator === $this->contents_to_maxima($contents))) {
$status = self::VALID;
} else {
$status = self::SCORE;
......
......@@ -139,7 +139,6 @@ class stack_potentialresponse_node {
if ($this->required_atoptions() && !$this->process_atoptions()) {
$ncasopts = $this->atoptions;
}
$at = new stack_ans_test_controller($this->answertest, $nsans, $ntans, $options, $ncasopts);
$at->do_test();
......@@ -190,7 +189,6 @@ class stack_potentialresponse_node {
}
$results->add_trace($at->get_trace());
return $resultbranch['nextnode'];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment