From 7b0932a6acb75e12ec606eb5e7cf5f69462109c7 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 26 Nov 2024 14:17:14 +0800 Subject: [PATCH] * [task#132545 doing 0.2h 2h] modify buildDetail function of thinkscore. --- lib/zin/wg/thinkscore/v1.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/zin/wg/thinkscore/v1.php b/lib/zin/wg/thinkscore/v1.php index 5e7bac9acb..fc73de74c8 100644 --- a/lib/zin/wg/thinkscore/v1.php +++ b/lib/zin/wg/thinkscore/v1.php @@ -28,6 +28,21 @@ class thinkScore extends thinkQuestion global $lang; $detailWg = parent::buildDetail(); list($step, $quoteQuestions, $preViewModel, $isRun, $scoreSetting) = $this->prop(array('step', 'quoteQuestions', 'preViewModel', 'isRun', 'scoreSetting')); + if($step) + { + $fields = !empty($step->options->fields) ? $step->options->fields : array(); + $scoreSetting = isset($step->options->scoreSetting) ? $step->options->scoreSetting : '0'; + $quoteTitleList = !empty($step->options->quoteTitle) ? explode(", ", $step->options->quoteTitle) : array(); + } + if(empty($fields) && !empty($quoteTitleList)) $fields = array($lang->thinkwizard->previewSteps->objectReference, $lang->thinkwizard->previewSteps->objectReference,$lang->thinkwizard->previewSteps->objectReference); + + $scoreCount = $scoreSetting == '0' ? 5 : 10; + $items = array(); + $radioItems = array(); + + for($i=1; $i<=$scoreCount; $i++){$items[] = array('text' => $i, 'value' => $i, 'disabledPrefix' => true);} + + $detailWg[] = div(setClass('score-content', $scoreSetting == '0' ? 'score-5' : 'score-10'), $radioItems); return $detailWg; } }