'student_profile_updates'

parent b0b8181c
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
<workItem from="1624999713528" duration="30000" /> <workItem from="1624999713528" duration="30000" />
<workItem from="1625431857632" duration="186000" /> <workItem from="1625431857632" duration="186000" />
<workItem from="1625432234857" duration="334000" /> <workItem from="1625432234857" duration="334000" />
<workItem from="1625686864504" duration="307000" />
</task> </task>
<servers /> <servers />
</component> </component>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<h5 class="text-dark mb-0">{{ student.first_name }} {{student.last_name}}</h5> <h5 class="text-dark mb-0">{{ student.first_name }} {{student.last_name}}</h5>
<p class="text-muted mb-0">{{ student.username }}</p> <p class="text-muted mb-0">{{ student.username }}</p>
<p class="text-muted mb-0">{{ student.email }}</p> <p class="text-muted mb-0">{{ student.email }}</p>
<p class="text-muted mb-0">{{ student.grade }}</p> <p class="text-muted mb-0">{{ student.grade }}</p>
<p class="text-muted mb-0">{{ student.contact }}</p> <p class="text-muted mb-0">{{ student.contact }}</p>
<p class="text-muted mb-0">Next Level Expectation: {{ nextLevel }}</p> <p class="text-muted mb-0">Next Level Expectation: {{ nextLevel }}</p>
</div> </div>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<div class="card-body"> <div class="card-body">
<p class="text-center text-dark mb-2" style="font-size: 4em;"><i class="fas fa-chart-area"></i></p> <p class="text-center text-dark mb-2" style="font-size: 4em;"><i class="fas fa-chart-area"></i></p>
<p class="text-center font-weight-bold text-dark">Works</p> <p class="text-center font-weight-bold text-dark">Works</p>
<p class="text-center text-muted">{{ works.grade }}</p> <p class="text-center text-muted">{{ works!= null ? works.grade : '' }}</p>
</div> </div>
</div> </div>
...@@ -65,11 +65,14 @@ ...@@ -65,11 +65,14 @@
<script> <script>
import Chart from 'chart.js'; import Chart from 'chart.js';
import ApiService from '../../services/api.service' import ApiService from '../../services/api.service'
import axios from 'axios'
export default { export default {
name: "StudentProfile", name: "StudentProfile",
data() { data() {
return { return {
student: {}, student: {
grade:null
},
attendance: null, attendance: null,
works: null, works: null,
chartData: [], chartData: [],
...@@ -87,14 +90,13 @@ ...@@ -87,14 +90,13 @@
}, },
methods: { methods: {
showStudentProgress() { showStudentProgress() {
ApiService.get('/students/prediction/' + this.$route.params.id) axios.get("http://127.0.0.1:5000/prediction/"+ this.$route.params.id)
.then(({ .then(({data}) => {
data
}) => {
var ctx = document.getElementById('myChart'); var ctx = document.getElementById('myChart');
if (data.result != null) { if (data != null) {
let actual=[]; let predicted = []; let actual=[]; let predicted = []; let _labels = [];
data.result .forEach(element => { data.forEach((element,index) => {
_labels.push(index++);
actual.push(element.actual); actual.push(element.actual);
predicted.push(element.predicted); predicted.push(element.predicted);
}); });
...@@ -103,25 +105,17 @@ ...@@ -103,25 +105,17 @@
new Chart(ctx, { new Chart(ctx, {
type: 'line', type: 'line',
data: { data: {
labels: ['Case 1', 'Case 2', 'Case 3', 'Case 4', 'Case 5'], labels: _labels,
datasets: [{ datasets: [{
label: ['Actual'], label: ['Actual'],
data: actual, data: actual,
backgroundColor: [ backgroundColor: [
'rgba(255, 99, 132, 0.2)', 'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)', 'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
], ],
borderColor: [ borderColor: [
'rgba(255, 99, 132, 1)', 'rgba(255, 99, 132, 1)',
'rgba(54, 162, 235, 1)', 'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
], ],
borderWidth: 1 borderWidth: 1
}, },
...@@ -131,20 +125,10 @@ ...@@ -131,20 +125,10 @@
backgroundColor: [ backgroundColor: [
'rgba(54, 162, 235, 0.2)', 'rgba(54, 162, 235, 0.2)',
'rgba(255, 99, 132, 0.2)', 'rgba(255, 99, 132, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
], ],
borderColor: [ borderColor: [
'rgba(54, 162, 235, 1)', 'rgba(54, 162, 235, 1)',
'rgba(255, 99, 132, 1)', 'rgba(255, 99, 132, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
], ],
borderWidth: 1 borderWidth: 1
}] }]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment