Skip to content

Commit 0857338

Browse files
committed
Merge remote-tracking branch 'origin/master' into delete-project-data
2 parents b0b21a6 + c266910 commit 0857338

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

src/compute/compute/lib/manager.ts

+3
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ class Manager {
334334
COCALC_PROJECT_ID: this.project_id,
335335
COCALC_USERNAME: userInfo().username,
336336
COMPUTE_SERVER_ID: `${this.compute_server_id}`,
337+
// default so that any windows that any user apps in terminal or jupyter run will
338+
// automatically just work in xpra's X11 desktop.... if they happen to be running it.
339+
DISPLAY: ":0",
337340
};
338341
};
339342

src/packages/frontend/jupyter/insert-cell/ai-cell-generator.tsx

+11-2
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ export function AIGenerateCodeCell({
364364

365365
function doQuery(prevCodeContents: string) {
366366
cancel.current = false;
367+
setError("");
367368
setQuerying(true);
368369

369370
if (showAICellGen == null) return;
@@ -571,7 +572,12 @@ export function AIGenerateCodeCell({
571572
>
572573
<Icon name="arrow-left" /> Discard
573574
</Button>
574-
<Button onClick={insert} type="primary" disabled={querying}>
575+
<Button
576+
size="large"
577+
onClick={insert}
578+
type="primary"
579+
disabled={querying}
580+
>
575581
<Icon name="plus" /> Insert {capitalize(cellStr)}
576582
</Button>
577583
</Space>
@@ -688,7 +694,10 @@ export function AIGenerateCodeCell({
688694
<LLMSelector
689695
project_id={project_id}
690696
model={model}
691-
setModel={setModel}
697+
setModel={(model) => {
698+
setError("");
699+
setModel(model);
700+
}}
692701
/>
693702
<Button
694703
onClick={() => setShowAICellGen(null)}

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)