|
@@ -45,6 +45,10 @@ class SurveyQuestion extends Resource
|
|
*/
|
|
*/
|
|
public $options;
|
|
public $options;
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Is this question required (0: no, 1: yes)
|
|
|
|
+ */
|
|
|
|
+ public $is_required;
|
|
/**
|
|
/**
|
|
* Create a new SurveyQuestion
|
|
* Create a new SurveyQuestion
|
|
* @param int $id
|
|
* @param int $id
|
|
@@ -56,6 +60,7 @@ class SurveyQuestion extends Resource
|
|
* @param int $sort
|
|
* @param int $sort
|
|
* @param int $shared_question_id
|
|
* @param int $shared_question_id
|
|
* @param int $max_value
|
|
* @param int $max_value
|
|
|
|
+ * @param int $is_required
|
|
*/
|
|
*/
|
|
public function __construct(
|
|
public function __construct(
|
|
$id,
|
|
$id,
|
|
@@ -66,7 +71,8 @@ class SurveyQuestion extends Resource
|
|
$display,
|
|
$display,
|
|
$sort,
|
|
$sort,
|
|
$shared_question_id,
|
|
$shared_question_id,
|
|
- $max_value
|
|
|
|
|
|
+ $max_value,
|
|
|
|
+ $is_required = false
|
|
) {
|
|
) {
|
|
parent::__construct($id, RESOURCE_SURVEYQUESTION);
|
|
parent::__construct($id, RESOURCE_SURVEYQUESTION);
|
|
$this->survey_id = $survey_id;
|
|
$this->survey_id = $survey_id;
|
|
@@ -78,6 +84,9 @@ class SurveyQuestion extends Resource
|
|
$this->shared_question_id = $shared_question_id;
|
|
$this->shared_question_id = $shared_question_id;
|
|
$this->max_value = $max_value;
|
|
$this->max_value = $max_value;
|
|
$this->answers = array();
|
|
$this->answers = array();
|
|
|
|
+ if (api_get_configuration_value('allow_required_survey_questions')) {
|
|
|
|
+ $this->is_required = $is_required;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|