Skip to content

Commit 385161b

Browse files
committed
fix: Display actual student answers in multiple choice results
- Fix multiple choice results always showing 'Not answered' by setting student_answer field in GradingResult - Add 'Get Dashscope API Key' link in settings for better UX - Improve settings layout with proper spacing between tabs and content
1 parent 8c651ed commit 385161b

2 files changed

Lines changed: 49 additions & 1 deletion

File tree

backend/omni_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ async def _grade_multiple_choice(self, request: GradingInput) -> GradingResult:
341341
return GradingResult(
342342
score=float(grading_data["score"]),
343343
feedback=grading_data["feedback"],
344-
explanation=grading_data["explanation"]
344+
explanation=grading_data["explanation"],
345+
student_answer=student_answer
345346
)
346347
except:
347348
return GradingResult(

frontend/src/components/Settings.vue

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@
3939
<div v-if="apiTestResult" :class="['api-result', apiTestResult.success ? 'success' : 'error']">
4040
{{ apiTestResult.message || apiTestResult.error }}
4141
</div>
42+
43+
<div class="api-help-link">
44+
<a
45+
href="https://bailian.console.aliyun.com/?tab=model#/api-key"
46+
target="_blank"
47+
rel="noopener noreferrer"
48+
class="get-key-link"
49+
>
50+
🔑 Get Dashscope API Key
51+
</a>
52+
<span class="help-text">Don't have an API key? Get one from Alibaba Cloud Dashscope</span>
53+
</div>
4254
</div>
4355
</div>
4456

@@ -385,6 +397,10 @@ export default {
385397
background: #f8f9fa;
386398
}
387399
400+
.tab-content {
401+
padding: 20px 0 0 0;
402+
}
403+
388404
.setting-group {
389405
margin-bottom: 20px;
390406
}
@@ -559,4 +575,35 @@ export default {
559575
color: #721c24;
560576
border: 1px solid #f5c6cb;
561577
}
578+
579+
.api-help-link {
580+
margin-top: 15px;
581+
padding-top: 15px;
582+
border-top: 1px solid #e0e0e0;
583+
text-align: center;
584+
}
585+
586+
.get-key-link {
587+
display: inline-block;
588+
background: #3498db;
589+
color: white;
590+
padding: 8px 16px;
591+
border-radius: 5px;
592+
text-decoration: none;
593+
font-weight: 500;
594+
margin-bottom: 5px;
595+
transition: background 0.3s;
596+
}
597+
598+
.get-key-link:hover {
599+
background: #2980b9;
600+
color: white;
601+
}
602+
603+
.help-text {
604+
display: block;
605+
font-size: 12px;
606+
color: #666;
607+
margin-top: 5px;
608+
}
562609
</style>

0 commit comments

Comments
 (0)