You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

调用nops_eval时触发scan错误,如何定位问题文件?

定位nops_eval报错的文件方法

运行代码及错误信息

ev1 <- nops_eval(
  register = "RegFile.csv",
  solutions = "output/metainfo.rds",
  scans = "nops/choiceresults.zip",
  string_scans ="nops_string/results.zip"
)

错误输出:

The following students were not registered or incorrectly filled in their registration numbers:
6
Correct registration number (for 0000000, POMT2_W23_005.png): xxxxxxx
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  : 
  line 7 did not have 6 elements

定位问题文件的步骤

  • 先排查注册相关异常文件:错误提示明确提到了POMT2_W23_005.png,找到该扫描文件对应的答题卡,核对学生填写的注册号是否正确,同时检查RegFile.csv里是否存在该学生的注册信息。
  • 针对line 7 did not have 6 elements错误:
    • 手动解压nops/choiceresults.zip和nops_string/results.zip,检查解压后的文本格式文件(如CSV、TXT):
      • 逐个查看文件的第7行,确认该行字段数量是否为6,是否存在分隔符缺失/多余的情况。
      • 优先检查与POMT2_W23_005.png同名的解析结果文件(可能是.txt或.csv),注册异常的答题卡往往会伴随解析格式错误。
    • 检查RegFile.csv的第7行:确认该行字段数是否为6,有没有逗号等分隔符使用错误的情况,注册文件格式问题也会触发此类扫描错误。
    • 分步运行函数缩小范围:先单独运行nops_eval(scans = "nops/choiceresults.zip"),再单独处理主观题扫描件,判断错误来自哪一批文件。

内容的提问来源于stack exchange,提问作者Patella

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.25 03:52:36