Skip to content

Commit

Permalink
MDL-9657 cleaning abstractype code.
Browse files Browse the repository at this point in the history
  • Loading branch information
pichetp committed Apr 25, 2007
1 parent 5df53d0 commit 56e248a
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions question/type/datasetdependent/abstractqtype.php
Expand Up @@ -80,42 +80,6 @@ function save_session_and_responses(&$question, &$state) {
return true;
}

function print_question_formulation_and_controls(&$question, &$state, $cmoptions,
$options) {
// Substitute variables in questiontext before giving the data to the
// virtual type for printing
$virtualqtype = $this->get_virtual_qtype();
$unit = $virtualqtype->get_default_numerical_unit($question);
foreach ($question->options->answers as $answer) {
$answer->answer = $this->substitute_variables($answer->answer,
$state->options->dataset);
}
$question->questiontext = $this->substitute_variables(
$question->questiontext, $state->options->dataset);
$virtualqtype->print_question_formulation_and_controls($question,
$state, $cmoptions, $options);
}

function grade_responses(&$question, &$state, $cmoptions) {
// Forward the grading to the virtual qtype
foreach ($question->options->answers as $answer) {
$answer->answer = $this->substitute_variables($answer->answer,
$state->options->dataset);
}
$virtualqtype = $this->get_virtual_qtype();
return $virtualqtype->grade_responses($question, $state, $cmoptions) ;
}

// ULPGC ecastro
function check_response(&$question, &$state) {
// Forward the checking to the virtual qtype
foreach ($question->options->answers as $answer) {
$answer->answer = $this->substitute_variables($answer->answer,
$state->options->dataset);
}
$virtualqtype = $this->get_virtual_qtype();
return $virtualqtype->check_response($question, $state) ;
}

function substitute_variables($str, $dataset) {
foreach ($dataset as $name => $value) {
Expand Down

0 comments on commit 56e248a

Please sign in to comment.