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.
Files changed (93) hide show
  1. package/README.md +155 -12
  2. package/dist/cli.d.ts +3 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +35 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/commands/init.d.ts +3 -0
  7. package/dist/commands/init.d.ts.map +1 -0
  8. package/dist/commands/init.js +70 -0
  9. package/dist/commands/init.js.map +1 -0
  10. package/dist/types.d.ts +35 -0
  11. package/dist/types.d.ts.map +1 -0
  12. package/dist/types.js +35 -0
  13. package/dist/types.js.map +1 -0
  14. package/dist/utils/prompts.d.ts +5 -0
  15. package/dist/utils/prompts.d.ts.map +1 -0
  16. package/dist/utils/prompts.js +185 -0
  17. package/dist/utils/prompts.js.map +1 -0
  18. package/dist/utils/template.d.ts +26 -0
  19. package/dist/utils/template.d.ts.map +1 -0
  20. package/dist/utils/template.js +170 -0
  21. package/dist/utils/template.js.map +1 -0
  22. package/eslint.config.mjs +21 -0
  23. package/package.json +41 -36
  24. package/src/cli.ts +42 -0
  25. package/src/commands/init.ts +83 -0
  26. package/src/types.ts +72 -0
  27. package/src/utils/prompts.ts +204 -0
  28. package/src/utils/template.ts +215 -0
  29. package/tsconfig.json +12 -21
  30. package/.npmignore +0 -56
  31. package/android/app/BUCK +0 -65
  32. package/android/app/build.gradle +0 -139
  33. package/android/app/proguard-rules.pro +0 -66
  34. package/android/app/src/main/AndroidManifest.xml +0 -32
  35. package/android/app/src/main/java/com/rxphelloworld/MainActivity.java +0 -15
  36. package/android/app/src/main/java/com/rxphelloworld/MainApplication.java +0 -40
  37. package/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  38. package/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  39. package/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  40. package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  41. package/android/app/src/main/res/values/strings.xml +0 -3
  42. package/android/app/src/main/res/values/styles.xml +0 -8
  43. package/android/build.gradle +0 -24
  44. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  45. package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  46. package/android/gradle.properties +0 -20
  47. package/android/gradlew +0 -164
  48. package/android/gradlew.bat +0 -90
  49. package/android/keystores/BUCK +0 -8
  50. package/android/keystores/debug.keystore.properties +0 -4
  51. package/android/settings.gradle +0 -3
  52. package/img/fingerCounter/1.PNG +0 -0
  53. package/img/fingerCounter/10.PNG +0 -0
  54. package/img/fingerCounter/2.PNG +0 -0
  55. package/img/fingerCounter/3.PNG +0 -0
  56. package/img/fingerCounter/4.PNG +0 -0
  57. package/img/fingerCounter/5.PNG +0 -0
  58. package/img/fingerCounter/6.PNG +0 -0
  59. package/img/fingerCounter/7.PNG +0 -0
  60. package/img/fingerCounter/8.PNG +0 -0
  61. package/img/fingerCounter/9.PNG +0 -0
  62. package/index.android.js +0 -1
  63. package/index.html +0 -30
  64. package/index.ios.js +0 -1
  65. package/ios/RXPHelloWorld/AppDelegate.h +0 -16
  66. package/ios/RXPHelloWorld/AppDelegate.m +0 -37
  67. package/ios/RXPHelloWorld/Base.lproj/LaunchScreen.xib +0 -42
  68. package/ios/RXPHelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json +0 -38
  69. package/ios/RXPHelloWorld/Info.plist +0 -56
  70. package/ios/RXPHelloWorld/main.m +0 -18
  71. package/ios/RXPHelloWorld.xcodeproj/project.pbxproj +0 -1251
  72. package/ios/RXPHelloWorld.xcodeproj/xcshareddata/xcschemes/RXPHelloWorld-tvOS.xcscheme +0 -129
  73. package/ios/RXPHelloWorld.xcodeproj/xcshareddata/xcschemes/RXPHelloWorld.xcscheme +0 -129
  74. package/ios/RXPHelloWorldTests/Info.plist +0 -24
  75. package/ios/RXPHelloWorldTests/RXPHelloWorldTests.m +0 -70
  76. package/src/App.tsx +0 -206
  77. package/src/appUtilities/Grader.ts +0 -72
  78. package/src/appUtilities/Keybinder.ts +0 -28
  79. package/src/appUtilities/Recorder.ts +0 -73
  80. package/src/cloudantFiles/_users._design._auth.validate_doc_update.js +0 -136
  81. package/src/components/ProgressChart.tsx +0 -155
  82. package/src/components/fingerCounter/fingerCounter.tsx +0 -38
  83. package/src/components/fingerCounter/resources/hands.svg +0 -512
  84. package/src/components/numpad.tsx +0 -146
  85. package/src/components/sessionReport.tsx +0 -87
  86. package/src/index.tsx +0 -8
  87. package/src/questions/addition.tsx +0 -30
  88. package/src/questions/division.tsx +0 -62
  89. package/src/questions/multiplication.tsx +0 -71
  90. package/src/styles/answerStyles.css +0 -22
  91. package/src/typings/react.d.ts +0 -964
  92. package/webpack.config.ts +0 -26
  93. 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} &times; {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} &#247; {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,8 +0,0 @@
1
- import RX = require('reactxp');
2
- import App = require('./App');
3
- import Recorder from './appUtilities/Recorder'
4
-
5
- Recorder.init();
6
-
7
- RX.App.initialize(true, true);
8
- RX.UserInterface.setMainView(<App />);
@@ -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} &#247; {b} =&nbsp;
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} &times; {question.b} =&nbsp;
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
- }