function qformat_gift::split_truefalse_comment in Quiz 6.5
Same name and namespace in other branches
- 6.6 includes/moodle/question/format/gift/format.php \qformat_gift::split_truefalse_comment()
1 call to qformat_gift::split_truefalse_comment()
- qformat_gift::readquestion in includes/
moodle/ question/ format/ gift/ format.php - Given the data known to define a question in this format, this function converts it into a question object suitable for processing and insertion into Moodle.
File
- includes/
moodle/ question/ format/ gift/ format.php, line 70
Class
- qformat_gift
- @package questionbank @subpackage importexport
Code
function split_truefalse_comment($comment) {
// splits up comment around # marks
// returns an array of true/false feedback
$bits = explode('#', $comment);
$feedback = array(
'wrong' => $bits[0],
);
if (count($bits) >= 2) {
$feedback['right'] = $bits[1];
}
else {
$feedback['right'] = '';
}
return $feedback;
}