字段提取结果
执行 processor.runSync(tree, file) 之后,标准化字段元数据会写入 file.data.aimdFields。
保持为数组的部分
下面这些 scope 仍然是 string[],数组里的每一项都是 id:
varstepcheckref_stepref_varref_figcite
使用对象结构的部分
var_table[]提供规范字段idvar_table[].subvars[]提供规范字段idclient_assigner[]提供id、mode、dependent_fields、assigned_fields、function_source,它们来自assigner(config, function ...)形式的前端代码块quiz[]本来就使用idstep_hierarchy[]提供id、step、parent_id、prev_id、next_id、estimated_duration_ms、timer_mode、has_check、has_children
示例
json
{
"var_table": [
{
"id": "samples",
"scope": "var_table",
"subvars": [
{ "id": "sample_id" },
{ "id": "concentration" }
]
}
],
"client_assigner": [
{
"id": "calculate_total",
"runtime": "client",
"mode": "auto",
"dependent_fields": ["a", "b"],
"assigned_fields": ["total"],
"function_source": "function calculate_total({ a, b }) { return { total: a + b }; }"
}
],
"step_hierarchy": [
{
"id": "sample_preparation",
"level": 1,
"sequence": 0,
"step": "1",
"next_id": "data_analysis"
}
]
}如果你在升级旧接入,需要注意旧的 name 别名已经移除。详见迁移说明。