Commit 30d45433 authored by 黄奎's avatar 黄奎

页面修改

parent 3b44ebcd
......@@ -197,6 +197,32 @@ namespace Edu.Common
}
}
/// <summary>
/// 获取URL参数
/// </summary>
/// <param name="url"></param>
/// <param name="paraName"></param>
/// <param name="isDecode"></param>
/// <returns></returns>
public static string GetParameterUrl(string url, string paraName, bool isDecode = false)
{
Regex re = new Regex(@"(^|&)?(\w+)=([^&]+)(&|$)?", RegexOptions.Compiled);
MatchCollection mc = re.Matches(url);
foreach (Match m in mc)
{
if (m.Result("$2").Equals(paraName))
{
string paraResult = m.Result("$3");
if (isDecode)
return System.Web.HttpUtility.UrlDecode(paraResult);
else
return paraResult;
}
}
return "";
}
/// <summary>
/// 获取erp站点图片
/// </summary>
......
......@@ -12,6 +12,7 @@ using Edu.Repository.Question;
using Edu.Module.Question;
using Edu.Common.Plugin;
using Edu.Common.Enum.Question;
using System.Text.RegularExpressions;
namespace Edu.Module.Exam
{
......@@ -1006,14 +1007,35 @@ namespace Edu.Module.Exam
}
if (questionList != null && questionList.Count > 0)
{
foreach (var item in questionList)
{
string VideoUrl = "";
var tempQuestion = stuExamList?.FirstOrDefault(qitem => qitem.QuestionId == item.QuestionId);
decimal Score = 5;
var QuestionContentObj = analysisQuestion.ParsingQuestion(item.QuestionTypeKey, item.QuestionContent, isNoAnswer: true);
List<object> quesAnswerList = new List<object>();
if (item.QuestionTypeKey == "listening" || item.QuestionTypeKey == "reading-comprehensio")
{
if (item.QuestionTypeKey == "listening")
{
try
{
var tempObj = Regex.Match(item.Title, "<iframe.+?src=[\"'](.+?)[\"'].*?>", RegexOptions.IgnoreCase);
if (tempObj != null && tempObj.Groups.Count > 1)
{
VideoUrl = tempObj.Groups[1].Value;
if (!string.IsNullOrEmpty(VideoUrl))
{
VideoUrl = Common.Config.GetParameterUrl(VideoUrl, "url", isDecode: true).Replace("http://", "https://");
}
}
}
catch
{
}
}
try
{
......@@ -1057,6 +1079,7 @@ namespace Edu.Module.Exam
}
var obj = new
{
VideoUrl,
item.QuestionId,
item.QuestionTypeId,
item.QuestionTypeKey,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment