Merge pull request 'Main' (#10) from main into production
Reviewed-on: admin/step3#10
This commit is contained in:
@@ -99,9 +99,13 @@ func _draw() -> void:
|
|||||||
|
|
||||||
static func point_value(point: Dictionary, series_mode: String) -> Variant:
|
static func point_value(point: Dictionary, series_mode: String) -> Variant:
|
||||||
if series_mode == "accuracy":
|
if series_mode == "accuracy":
|
||||||
return float(point.get("accuracy", 0)) if int(point.get("total", 0)) > 0 else null
|
if int(point.get("total", 0)) > 0:
|
||||||
|
return float(point.get("accuracy", 0))
|
||||||
|
return null
|
||||||
var value: Variant = point.get("questionBankRating", null)
|
var value: Variant = point.get("questionBankRating", null)
|
||||||
return null if value == null else float(value)
|
if value == null:
|
||||||
|
return null
|
||||||
|
return float(value)
|
||||||
|
|
||||||
|
|
||||||
static func axis_bounds(series_points: Array, series_mode: String) -> Vector2:
|
static func axis_bounds(series_points: Array, series_mode: String) -> Vector2:
|
||||||
|
|||||||
@@ -229,8 +229,8 @@ func _render_rating_card(key: String, sparkline: Control, accent: Color, rating_
|
|||||||
if delta_value != null:
|
if delta_value != null:
|
||||||
var delta := int(delta_value)
|
var delta := int(delta_value)
|
||||||
var arrow := "↗" if delta >= 0 else "↘"
|
var arrow := "↗" if delta >= 0 else "↘"
|
||||||
var sign := "+" if delta >= 0 else ""
|
var sign_prefix := "+" if delta >= 0 else ""
|
||||||
trend_text = "%s %s%d this week" % [arrow, sign, delta]
|
trend_text = "%s %s%d this week" % [arrow, sign_prefix, delta]
|
||||||
trend_color = Brand.SUCCESS if delta >= 0 else Brand.MAGENTA
|
trend_color = Brand.SUCCESS if delta >= 0 else Brand.MAGENTA
|
||||||
if percentile_value != null:
|
if percentile_value != null:
|
||||||
caption = "Top %d%% of users" % int(percentile_value)
|
caption = "Top %d%% of users" % int(percentile_value)
|
||||||
@@ -269,8 +269,8 @@ func _render_accuracy_card(data: Dictionary) -> void:
|
|||||||
if delta_value != null:
|
if delta_value != null:
|
||||||
var delta := int(delta_value)
|
var delta := int(delta_value)
|
||||||
var arrow := "↗" if delta >= 0 else "↘"
|
var arrow := "↗" if delta >= 0 else "↘"
|
||||||
var sign := "+" if delta >= 0 else ""
|
var sign_prefix := "+" if delta >= 0 else ""
|
||||||
trend_text = "%s %s%d%% vs last 100" % [arrow, sign, delta]
|
trend_text = "%s %s%d%% vs last 100" % [arrow, sign_prefix, delta]
|
||||||
trend_color = Brand.SUCCESS if delta >= 0 else Brand.MAGENTA
|
trend_color = Brand.SUCCESS if delta >= 0 else Brand.MAGENTA
|
||||||
_set_stat_card("accuracy", "%d%%" % accuracy, trend_text, trend_color, "Last %d questions" % int(data.get("accuracySampleSize", 0)))
|
_set_stat_card("accuracy", "%d%%" % accuracy, trend_text, trend_color, "Last %d questions" % int(data.get("accuracySampleSize", 0)))
|
||||||
accuracy_progress_bar.value = accuracy
|
accuracy_progress_bar.value = accuracy
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ func _build_ui() -> void:
|
|||||||
large_icon.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
|
large_icon.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
|
||||||
brand_row.add_child(large_icon)
|
brand_row.add_child(large_icon)
|
||||||
var wordmark := VBoxContainer.new()
|
var wordmark := VBoxContainer.new()
|
||||||
|
wordmark.size_flags_vertical = Control.SIZE_SHRINK_CENTER
|
||||||
wordmark.add_theme_constant_override("separation", 4)
|
wordmark.add_theme_constant_override("separation", 4)
|
||||||
brand_row.add_child(wordmark)
|
brand_row.add_child(wordmark)
|
||||||
var name_row := HBoxContainer.new()
|
var name_row := HBoxContainer.new()
|
||||||
|
|||||||
Reference in New Issue
Block a user