Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 065a595

Browse files
committed
Merged with upstream repo
2 parents c307b55 + 9720caa commit 065a595

55 files changed

Lines changed: 10847 additions & 2060 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

Lines changed: 9313 additions & 281 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

requirements-dev.txt

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,16 @@
66
#
77
alabaster==0.7.12
88
# via sphinx
9-
astroid==2.4.2
9+
astroid==2.5.6
1010
# via pylint
1111
attrs==20.3.0
1212
# via pytest
13-
babel==2.9.0
13+
babel==2.9.1
1414
# via sphinx
1515
bleach==3.3.0
1616
# via readme-renderer
1717
certifi==2020.12.5
1818
# via requests
19-
cffi==1.14.4
20-
# via cryptography
2119
chardet==4.0.0
2220
# via requests
2321
click==7.1.2
@@ -30,34 +28,34 @@ cogapp==3.0.0
3028
# via -r requirements.in
3129
colorama==0.4.4
3230
# via twine
33-
cryptography==3.3.1
34-
# via secretstorage
3531
docutils==0.16
3632
# via
3733
# codechat
3834
# readme-renderer
3935
# sphinx
4036
easyprocess==0.3
4137
# via pyvirtualdisplay
38+
greenlet==1.0.0
39+
# via sqlalchemy
4240
idna==2.10
4341
# via requests
4442
imagesize==1.2.0
4543
# via sphinx
44+
importlib-metadata==4.0.1
45+
# via
46+
# keyring
47+
# twine
4648
iniconfig==1.1.1
4749
# via pytest
48-
isort==5.7.0
50+
isort==5.8.0
4951
# via pylint
50-
jeepney==0.6.0
51-
# via
52-
# keyring
53-
# secretstorage
5452
jinja2==2.11.3
5553
# via sphinx
56-
keyring==22.0.1
54+
keyring==23.0.1
5755
# via twine
58-
lazy-object-proxy==1.4.3
56+
lazy-object-proxy==1.6.0
5957
# via astroid
60-
lxml==4.6.2
58+
lxml==4.6.3
6159
# via codechat
6260
markupsafe==1.1.1
6361
# via jinja2
@@ -72,32 +70,32 @@ paver==1.3.4
7270
# via
7371
# -r requirements.in
7472
# sphinxcontrib-paverutils
75-
pip-tools==5.5.0
73+
pep517==0.10.0
74+
# via pip-tools
75+
pip-tools==6.1.0
7676
# via -r requirements-dev.in
7777
pkginfo==1.7.0
7878
# via twine
7979
pluggy==0.13.1
8080
# via pytest
8181
py==1.10.0
8282
# via pytest
83-
pycparser==2.20
84-
# via cffi
85-
pygments==2.7.4
83+
pygments==2.8.1
8684
# via
8785
# codechat
8886
# readme-renderer
8987
# sphinx
90-
pylint==2.6.0
88+
pylint==2.8.2
9189
# via -r requirements-dev.in
9290
pyparsing==2.4.7
9391
# via packaging
94-
pytest==6.2.2
92+
pytest==6.2.3
9593
# via -r requirements-dev.in
9694
pytz==2021.1
9795
# via babel
98-
pyvirtualdisplay==2.0
96+
pyvirtualdisplay==2.1
9997
# via -r requirements-dev.in
100-
readme-renderer==28.0
98+
readme-renderer==29.0
10199
# via
102100
# -r requirements-dev.in
103101
# twine
@@ -110,21 +108,17 @@ requests==2.25.1
110108
# twine
111109
rfc3986==1.4.0
112110
# via twine
113-
secretstorage==3.3.0
114-
# via keyring
115111
selenium==3.141.0
116112
# via -r requirements-dev.in
117113
six==1.15.0
118114
# via
119115
# -r requirements.in
120-
# astroid
121116
# bleach
122-
# cryptography
123117
# paver
124118
# readme-renderer
125119
snowballstemmer==2.1.0
126120
# via sphinx
127-
sphinx==3.4.3
121+
sphinx==3.5.4
128122
# via
129123
# -r requirements.in
130124
# sphinxcontrib-paverutils
@@ -142,17 +136,18 @@ sphinxcontrib-qthelp==1.0.3
142136
# via sphinx
143137
sphinxcontrib-serializinghtml==1.1.4
144138
# via sphinx
145-
sqlalchemy==1.3.23
139+
sqlalchemy==1.4.12
146140
# via -r requirements.in
147141
toml==0.10.2
148142
# via
143+
# pep517
149144
# pylint
150145
# pytest
151-
tqdm==4.56.0
146+
tqdm==4.60.0
152147
# via twine
153-
twine==3.3.0
148+
twine==3.4.1
154149
# via -r requirements-dev.in
155-
urllib3==1.26.3
150+
urllib3==1.26.4
156151
# via
157152
# requests
158153
# selenium
@@ -162,6 +157,8 @@ wheel==0.36.2
162157
# via -r requirements-dev.in
163158
wrapt==1.12.1
164159
# via astroid
160+
zipp==3.4.1
161+
# via importlib-metadata
165162

