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

Commit 86e529c

Browse files
committed
Merge branch 'RunestoneInteractive-master' into hparsons-sql
2 parents 41a951d + cd1600c commit 86e529c

File tree

14 files changed

+363
-162
lines changed

14 files changed

+363
-162
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ bower_componenets/
4848
runestone/*/test/build_info
4949
**/sphinx_settings.json
5050
build_info
51+
runestone/dist*.tgz
5152
dist/
5253

5354
# IDEs

makeRelease.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ read -p "Did you update/commit the version in setup.py " yn
2020
esac
2121
done
2222

23-
rm dist/*
23+
rm -f dist/*
2424
npm run dist
2525
python setup.py sdist
2626
pip wheel --no-index --no-deps --global-option bdist_wheel --wheel-dir dist dist/*.tar.gz
@@ -33,3 +33,18 @@ echo "tagging this release and pushing to github"
3333

3434
git tag -a $1 -m 'tag new version'
3535
git push --follow-tags
36+
37+
38+
if [ -d ~/.virtualenvs/json2xml ]
39+
then
40+
41+
echo "Creating dist for PreTeXt"
42+
source ~/.virtualenvs/json2xml/bin/activate
43+
python scripts/dist2xml.py $1 > runestone/dist/webpack_static_imports.xml
44+
cd runestone
45+
tar zcf dist-$1.tgz dist
46+
else
47+
echo "Warning: no json2xml ve found skipping pretext"
48+
fi
49+
50+

requirements-dev.txt

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ certifi==2021.10.8
2828
# urllib3
2929
cffi==1.15.0
3030
# via cryptography
31-
charset-normalizer==2.0.11
31+
charset-normalizer==2.0.12
3232
# via requests
33-
click==8.0.3
33+
click==8.0.4
3434
# via
3535
# -r requirements.in
3636
# pip-tools
@@ -50,8 +50,6 @@ docutils==0.16
5050
# myst-parser
5151
# readme-renderer
5252
# sphinx
53-
easyprocess==1.1
54-
# via pyvirtualdisplay
5553
h11==0.13.0
5654
# via wsproto
5755
idna==3.3
@@ -61,7 +59,7 @@ idna==3.3
6159
# urllib3
6260
imagesize==1.3.0
6361
# via sphinx
64-
importlib-metadata==4.10.1
62+
importlib-metadata==4.11.2
6563
# via
6664
# keyring
6765
# twine
@@ -77,21 +75,21 @@ keyring==23.5.0
7775
# via twine
7876
lazy-object-proxy==1.7.1
7977
# via astroid
80-
lxml==4.7.1
78+
lxml==4.8.0
8179
# via codechat
8280
markdown-it-py==2.0.1
8381
# via
8482
# mdit-py-plugins
8583
# myst-parser
86-
markupsafe==2.0.1
84+
markupsafe==2.1.0
8785
# via jinja2
8886
mccabe==0.6.1
8987
# via pylint
9088
mdit-py-plugins==0.3.0
9189
# via myst-parser
9290
mdurl==0.1.0
9391
# via markdown-it-py
94-
myst-parser==0.16.1
92+
myst-parser==0.17.0
9593
# via -r requirements-dev.in
9694
outcome==1.1.0
9795
# via trio
@@ -106,11 +104,11 @@ paver==1.3.4
106104
# sphinxcontrib-paverutils
107105
pep517==0.12.0
108106
# via pip-tools
109-
pip-tools==6.4.0
107+
pip-tools==6.5.1
110108
# via -r requirements-dev.in
111109
pkginfo==1.8.2
112110
# via twine
113-
platformdirs==2.4.1
111+
platformdirs==2.5.1
114112
# via pylint
115113
pluggy==1.0.0
116114
# via pytest
@@ -129,11 +127,13 @@ pyopenssl==22.0.0
129127
# via urllib3
130128
pyparsing==3.0.7
131129
# via packaging
132-
pytest==6.2.5
130+
pysocks==1.7.1
131+
# via urllib3
132+
pytest==7.0.1
133133
# via -r requirements-dev.in
134134
pytz==2021.3
135135
# via babel
136-
pyvirtualdisplay==2.2
136+
pyvirtualdisplay==3.0
137137
# via -r requirements-dev.in
138138
pyyaml==6.0
139139
# via myst-parser
@@ -150,7 +150,7 @@ requests-toolbelt==0.9.1
150150
# via twine
151151
rfc3986==2.0.0
152152
# via twine
153-
selenium==4.1.0
153+
selenium==4.1.2
154154
# via -r requirements-dev.in
155155
six==1.16.0
156156
# via
@@ -163,7 +163,7 @@ snowballstemmer==2.2.0
163163
# via sphinx
164164
sortedcontainers==2.4.0
165165
# via trio
166-
sphinx==3.5.4
166+
sphinx==4.4.0
167167
# via
168168
# -r requirements.in
169169
# myst-parser
@@ -185,29 +185,31 @@ sphinxcontrib-serializinghtml==1.1.5
185185
sqlalchemy==1.4.31
186186
# via -r requirements.in
187187
toml==0.10.2
188+
# via pylint
189+
tomli==2.0.1
188190
# via
189-
# pylint
191+
# pep517
190192
# pytest
191-
tomli==2.0.0
192-
# via pep517
193-
tqdm==4.62.3
193+
tqdm==4.63.0
194194
# via twine
195-
trio==0.19.0
195+
trio==0.20.0
196196
# via
197197
# selenium
198198
# trio-websocket
199199
trio-websocket==0.9.2
200200
# via selenium
201-
twine==3.7.1
201+
twine==3.8.0
202202
# via -r requirements-dev.in
203-
typing-extensions==4.0.1
203+
typing-extensions==4.1.1
204204
# via
205205
# astroid
206+
# myst-parser
206207
# pylint
207-
urllib3[secure]==1.26.8
208+
urllib3[secure,socks]==1.26.8
208209
# via
209210
# requests
210211
# selenium
212+
# twine
211213
webencodings==0.5.1
212214
# via bleach
213215
wheel==0.37.1
@@ -216,7 +218,7 @@ wheel==0.37.1
216218
# pip-tools
217219
wrapt==1.13.3
218220
# via astroid
219-
wsproto==1.0.0
221+
wsproto==1.1.0
220222
# via trio-websocket
221223
zipp==3.7.0
222224
# via importlib-metadata

requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ babel==2.9.1
1010
# via sphinx
1111
certifi==2021.10.8
1212
# via requests
13-
charset-normalizer==2.0.11
13+
charset-normalizer==2.0.12
1414
# via requests
15-
click==8.0.3
15+
click==8.0.4
1616
# via -r requirements.in
1717
codechat==1.9.0
1818
# via -r requirements.in
@@ -28,9 +28,9 @@ imagesize==1.3.0
2828
# via sphinx
2929
jinja2==3.0.3
3030
# via sphinx
31-
lxml==4.7.1
31+
lxml==4.8.0
3232
# via codechat
33-
markupsafe==2.0.1
33+
markupsafe==2.1.0
3434
# via jinja2
3535
packaging==21.3
3636
# via sphinx
@@ -54,7 +54,7 @@ six==1.16.0
5454
# paver
5555
snowballstemmer==2.2.0
5656
# via sphinx
57-
sphinx==3.5.4
57+
sphinx==4.4.0
5858
# via
5959
# -r requirements.in
6060
# sphinxcontrib-paverutils

runestone/activecode/js/activecode.js

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ import "codemirror/mode/clike/clike.js";
2323
import "codemirror/mode/octave/octave.js";
2424
import "./../css/activecode.css";
2525
import "codemirror/lib/codemirror.css";
26+
import "codemirror/addon/hint/show-hint.js";
27+
import "codemirror/addon/hint/show-hint.css";
28+
import "codemirror/addon/hint/sql-hint.js";
29+
import "codemirror/addon/hint/anyword-hint.js";
30+
import "codemirror/addon/edit/matchbrackets.js";
2631
import "./skulpt.min.js";
2732
import "./skulpt-stdlib.js";
2833
// Used by Skulpt.
@@ -43,6 +48,10 @@ window.edList = {};
4348
var socket, connection, doc;
4449
var chatcodesServer = "chat.codes";
4550

51+
CodeMirror.commands.autocomplete = function (cm) {
52+
cm.showHint({ hint: CodeMirror.hint.anyword });
53+
};
54+
4655
// separate into constructor and init
4756
export class ActiveCode extends RunestoneBase {
4857
constructor(opts) {
@@ -73,6 +82,7 @@ export class ActiveCode extends RunestoneBase {
7382
this.loadButton = null;
7483
this.outerDiv = null;
7584
this.partner = "";
85+
this.runCount = 0;
7686
this.logResults = true;
7787
if (!eBookConfig.allow_pairs || $(orig).data("nopair")) {
7888
this.enablePartner = false;
@@ -176,6 +186,7 @@ export class ActiveCode extends RunestoneBase {
176186
extraKeys: {
177187
Tab: "indentMore",
178188
"Shift-Tab": "indentLess",
189+
"Ctrl-Space": "autocomplete",
179190
},
180191
});
181192
// Make the editor resizable
@@ -254,6 +265,10 @@ export class ActiveCode extends RunestoneBase {
254265
this.renderFeedback();
255266
// The run is finished; re-enable the button.
256267
this.runButton.disabled = false;
268+
this.runCount += 1;
269+
if (this.is_toggle && this.runCount == 3) {
270+
alert("Help is Available Using the Toggle Question Selector");
271+
}
257272
}
258273

259274
createControls() {
@@ -476,8 +491,8 @@ export class ActiveCode extends RunestoneBase {
476491
if (!didAgree) {
477492
didAgree = confirm(
478493
"Pair Programming should only be used with the consent of your instructor." +
479-
"Your partner must be a registered member of the class and have agreed to pair with you." +
480-
"By clicking OK you certify that both of these conditions have been met."
494+
"Your partner must be a registered member of the class and have agreed to pair with you." +
495+
"By clicking OK you certify that both of these conditions have been met."
481496
);
482497
if (didAgree) {
483498
localStorage.setItem("partnerAgree", "true");
@@ -520,13 +535,13 @@ export class ActiveCode extends RunestoneBase {
520535
$(butt).attr(
521536
"href",
522537
"http://" +
523-
chatcodesServer +
524-
"/new?" +
525-
$.param({
526-
topic: window.location.host + "-" + this.divid,
527-
code: this.editor.getValue(),
528-
lang: "Python",
529-
})
538+
chatcodesServer +
539+
"/new?" +
540+
$.param({
541+
topic: window.location.host + "-" + this.divid,
542+
code: this.editor.getValue(),
543+
lang: "Python",
544+
})
530545
);
531546
this.chatButton = butt;
532547
chatBar.appendChild(butt);
@@ -582,16 +597,21 @@ export class ActiveCode extends RunestoneBase {
582597
// If this is timed and already taken we should restore history info
583598
this.renderScrubber();
584599
} else {
585-
let request = new Request(`${eBookConfig.new_server_prefix}/assessment/gethist`, {
586-
method: "POST",
587-
headers: this.jsonHeaders,
588-
body: JSON.stringify(reqData),
589-
});
600+
let request = new Request(
601+
`${eBookConfig.new_server_prefix}/assessment/gethist`,
602+
{
603+
method: "POST",
604+
headers: this.jsonHeaders,
605+
body: JSON.stringify(reqData),
606+
}
607+
);
590608
try {
591609
response = await fetch(request);
592610
let data = await response.json();
593611
if (!response.ok) {
594-
throw new Error(`Failed to get the history data: ${data.detail}`);
612+
throw new Error(
613+
`Failed to get the history data: ${data.detail}`
614+
);
595615
}
596616
data = data.detail;
597617
if (data.history !== undefined) {
@@ -919,7 +939,7 @@ export class ActiveCode extends RunestoneBase {
919939
});
920940
}
921941

922-
toggleEditorVisibility() { }
942+
toggleEditorVisibility() {}
923943

924944
addErrorMessage(err) {
925945
// Add the error message
@@ -1057,7 +1077,7 @@ Yet another is that there is an internal error. The internal error message is:
10571077
var xl = eval(x);
10581078
xl = xl.map(pyStr);
10591079
x = xl.join(" ");
1060-
} catch (err) { }
1080+
} catch (err) {}
10611081
}
10621082
}
10631083
$(this.output).css("visibility", "visible");
@@ -1161,7 +1181,7 @@ Yet another is that there is an internal error. The internal error message is:
11611181
if (
11621182
this.historyScrubber &&
11631183
this.history[$(this.historyScrubber).slider("value")] !=
1164-
this.editor.getValue()
1184+
this.editor.getValue()
11651185
) {
11661186
saveCode = "True";
11671187
this.history.push(this.editor.getValue());
@@ -1220,7 +1240,7 @@ Yet another is that there is an internal error. The internal error message is:
12201240
if (typeof sid !== "undefined") {
12211241
unitData.sid = sid;
12221242
}
1223-
await this.logBookEvent(unitData)
1243+
await this.logBookEvent(unitData);
12241244
}
12251245
}
12261246

0 commit comments

Comments
 (0)