diff --git a/lib/zin/wg/thinkchecklist/v1.php b/lib/zin/wg/thinkchecklist/v1.php index c76147fe71..6e13bdfaa3 100644 --- a/lib/zin/wg/thinkchecklist/v1.php +++ b/lib/zin/wg/thinkchecklist/v1.php @@ -74,7 +74,7 @@ class thinkCheckList extends wg ( set(array( 'rows' => 1, - 'class' => 'hidden', + 'class' => isset($item['checked']) && $item['checked'] ? '' : 'hidden', 'name' => 'other', 'value' => isset($item['showText']) ? $item['showText'] : '', 'placeholder' => $lang->thinkrun->placeholder->otherOption diff --git a/lib/zin/wg/thinkrun/v1.php b/lib/zin/wg/thinkrun/v1.php index cbc6f35cd6..8747391687 100644 --- a/lib/zin/wg/thinkrun/v1.php +++ b/lib/zin/wg/thinkrun/v1.php @@ -2,7 +2,7 @@ declare(strict_types=1); namespace zin; -require_once dirname(__DIR__) . DS . 'thinkradiolist' . DS . 'v1.php'; +require_once dirname(__DIR__) . DS . 'thinkchecklist' . DS . 'v1.php'; class thinkRun extends wg { protected static array $defineProps = array( @@ -17,7 +17,7 @@ class thinkRun extends wg $options = json_decode($item->options); $answer = json_decode($item->answer); - if($options->questionType == 'radio') + if($options->questionType == 'radio' || $options->questionType == 'checkbox') { $fields = $options->fields ? explode(', ', $options->fields) : array(); $showFields = array(); @@ -25,8 +25,9 @@ class thinkRun extends wg if($options->enableOther) $showFields[] = array('text' => $lang->thinkwizard->step->other, 'value' => 'other', 'isOther' => '1', 'showText' => isset($answer->other) ? $answer->other : ''); - return new thinkRadioList + return new thinkCheckList ( + set::type($options->questionType), setClass('mt-6'), set::items($showFields), set::name('result'),