Improve variable names and fix test start bug
Ensure tests are started with a high enough question limit until UI to choose number of questions is implemented
This commit is contained in:
@@ -145,8 +145,8 @@ export default withRouter(class LoggedInHome extends React.Component {
|
|||||||
id: doc.id,
|
id: doc.id,
|
||||||
setTitle: data.set_title,
|
setTitle: data.set_title,
|
||||||
switchLanguage: data.switch_language,
|
switchLanguage: data.switch_language,
|
||||||
percentage: (data.progress / data.questions.length * 100).toFixed(2),
|
percentageProgress: (data.progress / data.questions.length * 100).toFixed(2),
|
||||||
mark: (data.progress > 0 ? data.correct.length / data.progress * 100 : 0).toFixed(2),
|
grade: (data.progress > 0 ? data.correct.length / data.progress * 100 : 0).toFixed(2),
|
||||||
mode: data.mode,
|
mode: data.mode,
|
||||||
correct: data.correct.length,
|
correct: data.correct.length,
|
||||||
progress: data.progress,
|
progress: data.progress,
|
||||||
@@ -183,7 +183,7 @@ export default withRouter(class LoggedInHome extends React.Component {
|
|||||||
sets: selections,
|
sets: selections,
|
||||||
switch_language: false,
|
switch_language: false,
|
||||||
mode: "questions",
|
mode: "questions",
|
||||||
limit: 10,
|
limit: 1000,
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
const progressId = result.data;
|
const progressId = result.data;
|
||||||
this.stopLoading();
|
this.stopLoading();
|
||||||
@@ -220,7 +220,7 @@ export default withRouter(class LoggedInHome extends React.Component {
|
|||||||
let newState = {
|
let newState = {
|
||||||
progressHistoryIncomplete: this.state.progressHistoryIncomplete,
|
progressHistoryIncomplete: this.state.progressHistoryIncomplete,
|
||||||
};
|
};
|
||||||
newState.progressHistoryIncomplete.splice(progressIndex);
|
delete newState.progressHistoryIncomplete[progressIndex];
|
||||||
this.setState(newState);
|
this.setState(newState);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -282,9 +282,9 @@ export default withRouter(class LoggedInHome extends React.Component {
|
|||||||
<SwapHorizRoundedIcon />
|
<SwapHorizRoundedIcon />
|
||||||
}
|
}
|
||||||
</Link>
|
</Link>
|
||||||
<p>{progressItem.percentage}%</p>
|
<p>{progressItem.percentageProgress}%</p>
|
||||||
<p>{progressItem.correct}/{progressItem.progress}</p>
|
<p>{progressItem.correct}/{progressItem.progress}</p>
|
||||||
<p>{progressItem.mark}%</p>
|
<p>{progressItem.grade}%</p>
|
||||||
<p>
|
<p>
|
||||||
{
|
{
|
||||||
progressItem.mode === "questions"
|
progressItem.mode === "questions"
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ export default withRouter(class SetPage extends React.Component {
|
|||||||
sets: [this.props.match.params.setId],
|
sets: [this.props.match.params.setId],
|
||||||
switch_language: false,
|
switch_language: false,
|
||||||
mode: "questions",
|
mode: "questions",
|
||||||
limit: 10,
|
limit: 1000,
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
const progressId = result.data;
|
const progressId = result.data;
|
||||||
this.stopLoading();
|
this.stopLoading();
|
||||||
|
|||||||
Reference in New Issue
Block a user