skuilder 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +155 -12
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +35 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +70 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/types.d.ts +35 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +35 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/prompts.d.ts +5 -0
- package/dist/utils/prompts.d.ts.map +1 -0
- package/dist/utils/prompts.js +185 -0
- package/dist/utils/prompts.js.map +1 -0
- package/dist/utils/template.d.ts +26 -0
- package/dist/utils/template.d.ts.map +1 -0
- package/dist/utils/template.js +170 -0
- package/dist/utils/template.js.map +1 -0
- package/eslint.config.mjs +21 -0
- package/package.json +41 -36
- package/src/cli.ts +42 -0
- package/src/commands/init.ts +83 -0
- package/src/types.ts +72 -0
- package/src/utils/prompts.ts +204 -0
- package/src/utils/template.ts +215 -0
- package/tsconfig.json +12 -21
- package/.npmignore +0 -56
- package/android/app/BUCK +0 -65
- package/android/app/build.gradle +0 -139
- package/android/app/proguard-rules.pro +0 -66
- package/android/app/src/main/AndroidManifest.xml +0 -32
- package/android/app/src/main/java/com/rxphelloworld/MainActivity.java +0 -15
- package/android/app/src/main/java/com/rxphelloworld/MainApplication.java +0 -40
- package/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/values/strings.xml +0 -3
- package/android/app/src/main/res/values/styles.xml +0 -8
- package/android/build.gradle +0 -24
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
- package/android/gradle.properties +0 -20
- package/android/gradlew +0 -164
- package/android/gradlew.bat +0 -90
- package/android/keystores/BUCK +0 -8
- package/android/keystores/debug.keystore.properties +0 -4
- package/android/settings.gradle +0 -3
- package/img/fingerCounter/1.PNG +0 -0
- package/img/fingerCounter/10.PNG +0 -0
- package/img/fingerCounter/2.PNG +0 -0
- package/img/fingerCounter/3.PNG +0 -0
- package/img/fingerCounter/4.PNG +0 -0
- package/img/fingerCounter/5.PNG +0 -0
- package/img/fingerCounter/6.PNG +0 -0
- package/img/fingerCounter/7.PNG +0 -0
- package/img/fingerCounter/8.PNG +0 -0
- package/img/fingerCounter/9.PNG +0 -0
- package/index.android.js +0 -1
- package/index.html +0 -30
- package/index.ios.js +0 -1
- package/ios/RXPHelloWorld/AppDelegate.h +0 -16
- package/ios/RXPHelloWorld/AppDelegate.m +0 -37
- package/ios/RXPHelloWorld/Base.lproj/LaunchScreen.xib +0 -42
- package/ios/RXPHelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json +0 -38
- package/ios/RXPHelloWorld/Info.plist +0 -56
- package/ios/RXPHelloWorld/main.m +0 -18
- package/ios/RXPHelloWorld.xcodeproj/project.pbxproj +0 -1251
- package/ios/RXPHelloWorld.xcodeproj/xcshareddata/xcschemes/RXPHelloWorld-tvOS.xcscheme +0 -129
- package/ios/RXPHelloWorld.xcodeproj/xcshareddata/xcschemes/RXPHelloWorld.xcscheme +0 -129
- package/ios/RXPHelloWorldTests/Info.plist +0 -24
- package/ios/RXPHelloWorldTests/RXPHelloWorldTests.m +0 -70
- package/src/App.tsx +0 -206
- package/src/appUtilities/Grader.ts +0 -72
- package/src/appUtilities/Keybinder.ts +0 -28
- package/src/appUtilities/Recorder.ts +0 -73
- package/src/cloudantFiles/_users._design._auth.validate_doc_update.js +0 -136
- package/src/components/ProgressChart.tsx +0 -155
- package/src/components/fingerCounter/fingerCounter.tsx +0 -38
- package/src/components/fingerCounter/resources/hands.svg +0 -512
- package/src/components/numpad.tsx +0 -146
- package/src/components/sessionReport.tsx +0 -87
- package/src/index.tsx +0 -8
- package/src/questions/addition.tsx +0 -30
- package/src/questions/division.tsx +0 -62
- package/src/questions/multiplication.tsx +0 -71
- package/src/styles/answerStyles.css +0 -22
- package/src/typings/react.d.ts +0 -964
- package/webpack.config.ts +0 -26
- package/yarn.lock +0 -6208
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import * as RX from 'reactxp';
|
|
2
|
-
import Recorder from '../appUtilities/Recorder';
|
|
3
|
-
|
|
4
|
-
interface SessionReportProps {
|
|
5
|
-
records: Array<any>
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const styles = {
|
|
9
|
-
correct: RX.Styles.createTextStyle({
|
|
10
|
-
backgroundColor: "green"
|
|
11
|
-
}),
|
|
12
|
-
incorrect: RX.Styles.createTextStyle({
|
|
13
|
-
backgroundColor: 'purple'
|
|
14
|
-
})
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
class SessionReport extends RX.Component<SessionReportProps, null> {
|
|
18
|
-
|
|
19
|
-
constructor(props: SessionReportProps) {
|
|
20
|
-
super(props);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
getSessionQuestions(records: Array<any>) {
|
|
24
|
-
let sessionRecords = new Array<any>();
|
|
25
|
-
let correctCount: number = 0;
|
|
26
|
-
let index: number = records.length - 1;
|
|
27
|
-
|
|
28
|
-
while (correctCount < 25) {
|
|
29
|
-
if (records[index].correct) {
|
|
30
|
-
correctCount++;
|
|
31
|
-
}
|
|
32
|
-
index--;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return records.slice(
|
|
36
|
-
Math.max(0, index),
|
|
37
|
-
records.length);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
render() {
|
|
41
|
-
const records = Recorder.getRecord();
|
|
42
|
-
const truncatedRecords = this.getSessionQuestions(records);
|
|
43
|
-
console.log("Rendering a session report...");
|
|
44
|
-
let time: number = 0;
|
|
45
|
-
|
|
46
|
-
truncatedRecords.forEach((record) => {
|
|
47
|
-
time += record.time;
|
|
48
|
-
});
|
|
49
|
-
time = parseInt(time.toFixed(0));
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<RX.View>
|
|
54
|
-
<ul>
|
|
55
|
-
{truncatedRecords.map(
|
|
56
|
-
(record, index) => {
|
|
57
|
-
return (<li key={index}>{this.renderRecord(record)}</li>)
|
|
58
|
-
}
|
|
59
|
-
)}
|
|
60
|
-
</ul>
|
|
61
|
-
{(truncatedRecords.length <= 28) ?
|
|
62
|
-
<RX.Text>
|
|
63
|
-
It took {time} seconds to do these! Can you beat this?
|
|
64
|
-
</RX.Text> :
|
|
65
|
-
null}
|
|
66
|
-
<button autoFocus onClick={() => { window.location.reload(); }}>Try again!</button>
|
|
67
|
-
</RX.View>
|
|
68
|
-
)
|
|
69
|
-
}
|
|
70
|
-
renderRecord(record: Object): JSX.Element {
|
|
71
|
-
if (record.q === 'multiplication') {
|
|
72
|
-
return (
|
|
73
|
-
<RX.Text style={record.correct ? styles.correct : styles.incorrect}>
|
|
74
|
-
{record.a} × {record.b} = {record.answer} (in {record.time} s)
|
|
75
|
-
</RX.Text>
|
|
76
|
-
)
|
|
77
|
-
} else {
|
|
78
|
-
return (
|
|
79
|
-
<RX.Text style={record.correct ? styles.correct : styles.incorrect}>
|
|
80
|
-
{record.a * record.b} ÷ {record.b} = {record.answer} (in {record.time} s)
|
|
81
|
-
</RX.Text>
|
|
82
|
-
)
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export default SessionReport;
|
package/src/index.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as RX from 'reactxp';
|
|
2
|
-
import Recorder from '../appUtilities/Recorder'
|
|
3
|
-
|
|
4
|
-
interface SingleDigitAdditionProblemProps extends RX.CommonProps {
|
|
5
|
-
a: number;
|
|
6
|
-
b: number;
|
|
7
|
-
db: Recorder;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
class SingleDigitAdditionProblem extends RX.Component<SingleDigitAdditionProblemProps, null> {
|
|
11
|
-
a: number;
|
|
12
|
-
b: number;
|
|
13
|
-
|
|
14
|
-
constructor(props: SingleDigitAdditionProblemProps) {
|
|
15
|
-
super(props);
|
|
16
|
-
|
|
17
|
-
this.a = props.a;
|
|
18
|
-
this.b = props.b;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
render() {
|
|
22
|
-
return (
|
|
23
|
-
<RX.View>
|
|
24
|
-
{this.a} + {this.b} = ___
|
|
25
|
-
</RX.View>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default SingleDigitAdditionProblem;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import * as RX from 'reactxp';
|
|
2
|
-
import Numpad from '../components/numpad';
|
|
3
|
-
import { Question, QuestionView, QuestionViewProps } from 'skldr-course-base'
|
|
4
|
-
|
|
5
|
-
interface SingleDigitDivisionProblemProps extends QuestionViewProps {
|
|
6
|
-
question: SingleDigitDivisionQuestion
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
class SingleDigitDivisionQuestion extends Question {
|
|
10
|
-
a: number = getRandomInt(0, 10);
|
|
11
|
-
b: number = getRandomInt(1, 10);
|
|
12
|
-
|
|
13
|
-
isCorrect(answer: number) {
|
|
14
|
-
return answer == this.a;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const styles = {
|
|
19
|
-
form: RX.Styles.createViewStyle({
|
|
20
|
-
flexDirection: "row",
|
|
21
|
-
padding: 15
|
|
22
|
-
})
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function getRandomInt(min: number, max: number) {
|
|
26
|
-
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
class SingleDigitDivisionProblemView extends QuestionView<SingleDigitDivisionProblemProps> {
|
|
30
|
-
|
|
31
|
-
static getProps(): SingleDigitDivisionProblemProps {
|
|
32
|
-
return {
|
|
33
|
-
question: new SingleDigitDivisionQuestion(),
|
|
34
|
-
onanswer: null
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
render() {
|
|
39
|
-
let { a, b } = this.props.question;
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<RX.View>
|
|
43
|
-
|
|
44
|
-
<RX.View style={styles.form}>
|
|
45
|
-
|
|
46
|
-
<div id="question">
|
|
47
|
-
{a * b} ÷ {b} =
|
|
48
|
-
</div>
|
|
49
|
-
<form onSubmit={this.submit.bind(this)}>
|
|
50
|
-
<input className="mousetrap"
|
|
51
|
-
autoFocus
|
|
52
|
-
id="answer" type="number" autoComplete={false} />
|
|
53
|
-
</form>
|
|
54
|
-
</RX.View>
|
|
55
|
-
<Numpad num={b} />
|
|
56
|
-
</RX.View>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export default SingleDigitDivisionProblemView;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import * as RX from 'reactxp';
|
|
2
|
-
import Numpad from '../components/numpad';
|
|
3
|
-
import { QuestionView, QuestionViewProps, Question } from 'skldr-course-base'
|
|
4
|
-
|
|
5
|
-
const styles = {
|
|
6
|
-
form: RX.Styles.createViewStyle({
|
|
7
|
-
flexDirection: "row",
|
|
8
|
-
padding: 15
|
|
9
|
-
})
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function getRandomInt(min: number, max: number) {
|
|
13
|
-
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
14
|
-
}; //todo move this somewhere sensible (or find a lib?)
|
|
15
|
-
|
|
16
|
-
class SingleDigitMultiplicationQuestion extends Question {
|
|
17
|
-
a: number = getRandomInt(0, 10);
|
|
18
|
-
b: number = getRandomInt(0, 10);
|
|
19
|
-
|
|
20
|
-
isCorrect(answer: number) {
|
|
21
|
-
return (this.a * this.b == answer);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
interface SingleDigitMultiplicationQuestionProps extends QuestionViewProps {
|
|
26
|
-
question: SingleDigitMultiplicationQuestion
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class SingleDigitMultiplicationProblemView extends QuestionView<SingleDigitMultiplicationQuestionProps> {
|
|
31
|
-
|
|
32
|
-
static getProps(): SingleDigitMultiplicationQuestionProps {
|
|
33
|
-
return {
|
|
34
|
-
onanswer: null,
|
|
35
|
-
question: new SingleDigitMultiplicationQuestion()
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
render() {
|
|
40
|
-
let { question } = this.props;
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<RX.View>
|
|
44
|
-
|
|
45
|
-
<RX.View style={styles.form}>
|
|
46
|
-
|
|
47
|
-
<div id="question">
|
|
48
|
-
{question.a} × {question.b} =
|
|
49
|
-
</div>
|
|
50
|
-
<form onSubmit={this.submit.bind(this)}>
|
|
51
|
-
<input className="mousetrap"
|
|
52
|
-
autoFocus
|
|
53
|
-
id="answer" type="number" autoComplete={false} />
|
|
54
|
-
</form>
|
|
55
|
-
{/*<RX.TextInput ref="answer2"
|
|
56
|
-
onSubmitEditing={() => console.log("I'm being submitted")}
|
|
57
|
-
autoFocus
|
|
58
|
-
keyboardType="numeric"
|
|
59
|
-
autoCorrect={false}
|
|
60
|
-
onKeyPress={null}>
|
|
61
|
-
</RX.TextInput>
|
|
62
|
-
<TextInput > </TextInput>*/}
|
|
63
|
-
|
|
64
|
-
</RX.View>
|
|
65
|
-
<Numpad num={question.b} />
|
|
66
|
-
</RX.View>
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export default SingleDigitMultiplicationProblemView;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
.correct-true {
|
|
2
|
-
animation: greenFade 500ms ease-out;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
@keyframes greenFade {
|
|
6
|
-
0% { background: green;}
|
|
7
|
-
100% {background: white;}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.correct-false {
|
|
11
|
-
animation: purpleFade 1000ms ease-out;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
@keyframes purpleFade {
|
|
15
|
-
0% { background: purple;}
|
|
16
|
-
100% {background: white;}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.finger {
|
|
20
|
-
height: 100%;
|
|
21
|
-
width: auto;
|
|
22
|
-
}
|