-
Notifications
You must be signed in to change notification settings - Fork 983
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AC-7 module feature requests (#1634)
* Changed Template Files: Co authored by Abhyuday Singh and Arghadeep Bosu * Configured Backend: Added new feature in Examination module and modified the Student_grades table in online_cms module * added migration file for the attributes changed in online_cms module * added dean actor and gave verification powers only to dean and not to acad admin * Examination Module completed: Dean academic added, resubmission power can be given to faculty by dean and acadadmin can only read and verify the data, revoked him of write access --------- Co-authored-by: Arghadeep Bosu <arghadeepbosu565@gmail.com>
1 parent
4b11e9e
commit a6438bc
Showing
18 changed files
with
1,244 additions
and
164 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
Large diffs are not rendered by default.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
FusionIIIT/applications/online_cms/migrations/0002_auto_20241021_0331.py
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,37 @@ | ||
# Generated by Django 3.1.5 on 2024-10-21 03:31 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('online_cms', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='student_grades', | ||
name='total_marks', | ||
), | ||
migrations.AddField( | ||
model_name='student_grades', | ||
name='remarks', | ||
field=models.CharField(max_length=500, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='student_grades', | ||
name='verified', | ||
field=models.BooleanField(default=False), | ||
), | ||
migrations.AlterField( | ||
model_name='attendance', | ||
name='present', | ||
field=models.IntegerField(default=0), | ||
), | ||
migrations.AlterField( | ||
model_name='gradingscheme', | ||
name='type_of_evaluation', | ||
field=models.CharField(max_length=100), | ||
), | ||
] |
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
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
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,70 @@ | ||
{% extends 'examination/base.html' %} | ||
|
||
{% block sidetabmenu %} | ||
<style> | ||
/* Your existing CSS styles */ | ||
|
||
.sortable-icon { | ||
margin-left: 5px; | ||
font-size: 1.2em; | ||
color: blue; | ||
} | ||
|
||
.sortable-icon + .sortable-icon { | ||
margin-left: 2px; | ||
} | ||
/* Your existing CSS styles */ | ||
|
||
.sortable-icon { | ||
margin-left: 5px; | ||
font-size: 1.2em; | ||
color: blue; | ||
display: inline-block; | ||
} | ||
|
||
th { | ||
white-space: nowrap; /* Prevent line breaks */ | ||
} | ||
|
||
th:first-child .sortable-icon { | ||
margin-left: 0; /* Remove left margin for the first icon */ | ||
} | ||
|
||
.sortable-icon + .sortable-icon { | ||
margin-left: 2px; | ||
} | ||
|
||
</style> | ||
<div class="ui medium fluid vertical pointing menu" style="max-width: 320px;"> | ||
<a class="active item" href="{% url 'examination:submitGrades' %}"></B>Submit</B> | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
{% comment %} <a class="item" href="{% url 'examination:updateGrades' %}">Verify | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
<a class="item" href="{% url 'examination:authenticate' %}">Authenticate Course | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
|
||
|
||
<a class="item" href="{% url 'examination:announcement' %}">Announcement | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
<a class="item" href="{% url 'examination:generate_transcript_form' %}">Generate Transcript | ||
<i class="right floated chevron right icon"></i> | ||
</a> {% endcomment %} | ||
</div> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="ui segment"> | ||
<div class="ui message"> | ||
<div class="header"> | ||
{{message}} | ||
</div> | ||
|
||
<p>Please check back later or contact support for assistance.</p> | ||
</div> | ||
</div> | ||
|
||
{% endblock %} |
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,113 @@ | ||
{% extends 'examination/base.html' %} | ||
|
||
{% block sidetabmenu %} | ||
<div class="ui medium fluid vertical pointing menu" style="max-width: 320px;"> | ||
{% comment %} | ||
<a class="item" href="{% url 'examination:submitGrades' %}">Submit | ||
<i class="right floated chevron right icon"></i> | ||
</a> {% endcomment %} | ||
<a class="active item" href="{% url 'examination:updateGrades' %}"><B>Verify</B> | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
{% comment %} <a class="item" href="{% url 'examination:authenticate' %}">Authenticate Course | ||
<i class="right floated chevron right icon"></i> | ||
</a> {% endcomment %} | ||
|
||
{% comment %} <a class="item" href="{% url 'examination:announcement' %}">Announcement | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
<a class="item" href="{% url 'examination:generate_transcript_form' %}">Generate Transcript | ||
<i class="right floated chevron right icon"></i> | ||
</a> {% endcomment %} | ||
</div> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<h1>Update Result</h1> | ||
<br /> | ||
|
||
<div style="display: flex; flex-direction: column; gap: 30px;"> | ||
<div style="display: flex; flex-direction: row; gap: 50px;"> | ||
<div style="display: flex; flex-direction: row; gap: 10px;"> | ||
<div style="margin-top: 8px;"> | ||
<label>Course</label> | ||
</div> | ||
<div class="ui selection dropdown" id="course-dropdown"> | ||
<input type="hidden" name="gender"> | ||
<i class="dropdown icon"></i> | ||
<div class="default text">Select Item</div> | ||
<div class="menu"> | ||
{% for course in courses_info %} | ||
<div class="item" data-value="{{ course.id }}"> {{ course.code }}- {{ course.name }} -{{ course.version }}</div> | ||
{% empty %} | ||
<div class="item">No Courses Available</div> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</div> | ||
<div style="display: flex; flex-direction: row; gap: 10px;"> | ||
<div style="margin-top: 8px;"> | ||
<label>Semester</label> | ||
</div> | ||
<div class="ui selection dropdown" id="semester-dropdown"> | ||
<input type="hidden" name="gender"> | ||
<i class="dropdown icon"></i> | ||
<div class="default text">Select Item</div> | ||
<div class="menu"> | ||
<div class="item" data-value="1">1</div> | ||
<div class="item" data-value="2">2</div> | ||
<div class="item" data-value="3">3</div> | ||
<div class="item" data-value="4">4</div> | ||
<div class="item" data-value="5">5</div> | ||
<div class="item" data-value="6">6</div> | ||
<div class="item" data-value="7">7</div> | ||
<div class="item" data-value="8">8</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div style="display: flex; flex-direction: row; gap: 10px;"> | ||
<div style="margin-top: 8px;"> | ||
<label>Batch</label> | ||
</div> | ||
<div class="ui selection dropdown" id="batch-dropdown"> | ||
<input type="hidden" name="gender"> | ||
<i class="dropdown icon"></i> | ||
<div class="default text">Select Item</div> | ||
<div class="menu"> | ||
{% for unique_batch_id in unique_batch_ids %} | ||
<div class="item" data-value="{{ unique_batch_id.batch }}">{{unique_batch_id.batch }}</div> | ||
{% empty %} | ||
<div class="item">No Batch</div> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div style="display: flex; flex-direction: row; gap: 50px; margin-left: 10px; "> | ||
|
||
<button class="ui primary button" onclick="search()">Search</button> | ||
|
||
</div> | ||
|
||
</div> | ||
<script> | ||
function search() { | ||
// Get selected course and semester values | ||
var selectedCourse = $('#course-dropdown .menu .item.active').attr('data-value'); | ||
var selectedSemester = $('#semester-dropdown .menu .item.active').attr('data-value'); | ||
var selectedBatch = $('#batch-dropdown .menu .item.active').attr('data-value'); | ||
|
||
// Check if both course and semester are selected | ||
if (selectedCourse && selectedSemester&&selectedBatch) { | ||
// Redirect to the new page with parameters | ||
window.location.href = `/examination/updateEntergradesDean?course=${selectedCourse}&semester=${selectedSemester}&batch=${selectedBatch}`; | ||
} else { | ||
alert('Please select both course and semester.'); | ||
} | ||
} | ||
</script> | ||
|
||
|
||
{% endblock %} | ||
|
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,155 @@ | ||
{% extends 'examination/base.html' %} | ||
|
||
{% block sidetabmenu %} | ||
<div class="ui medium fluid vertical pointing menu" style="max-width: 320px;"> | ||
<a class="active item" href="{% url 'examination:submitGrades' %}"><B>Submit</B> | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
{% comment %} <a class="item" href="{% url 'examination:updateGrades' %}">Verify | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
<a class="item" href="{% url 'examination:authenticate' %}">Authenticate Course | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
<a class="item" href="{% url 'examination:announcement' %}">Announcement | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
<a class="item" href="{% url 'examination:generate_transcript_form' %}">Generate Transcript | ||
<i class="right floated chevron right icon"></i> | ||
</a> {% endcomment %} | ||
</div> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<h1>Submit Results</h1> | ||
<br /> | ||
|
||
<div style="display: flex; flex-direction: column; gap: 30px;"> | ||
<div style="display: flex; flex-direction: row; gap: 50px;"> | ||
<div style="display: flex; flex-direction: row; gap: 10px;"> | ||
<div style="margin-top: 8px;"> | ||
<label>Course</label> | ||
</div> | ||
<div class="ui selection dropdown" id="course-dropdown"> | ||
<input type="hidden" name="course"> | ||
<i class="dropdown icon"></i> | ||
<div class="default text">Select Course</div> | ||
<div class="menu"> | ||
{% for course in courses_info %} | ||
<div class="item" data-value="{{ course.id }}"> {{ course.code }} - {{ course.name }} - {{ course.version }}</div> | ||
{% empty %} | ||
<div class="item">No Courses Available</div> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</div> | ||
<div style="display: flex; flex-direction: row; gap: 10px;"> | ||
<div style="margin-top: 8px;"> | ||
<label>Academic Year</label> | ||
</div> | ||
<div class="ui selection dropdown" id="year-dropdown"> | ||
<input type="hidden" name="year"> | ||
<i class="dropdown icon"></i> | ||
<div class="default text">Select Year</div> | ||
<div class="menu"> | ||
{% for working_year in working_years %} | ||
<div class="item" data-value="{{ working_year.working_year }}"> {{ working_year.working_year }}</div> | ||
{% empty %} | ||
<div class="item">No Years Available</div> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</div> | ||
{% comment %} <div style="display: flex; flex-direction: row; gap: 10px;"> | ||
<div style="margin-top: 8px;"> | ||
<label>Semester</label> | ||
</div> | ||
<div class="ui selection dropdown" id="semester-dropdown"> | ||
<input type="hidden" name="semester"> | ||
<i class="dropdown icon"></i> | ||
<div class="default text">Select Semester</div> | ||
<div class="menu"> | ||
<div class="item" data-value=1>1</div> | ||
<div class="item" data-value=2>2</div> | ||
<div class="item" data-value=3>3</div> | ||
<div class="item" data-value=4>4</div> | ||
<div class="item" data-value=5>5</div> | ||
<div class="item" data-value=6>6</div> | ||
<div class="item" data-value=7>7</div> | ||
<div class="item" data-value=8>8</div> | ||
</div> | ||
</div> | ||
</div> {% endcomment %} | ||
</div> | ||
|
||
<div style="display: flex; flex-direction: row; gap: 50px; margin-left: 10px;" id="upload-section"> | ||
<input type="file" id="csv-file" accept=".csv"> | ||
<button class="ui primary button" onclick="upload()">Upload Results</button> | ||
</div> | ||
<div style="display: flex; flex-direction: row; gap: 50px; margin-left: 10px; "> | ||
|
||
<button class="ui primary button" onclick="dwn_temp()">Download Template</button> | ||
|
||
</div> | ||
</div> | ||
|
||
<script> | ||
function upload() { | ||
|
||
let selectedCourse = $('#course-dropdown .menu .item.active').attr('data-value'); | ||
let selectedYear = $('#year-dropdown .menu .item.active').attr('data-value'); | ||
// let selectedSemester = $('#semester-dropdown .menu .item.active').attr('data-value'); | ||
|
||
|
||
let fileInput = document.getElementById('csv-file'); | ||
let file = fileInput.files[0]; | ||
console.log(selectedCourse,selectedYear,file); | ||
|
||
if (!selectedCourse || !selectedYear || !file) { | ||
alert('Please select course, year, and upload a CSV file.'); | ||
return; | ||
} | ||
|
||
if (!confirm('Are you sure you want to submit?')) { | ||
// If the user clicks "Cancel", do not proceed | ||
return; | ||
} | ||
var formData = new FormData(); | ||
formData.append('course_id', selectedCourse); | ||
formData.append('academic_year', selectedYear); | ||
//formData.append('semester', selectedSemester); | ||
formData.append('csv_file', file); | ||
|
||
|
||
$.ajax({ | ||
url: '/examination/upload_grades_prof/', | ||
type: 'POST', | ||
data: formData, | ||
processData: false, | ||
contentType: false, | ||
success: function(response) { | ||
if (response.redirect_url) { | ||
alert(response.message) | ||
window.location.href = response.redirect_url; | ||
} | ||
}, | ||
error: function(xhr, status, error) { | ||
if (xhr.responseJSON && xhr.responseJSON.redirect_url) { | ||
// Redirect the user to the provided URL | ||
window.location.href = xhr.responseJSON.redirect_url; | ||
} else { | ||
|
||
var errorMessage = xhr.responseJSON ? xhr.responseJSON.error : 'An unexpected error occurred.'; | ||
alert(errorMessage); | ||
} | ||
} | ||
}); | ||
|
||
|
||
} | ||
function dwn_temp(){ | ||
window.location.href = '/examination/download_template'; | ||
} | ||
</script> | ||
|
||
{% endblock %} |
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
226 changes: 226 additions & 0 deletions
226
FusionIIIT/templates/examination/updateEntergradesDean.html
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,226 @@ | ||
{% extends 'examination/base.html' %} | ||
|
||
{% block sidetabmenu %} | ||
<style> | ||
/* Your existing CSS styles */ | ||
|
||
.sortable-icon { | ||
margin-left: 5px; | ||
font-size: 1.2em; | ||
color: blue; | ||
} | ||
|
||
.sortable-icon + .sortable-icon { | ||
margin-left: 2px; | ||
} | ||
/* Your existing CSS styles */ | ||
|
||
.sortable-icon { | ||
margin-left: 5px; | ||
font-size: 1.2em; | ||
color: blue; | ||
display: inline-block; | ||
} | ||
|
||
th { | ||
white-space: nowrap; /* Prevent line breaks */ | ||
} | ||
|
||
th:first-child .sortable-icon { | ||
margin-left: 0; /* Remove left margin for the first icon */ | ||
} | ||
|
||
.sortable-icon + .sortable-icon { | ||
margin-left: 2px; | ||
} | ||
|
||
</style> | ||
<div class="ui medium fluid vertical pointing menu" style="max-width: 320px;"> | ||
{% if 'acadadmin' == request.user.extrainfo.user_type %} | ||
<a class="item" href="{% url 'examination:submitGrades' %}">Submit | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
{% endif %} | ||
<a class="item" href="{% url 'examination:updateGrades' %}">Verify | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
{% comment %} <a class="item" href="{% url 'examination:authenticate' %}">Authenticate Course | ||
<i class="right floated chevron right icon"></i> | ||
</a> {% endcomment %} | ||
|
||
{% if 'acadadmin' == request.user.extrainfo.user_type %} | ||
<a class="item" href="{% url 'examination:announcement' %}">Announcement | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
<a class="item" href="{% url 'examination:generate_transcript_form' %}">Generate Transcript | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
{% endif %} | ||
</div> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="ui segment"> | ||
<h1 class="ui header">VERIFY STUDENT MARKS</h1> | ||
{% if registrations %} | ||
<form method="post" action="{% url 'examination:moderate_student_grades' %}"> | ||
{% csrf_token %} | ||
<div class="ui celled table" id="gradesTable"> | ||
<table class="ui selectable striped table"> | ||
<thead> | ||
<tr> | ||
<th> | ||
Student ID | ||
<i class="arrow up icon sortable-icon"></i> | ||
<i class="arrow down icon sortable-icon"></i> | ||
</th> | ||
<th>batch</th> | ||
<th>Course ID</th> | ||
<th>semester </th> | ||
<th> | ||
Remarks | ||
</th> | ||
<th>Grade</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for registration in registrations %} | ||
<tr> | ||
<td>{{ registration.roll_no }}</td> | ||
<td>{{ registration.batch }}</td> | ||
<td>{{ registration.course_id }}</td> | ||
<td>{{ registration.semester }}</td> | ||
<td>{{ registration.remarks }}</td> | ||
|
||
<td> | ||
<input type="hidden" name="student_ids[]" value="{{ registration.roll_no}}"> | ||
<input type="hidden" name="semester_ids[]" value="{{ registration.semester }}"> | ||
<input type="hidden" name="course_ids[]" value="{{ registration.course_id.id }}"> | ||
<input type="text" name="grades[]" value="{{ registration.grade }}"> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
<div class="ui form field"> | ||
<label for="allow_resubmission">Allow Resubmission:</label> | ||
<select name="allow_resubmission" id="allow_resubmission" class="ui dropdown"> | ||
<option value="NO">NO</option> | ||
<option value="YES">YES</option> | ||
</select> | ||
</div> | ||
{% comment %} <button class="ui primary button" type="submit">FINALISE Grades</button> {% endcomment %} | ||
<button class="ui primary button" id="finalize-grades" onclick="finalizeGrades()"> FINALISE Grades & Download Excel</button> | ||
|
||
</form> | ||
<div class="ui segment"> | ||
<canvas id="gradesChart" width="400" height="400"></canvas> | ||
</div> | ||
{% else %} | ||
<div class="ui message"> | ||
<div class="header"> | ||
NO STUDENTS REGISTERED IN THIS COURSE THIS SEMESTER | ||
</div> | ||
<p>Please check back later or contact support for assistance.</p> | ||
</div> | ||
{% endif %} | ||
</div> | ||
|
||
<!-- Include Chart.js library --> | ||
<script src="https://cdn.jsdelivr.net/npm/chart.js@3.9.1"></script> | ||
|
||
<!-- JavaScript code for generating the pie chart --> | ||
<script> | ||
document.addEventListener('DOMContentLoaded', function () { | ||
function updateChart() { | ||
var gradesData = []; | ||
var gradesLabels = []; | ||
var totalGrades = 0; | ||
var tableRows = document.querySelectorAll('tbody tr'); | ||
|
||
tableRows.forEach(function (row) { | ||
var grade = row.querySelector('input[name="grades[]"]').value; | ||
totalGrades++; | ||
if (gradesLabels.includes(grade)) { | ||
var index = gradesLabels.indexOf(grade); | ||
gradesData[index]++; | ||
} else { | ||
gradesLabels.push(grade); | ||
gradesData.push(1); | ||
} | ||
}); | ||
|
||
var percentages = gradesData.map(function (count) { | ||
return ((count / totalGrades) * 100).toFixed(2) + '%'; | ||
}); | ||
|
||
var ctx = document.getElementById('gradesChart').getContext('2d'); | ||
if (window.myChart) { | ||
window.myChart.destroy(); // Destroy previous chart instance | ||
} | ||
window.myChart = new Chart(ctx, { | ||
type: 'pie', | ||
data: { | ||
labels: gradesLabels, | ||
datasets: [{ | ||
label: 'Grades Distribution', | ||
data: gradesData, | ||
backgroundColor: [ | ||
'rgba(255, 99, 132, 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: [ | ||
'rgba(255, 99, 132, 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 | ||
}] | ||
}, | ||
options: { | ||
responsive: true, | ||
maintainAspectRatio: false, | ||
plugins: { | ||
tooltip: { | ||
callbacks: { | ||
label: function (context) { | ||
var label = context.label || ''; | ||
var value = context.raw || 0; | ||
var percentage = ((value / totalGrades) * 100).toFixed(2) + '%'; | ||
return label + ': ' + value + ' (' + percentage + ')'; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}); | ||
} | ||
|
||
// Initial chart setup | ||
updateChart(); | ||
|
||
// Update the chart when form input changes | ||
var inputs = document.querySelectorAll('input[name="grades[]"]'); | ||
inputs.forEach(function (input) { | ||
input.addEventListener('input', updateChart); | ||
}); | ||
}); | ||
|
||
function finalizeGrades() { | ||
// Submit the form | ||
document.querySelector('form').submit(); | ||
console.log("hyee") | ||
// Redirect to the URL that handles Excel download | ||
alert('Course verification Successful please refresh the page') | ||
window.location.href = "{% url 'examination:submit' %}"; | ||
} | ||
</script> | ||
{% endblock %} |