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

Commit 08e1bac

Browse files
committed
🔥 Removing options that are not working currently
1 parent 21f2cf5 commit 08e1bac

5 files changed

Lines changed: 21 additions & 25 deletions

File tree

runestone/hparsons/hparsons.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def setup(app):
4949
<textarea data-lang="%(language)s"
5050
%(optional)s
5151
%(dburl)s
52-
%(textentry)s
5352
%(reuse)s
5453
%(randomize)s
5554
%(blockanswer)s
@@ -98,9 +97,7 @@ class HParsonsDirective(RunestoneIdDirective):
9897
:language: sql, regex
9998
:dburl: only for sql -- url to load database
10099
:randomize: randomize the order of horizontal parsons
101-
TODO: fix textentry
102100
:reuse: only for parsons -- make the blocks reusable
103-
:textentry: if you will use text entry instead of horizontal parsons
104101
:blockanswer: 0 1 2 3 # Provide answer for block-based feedback. Please note that the number of block start from 0. If not provided, will use execution based feedback.
105102
106103
Here is the problem description. It must ends with the tildes.
@@ -110,9 +107,6 @@ class HParsonsDirective(RunestoneIdDirective):
110107
block 1
111108
block 2
112109
block 3
113-
--explanations--
114-
explanations for block 1
115-
explanations for block 2
116110
--unittest--
117111
assert 1,1 == world
118112
assert 0,1 == hello
@@ -127,7 +121,6 @@ class HParsonsDirective(RunestoneIdDirective):
127121
{
128122
"dburl": directives.unchanged,
129123
"language": directives.unchanged,
130-
"textentry": directives.flag,
131124
"reuse": directives.flag,
132125
"randomize": directives.flag,
133126
"blockanswer": directives.unchanged,
@@ -139,11 +132,6 @@ def run(self):
139132

140133
env = self.state.document.settings.env
141134

142-
if "textentry" in self.options:
143-
self.options['textentry'] = ' data-textentry="true"'
144-
else:
145-
self.options['textentry'] = ''
146-
147135
if "reuse" in self.options:
148136
self.options['reuse'] = ' data-reuse="true"'
149137
else:

runestone/hparsons/js/BlockFeedback.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ export default class BlockFeedback extends HParsonsFeedback {
4141
this.grader.answer = this.hparsons.hparsonsInput.getParsonsTextArray();
4242
this.grade = this.grader.grade();
4343
if (this.grade == "correct") {
44-
this.solved = true;
4544
$(this.hparsons.runButton).prop("disabled", true);
45+
this.solved = true;
4646
}
4747
}
4848
}
@@ -114,11 +114,15 @@ export default class BlockFeedback extends HParsonsFeedback {
114114
);
115115
}
116116
$(this.messageDiv).hide();
117+
}
117118

118-
// TODO: might need to change this
119-
$(this.hparsons.runButton).prop("disabled", false);
120-
// this.checkCount = 0;
121-
this.solved = false;
119+
reset() {
120+
if (this.solved) {
121+
this.checkCount = 0;
122+
$(this.hparsons.runButton).prop("disabled", false);
123+
this.solved = false;
124+
}
125+
this.clearFeedback();
122126
}
123127

124128
}

runestone/hparsons/js/SQLFeedback.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ export default class SQLFeedback extends HParsonsFeedback {
3636
$(this.outDiv).hide();
3737
}
3838

39+
reset() {
40+
this.clearFeedback();
41+
}
42+
3943
init() {
4044
// adapted from activecode-sql
4145
// fnprefix sets the path to load the sql-wasm.wasm file

runestone/hparsons/js/hparsons-sql.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export default class SQLHParons extends RunestoneBase {
1818
var suffStart;
1919
// getting settings
2020
var orig = $(opts.orig).find("textarea")[0];
21-
this.textentry = $(orig).data('textentry') ? true : false;
2221
this.reuse = $(orig).data('reuse') ? true : false;
2322
this.randomize = $(orig).data('randomize') ? true : false;
2423
this.isBlockGrading = $(orig).data('blockanswer') ? true : false;
@@ -79,11 +78,7 @@ export default class SQLHParons extends RunestoneBase {
7978
this.outerDiv = document.createElement("div");
8079
$(this.origElem).replaceWith(this.outerDiv);
8180
let parsonsHTML = `<horizontal-parsons id='${this.divid}-hparsons'`
82-
if (this.textentry) {
83-
parsonsHTML += ` input-type='text' `;
84-
} else {
85-
parsonsHTML += ` input-type='parsons' `;
86-
}
81+
parsonsHTML += ` input-type='parsons' `;
8782
if (this.reuse) {
8883
parsonsHTML += ` reuse-blocks="true"`;
8984
}
@@ -138,7 +133,7 @@ export default class SQLHParons extends RunestoneBase {
138133
this.resetButton = resetBtn;
139134
this.resetButton.onclick = () => {
140135
this.hparsonsInput.resetInput();
141-
this.feedbackController.clearFeedback();
136+
this.feedbackController.reset();
142137
}
143138
$(resetBtn).attr("type", "button");
144139

runestone/hparsons/js/hparsonsFeedback.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ export default class HParsonsFeedback {
1717
}
1818

1919
clearFeedback() {
20-
// called when Reset is clicked or input is changed
20+
// called when input is changed
2121
console.log('clearFeedback method not implemented in feedback!');
2222
}
23+
24+
reset() {
25+
// called when reset is clicked
26+
console.log('reset method not implemented in feedback!');
27+
}
2328
}

0 commit comments

Comments
 (0)