Skip to content

Commit d9bfb19

Browse files
committed
nbgrader: don't flag as an error *any* output to stderr, e.g., warnings output to stderr with the R kernel
1 parent e6bfd37 commit d9bfb19

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/packages/frontend/jupyter/nbgrader/actions.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,12 @@ export class NBGraderActions {
149149
{ title: "Cancel" },
150150
{
151151
title: "Generate student version",
152-
style: !minimal_stubs ? "success" : undefined,
152+
style: !minimal_stubs ? "primary" : undefined,
153153
default: !minimal_stubs,
154154
},
155155
{
156156
title: MINIMAL_STUBS,
157-
style: minimal_stubs ? "success" : undefined,
157+
style: minimal_stubs ? "primary" : undefined,
158158
default: minimal_stubs,
159159
},
160160
],

src/packages/frontend/jupyter/nbgrader/autograde.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import type { JupyterNotebook, Cell } from "@cocalc/jupyter/nbgrader/types";
2727

2828
export function create_autograde_ipynb(
2929
instructor_ipynb: string,
30-
student_ipynb: string
30+
student_ipynb: string,
3131
): { autograde_ipynb: string; ids: string[] } {
3232
const instructor = JSON.parse(instructor_ipynb);
3333
const student = JSON.parse(student_ipynb);
@@ -45,7 +45,7 @@ export function create_autograde_ipynb(
4545
// TODO: be more clever within inserting this...? What does nbgrader upstream do?
4646
console.warn(
4747
"WARNING: student deleted locked cell with grade_id (inserting at end for now)",
48-
grade_id
48+
grade_id,
4949
);
5050
student.cells.push(copy(instructor_cell));
5151
} else {
@@ -175,10 +175,12 @@ function get_score(output: object, lang: string): number | undefined {
175175
output["traceback"] != null || // has a traceback
176176
output["ename"] != null || // name of the error
177177
output["evalue"] != null || // metadata about error
178-
output["output_type"] == "error" || // it's an error output
179-
output["name"] == "stderr" // writing to stderr stream
178+
output["output_type"] == "error" // it's an error output
180179
) {
181180
// If there is any traceback or error indication at all, it's obviously 0 points.
181+
// However, the one thing that is NOT zero points is 'output["name"] == "stderr"'
182+
// since warnings output to stderr with some kernels (e.g., R), and there's a lot
183+
// of cases when warnings are OK.
182184
return 0;
183185
}
184186
if (output["text"] == null) {

0 commit comments

Comments
 (0)