Example #1
0
        /// <summary>
        /// 加载题目
        /// </summary>
        /// <param name="item_id"></param>
        private void BindQsItemInfo()
        {
            //初始化
            TxtPlayingTime    = PlayTime = 0;
            TxtTotalTime      = TotalTime = PaperInfoItem.items[0].item_answer_second * 10;
            _audioPlayTimes   = 0;
            _item_repet_times = 1;
            _Recording        = RecordState.UnRecord;

            //默认取第一题
            //PaperItems
            SyncQsContent       = PaperInfoItem.items[0].item_content;
            _syncQsContentAudio = PaperInfoItem.items[0].source_content;

            WordView.QsItemContent.Children.Clear();
            var txt = new TextBlock();

            txt.Text         = SyncQsContent;
            txt.TextWrapping = TextWrapping.Wrap;
            txt.FontSize     = 28;
            txt.Margin       = new Thickness(0, 0, 6, 0);
            //BrushConverter brushConverter = new BrushConverter();
            //Brush brush = (Brush)brushConverter.ConvertFromString("#333333");
            txt.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#353535"));
            WordView.QsItemContent.Children.Add(txt);

            try
            {
                KeyWordEx keyWord = JsonHelper.FromJson <KeyWordEx>(PaperInfoItem.items[0].item_keyword);
                SyncQsYbContent  = $"[ {keyWord.yb} ]";
                SyncQsZhContent  = keyWord.desc;
                SyncQsExEContent = keyWord.ex_en;
                SyncQsExZContent = keyWord.ex_zh;

                if (string.IsNullOrEmpty(keyWord.sp))
                {
                    _IsSpell = true;
                }
            }
            catch (Exception ex)
            {
                Log4NetHelper.Error($"单词 KeyWord 绑定异常:{PaperInfoItem.items[0].item_keyword}", ex);
            }

            if (!string.IsNullOrEmpty(PaperInfoItem.items[0].img_source_content) &&
                MediaPic.Contains(PaperInfoItem.items[0].img_source_content.ToUpper().Split('.').LastOrDefault()))
            {
                string url = WebApiProxy.GetRedirectUrl($"{WebApiProxy.MEDIAURL}{PaperInfoItem.items[0].img_source_content}");
                SyncQsInfoImage = new BitmapImage(new Uri(url));
            }


            BindUserScoreBox();

            //BeginExam(_NextFlowType);
        }
Example #2
0
        /// <summary>
        /// 加载题目
        /// </summary>
        /// <param name="item_id"></param>
        private void BindQsItemInfo(string item_id = null)
        {
            if (_itemIndex >= PaperItems.Count)
            {
                _dTimer.Stop();
                _dTimer = null;
                //进入 下一道大题
                NextQsView();
            }
            else
            {
                //默认取第一题
                //PaperItems
                QsItemContent = $"{_itemIndex + 1}、{PaperItems[_itemIndex].items[0].item_content}";
                try
                {
                    KeyWordEx keyWord = JsonHelper.FromJson <KeyWordEx>(PaperItems[_itemIndex].items[0].item_keyword);
                    SyncQsYbContent = $"[ {keyWord.yb} ]";
                    SyncQsZhContent = keyWord.desc;
                }
                catch (Exception ex)
                {
                    Log4NetHelper.Error($"单词 KeyWord 绑定异常:{PaperItems[_itemIndex].items[0].item_keyword}", ex);
                }

                if (!string.IsNullOrEmpty(PaperItems[_itemIndex].items[0].img_source_content) &&
                    MediaPic.Contains(PaperItems[_itemIndex].items[0].img_source_content.ToUpper().Split('.').LastOrDefault()))
                {
                    string url = WebApiProxy.GetRedirectUrl($"{WebApiProxy.MEDIAURL}{PaperItems[_itemIndex].items[0].img_source_content}");
                    QsInfoImage = new BitmapImage(new Uri(url));
                }

                //初始化
                PlayTime          = 0;
                TotalTime         = 0;
                _audioPlayTimes   = 0;
                _item_repet_times = 1;
                _Recording        = RecordState.UnRecord;

                BeginExam(_NextFlowType);
            }
        }