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

gradethis::grade_this_code()在-code-check块中运行失败问题求助

求助:gradethis::grade_this_code()无法在-code-check块中正常工作?

在提交Bug报告前,先向社区求助验证:是否有人能让gradethis::grade_this_code()在-code-check块中正常工作?

根据grade_this_code()的帮助文档说明:

若在-code-check块中调用并返回反馈,用户代码不会执行;若想让用户看到代码输出,需在-check块中调用。

测试情况

  • 在-check块中调用grade_this_code(),提交练习时正常运行;
  • 将-check块改为-code-check块,提交练习时教程报错:“A problem occurred with the grading code for this exercise”;
  • 在-code-check块中改用已被grade_this_code()取代的grade_code(),提交练习时一切正常。

版本信息

  • learnr: 0.11.5.9000
  • gradethis: 0.2.14

可复现的RMarkdown示例代码

---
title: "Reproducible"
output: learnr::tutorial
runtime: shiny_prerendered
---

```{r setup, include=FALSE}
library(learnr)
knitr::opts_chunk$set(echo = FALSE)
gradethis::gradethis_setup()

Topic 1

Write the R code required to add two plus two:

2+2
gradethis::grade_this_code()
内容的提问来源于stack exchange,提问作者Geoffrey Poole
相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.02 12:21:07