You are here

function qformat_xml::trans_single in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle/question/format/xml/format.php \qformat_xml::trans_single()

Translate human readable single answer option to internal code number

Parameters

string name true/false:

Return value

int internal code number

1 call to qformat_xml::trans_single()
qformat_xml::import_multichoice in includes/moodle/question/format/xml/format.php
import multiple choice question

File

includes/moodle/question/format/xml/format.php, line 63

Class

qformat_xml

Code

function trans_single($name) {
  $name = trim($name);
  if ($name == "false" || !$name) {
    return 0;
  }
  else {
    return 1;
  }
}