-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
247 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
:canvasUrl="canvasCourseUrl" | ||
:joinUrl="joinUrl" | ||
/> | ||
<NavBar title="Home" :user="user" :link="'/'" /> | ||
<NavBar :title="isCanvasChime ? null : 'Home'" :user="user" link="/" /> | ||
<ErrorDialog /> | ||
<div v-if="error" class="alert alert-warning" role="alert"> | ||
{{ error }} | ||
|
@@ -25,7 +25,7 @@ | |
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" data-toggle="tab" href="#pastQuestions" | ||
>Closed Questions</a | ||
>Answered Questions</a | ||
> | ||
</li> | ||
</ul> | ||
|
@@ -37,27 +37,53 @@ | |
class="tab-pane container active" | ||
aria-live="polite" | ||
> | ||
<div | ||
v-if="filteredSession.length < 1" | ||
key="none" | ||
class="text-center" | ||
> | ||
<h1>No Open Questions</h1> | ||
<div v-if="ltiLaunchWarning"> | ||
<h1 class="text-center"> | ||
Whoops! You Didn't Follow the Link in Canvas | ||
</h1> | ||
<p class="text-left"> | ||
This chime is linked to Canvas. To participate, join this | ||
chime by clicking the assignment link in your Canvas course. | ||
</p> | ||
|
||
<a class="btn btn-primary" :href="canvasCourseUrl"> | ||
Go to Canvas | ||
</a> | ||
<p class="mt-3"> | ||
<small class="text-muted"> | ||
If you believe this message is in error, you may use | ||
<a href="#" @click.prevent="forceLoad = true">this link</a> | ||
to force the chime to load. You may not recieve credit for | ||
your responses. Please contact your instructor or | ||
<a href="mailto:[email protected]" class="text-muted" | ||
>[email protected]</a | ||
>. | ||
</small> | ||
</p> | ||
</div> | ||
<transition-group v-if="filteredSession.length > 0" name="fade"> | ||
<ParticipantPrompt | ||
v-for="s in filteredSession" | ||
:key="s.id" | ||
:session="s" | ||
:chime="chime" | ||
:responses="responses" | ||
@updateResponse="updateResponse" | ||
/> | ||
</transition-group> | ||
<template v-else> | ||
<div | ||
v-if="filteredSession.length < 1" | ||
key="none" | ||
class="text-center" | ||
> | ||
<h1>No Open Questions</h1> | ||
</div> | ||
<transition-group v-if="filteredSession.length > 0" name="fade"> | ||
<ParticipantPrompt | ||
v-for="s in filteredSession" | ||
:key="s.id" | ||
:session="s" | ||
:chime="chime" | ||
:responses="responses" | ||
@updateResponse="updateResponse" | ||
/> | ||
</transition-group> | ||
</template> | ||
</div> | ||
<div id="pastQuestions" class="tab-pane container"> | ||
<div v-if="responses.length < 1" class="text-center"> | ||
<h1>No Closed Questions</h1> | ||
<h1>No Answered Questions</h1> | ||
</div> | ||
<Response | ||
v-else | ||
|
@@ -68,7 +94,7 @@ | |
/> | ||
</div> | ||
</div> | ||
<p class="text-center m-0"> | ||
<p class="text-center m-0" v-if="!ltiLaunchWarning"> | ||
<small v-if="chime.lti_course_title" class="text-muted" | ||
>Not seeing the prompts you're looking for? Make sure you've | ||
followed the correct assignment link from Canvas. | ||
|
@@ -91,6 +117,9 @@ | |
.nav-item { | ||
width: 50%; | ||
} | ||
.container { | ||
margin-top: 1em; | ||
} | ||
</style> | ||
<script> | ||
import get from "lodash/get"; | ||
|
@@ -102,6 +131,7 @@ import ViewModeNotice from "./ViewModeNotice.vue"; | |
import { | ||
selectCanvasCourseUrl, | ||
selectJoinUrl, | ||
selectIsCanvasChime, | ||
} from "../../helpers/chimeSelectors.js"; | ||
export default { | ||
|
@@ -121,6 +151,7 @@ export default { | |
error: null, | ||
timeout: null, | ||
loadTime: null, | ||
forceLoad: false, | ||
}; | ||
}, | ||
computed: { | ||
|
@@ -130,6 +161,9 @@ export default { | |
joinUrl() { | ||
return selectJoinUrl(this.chime); | ||
}, | ||
isCanvasChime() { | ||
return selectIsCanvasChime(this.chime); | ||
}, | ||
inParticipantView() { | ||
const viewMode = get(this, "$route.query.viewMode", null); | ||
if (!viewMode) return false; | ||
|
@@ -154,6 +188,17 @@ export default { | |
return [...this.responses].sort(compare); | ||
}, | ||
ltiLaunchWarning: function () { | ||
if ( | ||
!this.forceLoad && | ||
!this.inParticipantView && | ||
!window.lti_launch && | ||
this.isCanvasChime | ||
) { | ||
return true; | ||
} | ||
return false; | ||
}, | ||
}, | ||
mounted: function () { | ||
this.loadChime(); | ||
|
@@ -241,12 +286,15 @@ export default { | |
); | ||
console.log("error getting chime:", err.response); | ||
} | ||
}) | ||
.then(() => { | ||
return axios | ||
.get("/api/chime/" + this.chimeId + "/responses") | ||
.then((res) => { | ||
console.log("debug", "Response:", res); | ||
this.responses = res.data; | ||
}); | ||
}); | ||
axios.get("/api/chime/" + this.chimeId + "/responses").then((res) => { | ||
console.log("debug", "Response:", res); | ||
this.responses = res.data; | ||
}); | ||
}, | ||
}, | ||
}; | ||
|
Oops, something went wrong.