mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-79863 qtype_ordering: qtype_ordering fix import of GIFT text files
This commit is contained in:
parent
6f79ea9708
commit
35551217e0
@ -161,13 +161,25 @@ class qtype_ordering extends question_type {
|
||||
// Insert all the new answers.
|
||||
foreach ($question->answer as $i => $answer) {
|
||||
|
||||
$answertext = '';
|
||||
$answerformat = 0;
|
||||
$answeritemid = null;
|
||||
|
||||
// Extract $answer fields.
|
||||
$answertext = $answer['text'];
|
||||
$answerformat = $answer['format'];
|
||||
if (!empty($answer['itemid'])) {
|
||||
$answeritemid = $answer['itemid'];
|
||||
} else {
|
||||
$answeritemid = null;
|
||||
if (is_string($answer)) {
|
||||
// import from file
|
||||
$answertext = $answer;
|
||||
} else if (is_array($answer)) {
|
||||
// input from browser
|
||||
if (isset($answer['text'])) {
|
||||
$answertext = $answer['text'];
|
||||
}
|
||||
if (isset($answer['format'])) {
|
||||
$answerformat = $answer['format'];
|
||||
}
|
||||
if (isset($answer['itemid'])) {
|
||||
$answeritemid = $answer['itemid'];
|
||||
}
|
||||
}
|
||||
|
||||
// Reduce simple <p>...</p> to plain text.
|
||||
|
@ -29,5 +29,5 @@ $plugin->cron = 0;
|
||||
$plugin->component = 'qtype_ordering';
|
||||
$plugin->maturity = MATURITY_STABLE;
|
||||
$plugin->requires = 2010112400; // Moodle 2.0
|
||||
$plugin->version = 2018011768;
|
||||
$plugin->release = '2018-01-17 (68)';
|
||||
$plugin->version = 2018052469;
|
||||
$plugin->release = '2018-05-24 (69)';
|
||||
|
Loading…
x
Reference in New Issue
Block a user