parent
02518a1c4f
commit
d433d84d46
|
|
@ -11,19 +11,24 @@
|
||||||
@for (int i = 0; i < videoKnows.Length; i++)
|
@for (int i = 0; i < videoKnows.Length; i++)
|
||||||
{
|
{
|
||||||
var item = videoKnows[i];
|
var item = videoKnows[i];
|
||||||
<div class="knowDiv" onclick="spClick(@i,this)">
|
<div class="knowDiv">
|
||||||
|
|
||||||
<div class="knowTtile">
|
<div class="knowTtile">
|
||||||
<div class="knowTtileTheme">@getF(item) @item.Theme</div>
|
<div style="cursor: pointer" onclick="spClick(@i,this)">
|
||||||
<span class="kSpan">#@item.KnowPointId @item.KnowPoint</span>
|
<div class="knowTtileTheme">@getF(item) @item.Theme</div>
|
||||||
|
<span class="kSpan">#@item.KnowPointId @item.KnowPoint</span>
|
||||||
|
</div>
|
||||||
<div>概览: @item.Content</div>
|
<div>概览: @item.Content</div>
|
||||||
<br />
|
<br />
|
||||||
@foreach (var q in item.QuestionArr)
|
@foreach (var q in item.QuestionArr)
|
||||||
{
|
{
|
||||||
<h3>问题: </h3>
|
|
||||||
<div class="knowQuestion">@q.Question</div>
|
<div class="knowQuestion" onclick="spClickTime(@q.StartTime)">
|
||||||
<img style="text-align:center" src="@q.ImageUrl" width="320" height="180" />
|
<h3>问题: <span class="kSpan">@q.StartTime 秒</span></h3>
|
||||||
<br />
|
<div class="kSpan">@q.TopicStem</div>
|
||||||
|
<div >@q.Question</div>
|
||||||
|
<img style="text-align:center" src="@q.ImageUrl" width="320" height="180" />
|
||||||
|
</div>
|
||||||
<br />
|
<br />
|
||||||
}
|
}
|
||||||
<br />
|
<br />
|
||||||
|
|
@ -112,6 +117,9 @@
|
||||||
function spClick(i, button) {
|
function spClick(i, button) {
|
||||||
videoPlayer.currentTime = displayButton[i].startTime;
|
videoPlayer.currentTime = displayButton[i].startTime;
|
||||||
}
|
}
|
||||||
|
function spClickTime(startTime) {
|
||||||
|
videoPlayer.currentTime = startTime;
|
||||||
|
}
|
||||||
function gd(btn) {
|
function gd(btn) {
|
||||||
let e = btn.parentElement.parentElement
|
let e = btn.parentElement.parentElement
|
||||||
if (e.style.right == "0px") {
|
if (e.style.right == "0px") {
|
||||||
|
|
|
||||||
|
|
@ -11,20 +11,24 @@
|
||||||
float: left;
|
float: left;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.kSpan {
|
.kSpan {
|
||||||
color: rgba(120, 120, 120,0.66);
|
color: rgba(120, 120, 120,0.66);
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
width: 330px;
|
width: 330px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.textEllipsis {
|
.textEllipsis {
|
||||||
white-space: nowrap; /* 禁止换行 */
|
white-space: nowrap; /* 禁止换行 */
|
||||||
overflow: hidden; /* 隐藏溢出内容 */
|
overflow: hidden; /* 隐藏溢出内容 */
|
||||||
text-overflow: ellipsis; /* 显示省略号 */
|
text-overflow: ellipsis; /* 显示省略号 */
|
||||||
}
|
}
|
||||||
|
|
||||||
video {
|
video {
|
||||||
width: 94%;
|
width: 94%;
|
||||||
height: 85%;
|
height: 85%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gudingBtn {
|
.gudingBtn {
|
||||||
width: 32px;
|
width: 32px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
|
|
@ -32,6 +36,7 @@ video {
|
||||||
line-height: 27px;
|
line-height: 27px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.subtitles {
|
.subtitles {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 200px;
|
bottom: 200px;
|
||||||
|
|
@ -41,9 +46,11 @@ video {
|
||||||
background-color: rgba(0, 0, 0, 0.7);
|
background-color: rgba(0, 0, 0, 0.7);
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#segmentsContainer:is(:hover) {
|
#segmentsContainer:is(:hover) {
|
||||||
right: 0px!important;
|
right: 0px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#segmentsContainer {
|
#segmentsContainer {
|
||||||
transition: right 0.7s;
|
transition: right 0.7s;
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
|
|
@ -62,7 +69,7 @@ video {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
align-content: flex-start;
|
align-content: flex-start;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
align-items: flex-end
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.kBtn {
|
.kBtn {
|
||||||
|
|
@ -75,6 +82,7 @@ video {
|
||||||
background-color: rgb(240, 249, 235);
|
background-color: rgb(240, 249, 235);
|
||||||
border: 1px solid rgb(179, 225, 157);
|
border: 1px solid rgb(179, 225, 157);
|
||||||
}
|
}
|
||||||
|
|
||||||
.knowTtileTheme {
|
.knowTtileTheme {
|
||||||
font-size: 1.3rem;
|
font-size: 1.3rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
@ -85,18 +93,24 @@ video {
|
||||||
background-color: rgb(248, 230, 191) !important;
|
background-color: rgb(248, 230, 191) !important;
|
||||||
border: 1px solid rgb(206, 187, 81);
|
border: 1px solid rgb(206, 187, 81);
|
||||||
}
|
}
|
||||||
|
|
||||||
.knowDiv {
|
.knowDiv {
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.knowQuestion {
|
.knowQuestion {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
border: 2px solid #ff000059;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: #cddc393d;
|
||||||
}
|
}
|
||||||
.knowDiv:hover .knowTtile {
|
|
||||||
width: 340px;
|
.knowDiv:hover .knowTtile {
|
||||||
display:block;
|
width: 340px;
|
||||||
background-color: rgb(240, 249, 235);
|
display: block;
|
||||||
border: 1px solid rgb(179, 225, 157);
|
background-color: rgb(240, 249, 235);
|
||||||
}
|
border: 1px solid rgb(179, 225, 157);
|
||||||
|
}
|
||||||
|
|
||||||
.knowTtile {
|
.knowTtile {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@ using Microsoft.AspNetCore.Mvc.Formatters;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using VideoAnalysisCore.AICore.FFMPGE;
|
using VideoAnalysisCore.AICore.FFMPGE;
|
||||||
|
using System.Text.Encodings.Web;
|
||||||
|
using System.Text.Unicode;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -39,7 +41,11 @@ namespace Learn.VideoAnalysis
|
||||||
loggingBuilder.SetMinimumLevel(LogLevel.Warning); // 设置最小日志级别为 Warning
|
loggingBuilder.SetMinimumLevel(LogLevel.Warning); // 设置最小日志级别为 Warning
|
||||||
});
|
});
|
||||||
|
|
||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers()
|
||||||
|
.AddJsonOptions(options =>
|
||||||
|
{
|
||||||
|
options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
|
||||||
|
});
|
||||||
|
|
||||||
builder.Services.AddEndpointsApiExplorer();
|
builder.Services.AddEndpointsApiExplorer();
|
||||||
builder.Services.AddSwaggerGen(c =>
|
builder.Services.AddSwaggerGen(c =>
|
||||||
|
|
|
||||||
|
|
@ -410,36 +410,46 @@ namespace VideoAnalysisCore.AICore.GPT.DeepSeek
|
||||||
Console.WriteLine(DateTime.Now + $"=>{taskInfo.Id} 提取{knowInfoArr.First().StartTime}秒试题的试题内容");
|
Console.WriteLine(DateTime.Now + $"=>{taskInfo.Id} 提取{knowInfoArr.First().StartTime}秒试题的试题内容");
|
||||||
Console.WriteLine( sRes.Result.res.value);
|
Console.WriteLine( sRes.Result.res.value);
|
||||||
var knowArr=JsonSerializer.Serialize(knowInfoArr.Select(s => new { s.KnowPointId, s.KnowPoint }));
|
var knowArr=JsonSerializer.Serialize(knowInfoArr.Select(s => new { s.KnowPointId, s.KnowPoint }));
|
||||||
var resFormat = """[{"TopicStem":string(试题题干),"Question:string(问题)","KnowPointId":(string)知识点ID}]""";
|
var resFormat = """[{"Type":string(试题类型),"TopicStem":string(试题题干),"QuestionArr":[{"Question":string(子问题),"KnowPointId":(string)知识点ID}]}]""";
|
||||||
var postMessages =
|
var postMessages =
|
||||||
$"我将提供一段内容是md格式的试题内容字符串。" +
|
$"我将提供一段内容是md格式的试题内容字符串。" +
|
||||||
$"请提取出其中的试题内容以及每个试题的问题。并且为每个试题关联上在我限定范围内的知识点(多个则用逗号分割)。" +
|
$"请提取出其中的试题内容试,题干以及每个试题的问题。并且为每个试题关联上在我限定范围内的知识点(多个则用逗号分割)。" +
|
||||||
$"知识点格式(json格式)范围[{knowArr}]。" +
|
$"知识点格式(json格式)范围[{knowArr}]。" +
|
||||||
$"排除不是试题内容的文字,优化公式排版并且去除题号。" +
|
$"排除不是试题内容的文字,优化公式排版并且去除题号,但不要修改latex数学公式。" +
|
||||||
$"如果存在多道题(或者小问),则需要拆分成为多个试题对象!" +
|
$"如果存在多道题,则需要拆分成为多个试题对象!" +
|
||||||
|
$"试题的类型约束在 填空题/判断题/选择题/解答题 范围内。" +
|
||||||
|
$"请检查我提供的字符串内容,如不包含问题试题则返回`[]`" +
|
||||||
$"输出内容只返回json格式为({resFormat})" +
|
$"输出内容只返回json格式为({resFormat})" +
|
||||||
$"以下是试题内容" +
|
$"以下是试题内容" +
|
||||||
$"`{sRes.Result.res.value}`";
|
$"`{sRes.Result.res.value}`";
|
||||||
var resData = await ChatAsync<VideoQuestionOSSDto[]>(taskInfo.Id.ToString(), postMessages, "提取试题", "deepseek-chat");
|
var resData = await ChatAsync<VideoQuestionOSSDto[]>(taskInfo.Id.ToString(), postMessages, "提取试题", "deepseek-chat");
|
||||||
foreach (var q in resData)
|
foreach (var q in resData)
|
||||||
{
|
{
|
||||||
q.Id = YitIdHelper.NextId();
|
var TopicId = YitIdHelper.NextId();
|
||||||
q.FilePath = filePath;
|
foreach (var qt in q.QuestionArr)
|
||||||
q.VideoTaskId = taskInfo.Id;
|
|
||||||
q.StageId = knowInfoArr.First().StageId;
|
|
||||||
foreach (var kid in q.KnowPointId.Split(","))
|
|
||||||
{
|
{
|
||||||
insertQuestionKonw.Add(new VideoQuestionKonw()
|
var vq = q.Adapt<VideoQuestionOSSDto>();
|
||||||
|
vq.Id = YitIdHelper.NextId();
|
||||||
|
vq.StartTime = item;
|
||||||
|
vq.FilePath = filePath;
|
||||||
|
vq.VideoTaskId = taskInfo.Id;
|
||||||
|
vq.StageId = knowInfoArr.First().StageId;
|
||||||
|
vq.Question = qt.Question;
|
||||||
|
vq.TopicId = TopicId;
|
||||||
|
insertData.Add(vq);
|
||||||
|
foreach (var kid in qt.KnowPointId.Split(","))
|
||||||
{
|
{
|
||||||
KnowPoint = knowInfoArr.First(s => s.KnowPointId == kid).KnowPoint,
|
insertQuestionKonw.Add(new VideoQuestionKonw()
|
||||||
KnowPointId= kid,
|
{
|
||||||
StageId =q.StageId,
|
KnowPoint = knowInfoArr.First(s => s.KnowPointId == kid).KnowPoint,
|
||||||
VideoTaskId = q.VideoTaskId,
|
KnowPointId = kid,
|
||||||
VideoQuestionId = q.Id,
|
StageId = q.StageId,
|
||||||
});
|
VideoTaskId = q.VideoTaskId,
|
||||||
|
VideoQuestionId = q.Id,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
insertData.AddRange(resData);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
@ -448,13 +458,6 @@ namespace VideoAnalysisCore.AICore.GPT.DeepSeek
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//分组共同题干试题ID
|
|
||||||
foreach (var item in insertData.GroupBy(x => x.TopicStem))
|
|
||||||
{
|
|
||||||
var keyId=YitIdHelper.NextId();
|
|
||||||
foreach (var s in item)
|
|
||||||
s.TopicId = keyId;
|
|
||||||
}
|
|
||||||
//上传oss 并更新imageUrl
|
//上传oss 并更新imageUrl
|
||||||
ossClient.AddVideoQuestionUrl(insertData);
|
ossClient.AddVideoQuestionUrl(insertData);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ using VideoAnalysisCore.Model;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using VideoAnalysisCore.Model.Dto;
|
using VideoAnalysisCore.Model.Dto;
|
||||||
using VideoAnalysisCore.Controllers.Dto;
|
using VideoAnalysisCore.Controllers.Dto;
|
||||||
|
using VideoAnalysisCore.Common.Expand;
|
||||||
|
|
||||||
namespace VideoAnalysisCore.Controllers
|
namespace VideoAnalysisCore.Controllers
|
||||||
{
|
{
|
||||||
|
|
@ -44,6 +45,29 @@ namespace VideoAnalysisCore.Controllers
|
||||||
throw new Exception("未能获取到客户端ip地址");
|
throw new Exception("未能获取到客户端ip地址");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ³õʼ»¯Ö÷¿â±í
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="url">ÎļþÁ÷</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet(Name = "InitDbTable")]
|
||||||
|
public IActionResult InitDbTable()
|
||||||
|
{
|
||||||
|
var b = AppCommon.Config.DB.UpdateTable;
|
||||||
|
AppCommon.Config.DB.UpdateTable= true;
|
||||||
|
SqlSugarExpand.InitDbTable();
|
||||||
|
AppCommon.Config.DB.UpdateTable = b;
|
||||||
|
return Ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 语音识别
|
/// 语音识别
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
@ -6,9 +7,26 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace VideoAnalysisCore.Model.Dto
|
namespace VideoAnalysisCore.Model.Dto
|
||||||
{
|
{
|
||||||
|
public class AIQuestionDto
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 问题
|
||||||
|
/// </summary>
|
||||||
|
public string Question { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 知识点id
|
||||||
|
/// </summary>
|
||||||
|
public string KnowPointId { get; set; }
|
||||||
|
}
|
||||||
public class VideoQuestionOSSDto: VideoQuestion
|
public class VideoQuestionOSSDto: VideoQuestion
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 问题
|
||||||
|
/// </summary>
|
||||||
|
public AIQuestionDto[]? QuestionArr { get; set; }
|
||||||
public string FilePath { get; set; }
|
public string FilePath { get; set; }
|
||||||
|
public string Type { get; set; }
|
||||||
public string KnowPointId { get; set; }
|
public string KnowPointId { get; set; }
|
||||||
}
|
}
|
||||||
public class VideoQuestionShowDto : VideoQuestion
|
public class VideoQuestionShowDto : VideoQuestion
|
||||||
|
|
|
||||||
|
|
@ -52,5 +52,9 @@ namespace VideoAnalysisCore.Model
|
||||||
/// 问题(设问)
|
/// 问题(设问)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? Question { get; set; }
|
public string? Question { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 试题开始时间
|
||||||
|
/// </summary>
|
||||||
|
public int StartTime { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue