Skip to content

Commit

Permalink
Improve handling of missing activity data
Browse files Browse the repository at this point in the history
  • Loading branch information
thaddeusm committed Nov 24, 2019
1 parent c628e05 commit 107dc49
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/views/Student.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@
<p class="response-text" v-else-if="session.responses.response.choice">
{{ session.responses.response.choice }}
</p>
<p class="response-text" v-else-if="session.activity.content.assignments[parseInt(session.responses.response.assignment)] == undefined">
(Click the button below to review more information.)
</p>
<p class="response-text" v-else-if="session.responses.response.assignment !== undefined && session.activity.content.assignments[parseInt(session.responses.response.assignment)].resourceType == 'text'">
{{ session.activity.content.assignments[parseInt(session.responses.response.assignment)].resourceData }}
</p>
Expand Down Expand Up @@ -433,6 +436,7 @@ export default {
getActivityRecords() {
db.sortThings('activitySessions', {chart: this.student.class}, {'date._d': -1})
.then((results) => {
if (results.length > 0) {
let studentResults = []
Expand All @@ -445,9 +449,9 @@ export default {
let respondent = result.responses[j].respondent.id
if (respondent == this.student._id) {
studentResults.push(result)
result.responses = result.responses[j]
break
let record = {...result}
record.responses = result.responses[j]
studentResults.push(record)
}
}
}
Expand Down

0 comments on commit 107dc49

Please sign in to comment.