diff --git a/package.json b/package.json index 4037f63..dd96f39 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "cleanName": "secret-spreadsheet" }, "dependencies": { - "materia-widget-development-kit": "^2.4.2" + "materia-widget-development-kit": "../../MWDK4" }, "devDependencies": { "@babel/preset-react": "^7.0.0", @@ -18,10 +18,10 @@ "react-test-renderer": "^16.9.0" }, "scripts": { - "start": "webpack-dev-server", "lint": "eslint src/**/*.js", - "build": "webpack -p", - "build-dev": "webpack", + "start": "mwdk-start", + "build": "mwdk-build-prod", + "build-dev": "mwdk-build-dev", "test": "jest", "test-ci": "TZ='America/New_York' CI=true jest --ci --useStderr --coverage --coverageReporters text-summary cobertura" }, diff --git a/src/components/player/cell.js b/src/components/player/cell.js index 0403331..b76a859 100644 --- a/src/components/player/cell.js +++ b/src/components/player/cell.js @@ -21,6 +21,10 @@ class Cell extends React.Component { value = value.slice(0, 36); } + if (value.length > 0) { + this.props.saveAnswer(event) + } + this.setState({ value: value, colorClass: this.state.colorClass, diff --git a/src/components/player/table.js b/src/components/player/table.js index bb79ec5..62f92aa 100644 --- a/src/components/player/table.js +++ b/src/components/player/table.js @@ -102,20 +102,11 @@ class PlayerTable extends React.Component { // add in the row labels if needed if (j === 0 && this.props.spreadsheet) { // make the first label generated a th if needed - if (i === 0 && this.props.header) { - cells.push( - - {i+1} - - ); - } - else { - cells.push( - - {i+1} - - ); - } + cells.push( + + {i+1} + + ); } // make the first row of user created content a header if needed @@ -177,6 +168,7 @@ class PlayerTable extends React.Component { } return( + <> {headRows} @@ -186,6 +178,7 @@ class PlayerTable extends React.Component { {mainRows}
+ ); } } diff --git a/src/components/scoreScreen/table.js b/src/components/scoreScreen/table.js index e90a3e4..5a33b82 100644 --- a/src/components/scoreScreen/table.js +++ b/src/components/scoreScreen/table.js @@ -72,7 +72,7 @@ class ScoreTable extends React.Component { // add in the row labels if needed if (this.props.spreadsheet) { cells.push( - 1 + 1 ); } @@ -124,9 +124,9 @@ class ScoreTable extends React.Component { // add in row labels if needed if (j === 0 && this.props.spreadsheet) { cells.push( - + {i+1} - + ); } diff --git a/src/creator.js b/src/creator.js index c2b9e44..c400f86 100644 --- a/src/creator.js +++ b/src/creator.js @@ -394,6 +394,7 @@ export default class CreatorApp extends React.Component { if (row >= 0 && row < this.state.qset.dimensions.rows && col >= 0 && col < this.state.qset.dimensions.columns) { this.refsArray[row][col].focus(); + console.log(document.activeElement) // return value for testing return 1; } diff --git a/src/player.js b/src/player.js index 4068cae..700c9dd 100644 --- a/src/player.js +++ b/src/player.js @@ -29,6 +29,7 @@ class PlayerApp extends React.Component { // check if question has been answered. If it is, submit the answer, or submit blank submitAnswer(id, counter) { if (Object.prototype.hasOwnProperty.call(this.answers, `${counter}-input`)) { + console.log(id) Materia.Score.submitQuestionForScoring(id, this.answers[`${counter}-input`]); } else { @@ -216,7 +217,7 @@ class PlayerApp extends React.Component { -

You've filled out {this.state.answered} of {this.blankPositions.size} missing cells

+ { this.state.question diff --git a/webpack.config.js b/webpack.config.js index e1529df..b2bbaa2 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -7,32 +7,20 @@ const rules = widgetWebpack.getDefaultRules() const copy = widgetWebpack.getDefaultCopyList() const entries = { - 'player.js': [ - path.join(srcPath, 'player.js') - ], - 'player.css': [ + 'player': [ path.join(srcPath, 'player.html'), + path.join(srcPath, 'player.js'), path.join(srcPath, 'player.scss') ], - 'creator.js': [ - path.join(srcPath, 'creator.js') - ], - 'creator.css': [ + 'creator': [ path.join(srcPath, 'creator.html'), + path.join(srcPath, 'creator.js'), path.join(srcPath, 'creator.scss') ], - 'scoreScreen.js': [ - path.join(srcPath, 'scoreScreen.js') - ], - 'scoreScreen.css': [ + 'scoreScreen': [ path.join(srcPath, 'scoreScreen.html'), + path.join(srcPath, 'scoreScreen.js'), path.join(srcPath, 'scoreScreen.scss') - ], - 'guides/player.temp.html': [ - path.join(srcPath, '_guides', 'player.md') - ], - 'guides/creator.temp.html': [ - path.join(srcPath, '_guides', 'creator.md') ] } @@ -54,9 +42,7 @@ const customReactLoader = { const customRules = [ rules.loadHTMLAndReplaceMateriaScripts, - rules.loadAndPrefixCSS, rules.loadAndPrefixSASS, - rules.loadAndCompileMarkdown, rules.copyImages, customReactLoader ]