diff --git a/lib/zin/wg/thinkstepmenu/v1.php b/lib/zin/wg/thinkstepmenu/v1.php index 10ff2ca08c..9f45e718f9 100644 --- a/lib/zin/wg/thinkstepmenu/v1.php +++ b/lib/zin/wg/thinkstepmenu/v1.php @@ -48,12 +48,24 @@ class thinkStepMenu extends wg foreach($items as $setting) { if(!is_object($setting)) continue; + $options = !empty($setting->options) ? json_decode($setting->options) : array(); + $quotedTitle = !empty($options->quoteTitle) ? $options->quoteTitle : null; + $quotedText = ''; + /* 给引用其他问题的多选题添加标签。Add tags to multiple-choice questions that reference other questions. */ + if($quotedTitle) + { + foreach($items as $item) + { + if($quotedTitle == $item->id) $quotedText = sprintf($this->lang->thinkstep->treeLabel, $item->index); + } + } $canView = common::hasPriv('thinkstep', 'view'); $unClickable = $toggleNonNodeShow && $setting->id != $activeKey && $setting->type != 'node' && json_decode($setting->answer) == null; $item = array( 'key' => $setting->id, 'text' => (isset($setting->index) ? ($setting->index . '. ') : '') . $setting->title, + 'subtitle' => !empty($quotedText) ? array('html' => "$quotedText") : null, 'hint' => $unClickable ? $this->lang->thinkrun->error->unanswered :$setting->title, 'url' => $unClickable || !$canView ? '' : $setting->url, 'data-id' => $setting->id,