}
$datasetdef->itemcount = $item->itemnumber - 1;
- // Retrieve ->options
+ // Retrieve ->options
if (is_numeric($datasetdata->min) && is_numeric($datasetdata->max)
&& $datasetdata->min <= $datasetdata->max) {
if (is_numeric($datasetdata->dec)) {
}
function readquestions ($lines) {
+ global $QTYPES;
$qtypecalculated = new qformat_webct_modified_calculated_qtype();
$webctnumberregex =
$nQuestionStartLine = 0;
$bIsHTMLText = FALSE;
$lines[] = ":EOF:"; // for an easiest processing of the last line
- $question = $this->defaultquestion();
+ // $question = $this->defaultquestion();
foreach ($lines as $line) {
$nLineCounter++;
case CALCULATED:
foreach ($question->answers as $answer) {
- if ($formulaerror = quiz_qtype_calculated_find_formula_errors($answer->answer)) {
+ if ($formulaerror = qtype_calculated_find_formula_errors($answer->answer)) {
$warnings[] = "'$question->name': ". $formulaerror;
$QuestionOK = FALSE;
}
if (eregi("^:TYPE:MC:1(.*)",$line,$webct_options)) {
// Multiple Choice Question with only one good answer
+ $question = $this->defaultquestion();
$question->qtype = MULTICHOICE;
$question->single = 1; // Only one answer is allowed
$ignore_rest_of_question = FALSE;
if (eregi("^:TYPE:MC:N(.*)",$line,$webct_options)) {
// Multiple Choice Question with several good answers
+ $question = $this->defaultquestion();
$question->qtype = MULTICHOICE;
$question->single = 0; // Many answers allowed
$ignore_rest_of_question = FALSE;
if (eregi("^:TYPE:S",$line)) {
// Short Answer Question
+ $question = $this->defaultquestion();
$question->qtype = SHORTANSWER;
$question->usecase = 0; // Ignore case
$ignore_rest_of_question = FALSE;
if (eregi("^:TYPE:C",$line)) {
// Calculated Question
+ $question = $this->defaultquestion();
$question->qtype = CALCULATED;
$question->answers = array(); // No problem as they go as :FORMULA: from webct
$question->units = array();
if (eregi("^:TYPE:M",$line)) {
// Match Question
+ $question = $this->defaultquestion();
$question->qtype = MATCH;
$ignore_rest_of_question = FALSE; // match question processing is not debugged
continue;
if (!isset($question)) {
continue;
}
- if (CALCULATED == $question->qtype && ereg(
+ if ('calculated' == $question->qtype && ereg(
"^:([[:lower:]].*|::.*)-(MIN|MAX|DEC|VAL([0-9]+))::?:?($webctnumberregex)", $line, $webct_options)) {
$datasetname = ereg_replace('^::', '', $webct_options[1]);
$datasetvalue = qformat_webct_convert_formula($webct_options[4]);