Skip to content

Commit

Permalink
Merge branch 'release/1.3.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
cmcfadden committed Jan 30, 2022
2 parents bdc5687 + 77318e6 commit c6bb965
Show file tree
Hide file tree
Showing 10 changed files with 247 additions and 65 deletions.
1 change: 1 addition & 0 deletions app/Http/Controllers/LTIHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function launch() {

$tool = new ChimeToolProvider();
$tool->handleRequest();
session(['lti_launch' => true]);
$launchDomain = $tool->resourceLink->getSetting("custom_canvas_api_domain");
if(!\App::environment('local') && !in_array($launchDomain, $this->allowedDomains)) {
abort(401, 'LTI Launch from an invalid domain');
Expand Down
12 changes: 11 additions & 1 deletion docs/canvas.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ChimeIn needs to be enabled in your Canvas course. This needs to be done once pe

Some instructions will be presented. **You'll need to copy and paste two values** - the "consumer key" and "secret key". It might be helpful to copy these to a temporary text document. Once it's been enabled, you can begin adding ChimeIn assignments.

**Important**: it can take a few minutes for new apps to show up within the Canvas "External Tools" list.
**Important**: it can take a few minutes for new apps to show up within the Canvas "External Tools" list. **Do not try to add ChimeIn a second time.**

This screencast shows the process.

Expand Down Expand Up @@ -64,3 +64,13 @@ ChimeIn is most often used to check engagement or collect feedback on a topic, r
If you've cloned a Canvas course from a previous semester, and would like to re-use your ChimeIn questions, simply click on one of your ChimeIn assignments. ChimeIn will ask if you'd like to import the questions and folders from a previous Chime.

We recommend click through each of your ChimeIn assignments from Canvas to ensure they're linked correctly, but that should generally happen automatically.

## Drop Lowest Canvas Chime Assignments from Grades

It's common to use ChimeIn with Canvas to track participation in the gradebook. In some cases, you might want to set up Canvas to allow students to miss a certain number of Chimes before it impacts their grades.

You can use [Canvas assignment groups](https://community.canvaslms.com/t5/Instructor-Guide/How-do-I-add-an-assignment-group-in-a-course/ta-p/970) to group all your chime assignments together, and then [create a rule to drop the lowest X chimes](https://community.canvaslms.com/t5/Instructor-Guide/How-do-I-create-rules-for-an-assignment-group/ta-p/848).

Here's a demo:

<iframe width="100%" height="420" src="https://www.youtube.com/embed/RXczYrezKmY" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production",
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs",
"docs:publish": "npm run docs:build && gh-pages -d docs/.vuepress/dist",
"cypress": "cypress open --env failOnSnapshotDiff=false",
"cypress:headless": "cypress run --browser chrome",
"jest": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",
Expand Down Expand Up @@ -37,6 +39,7 @@
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-jest": "^25.2.2",
"eslint-plugin-vue": "^7.20.0",
"gh-pages": "^3.2.3",
"husky": "^7.0.4",
"jest": "^27.3.0",
"laravel-mix": "^6.0.34",
Expand Down
1 change: 1 addition & 0 deletions resources/assets/js/components/Chip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default {
--color-inverse: #fff;
display: inline-flex;
flex-wrap: nowrap;
white-space: nowrap;
align-items: center;
color: var(--color);
border: 1px solid var(--color);
Expand Down
132 changes: 101 additions & 31 deletions resources/assets/js/views/FolderPage/QuestionCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,31 @@
:icon="showMoveIcon ? 'drag_handle' : ''"
iconClass="handle"
>
<footer class="question-card__footer">
<span class="question-card__question-type">{{
questionTypeToString
}}</span>
<header class="question-card__header">
<h2 class="question-card__question-type">
<router-link
:to="`/chime/${folder.chime_id}/folder/${folder.id}/present/${orderedQuestionIndex}`"
>
{{ questionTypeToString }}
</router-link>
</h2>
<Chip :color="totalResponses ? 'primary' : 'muted'" :solid="true"
>{{ totalResponses }} {{ "Response" | pluralize(totalResponses) }}</Chip
>
</footer>
<div class="flow-text question_list_text" v-html="question.text" />
</header>

<component
v-if="hasSpecializedQuestionDisplay(questionType)"
class="question-card__choice-display"
:is="`${questionType}_display`"
:question="question"
/>
<router-link
:to="`/chime/${folder.chime_id}/folder/${folder.id}/present/${orderedQuestionIndex}`"
>
<div class="flow-text question_list_text" v-html="question.text" />

<component
v-if="hasSpecializedQuestionDisplay(questionType)"
class="question-card__choice-display"
:is="`${questionType}_display`"
:question="question"
/>
</router-link>

<QuestionForm
v-if="showEdit"
Expand All @@ -42,25 +51,49 @@
{{ isOpen ? "Open" : "Closed" }}
</Toggle>

<CardActionButton
data-cy="edit-question-button"
icon="edit"
@click="handleEditClick"
>Edit</CardActionButton
>
<div class="dropdown question-card__dropdown">
<button
type="button"
data-toggle="dropdown"
aria-expanded="false"
class="question-card__dropdown-button"
>
<i class="material-icons">more_vert</i>
</button>
<ul
class="dropdown-menu dropdown-menu-right question-card__dropdown-list"
aria-labelledby="moreOptionsDropdownButton"
>
<li>
<CardActionButton
class="dropdown-item question-card__action-button"
data-cy="edit-question-button"
icon="edit"
@click="handleEditClick"
>Edit</CardActionButton
>
</li>

<CardActionButton
data-cy="present-question-button"
icon="play_circle_outline"
:to="`/chime/${folder.chime_id}/folder/${folder.id}/present/${orderedQuestionIndex}`"
>Present</CardActionButton
>
<CardActionButton
data-cy="delete-question-button"
icon="clear"
@click="handleDeleteClick"
>Delete</CardActionButton
>
<li>
<CardActionButton
class="dropdown-item question-card__action-button"
data-cy="present-question-button"
icon="play_circle_outline"
:to="`/chime/${folder.chime_id}/folder/${folder.id}/present/${orderedQuestionIndex}`"
>Present</CardActionButton
>
</li>
<li>
<CardActionButton
class="dropdown-item question-card__action-button"
data-cy="delete-question-button"
icon="clear"
@click="handleDeleteClick"
>Delete</CardActionButton
>
</li>
</ul>
</div>
</template>
</Card>
</template>
Expand Down Expand Up @@ -201,10 +234,12 @@ export default {
font-size: 0.8rem;
font-weight: bold;
}
.question-card__footer {
.question-card__header {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: baseline;
gap: 0.25rem;
margin-bottom: 1rem;
}
Expand All @@ -229,6 +264,41 @@ export default {
.total-responses__number {
font-size: 3rem;
}
.question-card .question-card__action-button {
flex-direction: row;
justify-content: left;
gap: 0.5rem;
padding: 0.25rem 1rem;
}
.question-card__dropdown-button {
display: block;
border: 0;
background: transparent;
padding: 0.8rem 0;
}
@media (min-width: 48rem) {
.question-card__dropdown .dropdown-menu {
display: flex;
position: initial;
z-index: initial;
float: initial;
min-width: initial;
padding: 0;
margin: 0;
background-color: transparent;
border: 0;
}
.question-card .question-card__action-button {
flex-direction: column;
gap: 0;
padding: 0.75rem;
}
.question-card__dropdown-button {
display: none;
}
}
</style>
<style>
.question-card__choice-display.mult-choice-display {
Expand Down
98 changes: 73 additions & 25 deletions resources/assets/js/views/ParticipantPage/ParticipantPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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>
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -91,6 +117,9 @@
.nav-item {
width: 50%;
}
.container {
margin-top: 1em;
}
</style>
<script>
import get from "lodash/get";
Expand All @@ -102,6 +131,7 @@ import ViewModeNotice from "./ViewModeNotice.vue";
import {
selectCanvasCourseUrl,
selectJoinUrl,
selectIsCanvasChime,
} from "../../helpers/chimeSelectors.js";
export default {
Expand All @@ -121,6 +151,7 @@ export default {
error: null,
timeout: null,
loadTime: null,
forceLoad: false,
};
},
computed: {
Expand All @@ -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;
Expand All @@ -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();
Expand Down Expand Up @@ -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;
});
},
},
};
Expand Down
Loading

0 comments on commit c6bb965

Please sign in to comment.