Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
studyweb_Prototype
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
yujiejie
studyweb_Prototype
Commits
935e00cf
提交
935e00cf
authored
8月 18, 2026
作者:
yujiejie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
学生端阶段二模型部署知识点预习小测完成
上级
d2e83417
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
374 行增加
和
3 行删除
+374
-3
index.html
index.html
+12
-0
pages-student.js
pages-student.js
+362
-3
没有找到文件。
index.html
浏览文件 @
935e00cf
...
...
@@ -448,6 +448,11 @@ var studentState = {
bridgeAnswers
:
{},
bridgeLastWrong
:
[],
// PRD 模块一:阶段二模型部署
deployReadIds
:
[],
deployQuizIndex
:
0
,
deployAnswers
:
{},
deployLastWrong
:
[],
deployQuizScore
:
0
,
deployQuizPassed
:
false
,
deploySubmitted
:
false
,
deployReviewed
:
false
,
...
...
@@ -762,6 +767,13 @@ function switchPage(pageId){
if
(
typeof
showBridgeLockModal
===
'function'
)
showBridgeLockModal
();
return
;
}
var
deployQuizGate
=
[
'student-autodl'
,
'student-deploy-submit'
];
if
(
typeof
isBridgePassed
===
'function'
&&
isBridgePassed
()
&&
!
studentState
.
deployQuizPassed
&&
deployQuizGate
.
indexOf
(
pageId
)
!==
-
1
)
{
currentPage
=
'student-dashboard'
;
renderContent
();
if
(
typeof
showStudentFlowModal
===
'function'
)
showStudentFlowModal
(
'请先通过部署小测'
,
'及格线 80 分。通过后才能进入 AutoDL 和提交部署产物。'
);
return
;
}
currentPage
=
pageId
;
renderContent
();
}
...
...
pages-student.js
浏览文件 @
935e00cf
...
...
@@ -57,6 +57,14 @@ function goStudentPrdPage(pageId) {
startBridgeQuiz
();
return
;
}
if
(
pageId
===
'student-deploy-quiz'
)
{
startDeployQuiz
();
return
;
}
if
((
pageId
===
'student-autodl'
||
pageId
===
'student-deploy-submit'
)
&&
!
studentState
.
deployQuizPassed
)
{
showStudentFlowModal
(
'请先通过部署小测'
,
'及格线 80 分。通过后才能进入 AutoDL 和提交部署产物。'
);
return
;
}
if
(
pageRenderers
[
pageId
])
{
switchPage
(
pageId
);
return
;
...
...
@@ -110,7 +118,7 @@ function getDashboardFlowSteps() {
}
return
[
{
name
:
'部署知识点'
,
desc
:
'
系统已下发部署任务
,无需选题'
,
icon
:
'book-open'
,
page
:
'student-deploy-preview'
,
condition
:
!
studentState
.
deployQuizPassed
,
locked
:
false
},
{
name
:
'部署知识点'
,
desc
:
'
已下发:Qwen2.5-7B 推理服务部署
,无需选题'
,
icon
:
'book-open'
,
page
:
'student-deploy-preview'
,
condition
:
!
studentState
.
deployQuizPassed
,
locked
:
false
},
{
name
:
'部署小测'
,
desc
:
'及格线 80 分,通过后解锁实操'
,
icon
:
'clipboard-check'
,
page
:
'student-deploy-quiz'
,
condition
:
!
studentState
.
deployQuizPassed
,
locked
:
false
},
{
name
:
'AutoDL / 沙箱'
,
desc
:
'导师下发配置,学生只读'
,
icon
:
'server'
,
page
:
'student-autodl'
,
condition
:
studentState
.
deployQuizPassed
&&
!
studentState
.
deploySubmitted
,
locked
:
!
studentState
.
deployQuizPassed
},
{
name
:
'提交部署产物'
,
desc
:
'日志包 + API 地址'
,
icon
:
'upload'
,
page
:
'student-deploy-submit'
,
condition
:
studentState
.
deployQuizPassed
&&
!
studentState
.
deploySubmitted
,
locked
:
!
studentState
.
deployQuizPassed
},
...
...
@@ -199,7 +207,7 @@ pageRenderers["student-dashboard"] = function() {
var
rowClass
=
step
.
locked
?
'opacity-50'
:
(
isCurrent
?
'bg-[#165DFF]/5 border border-[#165DFF]/20'
:
'hover:bg-[#F7F8FA]'
);
var
iconBg
=
isDone
?
'bg-emerald-100 text-emerald-600'
:
(
isCurrent
?
'bg-[#165DFF] text-white'
:
'bg-[#F2F3F5] text-[#C9CDD4]'
);
var
click
=
step
.
locked
?
(
currentStageId
===
1
?
'showBridgeLockModal()'
:
"showStudentFlowModal('请先
完成前置步骤','请按学习流程完成当前高亮任务后再进入本步骤
。')"
)
?
(
currentStageId
===
1
?
'showBridgeLockModal()'
:
"showStudentFlowModal('请先
通过部署小测','及格线 80 分。通过后才能进入 AutoDL / 提交部署产物
。')"
)
:
"goStudentPrdPage('"
+
step
.
page
+
"')"
;
return
`
<div class="flex items-center gap-3 p-3 rounded-lg `
+
rowClass
+
` cursor-pointer transition-colors" onclick="`
+
click
+
`">
...
...
@@ -237,7 +245,7 @@ pageRenderers["student-dashboard"] = function() {
<div class="bg-white rounded-lg shadow-sm border border-[#E5E6EB] p-4 cursor-pointer hover:border-[#165DFF] transition-colors" onclick="goStudentPrdPage('student-deploy-preview')">
<svg class="w-5 h-5 text-[#165DFF] mb-2" data-lucide="cpu"></svg>
<h4 class="text-sm font-medium text-[#1D2129] mb-1">模型部署任务</h4>
<p class="text-xs text-[#86909C]">已下发 ·
无需选题
</p>
<p class="text-xs text-[#86909C]">已下发 ·
Qwen2.5-7B 推理服务
</p>
</div>
<div class="bg-white rounded-lg shadow-sm border border-[#E5E6EB] p-4 cursor-pointer hover:border-[#165DFF] transition-colors" onclick="`
+
(
studentState
.
deployQuizPassed
?
"goStudentPrdPage('student-deploy-submit')"
:
"showStudentFlowModal('请先通过部署小测','通过 80 分小测后才能提交部署产物。')"
)
+
`">
<svg class="w-5 h-5 text-[#165DFF] mb-2" data-lucide="upload"></svg>
...
...
@@ -405,6 +413,11 @@ function previewStudentHome(mode) {
studentState
.
bridgeQuizScore
=
82
;
studentState
.
bridgeReadIds
=
[
'linux'
,
'ai-basic'
,
'python-env'
,
'deploy-prep'
];
studentState
.
currentStage
=
2
;
studentState
.
deployReadIds
=
[];
studentState
.
deployQuizIndex
=
0
;
studentState
.
deployAnswers
=
{};
studentState
.
deployLastWrong
=
[];
studentState
.
deployQuizScore
=
0
;
studentState
.
deployQuizPassed
=
false
;
studentState
.
deploySubmitted
=
false
;
studentState
.
deployReviewed
=
false
;
...
...
@@ -419,6 +432,11 @@ function previewStudentHome(mode) {
studentState
.
bridgeAnswers
=
{};
studentState
.
bridgeLastWrong
=
[];
studentState
.
currentStage
=
1
;
studentState
.
deployReadIds
=
[];
studentState
.
deployQuizIndex
=
0
;
studentState
.
deployAnswers
=
{};
studentState
.
deployLastWrong
=
[];
studentState
.
deployQuizScore
=
0
;
studentState
.
deployQuizPassed
=
false
;
studentState
.
deploySubmitted
=
false
;
studentState
.
deployReviewed
=
false
;
...
...
@@ -833,6 +851,347 @@ pageRenderers["student-bridge-quiz-result"] = function() {
</div>`
;
};
var
DEPLOY_TASK
=
{
name
:
'Qwen2.5-7B 推理服务部署'
,
goal
:
'在 AutoDL 启动推理服务,提交启动日志包与可调用 API'
,
env
:
'平台沙箱做基础开发,重 GPU 部署走 AutoDL'
};
var
DEPLOY_KNOWLEDGE
=
[
{
id
:
'infer-flow'
,
title
:
'推理服务部署流程'
,
duration
:
'45 分钟'
,
summary
:
'从拉起模型到对外提供 HTTP 推理接口。'
,
body
:
[
'本阶段任务由系统直接下发,不经过选题。当前任务:Qwen2.5-7B 推理服务部署。'
,
'学习目标:能按顺序完成环境准备、启动推理进程、健康检查、登记 API。'
,
'标准路径:检查 GPU 与依赖 → 启动服务 → 访问 /health 或等价探针 → 用示例请求验证返回 → 记录地址/路径/端口。'
,
'阶段二产物不是 Git 仓库,而是日志包 + API 信息,供导师探测验收。'
]
},
{
id
:
'autodl-ssh'
,
title
:
'AutoDL 环境与 SSH'
,
duration
:
'40 分钟'
,
summary
:
'分清沙箱和 AutoDL,知道配置从哪里来。'
,
body
:
[
'平台沙箱只做基础开发与排障练习,不要把大模型本体部署进沙箱。'
,
'重 GPU 任务走 AutoDL。服务器由导师下发,学生页只读,可测试连通、复制 ssh 命令。'
,
'登录后先确认工作目录、GPU 可见性和端口占用,再启动推理服务。'
,
'配置变更只能找导师,学生不能自行改 IP / 端口 / 账号。'
]
},
{
id
:
'deploy-log'
,
title
:
'日志包与常见排障'
,
duration
:
'35 分钟'
,
summary
:
'AutoDL 日志需自行导出上传,沙箱日志由平台采集。'
,
body
:
[
'MVP 阶段 AutoDL 日志不会自动采集,需要你导出 .log / .txt 日志包一并提交。'
,
'日志里应能看到启动命令、监听端口、健康检查结果,以及关键报错栈。'
,
'常见问题:CUDA 与驱动不匹配、端口未放行、依赖缺失、显存不足导致进程退出。'
,
'导师验收会抽检日志是否与你提交的 API 地址一致。'
]
},
{
id
:
'api-accept'
,
title
:
'API 回传与验收标准'
,
duration
:
'40 分钟'
,
summary
:
'导师用探测和 API 调用决定是否通过。'
,
body
:
[
'提交时填写 API 地址、请求路径、端口,必要时补充请求示例。'
,
'大模型推理类任务:导师会实际调用接口,检查连通和返回是否可用。'
,
'提交成功后仍需撰写实操报告;产物检查通过后才解锁答辩,不是交完就能答辩。'
,
'被驳回可以按评语修改后重提日志包和 API,旧的仓库提交页不会用于本阶段。'
]
}
];
var
DEPLOY_QUIZ
=
[
{
id
:
'dq1'
,
type
:
'judge'
,
kp
:
'infer-flow'
,
stem
:
'阶段二需要先在项目大厅选题,系统才会下发部署任务。'
,
options
:
[
'正确'
,
'错误'
],
answer
:
'错误'
},
{
id
:
'dq2'
,
type
:
'single'
,
kp
:
'infer-flow'
,
stem
:
'阶段二应提交的核心产物是?'
,
options
:
[
'Git 仓库地址'
,
'日志包 + API 地址/路径/端口'
,
'仅项目截图'
],
answer
:
'日志包 + API 地址/路径/端口'
},
{
id
:
'dq3'
,
type
:
'single'
,
kp
:
'infer-flow'
,
stem
:
'推理服务启动后,应优先确认什么?'
,
options
:
[
'是否已经申请答辩'
,
'健康检查是否通过、端口是否在监听'
,
'成长档案分数是否更新'
],
answer
:
'健康检查是否通过、端口是否在监听'
},
{
id
:
'dq4'
,
type
:
'judge'
,
kp
:
'autodl-ssh'
,
stem
:
'学生可以把大模型直接部署进平台沙箱,方便导师在沙箱里验收。'
,
options
:
[
'正确'
,
'错误'
],
answer
:
'错误'
},
{
id
:
'dq5'
,
type
:
'single'
,
kp
:
'autodl-ssh'
,
stem
:
'AutoDL 的 IP / 端口 / 账号由谁配置?'
,
options
:
[
'学生在工作台自行填写'
,
'导师下发,学生只读'
,
'管理员随机分配且不可测连通'
],
answer
:
'导师下发,学生只读'
},
{
id
:
'dq6'
,
type
:
'judge'
,
kp
:
'autodl-ssh'
,
stem
:
'学生可以在只读页测试连通,并复制 ssh 命令登录 AutoDL。'
,
options
:
[
'正确'
,
'错误'
],
answer
:
'正确'
},
{
id
:
'dq7'
,
type
:
'single'
,
kp
:
'deploy-log'
,
stem
:
'AutoDL 任务的日志在 MVP 阶段如何交给导师?'
,
options
:
[
'平台自动采集,无需上传'
,
'学生导出日志包(.log / .txt)上传'
,
'只发微信截图即可'
],
answer
:
'学生导出日志包(.log / .txt)上传'
},
{
id
:
'dq8'
,
type
:
'judge'
,
kp
:
'deploy-log'
,
stem
:
'显存不足或端口未放行,都可能导致推理服务无法被导师探测到。'
,
options
:
[
'正确'
,
'错误'
],
answer
:
'正确'
},
{
id
:
'dq9'
,
type
:
'single'
,
kp
:
'api-accept'
,
stem
:
'部署产物提交成功后,下一步应做什么?'
,
options
:
[
'直接申请答辩'
,
'去写实操报告,等待部署验收'
,
'回到项目大厅重新选题'
],
answer
:
'去写实操报告,等待部署验收'
},
{
id
:
'dq10'
,
type
:
'judge'
,
kp
:
'api-accept'
,
stem
:
'阶段二的答辩须等导师「部署验收」通过后才解锁,而不是旧的实操评审。'
,
options
:
[
'正确'
,
'错误'
],
answer
:
'正确'
}
];
function
getDeployReadIds
()
{
return
studentState
.
deployReadIds
||
[];
}
function
isDeployKnowledgeRead
(
id
)
{
return
getDeployReadIds
().
indexOf
(
id
)
!==
-
1
;
}
function
markDeployKnowledgeRead
(
id
)
{
if
(
!
studentState
.
deployReadIds
)
studentState
.
deployReadIds
=
[];
if
(
studentState
.
deployReadIds
.
indexOf
(
id
)
===
-
1
)
studentState
.
deployReadIds
.
push
(
id
);
renderContent
();
}
function
getDeployKnowledge
(
id
)
{
var
found
=
DEPLOY_KNOWLEDGE
[
0
];
for
(
var
i
=
0
;
i
<
DEPLOY_KNOWLEDGE
.
length
;
i
++
)
{
if
(
DEPLOY_KNOWLEDGE
[
i
].
id
===
id
)
found
=
DEPLOY_KNOWLEDGE
[
i
];
}
return
found
;
}
function
startDeployQuiz
()
{
if
(
!
isBridgePassed
())
{
showBridgeLockModal
();
return
;
}
if
(
studentState
.
deployQuizPassed
)
{
switchPage
(
'student-deploy-quiz-result'
);
return
;
}
var
readCount
=
getDeployReadIds
().
length
;
if
(
readCount
<
DEPLOY_KNOWLEDGE
.
length
)
{
if
(
currentPage
!==
'student-deploy-preview'
)
switchPage
(
'student-deploy-preview'
);
showStudentFlowModal
(
'请先完成部署预习'
,
'还有 '
+
(
DEPLOY_KNOWLEDGE
.
length
-
readCount
)
+
' 个知识点未标记已读。全部学完后再参加 80 分小测。'
);
return
;
}
studentState
.
deployQuizIndex
=
0
;
studentState
.
deployAnswers
=
{};
switchPage
(
'student-deploy-quiz'
);
}
function
setDeployAnswer
(
qid
,
value
)
{
if
(
!
studentState
.
deployAnswers
)
studentState
.
deployAnswers
=
{};
studentState
.
deployAnswers
[
qid
]
=
value
;
renderContent
();
}
function
goDeployQuizIndex
(
idx
)
{
if
(
idx
<
0
||
idx
>=
DEPLOY_QUIZ
.
length
)
return
;
studentState
.
deployQuizIndex
=
idx
;
renderContent
();
}
function
submitDeployQuiz
()
{
var
answers
=
studentState
.
deployAnswers
||
{};
var
unanswered
=
[];
var
wrong
=
[];
var
correct
=
0
;
for
(
var
i
=
0
;
i
<
DEPLOY_QUIZ
.
length
;
i
++
)
{
var
q
=
DEPLOY_QUIZ
[
i
];
if
(
!
answers
[
q
.
id
])
unanswered
.
push
(
i
+
1
);
else
if
(
answers
[
q
.
id
]
===
q
.
answer
)
correct
++
;
else
wrong
.
push
(
q
);
}
if
(
unanswered
.
length
)
{
showStudentFlowModal
(
'还有题目未作答'
,
'第 '
+
unanswered
.
join
(
'、'
)
+
' 题尚未作答,请全部完成后再提交。'
);
return
;
}
var
score
=
Math
.
round
((
correct
/
DEPLOY_QUIZ
.
length
)
*
100
);
studentState
.
deployQuizScore
=
score
;
studentState
.
deployLastWrong
=
wrong
;
studentState
.
deployQuizPassed
=
score
>=
80
;
switchPage
(
'student-deploy-quiz-result'
);
}
pageRenderers
[
"student-deploy-preview"
]
=
function
()
{
if
(
!
isBridgePassed
())
{
return
`
<div class="max-w-3xl mx-auto">
<div class="feature-card p-8 text-center">
<div class="w-16 h-16 mx-auto mb-4 rounded-full bg-[#FFF7E6] flex items-center justify-center">
<svg class="w-8 h-8 text-[#FF7D00]" data-lucide="lock"></svg>
</div>
<h3 class="text-xl font-bold text-[#1D2129] mb-2">请先完成阶段一</h3>
<p class="text-[#86909C] mb-6">衔接测验通过(≥70 分)后,系统才会下发模型部署任务。</p>
<button class="btn-primary py-2.5 px-6" onclick="switchPage('student-dashboard')">返回学习首页</button>
</div>
</div>`
;
}
var
activeId
=
studentState
.
deployActiveId
||
DEPLOY_KNOWLEDGE
[
0
].
id
;
var
item
=
getDeployKnowledge
(
activeId
);
var
readCount
=
getDeployReadIds
().
length
;
var
percent
=
Math
.
round
((
readCount
/
DEPLOY_KNOWLEDGE
.
length
)
*
100
);
var
tree
=
DEPLOY_KNOWLEDGE
.
map
(
function
(
k
)
{
var
read
=
isDeployKnowledgeRead
(
k
.
id
);
var
active
=
k
.
id
===
item
.
id
;
return
`
<button class="w-full text-left px-3 py-2.5 rounded-lg mb-1 `
+
(
active
?
'bg-[#E8F3FF] text-[#165DFF]'
:
'hover:bg-[#F7F8FA] text-[#4E5969]'
)
+
`" onclick="studentState.deployActiveId='`
+
k
.
id
+
`';renderContent();">
<div class="flex items-center justify-between">
<span class="text-sm font-medium">`
+
k
.
title
+
`</span>
<span class="text-[10px] `
+
(
read
?
'text-emerald-600'
:
'text-[#FF7D00]'
)
+
`">`
+
(
read
?
'已读'
:
'未读'
)
+
`</span>
</div>
</button>`
;
}).
join
(
''
);
var
body
=
item
.
body
.
map
(
function
(
p
)
{
return
'<p class="text-sm text-[#4E5969] leading-relaxed mb-3">'
+
p
+
'</p>'
;
}).
join
(
''
);
return
`
<div class="max-w-7xl mx-auto">
<div class="flex items-center justify-between mb-6">
<div class="flex items-center gap-4">
<button class="btn-ghost p-2 rounded-lg hover:bg-[#F2F3F5]" onclick="switchPage('student-dashboard')">
<svg class="w-5 h-5 text-[#86909C]" data-lucide="arrow-left"></svg>
</button>
<div class="w-10 h-10 rounded-lg bg-gradient-to-br from-[#165DFF] to-[#4080FF] flex items-center justify-center">
<svg class="w-5 h-5 text-white" data-lucide="cpu"></svg>
</div>
<div>
<h1 class="text-2xl font-bold text-[#1D2129]">部署知识点预习</h1>
<p class="text-sm text-[#86909C]">阶段二 · 系统已下发任务,无需选题。学完后参加 80 分小测。</p>
</div>
</div>
<button class="btn-primary py-2.5 px-5" onclick="startDeployQuiz()">开始章节小测</button>
</div>
<div class="bg-[#E8F3FF] border border-[#165DFF]/20 rounded-lg p-4 mb-6">
<div class="text-xs text-[#86909C] mb-1">系统已下发部署任务</div>
<div class="text-base font-semibold text-[#1D2129] mb-1">`
+
DEPLOY_TASK
.
name
+
`</div>
<div class="text-sm text-[#4E5969]">`
+
DEPLOY_TASK
.
goal
+
` · `
+
DEPLOY_TASK
.
env
+
`</div>
</div>
<div class="bg-white rounded-lg shadow-sm border border-[#E5E6EB] p-4 mb-6">
<div class="flex items-center justify-between mb-2">
<span class="text-sm text-[#86909C]">阅读进度</span>
<span class="text-sm font-medium text-[#165DFF]">`
+
readCount
+
` / `
+
DEPLOY_KNOWLEDGE
.
length
+
` · `
+
percent
+
`%</span>
</div>
<div class="progress-bar h-2"><div class="fill" style="width:`
+
percent
+
`%"></div></div>
</div>
<div class="flex gap-6">
<div class="w-72 flex-shrink-0">
<div class="bg-white rounded-lg shadow-sm border border-[#E5E6EB] p-4">
<div class="text-xs text-[#86909C] mb-2">知识点目录</div>
`
+
tree
+
`
</div>
</div>
<div class="flex-1 bg-white rounded-lg shadow-sm border border-[#E5E6EB] p-6">
<div class="flex items-start justify-between mb-4">
<div>
<h2 class="text-xl font-bold text-[#1D2129] mb-1">`
+
item
.
title
+
`</h2>
<p class="text-sm text-[#86909C]">预计 `
+
item
.
duration
+
` · `
+
item
.
summary
+
`</p>
</div>
`
+
(
isDeployKnowledgeRead
(
item
.
id
)
?
'<span class="px-2 py-1 rounded text-xs bg-emerald-100 text-emerald-700">已读</span>'
:
''
)
+
`
</div>
`
+
body
+
`
<div class="mt-6 pt-4 border-t border-[#E5E6EB]">
`
+
(
isDeployKnowledgeRead
(
item
.
id
)
?
'<button class="btn-outline py-2 px-4" onclick="startDeployQuiz()">去参加小测</button>'
:
'<button class="btn-primary py-2 px-4" onclick="markDeployKnowledgeRead(
\'
'
+
item
.
id
+
'
\'
)">标记为已读</button>'
)
+
`
</div>
</div>
</div>
</div>`
;
};
pageRenderers
[
"student-deploy-quiz"
]
=
function
()
{
if
(
!
isBridgePassed
())
{
return
`
<div class="max-w-3xl mx-auto">
<div class="feature-card p-8 text-center">
<div class="w-16 h-16 mx-auto mb-4 rounded-full bg-[#FFF7E6] flex items-center justify-center">
<svg class="w-8 h-8 text-[#FF7D00]" data-lucide="lock"></svg>
</div>
<h3 class="text-xl font-bold text-[#1D2129] mb-2">请先完成阶段一</h3>
<p class="text-[#86909C] mb-6">部署小测仅在衔接测验通过后开放。</p>
<button class="btn-primary py-2.5 px-6" onclick="switchPage('student-dashboard')">返回学习首页</button>
</div>
</div>`
;
}
if
(
!
studentState
.
deployQuizPassed
&&
getDeployReadIds
().
length
<
DEPLOY_KNOWLEDGE
.
length
)
{
return
`
<div class="max-w-3xl mx-auto">
<div class="feature-card p-8 text-center">
<div class="w-16 h-16 mx-auto mb-4 rounded-full bg-[#FFF7E6] flex items-center justify-center">
<svg class="w-8 h-8 text-[#FF7D00]" data-lucide="book-open"></svg>
</div>
<h3 class="text-xl font-bold text-[#1D2129] mb-2">请先完成部署预习</h3>
<p class="text-[#86909C] mb-6">全部知识点标记已读后,才能参加 80 分章节小测。</p>
<button class="btn-primary py-2.5 px-6" onclick="switchPage('student-deploy-preview')">返回部署预习</button>
</div>
</div>`
;
}
var
idx
=
studentState
.
deployQuizIndex
||
0
;
var
q
=
DEPLOY_QUIZ
[
idx
];
var
answers
=
studentState
.
deployAnswers
||
{};
var
dots
=
DEPLOY_QUIZ
.
map
(
function
(
item
,
i
)
{
var
answered
=
!!
answers
[
item
.
id
];
var
current
=
i
===
idx
;
var
cls
=
current
?
'bg-[#165DFF] text-white'
:
(
answered
?
'bg-emerald-100 text-emerald-700'
:
'bg-rose-100 text-rose-600'
);
return
'<button class="w-8 h-8 rounded-full text-xs font-medium '
+
cls
+
'" onclick="goDeployQuizIndex('
+
i
+
')">'
+
(
i
+
1
)
+
'</button>'
;
}).
join
(
''
);
var
options
=
q
.
options
.
map
(
function
(
opt
)
{
var
checked
=
answers
[
q
.
id
]
===
opt
?
'checked'
:
''
;
var
active
=
answers
[
q
.
id
]
===
opt
?
'border-[#165DFF] bg-[#E8F3FF]'
:
'border-[#E5E6EB] hover:border-[#165DFF]'
;
return
'<label class="flex items-center gap-3 p-4 rounded-lg border cursor-pointer mb-2 '
+
active
+
'"><input type="radio" name="deployQ" class="text-[#165DFF]" '
+
checked
+
' onchange="setDeployAnswer(
\'
'
+
q
.
id
+
'
\'
,
\'
'
+
opt
+
'
\'
)"><span class="text-sm text-[#1D2129]">'
+
opt
+
'</span></label>'
;
}).
join
(
''
);
return
`
<div class="max-w-3xl mx-auto">
<div class="flex items-center justify-between mb-6">
<div class="flex items-center gap-3">
<button class="btn-ghost p-2" onclick="switchPage('student-deploy-preview')"><svg class="w-5 h-5" data-lucide="arrow-left"></svg></button>
<div>
<h1 class="text-xl font-bold text-[#1D2129]">部署章节小测</h1>
<p class="text-sm text-[#86909C]">共 10 题 · 单选 / 判断 · 及格线 80 分</p>
</div>
</div>
<span class="text-sm font-medium text-[#165DFF]">`
+
(
idx
+
1
)
+
` / 10</span>
</div>
<div class="flex flex-wrap gap-2 mb-4">`
+
dots
+
`</div>
<p class="text-xs text-[#86909C] mb-4">未作答题号为红色。全部作答后才能提交。通过后解锁 AutoDL / 部署产物提交。</p>
<div class="bg-white rounded-lg shadow-sm border border-[#E5E6EB] p-6 mb-6">
<div class="text-xs text-[#86909C] mb-2">`
+
(
q
.
type
===
'judge'
?
'判断题'
:
'单选题'
)
+
`</div>
<h3 class="font-semibold text-[#1D2129] mb-4">`
+
q
.
stem
+
`</h3>
`
+
options
+
`
</div>
<div class="flex items-center justify-between">
<button class="btn-outline py-2 px-4" `
+
(
idx
===
0
?
'disabled style="opacity:.4"'
:
''
)
+
` onclick="goDeployQuizIndex(`
+
(
idx
-
1
)
+
`)">上一题</button>
<div class="flex gap-3">
`
+
(
idx
<
DEPLOY_QUIZ
.
length
-
1
?
'<button class="btn-primary py-2 px-5" onclick="goDeployQuizIndex('
+
(
idx
+
1
)
+
')">下一题</button>'
:
'<button class="btn-primary py-2 px-5" onclick="submitDeployQuiz()">提交答卷</button>'
)
+
`
</div>
</div>
</div>`
;
};
pageRenderers
[
"student-deploy-quiz-result"
]
=
function
()
{
var
passed
=
studentState
.
deployQuizPassed
;
var
score
=
studentState
.
deployQuizScore
||
0
;
var
wrong
=
studentState
.
deployLastWrong
||
[];
var
kpMap
=
{};
DEPLOY_KNOWLEDGE
.
forEach
(
function
(
k
)
{
kpMap
[
k
.
id
]
=
k
.
title
;
});
var
wrongHtml
=
wrong
.
length
?
wrong
.
map
(
function
(
q
)
{
return
'<div class="p-4 rounded-lg bg-[#F7F8FA] mb-3 text-left"><div class="text-sm font-medium text-[#1D2129] mb-1">'
+
q
.
stem
+
'</div><div class="text-xs text-rose-600 mb-1">你的答案:'
+
((
studentState
.
deployAnswers
||
{})[
q
.
id
]
||
'未作答'
)
+
'</div><div class="text-xs text-emerald-600 mb-2">正确答案:'
+
q
.
answer
+
'</div><button class="text-xs text-[#165DFF] hover:underline" onclick="studentState.deployActiveId=
\'
'
+
q
.
kp
+
'
\'
;switchPage(
\'
student-deploy-preview
\'
)">查看知识点:'
+
(
kpMap
[
q
.
kp
]
||
''
)
+
'</button></div>'
;
}).
join
(
''
)
:
'<div class="text-sm text-[#86909C]">没有错题。</div>'
;
return
`
<div class="max-w-2xl mx-auto">
<div class="flex items-center gap-3 mb-6">
<button class="btn-ghost p-2" onclick="switchPage('student-dashboard')"><svg class="w-5 h-5" data-lucide="arrow-left"></svg></button>
<div>
<h1 class="text-xl font-bold text-[#1D2129]">部署小测成绩</h1>
<p class="text-sm text-[#86909C]">及格线 80 分 · `
+
DEPLOY_TASK
.
name
+
`</p>
</div>
</div>
<div class="bg-white rounded-lg shadow-sm border border-[#E5E6EB] p-8 text-center">
<div class="inline-flex px-3 py-1 rounded text-sm font-medium mb-4 `
+
(
passed
?
'bg-emerald-100 text-emerald-700'
:
'bg-rose-100 text-rose-700'
)
+
`">`
+
(
passed
?
'已通过'
:
'未通过'
)
+
`</div>
<div class="text-5xl font-bold `
+
(
passed
?
'text-emerald-600'
:
'text-rose-600'
)
+
` mb-2">`
+
score
+
`</div>
<p class="text-sm text-[#86909C] mb-6">`
+
(
passed
?
'可以进入 AutoDL 实操。导师下发配置后,在只读页测连通并复制 ssh;本阶段不交 Git 仓库。'
:
'请回到预习,针对错题再学一遍后重考。未达 80 分不能进入 AutoDL。'
)
+
`</p>
<div class="text-left mb-6">
<div class="text-sm font-semibold text-[#1D2129] mb-3">错题列表</div>
`
+
wrongHtml
+
`
</div>
`
+
(
passed
?
'<div class="flex flex-col gap-3"><button class="btn-primary w-full py-3" onclick="goStudentPrdPage(
\'
student-autodl
\'
)">进入 AutoDL 实操</button><button class="btn-outline w-full py-3" onclick="switchPage(
\'
student-dashboard
\'
)">返回学习首页</button></div>'
:
'<div class="flex flex-col gap-3"><button class="btn-primary w-full py-3" onclick="startDeployQuiz()">重新作答</button><button class="btn-outline w-full py-3" onclick="switchPage(
\'
student-deploy-preview
\'
)">返回部署预习</button></div>'
)
+
`
</div>
</div>`
;
};
// 入项申请未解锁提示
function
showEntryNotAllowedAlert
()
{
var
completedStages
=
0
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论