This commit is contained in:
@@ -7,7 +7,12 @@ class ScoreDimensionInline(admin.TabularInline):
|
||||
model = ScoreDimension
|
||||
extra = 1
|
||||
tab = True
|
||||
fields = ('name', 'description', 'weight', 'max_score', 'is_public', 'is_peer_review', 'order')
|
||||
fields = ('name', 'description', 'weight', 'max_score', 'formula_type', 'formula', 'is_public', 'is_peer_review', 'order')
|
||||
|
||||
@admin.display(description="算式预览")
|
||||
def formula_preview(self, obj):
|
||||
preview = obj.get_formula_preview()
|
||||
return preview if preview else "-"
|
||||
|
||||
class ProjectFileInline(admin.TabularInline):
|
||||
model = ProjectFile
|
||||
@@ -32,6 +37,10 @@ class CompetitionAdmin(ModelAdmin):
|
||||
('时间和状态', {
|
||||
'fields': ('start_time', 'end_time', 'status', 'project_visibility', 'allow_contestant_grading', 'is_active')
|
||||
}),
|
||||
('评分计算设置', {
|
||||
'fields': ('score_calculation_type', 'custom_score_formula'),
|
||||
'description': '配置得分计算方式:默认模式使用(维度分数×权重)求和后取评委平均;自定义算式使用下方公式直接计算最终得分。变量格式: dimension_维度ID,如 dimension_1, dimension_2'
|
||||
}),
|
||||
)
|
||||
|
||||
actions = ['make_published', 'make_ended']
|
||||
|
||||
Reference in New Issue
Block a user