166163
# The following packages are considered to be unsafe in a requirements file:
167164
# pip

requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ six>1.12
77
Sphinx>=2.0.0
88
sphinxcontrib-paverutils>=1.17
99
cogapp>=2.5
10-
SQLAlchemy>=1.0.13
10+
SQLAlchemy>=1.4.0
1111
CodeChat>=1.8.6

requirements.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
alabaster==0.7.12
88
# via sphinx
9-
babel==2.9.0
9+
babel==2.9.1
1010
# via sphinx
1111
certifi==2020.12.5
1212
# via requests
@@ -22,13 +22,15 @@ docutils==0.16
2222
# via
2323
# codechat
2424
# sphinx
25+
greenlet==1.0.0
26+
# via sqlalchemy
2527
idna==2.10
2628
# via requests
2729
imagesize==1.2.0
2830
# via sphinx
2931
jinja2==2.11.3
3032
# via sphinx
31-
lxml==4.6.2
33+
lxml==4.6.3
3234
# via codechat
3335
markupsafe==1.1.1
3436
# via jinja2
@@ -38,7 +40,7 @@ paver==1.3.4
3840
# via
3941
# -r requirements.in
4042
# sphinxcontrib-paverutils
41-
pygments==2.7.4
43+
pygments==2.8.1
4244
# via
4345
# codechat
4446
# sphinx
@@ -54,7 +56,7 @@ six==1.15.0
5456
# paver
5557
snowballstemmer==2.1.0
5658
# via sphinx
57-
sphinx==3.4.3
59+
sphinx==3.5.4
5860
# via
5961
# -r requirements.in
6062
# sphinxcontrib-paverutils
@@ -72,9 +74,9 @@ sphinxcontrib-qthelp==1.0.3
7274
# via sphinx
7375
sphinxcontrib-serializinghtml==1.1.4
7476
# via sphinx
75-
sqlalchemy==1.3.23
77+
sqlalchemy==1.4.12
7678
# via -r requirements.in
77-
urllib3==1.26.3
79+
urllib3==1.26.4
7880
# via requests
7981

8082
# The following packages are considered to be unsafe in a requirements file:

runestone/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ def build(options):
210210
"presenter_mode.css",
211211
"jquery-ui-1.10.3.custom.min.css",
212212
"bootstrap-sphinx.css",
213-
"user-highlights.css",
214213
"runestone-custom-sphinx-bootstrap.css?v=" + runestone_version,
215214
"theme-overrides.css",
216215
]

