Add ability to ignore capitals during tests
This commit is contained in:
@@ -61,6 +61,15 @@ export default function ClassicTestStart(props) {
|
||||
<span>Switch language</span>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<Checkbox
|
||||
checked={props.ignoreCaps}
|
||||
onChange={props.handleIgnoreCapsChange}
|
||||
inputProps={{ 'aria-label': 'checkbox' }}
|
||||
/>
|
||||
<span>Ignore capitals</span>
|
||||
</label>
|
||||
|
||||
<Button
|
||||
onClick={() => props.startTest("questions")}
|
||||
icon={<ArrowForwardRoundedIcon />}
|
||||
|
||||
@@ -61,6 +61,15 @@ export default function LivesTestStart(props) {
|
||||
<span>Switch language</span>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<Checkbox
|
||||
checked={props.ignoreCaps}
|
||||
onChange={props.handleIgnoreCapsChange}
|
||||
inputProps={{ 'aria-label': 'checkbox' }}
|
||||
/>
|
||||
<span>Ignore capitals</span>
|
||||
</label>
|
||||
|
||||
<Button
|
||||
onClick={() => props.startTest("lives")}
|
||||
icon={<ArrowForwardRoundedIcon />}
|
||||
|
||||
@@ -72,6 +72,7 @@ export default withRouter(class LoggedInHome extends React.Component {
|
||||
showLivesTestStart: false,
|
||||
sliderValue: 1,
|
||||
switchLanguage: false,
|
||||
ignoreCaps: false,
|
||||
totalTestQuestions: 1,
|
||||
pendingDeletions: {},
|
||||
};
|
||||
@@ -199,6 +200,7 @@ export default withRouter(class LoggedInHome extends React.Component {
|
||||
switch_language: this.state.switchLanguage,
|
||||
mode: mode,
|
||||
limit: this.state.sliderValue,
|
||||
ignoreCaps: this.state.ignoreCaps,
|
||||
}).then((result) => {
|
||||
const progressId = result.data;
|
||||
this.stopLoading();
|
||||
@@ -351,6 +353,12 @@ export default withRouter(class LoggedInHome extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
handleIgnoreCapsChange = (event) => {
|
||||
this.setState({
|
||||
ignoreCaps: event.target.checked,
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
@@ -570,7 +578,9 @@ export default withRouter(class LoggedInHome extends React.Component {
|
||||
sliderValue={this.state.sliderValue}
|
||||
onSliderChange={this.changeSliderValue}
|
||||
switchLanguage={this.state.switchLanguage}
|
||||
ignoreCaps={this.state.ignoreCaps}
|
||||
handleSwitchLanguageChange={this.handleSwitchLanguageChange}
|
||||
handleIgnoreCapsChange={this.handleIgnoreCapsChange}
|
||||
loading={this.state.loading}
|
||||
/>
|
||||
}
|
||||
@@ -583,7 +593,9 @@ export default withRouter(class LoggedInHome extends React.Component {
|
||||
sliderValue={this.state.sliderValue}
|
||||
onSliderChange={this.changeSliderValue}
|
||||
switchLanguage={this.state.switchLanguage}
|
||||
ignoreCaps={this.state.ignoreCaps}
|
||||
handleSwitchLanguageChange={this.handleSwitchLanguageChange}
|
||||
handleIgnoreCapsChange={this.handleIgnoreCapsChange}
|
||||
loading={this.state.loading}
|
||||
/>
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ export default withRouter(class Progress extends React.Component {
|
||||
pageLoaded: false,
|
||||
startTime: null,
|
||||
sound: false,
|
||||
ignoreCaps: false,
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
|
||||
@@ -53,6 +53,7 @@ export default withRouter(class SetPage extends React.Component {
|
||||
showLivesTestStart: false,
|
||||
sliderValue: 1,
|
||||
switchLanguage: false,
|
||||
ignoreCaps: false,
|
||||
totalTestQuestions: 1,
|
||||
};
|
||||
|
||||
@@ -134,6 +135,7 @@ export default withRouter(class SetPage extends React.Component {
|
||||
switch_language: this.state.switchLanguage,
|
||||
mode: mode,
|
||||
limit: this.state.sliderValue,
|
||||
ignoreCaps: this.state.ignoreCaps,
|
||||
}).then((result) => {
|
||||
const progressId = result.data;
|
||||
this.stopLoading();
|
||||
@@ -332,6 +334,12 @@ export default withRouter(class SetPage extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
handleIgnoreCapsChange = (event) => {
|
||||
this.setState({
|
||||
ignoreCaps: event.target.checked,
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
@@ -479,7 +487,9 @@ export default withRouter(class SetPage extends React.Component {
|
||||
sliderValue={this.state.sliderValue}
|
||||
onSliderChange={this.changeSliderValue}
|
||||
switchLanguage={this.state.switchLanguage}
|
||||
ignoreCaps={this.state.ignoreCaps}
|
||||
handleSwitchLanguageChange={this.handleSwitchLanguageChange}
|
||||
handleIgnoreCapsChange={this.handleIgnoreCapsChange}
|
||||
loading={this.state.loading}
|
||||
disabled={!this.state.canStartTest}
|
||||
/>
|
||||
@@ -493,7 +503,9 @@ export default withRouter(class SetPage extends React.Component {
|
||||
sliderValue={this.state.sliderValue}
|
||||
onSliderChange={this.changeSliderValue}
|
||||
switchLanguage={this.state.switchLanguage}
|
||||
ignoreCaps={this.state.ignoreCaps}
|
||||
handleSwitchLanguageChange={this.handleSwitchLanguageChange}
|
||||
handleIgnoreCapsChange={this.handleIgnoreCapsChange}
|
||||
loading={this.state.loading}
|
||||
disabled={!this.state.canStartTest}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user