public function OpignoTincanQuestionTypeQuestion::getCreationForm in Opigno TinCan Question Type 7
Get the form used to create a new question.
Parameters
array $form_state: FAPI form state.
Return value
array Must return a FAPI array.
File
- includes/
opigno_tincan_question_type.question.inc, line 167 - This file contains the class OpignoTincanQuestionTypeQuestion.
Class
- OpignoTincanQuestionTypeQuestion
- This class goal is to provide specific TinCan question information.
Code
public function getCreationForm(array &$form_state = NULL) {
if (isset($this->node->nid) && !isset($this->nodeProperties['fid'])) {
$this
->getNodeProperties();
}
return array(
'file' => array(
'#type' => 'managed_file',
'#title' => t('TinCan package'),
'#default_value' => $this->nodeProperties['fid'],
'#upload_location' => self::PATH_PUBLIC_PACKAGE_FOLDER,
'#upload_validators' => array(
'file_validate_extensions' => array(
'zip',
),
),
'#required' => TRUE,
),
);
}