Skip to content

Commit

Permalink
Trying to fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kreut committed Jan 17, 2023
1 parent e9ff03d commit 7977332
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions resources/js/components/QtiJsonQuestionViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ export default {
},
mounted () {
this.question = JSON.parse(this.qtiJson)
if (!this.question) {
console.log('no question here')
return false
}
this.questionType = this.question.questionType
console.log(this.question)
switch (this.questionType) {
Expand Down Expand Up @@ -309,6 +313,7 @@ export default {
case ('select_choice'):
response = []
$('select.select-choice').each(function () {
console.log($(this).val())
if ($(this).val() === '') {
$(this).addClass('is-invalid-border')
invalidResponse = true
Expand Down
14 changes: 8 additions & 6 deletions resources/js/pages/questions.view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1706,7 +1706,7 @@
</b-button>
</span>
</div>
<b-container v-show="caseStudyNotesByQuestion.length">
<b-container v-if="caseStudyNotesByQuestion.length">
<b-row v-if="questions[currentPage - 1].common_question_text" class="p-3">
<p>{{ questions[currentPage - 1].common_question_text }}</p>
</b-row>
Expand Down Expand Up @@ -1756,7 +1756,7 @@
<b-col v-if="showQuestion && showQtiJsonQuestionViewer">
<div class="card p-2">
<div class="d-flex d-inline-flex">
<div v-if="questions[currentPage-1]['qti_json'] && qtiJson">
<div v-if="questions[currentPage-1]['qti_json'] && getQtiJson()['qtiJson']">
<QtiJsonQuestionViewer
:key="`qti-json-${currentPage}-${cacheIndex}-${questions[currentPage - 1].student_response}`"
:qti-json="getQtiJson()['qtiJson']"
Expand Down Expand Up @@ -2013,7 +2013,7 @@
</span>Root Assessment
</h2>
</div>
<div v-if="showQuestion && !fetchingRemediation" id="question-to-view">
<div v-if="!caseStudyNotesByQuestion.length && showQuestion && !fetchingRemediation" id="question-to-view">
<div v-if="questions[currentPage-1].a11y_question_html && user.role === 3"
class="m-2"
v-html="formatA11YQuestionHtml(questions[currentPage - 1].a11y_question_html)"
Expand All @@ -2034,8 +2034,8 @@
:title="getIframeTitle()"
/>
</div>
<div v-show="questions[currentPage-1]['qti_json'] && qtiJson && showQtiJsonQuestionViewer">
<QtiJsonQuestionViewer
<div v-if="questions[currentPage-1]['qti_json'] && getQtiJson()['qtiJson'] && showQtiJsonQuestionViewer">
<QtiJsonQuestionViewer
:key="`qti-json-${currentPage}-${cacheIndex}-${questions[currentPage - 1].student_response}`"
:qti-json="getQtiJson()['qtiJson']"
:student-response="questions[currentPage - 1].student_response"
Expand Down Expand Up @@ -5150,7 +5150,9 @@ export default {
await this.canSubmit()
}
this.isLoading = false
this.showQtiJsonQuestionViewer = true
if (this.questions[this.currentPage-1].qti_json) {
this.showQtiJsonQuestionViewer = true
}
},
async updateReviewQuestionTime (reviewSessionId) {
try {
Expand Down

0 comments on commit 7977332

Please sign in to comment.