runestone/activecode/js/acfactory.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ export default class ACFactory {
160160
// Page Initialization
161161
//
162162

163-
$(document).ready(function () {
163+
$(document).bind("runestone:login-complete", function () {
164164
ACFactory.createScratchActivecode();
165-
$("[data-component=activecode]").each(function (index) {
165+
$("[data-component=activecode]").each(function () {
166166
if ($(this).closest("[data-component=timedAssessment]").length == 0) {
167167
// If this element exists within a timed component, don't render it here
168168
try {

runestone/activecode/js/activecode.js

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
"use strict";
99

1010
import RunestoneBase from "../../common/js/runestonebase.js";
11-
import AudioTour from "./audiotour";
12-
import "./activecode-i18n.en";
13-
import "./activecode-i18n.pt-br";
11+
import AudioTour from "./audiotour.js";
12+
import "./activecode-i18n.en.js";
13+
import "./activecode-i18n.pt-br.js";
14+
import "./activecode-i18n.sr-Cyrl.js";
1415
import CodeMirror from "codemirror";
1516
import "codemirror/mode/python/python.js";
1617
import "codemirror/mode/css/css.js";
@@ -20,7 +21,6 @@ import "codemirror/mode/javascript/javascript.js";
2021
import "codemirror/mode/sql/sql.js";
2122
import "codemirror/mode/clike/clike.js";
2223
import "codemirror/mode/octave/octave.js";
23-
import "./activecode-i18n.en.js";
2424
import "./../css/activecode.css";
2525
import "codemirror/lib/codemirror.css";
2626

@@ -43,6 +43,7 @@ export class ActiveCode extends RunestoneBase {
4343
super(opts);
4444
var suffStart;
4545
var orig = $(opts.orig).find("textarea")[0];
46+
this.containerDiv = opts.orig;
4647
this.useRunestoneServices = opts.useRunestoneServices;
4748
this.python3 = opts.python3;
4849
this.alignVertical = opts.vertical;
@@ -124,28 +125,28 @@ export class ActiveCode extends RunestoneBase {
124125
1000
125126
);
126127
if (this.autorun) {
127-
$(document).ready(this.runProg.bind(this));
128+
// Simulate pressing the run button, since this will also prevent the user from clicking it until the initial run is complete, and also help the user understand why they're waiting.
129+
$(document).ready(this.runButtonHandler.bind(this));
128130
}
131+
this.indicate_component_ready();
129132
}
130133

131134
createEditor(index) {
132-
this.containerDiv = document.createElement("div");
135+
this.outerDiv = document.createElement("div");
133136
var linkdiv = document.createElement("div");
134137
linkdiv.id = this.divid.replace(/_/g, "-").toLowerCase(); // :ref: changes _ to - so add this as a target
135-
$(this.containerDiv).addClass("ac_section alert alert-warning");
138+
$(this.outerDiv).addClass("ac_section alert alert-warning");
136139
var codeDiv = document.createElement("div");
137140
$(codeDiv).addClass("ac_code_div col-md-12");
138141
this.codeDiv = codeDiv;
139-
this.containerDiv.id = this.divid;
140-
this.containerDiv.lang = this.language;
141-
this.outerDiv = this.containerDiv;
142-
$(this.origElem).replaceWith(this.containerDiv);
142+
this.outerDiv.lang = this.language;
143+
$(this.origElem).replaceWith(this.outerDiv);
143144
if (linkdiv.id !== this.divid) {
144145
// Don't want the 'extra' target if they match.
145-
this.containerDiv.appendChild(linkdiv);
146+
this.outerDiv.appendChild(linkdiv);
146147
}
147-
this.containerDiv.appendChild(codeDiv);
148-
var edmode = this.containerDiv.lang;
148+
this.outerDiv.appendChild(codeDiv);
149+
var edmode = this.outerDiv.lang;
149150
if (edmode === "sql") {
150151
edmode = "text/x-sql";
151152
} else if (edmode === "java") {
@@ -233,7 +234,9 @@ export class ActiveCode extends RunestoneBase {
233234
}
234235
}
235236

236-
async runButtonHander() {
237+
async runButtonHandler() {
238+
// Disable the run button until the run is finished.
239+
this.runButton.disabled = true;
237240
try {
238241
await this.runProg();
239242
} catch (e) {
@@ -243,6 +246,8 @@ export class ActiveCode extends RunestoneBase {
243246
this.logCurrentAnswer();
244247
}
245248
this.renderFeedback();
249+
// The run is finished; re-enable the button.
250+
this.runButton.disabled = false;
246251
}
247252

248253
createControls() {
@@ -257,7 +262,7 @@ export class ActiveCode extends RunestoneBase {
257262
ctrlDiv.appendChild(butt);
258263
this.runButton = butt;
259264
console.log("adding click function for run");
260-
this.runButton.onclick = this.runButtonHander.bind(this);
265+
this.runButton.onclick = this.runButtonHandler.bind(this);
261266
$(butt).attr("type", "button");
262267

263268
if (this.enabledownload || eBookConfig.downloadsEnabled) {
@@ -1207,22 +1212,21 @@ Yet another is that there is an internal error. The internal error message is:
12071212
let urDivid = `${this.divid}_offscreen_unit_results`;
12081213
let unitFeedback = document.getElementById(urDivid);
12091214
let tmp = document.body.removeChild(unitFeedback);
1210-
if ($(this.containerDiv).find(`#${urDivid}`).length > 0) {
1211-
tmp = $(this.containerDiv).find(`#${urDivid}`)[0];
1215+
if ($(this.outerDiv).find(`#${urDivid}`).length > 0) {
1216+
tmp = $(this.outerDiv).find(`#${urDivid}`)[0];
12121217
} else {
1213-
this.containerDiv.appendChild(tmp);
1218+
this.outerDiv.appendChild(tmp);
12141219
}
12151220
$(tmp).show();
12161221
} else {
12171222
let urDivid = this.divid + "_unit_results";
12181223
if (
1219-
$(this.containerDiv).find(`#${urDivid}`).length == 0 &&
1220-
$(this.containerDiv).find(
1221-
`#${urDivid}_offscreen_unit_results`
1222-
).length == 0
1224+
$(this.outerDiv).find(`#${urDivid}`).length == 0 &&
1225+
$(this.outerDiv).find(`#${urDivid}_offscreen_unit_results`)
1226+
.length == 0
12231227
) {
12241228
let urResults = document.getElementById(urDivid);
1225-
this.containerDiv.appendChild(urResults);
1229+
this.outerDiv.appendChild(urResults);
12261230
}
12271231
}
12281232
}
@@ -1274,8 +1278,8 @@ Yet another is that there is an internal error. The internal error message is:
12741278
});
12751279
Sk.divid = this.divid;
12761280
Sk.logResults = logResults;
1277-
if (this.graderactive && this.containerDiv.closest(".loading")) {
1278-
Sk.gradeContainer = this.containerDiv.closest(".loading").id;
1281+
if (this.graderactive && this.outerDiv.closest(".loading")) {
1282+
Sk.gradeContainer = this.outerDiv.closest(".loading").id;
12791283
} else {
12801284
Sk.gradeContainer = this.divid;
12811285
}

runestone/activecode/js/livecode.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ActiveCode } from "./activecode.js";
22
import MD5 from "./md5.js";
33
import JUnitTestParser from "./extractUnitResults.js";
4+
import "../../codelens/js/pytutor-embed.bundle.js";
45

56
export default class LiveCode extends ActiveCode {
67
constructor(opts) {

runestone/activecode/js/timed_activecode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
The TimedActivecode classes are a great example of where multiple inheritance would be useful
3-
But since Javascript does not suppport multiple inheritance we use the mixin pattern.
3+
But since Javascript does not support multiple inheritance we use the mixin pattern.
44
55
*/
66
import LiveCode from "./livecode";

0 commit comments

Comments
 (0)