Skip to content

Commit

Permalink
Merge pull request #33 from ucdavis/feature/CTS2
Browse files Browse the repository at this point in the history
Feature/cts2
  • Loading branch information
bsedwards authored Oct 22, 2024
2 parents 0f0ebfc + cf5b2ba commit 76bd9b6
Show file tree
Hide file tree
Showing 13 changed files with 318 additions and 43 deletions.
17 changes: 16 additions & 1 deletion VueApp/src/CTS/components/LevelSelect.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import type { Ref } from 'vue'
import type { Level } from '@/CTS/types'
import type { Level, MilestoneLevel } from '@/CTS/types'
import { ref, defineProps, defineEmits, watch } from 'vue'
import { useFetch } from '@/composables/ViperFetch'
Expand All @@ -15,6 +15,9 @@
levelId: {
type: Number
},
milestoneLevels: {
type: Array<MilestoneLevel>
}
})
const emit = defineEmits(["levelChange"])
Expand Down Expand Up @@ -71,6 +74,11 @@
:class="selectedLevel.levelId == level.levelId ? 'selectedLevel q-py-sm' : 'q-py-sm'"
@click="selectedLevel = level">
</q-btn>
<template v-if="milestoneLevels != undefined">
<div v-for="ml in milestoneLevels.filter(ml => ml.levelId == level.levelId)" class="q-px-sm">
{{ ml.description }}
</div>
</template>
</div>
</div>
<div class="q-mb-sm text-center lt-md">
Expand All @@ -87,6 +95,13 @@
{{level.order}}. {{level.levelName}}
</template>
</q-btn>
<template v-if="milestoneLevels != undefined">
<div v-for="ml in milestoneLevels.filter(ml => ml.levelId == level.levelId)"
v-if="selectedLevel.levelId == level.levelId"
class="q-px-sm q-mb-md">
{{ ml.description }}
</div>
</template>
</div>
</div>
</template>
Expand Down
73 changes: 73 additions & 0 deletions VueApp/src/CTS/pages/AssessmentCompetency.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<script setup lang="ts">
import { ref } from 'vue'
import type { Ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import type { Competency, Student, MilestoneLevel } from '@/CTS/types'
import StudentSelect from '@/components/StudentSelect.vue'
import LevelSelect from '@/CTS/components/LevelSelect.vue'
const route = useRoute()
const router = useRouter()
const competency = ref({ competencyId: 0, name: "Listens attentively and communicates professionally", number: "5.1." }) as Ref<Competency>
const serviceId = ref(0)
const clearStudent = ref(false)
const autoSelectedStudent = ref(route.query.studentId != null ? parseInt(route.query.studentId.toString()) : 0)
const selectedStudentId = ref(autoSelectedStudent)
const studentMilestone = ref({}) as Ref<any>
const submitErrors = ref()
const levelId = ref(0)
const clearLevel = ref(false)
const milestoneLevels = ref([
{ milestoneLevelId: 0, milestoneId: 0, levelId: 9, levelName: "Novice", levelOrder: 1, description: "Communicates primarily unidirectionally with limited active listening. Communicates well with scripted plan but may falter when confronted with unexpected variables in the workplace." },
{ milestoneLevelId: 0, milestoneId: 0, levelId: 10, levelName: "Advanced Beginner", levelOrder: 2, description: "Actively listens and fosters bidirectional communication in most situations." },
{ milestoneLevelId: 0, milestoneId: 0, levelId: 12, levelName: "Competent", levelOrder: 3, description: "Consistently communicates bidirectionally and professionally." },
{ milestoneLevelId: 0, milestoneId: 0, levelId: 13, levelName: "Proficient", levelOrder: 4, description: "Communicates with confidence and ease regardless of situation." },
]) as Ref<MilestoneLevel[]>
function submitMilestone() {
}
</script>
<template>
<h2>Competency Assessment</h2>
<div class="row justify-between items-center q-mb-lg">
<div class="col-12 col-md-6">
<h2 class="epa text-weight-regular">{{ competency.number }} {{ competency.name }}</h2>
</div>
<div class="col-12 col-md-6 text-right">
<StudentSelect @studentChange="(s : number) => selectedStudentId = s"
selectedFilter="All"
:clearStudent="clearStudent"
:borderless="false"
:outlined="true"
:autoSelectStudent="autoSelectedStudent" />
</div>
</div>
<q-form @submit="submitMilestone" v-bind="studentMilestone" v-show="selectedStudentId > 0">
<div class="bg-red-5 text-white q-pa-sm rounded q-mb-md" v-if="submitErrors?.message?.length > 0">
{{submitErrors.message}}
Please make sure you have selected a service, EPA, student, and a level on the entrustment scale.
</div>
<LevelSelect levelType="milestone"
@levelChange="(selectedLevelId : number) => levelId = selectedLevelId"
:clearLevel="clearLevel"
:milestoneLevels="milestoneLevels"/>
<div class="row">
<div class="col-12 q-mx-sm">
<q-input type="textarea" outlined dense v-model="studentMilestone.comment" class="q-mb-md"
label="Comments: What should the student keep doing? How can they improve performance?"></q-input>
</div>
</div>
<div class="column">
<q-btn no-caps
label="Submit Milestone"
type="submit"
padding="sm xl"
color="primary"
size="md"
class="self-center"></q-btn>
</div>
</q-form>
</template>
48 changes: 31 additions & 17 deletions VueApp/src/CTS/pages/AssessmentEpa.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
//assessment data
const studentEpa = ref({}) as Ref<any>
const success = ref(false)
const submitErrors = ref({}) as Ref<any>
const submitErrors = ref(false)
const commentValidationMessage = ref('')
//urls
const baseUrl = inject('apiURL') + "cts/"
Expand All @@ -45,18 +46,30 @@
studentEpa.value.serviceId = serviceId.value
studentEpa.value.levelId = levelId.value
const { post } = useFetch()
const r = await post(baseUrl + "assessments/epa", studentEpa.value)
if (!r.success) {
submitErrors.value = r.errors
commentValidationMessage.value = ''
submitErrors.value = false
if (studentEpa.value.comment == undefined || studentEpa.value.comment.length < 5) {
commentValidationMessage.value = 'Please describe what the student should keep doing and how they can improve performance.'
submitErrors.value = true
}
else if (studentEpa.value.levelId == undefined) {
submitErrors.value = true
}
else {
clearStudent.value = true
clearLevel.value = true
selectedStudentId.value = 0
studentEpa.value.levelId = ""
studentEpa.value.comment = ""
success.value = true
const { post } = useFetch()
const r = await post(baseUrl + "assessments/epa", studentEpa.value)
if (!r.success) {
submitErrors.value = true
}
else {
clearStudent.value = true
clearLevel.value = true
selectedStudentId.value = 0
studentEpa.value.levelId = ""
studentEpa.value.comment = ""
success.value = true
}
}
}
Expand Down Expand Up @@ -86,7 +99,7 @@
</div>

<!--Epa-->
<div class="col-12 col-md-6 col-lg-4">
<div class="col-12 col-md-6">
<q-select label="Select EPA" dense options-dense outlined v-model="epa"
option-label="name" option-value="epaId" :options="epas">
</q-select>
Expand Down Expand Up @@ -116,15 +129,15 @@
</div>
<!--Show form once student is selected-->
<q-form @submit="submitEpa" v-bind="studentEpa" v-show="selectedStudentId > 0">
<div class="bg-red-5 text-white q-pa-sm rounded q-mb-md" v-if="submitErrors?.message?.length > 0">
{{submitErrors.message}}
Please make sure you have selected a service, EPA, student, and a level on the entrustment scale.
<div class="bg-red-5 text-white q-pa-sm rounded q-mb-md" v-if="submitErrors">
Please make sure you have selected a service, EPA, student, a level on the entrustment scale, and entered a comment.
</div>
<LevelSelect levelType="epa"
@levelChange="(selectedLevelId : number) => levelId = selectedLevelId"
:clearLevel="clearLevel"/>
<q-input type="textarea" outlined dense v-model="studentEpa.comment" class="q-mb-md"
label="Comments: What should the student keep doing? How can they improve performance?"></q-input>
label="Comments: What should the student keep doing? How can they improve performance?"
:error="commentValidationMessage != ''" :error-message="commentValidationMessage"></q-input>
<div class="column">
<q-btn no-caps
label="Submit EPA"
Expand All @@ -143,7 +156,8 @@
<style scoped>
h2.epa {
font-weight: 400;
font-size: 2.0rem;
font-size: 1.3rem;
margin-bottom: 4px;
line-height: normal;
}
</style>
72 changes: 72 additions & 0 deletions VueApp/src/CTS/pages/CourseStudents.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<script setup lang="ts">
import { ref } from 'vue'
const student = ref("")
</script>
<template>
<h2>Students for VET430 Lab 1 Challenging Communication - Simulated Lab with Actors and Video</h2>

<h3>Add Student(s)</h3>
<div class="row q-mb-md">
<div class="col-12 col-md-6 col-lg-4">
<q-select dense options-dense outlined :options="['Student 1', 'Student 2']" v-model="student"></q-select>
</div>
</div>

<h3 class="q-mt-md">Logged in students</h3>
<div class="row">
<div class="col-12 col-md-8 col-lg-6">
<table cellspacing="0" cellpadding="3" width="100%">
<thead>
<tr>
<th>Assess Competency</th>
<th class="text-left">Student</th>
<th class="text-left">Time</th>
<th class="text-center">Manually Added</th>
<th class="text-left">Remove</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<q-btn dense flat icon="assignment" size="sm" color="primary" to="AssessmentCompetency?studentId=23631&sessionId="></q-btn>
</td>
<td>Montserrat Armero</td>
<td>10/16/24 2:29:01 PM</td>
<td class="text-center">
<q-icon name="check" color="primary" size="sm"></q-icon>
</td>
<td>
<q-btn dense icon="delete" color="red-5" flat size="sm"></q-btn>
</td>
</tr>
<tr>
<td>
<q-btn dense flat icon="assignment" size="sm" color="primary" to="AssessmentCompetency?studentId=34123&sessionId="></q-btn>
</td>
<td>Hailey Atwood</td>
<td>10/16/24 2:29:01 PM</td>
<td class="text-center">
<q-icon name="check" color="primary" size="sm"></q-icon>
</td>
<td>
<q-btn dense icon="delete" color="red-5" flat size="sm"></q-btn>
</td>
</tr>
<tr>
<td>
<q-btn dense flat icon="assignment" size="sm" color="primary" to="AssessmentCompetency?studentId=34158&sessionId="></q-btn>
</td>
<td>Xander Avila</td>
<td>10/16/24 2:29:01 PM</td>
<td class="text-center">
<q-icon name="check" color="primary" size="sm"></q-icon>
</td>
<td>
<q-btn dense icon="delete" color="red-5" flat size="sm"></q-btn>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</template>
2 changes: 1 addition & 1 deletion VueApp/src/CTS/pages/ManageBundles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
const loading = ref(false)
async function load() {
get(apiUrl + "cts/bundles").then(r => bundles.value = r.result)
get(apiUrl + "cts/bundles?milestone=false").then(r => bundles.value = r.result)
get(apiUrl + "cts/roles").then(r => roles.value = r.result)
}
Expand Down
Loading

0 comments on commit 76bd9b6

Please sign in to comment.