Skip to content

Commit

Permalink
ucfopen#2035 Centering current question text in assessment Test compo…
Browse files Browse the repository at this point in the history
…nent. Adjusting logic in QuestionBank to properly display a single question when the current question index is 0.
  • Loading branch information
FrenjaminBanklin committed Dec 14, 2022
1 parent e1ed146 commit 8e1667d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const QuestionBank = props => {
let questionRender = null
// props will only contain 'questionIndex' in single-question pace assessments
// default to null otherwise
const currentQuestionIndex = props.questionIndex || null
let currentQuestionIndex = props.questionIndex
if (typeof currentQuestionIndex === 'undefined') currentQuestionIndex = null

if (currentQuestionIndex !== null) {
const questionModel = props.model.children.models[currentQuestionIndex]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class AssessmentTest extends React.Component {
return (
<div className="test">
{questionIndex !== null ? (
<p>
<p className="current-question">
Question {questionIndex + 1} of {this.props.model.children.models.length}
</p>
) : null}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
.current-question {
display: block;
margin: 0 auto;
text-align: center;
}

.submit-button {
display: block;
margin: 0 auto;
Expand Down

0 comments on commit 8e1667d

Please sign in to comment.