Я разрабатываю Google Active Script для создания формы Google на основе файла Excel с форматом шаблона Quizziz ... Вопросы генерируются правильно, но я не знаю, как вставить изображения в CheckboxItem или MultipleChoiceItem. Основная функция показана ниже:
/* KahootArray2GoogleForm KahootArray2GoogleFormResult
pArrayKahoot = array Kahoot a partir del que generaremos el formulario Google
(array format: 0.Question, 1.Option 1, 2.Option 2, 3.Option 3, 4.Option 4, 5.Option 5, 6.Correct Answer, 7.Time, 8.Image Link)
Devuelve un array de dos elementos: id, error
donde
id = id del Google Form resultante; eoc undefined
error = mensaje de error; eoc undefined
*/
function KahootArray2GoogleFormItem(pArrayKahootQuestion, pForm) {
var lKahootArray2GoogleFormItemResult = [undefined, undefined];
Logger.log(pArrayKahootQuestion[KahootQuestion.Question]);
Logger.log(pArrayKahootQuestion[KahootQuestion.CorrectAnswer]);
if (pArrayKahootQuestion[KahootQuestion.CorrectAnswer].indexOf(",") > -1) {
// Multiple corrrect answers question -> check box options question
var lQuestion = pForm.addCheckboxItem();
}
else {
// Only one corrrect answer question -> radio button options question
var lQuestion = pForm.addMultipleChoiceItem();
}
lQuestion.setTitle(pArrayKahootQuestion[KahootQuestion.Question]);
**/* How to add image between question and choices? */**
var lChoices = [];
AddChoice(lQuestion, lChoices, pArrayKahootQuestion[KahootQuestion.Option1], (pArrayKahootQuestion[KahootQuestion.CorrectAnswer].indexOf(KahootQuestion.Option1) > -1))
AddChoice(lQuestion, lChoices, pArrayKahootQuestion[KahootQuestion.Option2], (pArrayKahootQuestion[KahootQuestion.CorrectAnswer].indexOf(KahootQuestion.Option2) > -1))
AddChoice(lQuestion, lChoices, pArrayKahootQuestion[KahootQuestion.Option3], (pArrayKahootQuestion[KahootQuestion.CorrectAnswer].indexOf(KahootQuestion.Option3) > -1))
AddChoice(lQuestion, lChoices, pArrayKahootQuestion[KahootQuestion.Option4], (pArrayKahootQuestion[KahootQuestion.CorrectAnswer].indexOf(KahootQuestion.Option4) > -1))
lQuestion.setChoices(lChoices);
lQuestion.setPoints(1);
return lKahootArray2GoogleFormItemResult;
}
Заранее спасибо !!!