-
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.
Showing
31 changed files
with
3,119 additions
and
1,098 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
4 changes: 4 additions & 0 deletions
4
FusionIIIT/applications/globals/static/globals/js/jquery-3.0.0.min.js
Large diffs are not rendered by default.
Oops, something went wrong.
69 changes: 69 additions & 0 deletions
69
FusionIIIT/applications/globals/static/semantic/dist/components/semantic-ui-alerts.css
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,69 @@ | ||
.ui-alerts { | ||
position: fixed; | ||
/* width: 360px; */ | ||
z-index: 2060; | ||
padding: 23px; | ||
} | ||
|
||
.ui-alerts.center { | ||
top: 50%; | ||
left: 50%; | ||
margin-top: -100px; | ||
margin-left: -222px; | ||
} | ||
|
||
.ui-alerts.top-right{ | ||
top: 20px; | ||
right: 20px; | ||
} | ||
|
||
.ui-alerts.top-center{ | ||
top: 20px; | ||
margin-left: -222px; | ||
left: 50%; | ||
} | ||
|
||
.ui-alerts.top-left{ | ||
top: 20px; | ||
left: 20px; | ||
} | ||
|
||
.ui-alerts.bottom-right{ | ||
bottom: 0; | ||
right: 20px; | ||
} | ||
.ui-alerts.bottom-center{ | ||
bottom: 0; | ||
margin-left: -222px; | ||
left: 50%; | ||
} | ||
|
||
.ui-alerts.bottom-left{ | ||
bottom: 0; | ||
left: 20px; | ||
} | ||
|
||
.ui-alerts.ui-alerts > .message > .content > .header { | ||
padding-right: 13px; | ||
} | ||
|
||
@media (min-width:320px) { | ||
/* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ | ||
.ui-alerts.top-center{ | ||
margin-left: -163px; | ||
} | ||
} | ||
@media (min-width:480px) { | ||
/* smartphones, Android phones, landscape iPhone */ | ||
} | ||
@media (min-width:600px) { | ||
/* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ | ||
} | ||
@media (min-width:801px) { | ||
/* tablet, landscape iPad, lo-res laptops ands desktops */ } | ||
@media (min-width:1025px) { | ||
/* big landscape tablets, laptops, and desktops */ | ||
} | ||
@media (min-width:1281px) { | ||
/* hi-res laptops and desktops */ | ||
} |
93 changes: 93 additions & 0 deletions
93
FusionIIIT/applications/globals/static/semantic/dist/components/semantic-ui-alerts.js
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,93 @@ | ||
$.suiAlert = function (permanents) { | ||
var options = $.extend({ | ||
title: 'Semantic UI Alerts', | ||
description: 'semantic ui alerts library', | ||
// alert types 'info, success, error, warning' | ||
type: "error", | ||
time: 5, | ||
position: "top-right", | ||
icon: false, | ||
}, permanents); | ||
|
||
// set alert icon | ||
if (options.icon === false) { | ||
if (options.type == "info") { | ||
// announcement | ||
options.icon = "announcement"; | ||
} else if (options.type == "success") { | ||
// checkmark, checkmark box | ||
options.icon = "checkmark"; | ||
} else if (options.type == "error") { | ||
// ban, remove, remove circle | ||
options.icon = "remove"; | ||
} else if (options.type == "warning") { | ||
// warning sign, warning circle | ||
options.icon = "warning circle"; | ||
} | ||
} | ||
|
||
// set close animation | ||
var close_anim = "drop"; | ||
if (options.position == "top-right") { | ||
close_anim = "fly left"; | ||
} else if (options.position == "top-center") { | ||
close_anim = "fly down"; | ||
} else if (options.position == "top-left") { | ||
close_anim = "fly right"; | ||
} else if (options.position == "bottom-right") { | ||
close_anim = "fly left"; | ||
} else if (options.position == "bottom-center") { | ||
close_anim = "fly up"; | ||
} else if (options.position == "bottom-left") { | ||
close_anim = "fly right"; | ||
} | ||
|
||
// screen size check | ||
var alert_size = ''; | ||
var screen_width = $(window).width(); | ||
if (screen_width < 425) | ||
alert_size = 'mini'; | ||
|
||
var alerts_class = "ui-alerts." + options.position; | ||
if (!$('body > .' + alerts_class).length) { | ||
$('body').append('<div class="ui-alerts ' + options.position + '"></div>'); | ||
} | ||
|
||
var _alert = $('<div class="ui icon floating ' + alert_size + ' message ' + options.type + '" id="alert"> <i class="' + options.icon + ' icon"></i> <i class="close icon" id="alertclose"></i> <div class="content"> <div class="header">' + options.title + '</div> <p>' + options.description + '</p> </div> </div>'); | ||
$('.' + alerts_class).prepend(_alert); | ||
|
||
_alert.transition('pulse'); | ||
|
||
/** | ||
* Close the alert | ||
*/ | ||
$('#alertclose').on('click', function () { | ||
$(this).closest('#alert').transition({ | ||
animation: close_anim, | ||
onComplete: function () { | ||
_alert.remove(); | ||
} | ||
}); | ||
}); | ||
|
||
var timer = 0; | ||
$(_alert).mouseenter(function () { | ||
clearTimeout(timer); | ||
}).mouseleave(function () { | ||
alertHide(); | ||
}); | ||
|
||
alertHide(); | ||
|
||
function alertHide() { | ||
timer = setTimeout(function () { | ||
_alert.transition({ | ||
animation: close_anim, | ||
duration: '2s', | ||
onComplete: function () { | ||
_alert.remove(); | ||
} | ||
}); | ||
}, (options.time * 1000)); | ||
} | ||
}; |
1 change: 1 addition & 0 deletions
1
FusionIIIT/applications/globals/static/semantic/dist/components/semantic-ui-alerts.min.css
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
FusionIIIT/applications/globals/static/semantic/dist/components/semantic-ui-alerts.min.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,72 +1,86 @@ | ||
from django.conf import settings | ||
from django.conf.urls.static import static | ||
from django.conf.urls import url | ||
|
||
from . import views | ||
app_name = 'online_cms' | ||
app_name = 'online_cms' | ||
|
||
urlpatterns = [ | ||
|
||
url(r'^$', views.viewcourses, name='viewcourses'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/$', views.course, name='course'), | ||
# url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/edit_marks$', views.edit_marks, name='edit_marks'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/get_exam_data$', views.get_exam_data, name='get_exam_data'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/forum$', views.forum, | ||
url(r'^(?P<course_code>[A-Z0-9]+)/(?P<version>[\d.]+)/$', views.course, name='course'), | ||
# url(r'^(?P<course_code>[A-Z0-9]+)/edit_marks$', views.edit_marks, name='edit_marks'), | ||
url(r'^(?P<course_code>[A-Z0-9]+)/(?P<version>[\d.]+)/get_exam_data$', views.get_exam_data, name='get_exam_data'), | ||
url(r'^(?P<course_code>[A-Z0-9]+)/(?P<version>[\d.]+)/forum$', views.forum, | ||
name='forum'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/ajax_reply$', views.ajax_reply, | ||
url(r'^(?P<course_code>[A-Z0-9]+)/(?P<version>[\d.]+)/ajax_reply$', views.ajax_reply, | ||
name='ajax_reply'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/ajax_new$', views.ajax_new, | ||
url(r'^(?P<course_code>[A-Z0-9]+)/(?P<version>[\d.]+)/ajax_new$', views.ajax_new, | ||
name='ajax_new'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/ajax_remove$', views.ajax_remove, | ||
url(r'^(?P<course_code>[A-Z0-9]+)/(?P<version>[\d.]+)/ajax_remove$', views.ajax_remove, | ||
name='ajax_remove'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/upload_assignment$', views.upload_assignment, | ||
url(r'^(?P<course_code>[A-Z0-9]+)/(?P<version>[\d.]+)/upload_assignment$', views.upload_assignment, | ||
name='upload_assignment'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/add_documents$', views.add_document, | ||
url(r'^(?P<course_code>[A-Z0-9]+)/(?P<version>[\d.]+)/add_modules$', views.add_modules, | ||
name='add_modules'), | ||
url(r'^(?P<course_code>[A-Z0-9]+)/(?P<version>[\d.]+)/add_documents$', views.add_document, | ||
name='add_document'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/add_assignment$', | ||
url(r'^(?P<course_code>[A-Z0-9]+)/(?P<version>[\d.]+)/add_assignment$', | ||
views.add_assignment, name='add_assignment'), | ||
# url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/add_video$', views.add_videos, | ||
# url(r'^(?P<course_code>[A-Z0-9]+)/add_video$', views.add_videos, | ||
# name='add_videos'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/delete/$', views.delete, | ||
url(r'^(?P<course_code>[A-Z0-9]+)/(?P<version>[\d.]+)/delete/$', views.delete, | ||
name='delete'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/ajax_assess$', views.ajax_assess, | ||
url(r'^(?P<course_code>[A-Z0-9]+)/(?P<version>[\d.]+)/ajax_assess$', views.ajax_assess, | ||
name='ajax_assess'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/ajax_feedback$', views.ajax_feedback, | ||
url(r'^(?P<course_code>[A-Z0-9]+)/(?P<version>[\d.]+)/ajax_feedback$', views.ajax_feedback, | ||
name='ajax_feedback'), | ||
url(r'^quiz/(?P<quiz_id>[0-9]+)/$', views.quiz, name='quiz'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/create_quiz/$', views.create_quiz, name='create_quiz'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/edit_quiz/(?P<quiz_code>[0-9]+)/$', | ||
url(r'^(?P<course_code>[A-Z0-9]+)/create_quiz/$', views.create_quiz, name='create_quiz'), | ||
url(r'^(?P<course_code>[A-Z0-9]+)/edit_quiz/(?P<quiz_code>[0-9]+)/$', | ||
views.edit_quiz, name='edit_quiz'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/edit_quiz/(?P<quiz_code>[0-9]+)/(?P<topic_id>[0-9]+)$', | ||
url(r'^(?P<course_code>[A-Z0-9]+)/edit_quiz/(?P<quiz_code>[0-9]+)/(?P<topic_id>[0-9]+)$', | ||
views.edit_quiz_topic, name='edit_quiz_topic'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/(?P<quiz_id>[0-9]+)/add_question_topic$', | ||
url(r'^(?P<course_code>[A-Z0-9]+)/(?P<quiz_id>[0-9]+)/add_question_topic$', | ||
views.add_question_topicwise, name='add_question_topicwise'), | ||
url(r'^(?P<course_id>[0-9]+?)/(?P<quiz_id>[0-9]+)/add_questions_to_quiz$', | ||
views.add_questions_to_quiz, name='add_questions_to_quiz'), | ||
url( | ||
r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/(?P<quiz_code>[0-9]+)/(?P<topic_id>[0-9]+)/remove_quiz_question$', | ||
r'^(?P<course_code>[A-Z0-9]+)/(?P<quiz_code>[0-9]+)/(?P<topic_id>[0-9]+)/remove_quiz_question$', | ||
views.remove_quiz_question, name='remove_quiz_question'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/preview_quiz/(?P<quiz_code>[0-9]+)/$', views.preview_quiz, | ||
url(r'^(?P<course_code>[A-Z0-9]+)/preview_quiz/(?P<quiz_code>[0-9]+)/$', views.preview_quiz, | ||
name='preview_quiz'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/edit_quiz_details/(?P<quiz_code>[0-9]+)/$', | ||
url(r'^(?P<course_code>[A-Z0-9]+)/edit_quiz_details/(?P<quiz_code>[0-9]+)/$', | ||
views.edit_quiz_details, name='edit_quiz_details'), | ||
url(r'^(?P<quiz_code>[0-9]+)/ajax$', views.ajax_q, name='ajax_q'), | ||
url(r'^(?P<quiz_code>[0-9]+)/submit$', views.submit, name='submit'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/remove_quiz$', views.remove_quiz, | ||
url(r'^(?P<course_code>[A-Z0-9]+)/remove_quiz$', views.remove_quiz, | ||
name='remove_quiz'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/remove_bank$', views.remove_bank, | ||
url(r'^(?P<course_code>[A-Z0-9]+)/remove_bank$', views.remove_bank, | ||
name='remove_bank'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/remove_topic$', views.remove_topic, | ||
url(r'^(?P<course_code>[A-Z0-9]+)/remove_topic$', views.remove_topic, | ||
name='remove_topic'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/create_bank$', views.create_bank, | ||
url(r'^(?P<course_code>[A-Z0-9]+)/create_bank$', views.create_bank, | ||
name='create_bank'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/create_topic$', views.create_topic, | ||
url(r'^(?P<course_code>[A-Z0-9]+)/create_topic$', views.create_topic, | ||
name='create_topic'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/(?P<qb_code>[0-9]+)/(?P<topic_id>[0-9]+)$', | ||
url(r'^(?P<course_code>[A-Z0-9]+)/(?P<qb_code>[0-9]+)/(?P<topic_id>[0-9]+)$', | ||
views.edit_qb_topics, name='edit_qb_topics'), | ||
url(r'^(?P<course_id>[0-9]+?)/(?P<qb_code>[0-9]+)/(?P<topic_id>[0-9]+)/add_question$', | ||
views.add_question, name='add_question'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/(?P<qb_code>[0-9]+)/(?P<topic_id>[0-9]+)/remove_question$', | ||
url(r'^(?P<course_code>[A-Z0-9]+)/(?P<qb_code>[0-9]+)/(?P<topic_id>[0-9]+)/remove_question$', | ||
views.remove_question, name='remove_question'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/edit_bank/(?P<qb_code>[0-9]+)$', | ||
url(r'^(?P<course_code>[A-Z0-9]+)/edit_bank/(?P<qb_code>[0-9]+)$', | ||
views.edit_bank, name='edit_bank'), | ||
url(r'^(?P<course_code>[A-z]+[0-9]+[A-z]?)/attendance$', views.submit_attendance, | ||
name='submit_attendance'),] | ||
url(r'^(?P<course_code>[A-Z0-9]+)/(?P<version>[\d.]+)/attendance$', views.submit_attendance, | ||
name='submit_attendance'), | ||
url(r'^(?P<course_code>[A-Z0-9]+)/(?P<version>[\d.]+)/add_attendance$', views.add_attendance, | ||
name='add_attendance'), | ||
url(r'^(?P<course_code>[A-Z0-9]+)/(?P<version>[\d.]+)/create_grading_scheme$', | ||
views.create_grading_scheme, name='Create_grading_scheme'), | ||
url(r'^admin/add_academic_calendar', views.add_academic_calendar, name='Add Calendar'), | ||
url(r'^admin/update_calendar', views.update_calendar, name='Add Calendar'), | ||
url(r'^admin/add_timetable', views.add_timetable, name="add_timetable"), | ||
url(r'^admin/delete_timetable', views.delete_timetable, name='delete_timetable'), | ||
url(r'^(?P<course_code>[A-z0-9]+)/(?P<version>[\d.]+)/submit_marks$',views.submit_marks, name='submit_marks'), | ||
] | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
123 changes: 123 additions & 0 deletions
123
FusionIIIT/applications/programme_curriculum/api/serializers.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,123 @@ | ||
from rest_framework import serializers | ||
from applications.programme_curriculum.models import Programme, Discipline, Curriculum, Semester, Course, Batch, CourseSlot, CourseInstructor | ||
|
||
# this is for Programme model .... | ||
|
||
|
||
class ProgrammeSerializer(serializers.ModelSerializer): | ||
discipline = serializers.SerializerMethodField() | ||
programmes = serializers.SerializerMethodField() | ||
|
||
def get_discipline(self, obj): | ||
disciplines = obj.get_discipline_objects.all() | ||
return ', '.join([discipline.name for discipline in disciplines]) # Join disciplines into a single string | ||
|
||
def get_programmes(self, obj): | ||
return obj.name | ||
|
||
class Meta: | ||
model = Programme | ||
fields = [ 'programmes', 'discipline'] | ||
|
||
|
||
|
||
# this is for Discipline ... | ||
class DisciplineSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = Discipline | ||
fields = "__all__" | ||
|
||
|
||
|
||
# this is for Curriculum .... | ||
# fields in fronted form --> name, version , batch , no of semester | ||
class BatchSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = Batch | ||
fields = ['name', 'year'] | ||
|
||
|
||
|
||
class CurriculumBatchSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = Curriculum | ||
fields = ['name', 'version', 'no_of_semester'] | ||
|
||
class CurriculumSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = Curriculum | ||
fields = ['name', 'version', 'batches', 'no_of_semester'] | ||
|
||
def to_representation(self, instance): | ||
representation = super().to_representation(instance) | ||
batches = instance.batches.all() | ||
representations = [] | ||
for batch in batches: | ||
batch_representation = { | ||
'name': representation['name'], | ||
'version': representation['version'], | ||
'no_of_semester': representation['no_of_semester'], | ||
'batch': f"{representation['name']} {batch.year}" | ||
} | ||
representations.append(batch_representation) | ||
return representations | ||
|
||
|
||
|
||
class ProgrammeInfoSerializer(serializers.ModelSerializer): | ||
|
||
class Meta: | ||
model = Programme | ||
fields = ['category', 'name', 'programme_begin_year'] | ||
|
||
|
||
|
||
|
||
# this is for Semester model ... | ||
# no frontend form for this model ... | ||
class SemesterSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = Semester | ||
fields = "__all__" | ||
|
||
|
||
|
||
# this is for course model ... | ||
# fields in frontend form --> coursecode, coursename, credit | ||
class CourseSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = Course | ||
fields = "__all__" | ||
|
||
|
||
|
||
# this is for Batch model ... | ||
# field in frontend form --> name, discipline, year, curriculum . | ||
# class BatchSerializer(serializers.ModelSerializer): | ||
# class Meta: | ||
# model = Batch | ||
# fields = "__all__" | ||
|
||
|
||
# for this 2 there is no frontend form ... | ||
|
||
|
||
# CourseSlot model serializers ... | ||
class CourseSlotSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = CourseSlot | ||
fields = "__all__" | ||
|
||
|
||
|
||
# CourseInstructor model serializers ... | ||
class CourseInstructorSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = CourseInstructor | ||
fields = "__all__" | ||
|
||
|
||
class ProgrammePostSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = Programme | ||
fields = ['id', 'category', 'name', 'programme_begin_year'] |
141 changes: 141 additions & 0 deletions
141
FusionIIIT/applications/programme_curriculum/api/views.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,141 @@ | ||
from rest_framework.decorators import api_view | ||
from rest_framework.response import Response | ||
from django.shortcuts import get_object_or_404 | ||
from rest_framework import status | ||
|
||
from applications.programme_curriculum.models import ( | ||
Programme, | ||
Discipline, | ||
Curriculum, | ||
Semester, | ||
Course, | ||
Batch, | ||
CourseSlot, | ||
CourseInstructor, | ||
) | ||
|
||
from .serializers import ( | ||
ProgrammeSerializer, | ||
CurriculumSerializer, | ||
ProgrammePostSerializer, | ||
SemesterSerializer, | ||
DisciplineSerializer, | ||
CourseSerializer, | ||
CourseSlotSerializer, | ||
BatchSerializer, | ||
ProgrammeInfoSerializer, | ||
) | ||
|
||
from applications.programme_curriculum.filters import ( | ||
CourseFilter, | ||
BatchFilter, | ||
CurriculumFilter, | ||
) | ||
from rest_framework import generics | ||
|
||
|
||
@api_view(["GET", "POST"]) | ||
def view_ug_programmes(request): | ||
""" | ||
This function is used to display all the ug programmes offered by the institute. | ||
""" | ||
ug = Programme.objects.filter(category="UG") | ||
|
||
ug_serializer = ProgrammeSerializer(ug, many=True) | ||
|
||
return Response(ug_serializer.data) | ||
|
||
|
||
@api_view(["GET", "POST"]) | ||
def view_pg_programmes(request): | ||
""" | ||
This function is used to display all the ug programmes offered by the institute. | ||
""" | ||
ug = Programme.objects.filter(category="PG") | ||
|
||
ug_serializer = ProgrammeSerializer(ug, many=True) | ||
|
||
return Response(ug_serializer.data) | ||
|
||
|
||
@api_view(["GET", "POST"]) | ||
def view_phd_programmes(request): | ||
""" | ||
This function is used to display all the ug programmes offered by the institute. | ||
""" | ||
ug = Programme.objects.filter(category="PHD") | ||
|
||
ug_serializer = ProgrammeSerializer(ug, many=True) | ||
|
||
return Response(ug_serializer.data) | ||
|
||
|
||
@api_view(["GET"]) | ||
def get_programme_info(request): | ||
if request.method == "GET": | ||
# Fetch all programmes | ||
programmes = Programme.objects.all() | ||
|
||
# Serialize the data | ||
serializer = ProgrammeInfoSerializer(programmes, many=True) | ||
|
||
# Return the serialized data as response | ||
return Response(serializer.data) | ||
|
||
|
||
@api_view(["GET"]) | ||
def view_curriculumns(request): | ||
if request.method == "GET": | ||
# Fetch all programmes | ||
curriculums = Curriculum.objects.all() | ||
serializer = CurriculumSerializer(curriculums, many=True) | ||
return Response(serializer.data) | ||
|
||
|
||
@api_view(["POST"]) | ||
def create_programme(request): | ||
if request.method == "POST": | ||
# Extract data from the request | ||
category = request.data.get("category") | ||
name = request.data.get("name") | ||
programme_begin_year = request.data.get("programme_begin_year") | ||
discipline_names = request.data.get( | ||
"discipline" | ||
) # Assuming discipline names are sent as a list | ||
|
||
# Validate data | ||
if not category or not name or not programme_begin_year or not discipline_names: | ||
return Response( | ||
{ | ||
"message": "Please provide category, name, programme_begin_year, and discipline in the request body" | ||
}, | ||
status=status.HTTP_400_BAD_REQUEST, | ||
) | ||
|
||
# Create Programme object | ||
programme = Programme.objects.create( | ||
category=category, name=name, programme_begin_year=programme_begin_year | ||
) | ||
|
||
# Find Discipline objects and associate them with the Programme | ||
disciplines = [] | ||
for discipline_name in discipline_names: | ||
try: | ||
discipline = Discipline.objects.get(name=discipline_name) | ||
discipline.programmes.add(programme) | ||
disciplines.append(discipline) | ||
except Discipline.DoesNotExist: | ||
# If discipline does not exist, you may handle it according to your application's logic | ||
# For example, you can create the discipline here | ||
pass | ||
|
||
# Serialize the Programme object | ||
serializer = ProgrammePostSerializer(programme) | ||
|
||
return Response( | ||
{ | ||
"programme": serializer.data, | ||
"disciplines": [discipline.name for discipline in disciplines], | ||
}, | ||
status=status.HTTP_201_CREATED, | ||
) |
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
192 changes: 192 additions & 0 deletions
192
FusionIIIT/templates/coursemanagement/academicinfo.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,192 @@ | ||
{% extends 'globals/base.html' %} | ||
{% load static %} | ||
|
||
|
||
{% block title %} | ||
Academic Information System | ||
{% endblock %} | ||
|
||
{% block css %} | ||
|
||
<link href="https://cdn.rawgit.com/mdehoog/Semantic-UI/6e6d051d47b598ebab05857545f242caf2b4b48c/dist/semantic.min.css" | ||
rel="stylesheet" type="text/css" /> | ||
|
||
|
||
<link rel="stylesheet" type="text/css" href="{% static 'semantic/dist/components/semantic-ui-alerts.css' %}"> | ||
|
||
|
||
{% endblock %} | ||
|
||
{% block body %} | ||
{% block navBar %} | ||
{% include 'dashboard/navbar.html' %} | ||
{% endblock %} | ||
<style> | ||
span.circle { | ||
background: orange; | ||
border-radius: 50%; | ||
-moz-border-radius: 50%; | ||
-webkit-border-radius: 50%; | ||
color: black; | ||
display: inline-block; | ||
font-weight: bold; | ||
line-height: 25px; | ||
margin-right: 5px; | ||
text-align: center; | ||
width: 25px; | ||
} | ||
</style> | ||
|
||
<div class="ui stackable doubling grid"> | ||
|
||
<div class="column"></div> | ||
|
||
<div class="three wide column"> | ||
|
||
{% block usercard %} | ||
{% include 'globals/usercard.html' %} | ||
{% endblock %} | ||
|
||
<div class="ui divider"></div> | ||
|
||
<div class="ui large fluid vertical pointing menu" style="max-width: 320px;"> | ||
|
||
|
||
<a class="active item" data-tab="third"> | ||
Academic Calendar | ||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
<a class="item" data-tab="fourth"> | ||
Time Tables | ||
|
||
<i class="right floated chevron right icon"></i> | ||
</a> | ||
|
||
</div> | ||
<br><br> | ||
|
||
</div> | ||
|
||
<div class="eight wide column"> | ||
|
||
<div class="ui active tab segment" data-tab="third"> | ||
{% block calendar %} | ||
{% include 'coursemanagement/calendar.html' %} | ||
{% endblock %} | ||
</div> | ||
|
||
<div class="ui tab segment" data-tab="fourth" style="margin-top: 0px;"> | ||
{% block timetable %} | ||
{% include 'coursemanagement/timetable.html' %} | ||
{% endblock %} | ||
</div> | ||
|
||
</div> | ||
|
||
<div class="three wide column"> | ||
|
||
<!-- <div class="row"> | ||
<div class="ui tab segment" data-tab="ninth"> | ||
{% block filter_stu %} | ||
{% include 'ais/filter_student.html' %} | ||
{% endblock %} | ||
</div> | ||
</div> --> | ||
</div> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block javascript %} | ||
|
||
<script type="text/javascript" src="{% static 'fusion/js/tablesort.js' %}"></script> | ||
<script type="text/javascript" src="{% static 'fusion/js/jquery.min.js' %}"></script> | ||
<script type="text/javascript" src="{% static 'globals/js/semantic.min.js' %}"></script> | ||
<script type="text/javascript" src="{% static 'semantic/dist/components/semantic-ui-alerts.js' %}"></script> | ||
|
||
<!-- <script src="https://code.jquery.com/jquery-2.1.4.js"></script> --> | ||
<script | ||
src="https://cdn.rawgit.com/mdehoog/Semantic-UI/6e6d051d47b598ebab05857545f242caf2b4b48c/dist/semantic.min.js"></script> | ||
<script type="text/javascript"> | ||
|
||
function successAlert(data){ | ||
$.suiAlert({ | ||
title: 'Success', | ||
description: data, | ||
type: 'success', | ||
time: '3', | ||
position: 'top-center', | ||
}); | ||
} | ||
|
||
function errAlert(data){ | ||
$.suiAlert({ | ||
title: 'Error', | ||
description: data, | ||
type: 'error', | ||
time: '3', | ||
position: 'top-center', | ||
}); | ||
} | ||
|
||
function delAlert(data){ | ||
$.suiAlert({ | ||
title: 'Deleted', | ||
description: data, | ||
type: 'info', | ||
time: '3', | ||
position: 'top-center', | ||
}); | ||
} | ||
|
||
$(document).on('click','.trash',function(){ | ||
var pk = $(this).attr('data-pk'); | ||
$.ajax({ | ||
type: 'POST', | ||
url: '/ocms/admin/delete_timetable', | ||
data: { | ||
'pk': pk, | ||
'csrfmiddlewaretoken': '{{ csrf_token }}' | ||
}, | ||
success: function(data) { | ||
delAlert(data); | ||
$("#add_timetable_refresh").load(" #add_timetable_refresh > *"); | ||
}, | ||
error: function(data, err) { | ||
errAlert(err); | ||
} | ||
}); | ||
}); | ||
|
||
$(document).on('click','#add_timetable',function() { | ||
var data = new FormData(); | ||
var img = $('#time_table')[0].files; | ||
for (var i = 0; i < img.length; i++) { | ||
data.append("img", img[i]); | ||
} | ||
data.append('img', img); | ||
var other_data = $('#form7').serializeArray(); | ||
$.each(other_data, function(key, input) { | ||
data.append(input.name, input.value); | ||
}); | ||
$('#load_add_timetable').show(); | ||
$.ajax({ | ||
url: "/ocms/admin/add_timetable", | ||
processData: false, | ||
contentType: false, | ||
type: 'POST', | ||
data: data, | ||
success: function(data) { | ||
$('#load_add_timetable').hide(); | ||
successAlert(data); | ||
//location.reload(); | ||
$("#add_timetable_refresh").load(" #add_timetable_refresh > *"); | ||
}, | ||
error: function(data, err) { | ||
$('#load_add_timetable').hide(); | ||
errAlert(data.responseText); | ||
} | ||
}); | ||
}); | ||
</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
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,167 @@ | ||
{% load static %} | ||
{% block calendar %} | ||
<h3 class="ui header">Academic Calendar</h3> | ||
<table class="ui celled table"> | ||
<thead> | ||
<tr> | ||
<th>Description</th> | ||
<th>Start Date</th> | ||
<th>End Date</th> | ||
<th>Action</th> | ||
</tr> | ||
</thead> | ||
{% for i in academic_calendar %} | ||
{% csrf_token %} | ||
<tr> | ||
<td>{{ i.description }}</td><input type="hidden" name="desc" value="{{ i.description }}"> | ||
<td>{{ i.from_date }}</td> | ||
<td>{{ i.to_date }}</td> | ||
<td><button class="ui button red icon" id="{{ forloop.counter }}"><i class="edit icon"></i></button> | ||
<div class="ui modal {{forloop.counter}}"> | ||
<i class="close icon"></i> | ||
<div class="header"> | ||
Academic Calendar | ||
</div> | ||
<div class="image content"> | ||
<div class="description"> | ||
<form class="ui form" id='update_calendar_{{forloop.counter}}' action='/ocms/update_calendar/'> | ||
{% csrf_token %} | ||
<div class="field"> | ||
<label>Description:</label> | ||
<input name="description" value="{{ i.description }}" type="text"> | ||
<input type="text" name="prev_desc" value="{{i.description}}" hidden="true"> | ||
</div> | ||
<div class="ui calendar" id="date1"> | ||
<label>From Date:</label><br> | ||
<div class="ui input left icon"> | ||
<i class="calendar icon"></i> | ||
<input type="date" placeholder="From Date" id="fe_date_{{forloop.counter}}" name="from_date" value="{{i.from_date|date:"Y-m-d"}}"> | ||
</div> | ||
</div><br> | ||
<div class="ui calendar" id="date2"> | ||
<label>To Date:</label><br> | ||
<div class="ui input left icon"> | ||
<i class="calendar icon"></i> | ||
<input type="date" placeholder="To Date" id="toe_date_{{forloop.counter}}" name="to_date" value="{{i.to_date|date:"Y-m-d"}}"> | ||
</div> | ||
</div> | ||
<hr> | ||
<button class="ui button black create_btn" type="submit">Submit</button> | ||
<script type="text/javascript" src="{% static 'globals/js/jquery.min.js' %}"></script> | ||
<script type="text/javascript"> | ||
$(function () { | ||
$("#update_calendar_{{forloop.counter}}").submit(function (event) { | ||
event.preventDefault(); | ||
var friendForm = $(this); | ||
var start_date = $('#fe_date_{{forloop.counter}}').val(); | ||
var end_date = $('#toe_date_{{forloop.counter}}').val(); | ||
console.log(start_date,end_date); | ||
console.log(Date.parse(start_date),Date.parse(end_date)); | ||
console.log(Date.parse(start_date) > Date.parse(end_date)); | ||
console.log(" "); | ||
if (Date.parse(start_date) > Date.parse(end_date)) { | ||
alert("Start Date must be less than End date"); | ||
} else { | ||
var posting = $.post(friendForm.attr('action'), friendForm.serialize()); | ||
posting.done(function (data) { | ||
alert('Academic Calendar Updated'); | ||
location.reload(); | ||
}); | ||
posting.fail(function (data) { | ||
alert('Failed to update'); | ||
}); | ||
} | ||
|
||
}); | ||
}); | ||
</script> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
<script type="text/javascript" src="{% static 'globals/js/jquery.min.js' %}"></script> | ||
<script type="text/javascript"> | ||
$(function () { | ||
$("#{{forloop.counter}}").click(function () { | ||
$(".{{forloop.counter}}").modal('show'); | ||
}); | ||
$(".{{forloop.counter}}").modal({ | ||
closable: true | ||
}); | ||
}); | ||
</script> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
{% endblock %} | ||
<button class="ui button yellow create_btn" type="button" id="test">Add More</button> | ||
<div class="ui modal test"> | ||
<i class="close icon"></i> | ||
<div class="header"> | ||
Academic Calendar | ||
</div> | ||
<div class="image content"> | ||
<div class="description"> | ||
<form class="ui form" id='add_calendar' action='/ocms/add_academic_calendar/' method='post'> | ||
{% csrf_token %} | ||
<div class="field"> | ||
<label>Description:</label> | ||
<input name="description" placeholder="Enter the description..." type="text"> | ||
</div> | ||
<div class="ui calendar" id="date1"> | ||
<label>From Date:</label><br> | ||
<div class="ui input left icon"> | ||
<i class="calendar icon"></i> | ||
<input type="date" placeholder="From Date" id="f_date" name="from_date"> | ||
</div> | ||
</div><br> | ||
<div class="ui calendar" id="date2"> | ||
<label>To Date:</label><br> | ||
<div class="ui input left icon"> | ||
<i class="calendar icon"></i> | ||
<input type="date" placeholder="To Date" id="to_date" name="to_date"> | ||
</div> | ||
</div> | ||
<hr> | ||
<button class="ui button black create_btn" type="submit">Submit</button> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
<script type="text/javascript" src="{% static 'globals/js/jquery.min.js' %}"></script> | ||
<script type="text/javascript"> | ||
$(function () { | ||
$("#test").click(function () { | ||
$(".test").modal('show'); | ||
}); | ||
$(".test").modal({ | ||
closable: true | ||
}); | ||
}); | ||
$(function () { | ||
$("#add_calendar").submit(function (event) { | ||
event.preventDefault(); | ||
var friendForm = $(this); | ||
var start_date = $('#f_date').val(); | ||
var end_date = $('#to_date').val(); | ||
console.log(start_date,end_date); | ||
console.log(Date.parse(start_date),Date.parse(end_date)); | ||
console.log(Date.parse(start_date) > Date.parse(end_date)); | ||
console.log(" "); | ||
if (Date.parse(start_date) > Date.parse(end_date)) { | ||
alert("Start Date must be less than End date"); | ||
} else { | ||
var posting = $.post(friendForm.attr('action'), friendForm.serialize()); | ||
posting.done(function (data) { | ||
alert('Academic Calendar Updated'); | ||
location.reload() | ||
}); | ||
posting.fail(function (data) { | ||
alert('Failed to update'); | ||
}); | ||
} | ||
|
||
}); | ||
}); | ||
</script> |
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
506 changes: 13 additions & 493 deletions
506
FusionIIIT/templates/coursemanagement/coursemanagement1.html
Large diffs are not rendered by default.
Oops, something went wrong.
266 changes: 266 additions & 0 deletions
266
FusionIIIT/templates/coursemanagement/gradingscheme.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,266 @@ | ||
{% load static %} | ||
{% block css %} | ||
<link rel="stylesheet" type="text/css" href="{% static 'semantic/dist/components/semantic-ui-alerts.css' %}"> | ||
|
||
{% endblock %} | ||
{% block gradingScheme %} | ||
<div style="height:45em;overflow:auto;overflow-x:hidden;width:100%;"> | ||
<h3 class="ui dividing header">Create Grading Scheme</h3> | ||
|
||
<form class="ui form" id="gradingScheme_submit" method="post" action="/ocms/{{ course.code }}/{{course.version}}/create_grading_scheme"> | ||
{% csrf_token %} | ||
|
||
<div style="overflow:auto;overflow-x:hidden; margin-right:0.75em;"> | ||
<table class="ui fixed single line sortable celled table"> | ||
<thead> | ||
<tr> | ||
<th style="width: 30%;">Type of Evaluation</th> | ||
<th style="width: 30%;">Weightage (%)</th> | ||
</tr> | ||
</thead> | ||
<tbody id="grading_scheme_table"> | ||
{% comment %} {% if gradingscheme is defined %} {% endcomment %} | ||
{% for eval in gradingscheme %} | ||
<tr><td style="padding-left:28px;">{{eval.type_of_evaluation}}</td><td> <input type="number" name="{{eval.type_of_evaluation}}" id="{{eval.type_of_evaluation}}" value= {{eval.weightage}} /></tr> | ||
{% endfor %} | ||
{% comment %} {% endif %} {% endcomment %} | ||
|
||
<tr id="addItem_Row"> | ||
<td style="overflow:visible; display:flex; "> | ||
<input type="text" style="width:80%;" name="add_eval_type" id="add_eval_type" value="" placeholder="Enter New Evaluation" /> | ||
{% comment %} <select class="ui selection dropdown" id="add_item" >; | ||
<option class="item" name="add_item" value="Assignment">Assignment</option> | ||
<option class="item" name="add_item" value="Lab">Lab</option> | ||
<option class="item" name="add_item" value="Project">Project</option> | ||
<option class="item" name="add_item" value="Quiz">Quiz</option> | ||
<option class="item" name="add_item" value="Quiz_2">Quiz_2</option> | ||
<option class="item" name="add_item" value="Mid-Sem Exam">Mid-Sem Exam</option> | ||
<option class="item" name="add_item" value="End-Sem Exam">End-Sem Exam</option> | ||
<option class="item" name="add_item" value="Attendance">Attendance</option> | ||
</select> {% endcomment %} | ||
</td> | ||
<td > | ||
<input type="number" style="width:80%; float:left;" name="add_item_wtg" id="" value="" placeholder="Enter Weightage" /> | ||
<input type="button" style="float:right;" class="ui primary button tiny" id="add_item_btn" style="display: flex; justify-content: center;" value="Add"> | ||
</td> | ||
</tr> | ||
{% comment %} <tr> | ||
<td>Quiz</td> | ||
<td> | ||
<input type="number" name="quiz_weightage" id="quiz_weightage" value="{{ quiz_weightage }}" /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>Mid Semester</td> | ||
<td> | ||
<input type="number" name="midsem_weightage" id="midsem_weightage" value="{{ midsem_weightage }}" /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>Assignment</td> | ||
<td> | ||
<input type="number" name="assignment_weightage" id="assignment_weightage" value="{{ assignment_weightage }}" /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>End Semester</td> | ||
<td> | ||
<input type="number" name="endsem_weightage" id="endsem_weightage" value="{{ endsem_weightage }}" /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>Project</td> | ||
<td> | ||
<input type="number" name="project_weightage" id="project_weightage" value="{{ project_weightage }}" /> | ||
</td> | ||
</tr> {% endcomment %} | ||
|
||
</tbody> | ||
</table> | ||
</div> | ||
<div style="overflow-x:hidden; margin-top:15px; margin-right:0.75em;"> | ||
<table class="ui fixed single line sortable celled table"> | ||
<thead> | ||
<tr> | ||
<th style="width: 30%;">Grade</th> | ||
<th style="width: 30%;">Lower Bound (%)</th> | ||
<th style="width: 30%;">Upper Bound (%)</th> | ||
</tr> | ||
</thead> | ||
<tbody id="grade_table"> | ||
<tr> | ||
<td>O</td> | ||
<td> | ||
<input type="number" name="O_Lower" id="O_Lower" value="{{ gradingscheme_grades.O_Lower }}" /> | ||
</td> | ||
<td> | ||
<input type="number" name="O_Upper" id="O_Upper" value="{{ gradingscheme_grades.O_Upper }}" /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>A+</td> | ||
<td> | ||
<input type="number" name="A_plus_Lower" id="A_plus_Lower" value="{{ gradingscheme_grades.A_plus_Lower }}" /> | ||
</td> | ||
<td> | ||
<input type="number" name="A_plus_Upper" id="A_plus_Upper" value="{{ gradingscheme_grades.A_plus_Upper }}" /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>A</td> | ||
<td> | ||
<input type="number" name="A_Lower" id="A_Lower" value="{{ gradingscheme_grades.A_Lower }}" /> | ||
</td> | ||
<td> | ||
<input type="number" name="A_Upper" id="A_Upper" value="{{ gradingscheme_grades.A_Upper }}" /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>B+</td> | ||
<td> | ||
<input type="number" name="B_plus_Lower" id="B_plus_Lower" value="{{ gradingscheme_grades.B_plus_Lower }}" /> | ||
</td> | ||
<td> | ||
<input type="number" name="B_plus_Upper" id="B_plus_Upper" value="{{ gradingscheme_grades.B_plus_Upper }}" /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>B</td> | ||
<td> | ||
<input type="number" name="B_Lower" id="B_Lower" value="{{ gradingscheme_grades.B_Lower }}" /> | ||
</td> | ||
<td> | ||
<input type="number" name="B_Upper" id="B_Upper" value="{{ gradingscheme_grades.B_Upper }}" /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>C+</td> | ||
<td> | ||
<input type="number" name="C_plus_Lower" id="C_plus_Lower" value="{{ gradingscheme_grades.C_plus_Lower }}" /> | ||
</td> | ||
<td> | ||
<input type="number" name="C_plus_Upper" id="C_plus_Upper" value="{{ gradingscheme_grades.C_plus_Upper }}" /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>C</td> | ||
<td> | ||
<input type="number" name="C_Lower" id="C_Lower" value="{{ gradingscheme_grades.C_Lower }}" /> | ||
</td> | ||
<td> | ||
<input type="number" name="C_Upper" id="C_Upper" value="{{ gradingscheme_grades.C_Upper }}" /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>D+</td> | ||
<td> | ||
<input type="number" name="D_plus_Lower" id="D_plus_Lower" value="{{ gradingscheme_grades.D_plus_Lower }}" /> | ||
</td> | ||
<td> | ||
<input type="number" name="D_plus_Upper" id="D_plus_Upper" value="{{ gradingscheme_grades.D_plus_Upper }}" /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>D</td> | ||
<td> | ||
<input type="number" name="D_Lower" id="D_Lower" value="{{ gradingscheme_grades.D_Lower }}" /> | ||
</td> | ||
<td> | ||
<input type="number" name="D_Upper" id="D_Upper" value="{{ gradingscheme_grades.D_Upper }}" /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>F</td> | ||
<td> | ||
<input type="number" name="F_Lower" id="F_Lower" value="{{ gradingscheme_grades.F_Lower }}" /> | ||
</td> | ||
<td> | ||
<input type="number" name="F_Upper" id="F_Upper" value="{{ gradingscheme_grades.F_Upper }}" /> | ||
</td> | ||
</tr> | ||
|
||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<input type="button" class="ui primary button" id="submit_gradingScheme" style="float:right; margin-top:15px; margin-right:0.75em;" value="Upload"> | ||
|
||
</form> | ||
|
||
|
||
</div> | ||
|
||
<script type="text/javascript" src="{% static 'globals/js/jquery.min.js' %}"></script> | ||
<script type="text/javascript" src="{% static 'globals/js/semantic.min.js' %}"></script> | ||
<script type="text/javascript" src="{% static 'semantic/dist/components/semantic-ui-alerts.js' %}"></script> | ||
|
||
<script type="text/javascript"> | ||
// Function to handle add_item_btn | ||
//var no_of_items = 0; | ||
add_item_btn.addEventListener('click', function() { | ||
//no_of_items=no_of_items+1; | ||
// Your code to execute when the input is clicked | ||
const add_item_btn = document.getElementById('add_item_btn'); | ||
const tbody = document.getElementById('grading_scheme_table'); | ||
const addItem_Row = document.getElementById('addItem_Row'); | ||
|
||
const itemType = document.getElementById('addItem_Row').childNodes[1].childNodes[1] ; | ||
const itemWtg = document.getElementById('addItem_Row').childNodes[3].childNodes[1] ; | ||
|
||
if (itemType.value == '') {return} | ||
if (itemWtg.value == '') {return} | ||
|
||
const newElement = document.createElement('tr'); | ||
newElement.id = 'new_row'; | ||
newElement.innerHTML = `<td style="padding-left:28px;"><input value="` + itemType.value + `"></input></td> <td> <input style="width:85%;" type="number" name="`+itemType.value+`" id="`+itemType.value+`" value= `+itemWtg.value+` /> <div class="ui button" style="width:10px; margin-right:5px; float:right;" onclick="const new_row = document.getElementById('new_row'); new_row.parentNode.removeChild(new_row);" > <i style="margin-left:-8px;" class="close icon"></i> </div> </td> `; | ||
//console.log(itemType.value + ` has weightage `+ itemWtg.value +`%`); | ||
//console.log(newElement.innerHTML = `<td>` + itemType.value + `</td> <td> <input type="number" name="`+itemType.value+`_weightage" id="`+itemType.value+`_weightage" value="`+itemWtg.value+`" /> `); | ||
//console.log('Input clicked!'); | ||
tbody.insertBefore(newElement, addItem_Row); | ||
itemType.value = '' | ||
itemWtg.value = '' | ||
}); | ||
|
||
function successAlert(data){ | ||
$.suiAlert({ | ||
title: 'Success', | ||
description: data, | ||
type: 'success', | ||
time: '3', | ||
position: 'top-center', | ||
}); | ||
} | ||
|
||
|
||
// Function to handle form submission | ||
function submitForm() { | ||
var form = document.getElementById("gradingScheme_submit"); | ||
var formData = new FormData(form); | ||
|
||
var xhr = new XMLHttpRequest(); | ||
xhr.open(form.method, form.action, true); | ||
xhr.onload = function () { | ||
if (xhr.status >= 200 && xhr.status < 300) { | ||
successAlert('Success: ' + xhr.responseText); // Display success message | ||
} else { | ||
alert('Error: ' + xhr.statusText); // Display error message | ||
} | ||
}; | ||
xhr.onerror = function () { | ||
alert('Request failed'); // Display request failure message | ||
}; | ||
xhr.send(formData); | ||
} | ||
|
||
document.getElementById("submit_gradingScheme").addEventListener("click", submitForm); | ||
|
||
document.getElementById("submit_gradingScheme").addEventListener("click", function() { | ||
setTimeout(function() { | ||
location.reload(); | ||
}, 3000); | ||
}); | ||
</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,192 @@ | ||
{% load static %} | ||
{% block css %} | ||
<link rel="stylesheet" type="text/css" href="{% static 'semantic/dist/components/semantic-ui-alerts.css' %}"> | ||
|
||
{% endblock %} | ||
{% block manageEval %} | ||
<div style="height:45em;overflow:auto;overflow-x:hidden;width:100%;"> | ||
<h3 class="ui dividing header">Manage Evaluations</h3> | ||
|
||
<form class="ui form" id="manageEval" method="post" action="/ocms/{{ course.code }}/{{course.version}}/submit_marks"> | ||
{% csrf_token %} | ||
|
||
<div style="overflow-x:hidden; margin-top:15px; margin-right:0.75em;"> | ||
<!-- <div class="ui fluid input"> | ||
<input type="text" id="usernameSearchInput" placeholder="Search by Roll No." onkeyup="searchByUsername()"> | ||
</div> --> | ||
<table class="ui fixed single line celled table" id="grading_table"> | ||
<thead> | ||
<tr> | ||
<th style="width: 25%;">S.No.</th> | ||
<th style="width: 25%;">Roll No</th> | ||
<th style="width: 25%;">Total Marks (%)</th> | ||
<th style="width: 25%;"> | ||
<div style="float:left; margin-top:8px;">Grade</div> | ||
<div class="ui button green" style="float:right;" id="generate_btn"> Generate </div> | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody id="grade_table"> | ||
{% if student_grades %} | ||
{% for row in student_grades %} | ||
<tr> | ||
<td>{{forloop.counter}}</td> | ||
<td> | ||
<input type="text" readonly name="stu_marks" id="roll_no{{forloop.counter}}" value="{{row.roll_no}}" /> | ||
</td> | ||
<td> | ||
<input type="number" name="stu_marks" id="total_marks{{forloop.counter}}" value="{{row.total_marks}}" placeholder="Enter total marks" /> | ||
</td> | ||
<td> | ||
<input name="stu_marks" id="grade{{forloop.counter}}" value="{{row.grade}}" placeholder="Add manually" /> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
{% else%} | ||
{% for stu in registered_students %} | ||
<tr> | ||
<td>{{forloop.counter}}</td> | ||
<td> | ||
<input type="text" readonly name="stu_marks" id="roll_no{{forloop.counter}}" value="{{stu.student_id.id.user.username}}" /> | ||
</td> | ||
<td> | ||
<input type="number" name="stu_marks" id="total_marks{{forloop.counter}}" value="" placeholder="Enter total marks" /> | ||
</td> | ||
<td> | ||
<input name="stu_marks" id="grade{{forloop.counter}}" value="" placeholder="Add manually" /> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
{% endif %} | ||
</tbody> | ||
</table> | ||
<input type="button" class="ui primary button" id="submit_grades" style ="float:right;" value="Upload"> | ||
</div> | ||
</form> | ||
</div> | ||
|
||
<script type="text/javascript" src="{% static 'globals/js/jquery.min.js' %}"></script> | ||
<script type="text/javascript" src="{% static 'globals/js/semantic.min.js' %}"></script> | ||
<script type="text/javascript" src="{% static 'semantic/dist/components/semantic-ui-alerts.js' %}"></script> | ||
|
||
<script type="text/javascript"> | ||
let O_Lower = {{gradingscheme_grades.O_Lower}}; | ||
let O_Upper = {{gradingscheme_grades.O_Upper}}; | ||
let A_Lower = {{gradingscheme_grades.A_Lower}}; | ||
let A_Upper = {{gradingscheme_grades.A_Upper}}; | ||
let A_plus_Lower = {{gradingscheme_grades.A_plus_Lower}}; | ||
let A_plus_Upper = {{gradingscheme_grades.A_plus_Upper}}; | ||
let B_Lower = {{gradingscheme_grades.B_Lower}}; | ||
let B_Upper = {{gradingscheme_grades.B_Upper}}; | ||
let B_plus_Lower = {{gradingscheme_grades.B_plus_Lower}}; | ||
let B_plus_Upper = {{gradingscheme_grades.B_plus_Upper}}; | ||
let C_Lower = {{gradingscheme_grades.C_Lower}}; | ||
let C_Upper = {{gradingscheme_grades.C_Upper}}; | ||
let C_plus_Lower = {{gradingscheme_grades.C_plus_Lower}}; | ||
let C_plus_Upper = {{gradingscheme_grades.C_plus_Upper}}; | ||
let D_Lower = {{gradingscheme_grades.D_Lower}}; | ||
let D_Upper = {{gradingscheme_grades.D_Upper}}; | ||
let D_plus_Lower = {{gradingscheme_grades.D_plus_Lower}}; | ||
let D_plus_Upper = {{gradingscheme_grades.D_plus_Upper}}; | ||
let F_Lower = {{gradingscheme_grades.F_Lower}}; | ||
let F_Upper = {{gradingscheme_grades.F_Upper}}; | ||
|
||
const generate_btn = document.getElementById('generate_btn'); | ||
generate_btn.addEventListener('click', function() { | ||
// Your code to execute when the input is clicked | ||
let num = 1; | ||
while (document.getElementById('total_marks'+num.toString())) { | ||
let marks = document.getElementById('total_marks'+num.toString()); | ||
let grade = document.getElementById('grade'+num.toString()); | ||
if (marks.value >= O_Lower && marks.value <= O_Upper) { | ||
grade.value = "O"; | ||
} | ||
else if (marks.value >= A_plus_Lower && marks.value <= A_plus_Upper) { | ||
grade.value = "A+"; | ||
} | ||
else if (marks.value >= A_Lower && marks.value <= A_Upper) { | ||
grade.value = "A"; | ||
} | ||
else if (marks.value >= B_plus_Lower && marks.value <= B_plus_Upper) { | ||
grade.value = "B+"; | ||
} | ||
else if (marks.value >= B_Lower && marks.value <= B_Upper) { | ||
grade.value = "B"; | ||
} | ||
else if (marks.value >= C_plus_Lower && marks.value <= C_plus_Upper) { | ||
grade.value = "C+"; | ||
} | ||
else if (marks.value >= C_Lower && marks.value <= C_Upper) { | ||
grade.value = "C"; | ||
} | ||
else if (marks.value >= D_plus_Lower && marks.value <= D_plus_Upper) { | ||
grade.value = "D+"; | ||
} | ||
else if (marks.value >= D_Lower && marks.value <= D_Upper) { | ||
grade.value = "D"; | ||
} | ||
else if (marks.value >= F_Lower && marks.value <= F_Upper) { | ||
grade.value = "F"; | ||
} | ||
|
||
num = num + 1; | ||
} | ||
}); | ||
|
||
function successAlert(data){ | ||
$.suiAlert({ | ||
title: 'Success', | ||
description: data, | ||
type: 'success', | ||
time: '3', | ||
position: 'top-center', | ||
}); | ||
} | ||
|
||
|
||
function searchByUsername() { | ||
var input, filter, table, tr, td, i, txtValue; | ||
input = document.getElementById("usernameSearchInput"); | ||
filter = input.value.toUpperCase(); | ||
table = document.getElementById("grading_table"); | ||
tr = table.getElementsByTagName("tr"); | ||
for (i = 0; i < tr.length; i++) { | ||
td = tr[i].getElementsByTagName("td")[1]; | ||
if (td) { | ||
txtValue = td.getElementsByTagName("input")[0].value; | ||
if (txtValue.toUpperCase().indexOf(filter) > -1) { | ||
tr[i].style.display = ""; | ||
} else { | ||
tr[i].style.display = "none"; | ||
} | ||
} | ||
} | ||
} | ||
|
||
// Function to handle form submission | ||
function submitForm() { | ||
var form = document.getElementById("manageEval"); | ||
var formData = new FormData(form); | ||
|
||
var xhr = new XMLHttpRequest(); | ||
xhr.open(form.method, form.action, true); | ||
xhr.onload = function () { | ||
if (xhr.status >= 200 && xhr.status < 300) { | ||
successAlert('Success: ' + xhr.responseText); // Display success message | ||
} else { | ||
alert('Error: ' + xhr.statusText); // Display error message | ||
} | ||
}; | ||
xhr.onerror = function () { | ||
alert('Request failed'); // Display request failure message | ||
}; | ||
xhr.send(formData); | ||
} | ||
|
||
// Attach submitForm function to the click event of the submit button | ||
document.getElementById("submit_grades").addEventListener("click", submitForm); | ||
</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
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,122 @@ | ||
{% load static %} | ||
{% block timetable %} | ||
|
||
<div class="ui pointing secondary menu"> | ||
<a class="active item" data-tab="academic"> | ||
Academic Time Table | ||
</a> | ||
</div> | ||
|
||
<div class="ui active tab segment" data-tab="academic" id="add_timetable_refresh"> | ||
|
||
<h4 class="ui dividing header">Add Time Table</h4> | ||
|
||
<form class="ui form" method="POST" id="form7" enctype="multipart/form-data"> | ||
{% csrf_token %} | ||
|
||
<div class="field"> | ||
<label>Programme</label> | ||
<select name="programme" id="programme" required> | ||
<option value="B.Tech">B.Tech</option> | ||
<option value="B.Des">B.Des</option> | ||
<option value="M.Des">M.Des</option> | ||
<option value="M.Tech">M.Tech</option> | ||
<option value="Phd">PhD</option> | ||
</select> | ||
</div> | ||
|
||
<div class="field"> | ||
<label>Batch</label> | ||
<input type="number" id="batch" name="batch" required> | ||
</div> | ||
|
||
<div class="field"> | ||
<label>Branch</label> | ||
<select name="branch" id="branch" required> | ||
<option value="CSE">CSE</option> | ||
<option value="ECE">ECE</option> | ||
<option value="ME">ME</option> | ||
<option value="Design">Design</option> | ||
<option value="Common">Common</option> | ||
</select> | ||
</div> | ||
|
||
<div class="field"> | ||
<label>Upload Time Table</label> | ||
<input placeholder="Upload Time Table" type="file" id="time_table" name="time_table" required> | ||
</div> | ||
|
||
<div class="field"> | ||
<div class="ui labeled button" id="add_timetable" tabindex="0"> | ||
<div class="ui blue button"> | ||
<i class="upload icon"></i> | ||
</div> | ||
<a class="ui basic blue left pointing label">Upload</a> | ||
</div> | ||
<div class="load" id="load_add_timetable" style="display:none"> | ||
<!-- <img src="{% static 'globals/img/loading.gif'%}" alt="#loading"> --> | ||
<span >Your file is being uploaded!</span> | ||
</div> | ||
</div> | ||
|
||
|
||
</form> | ||
{% if timetable %} | ||
<form class="ui form" method="post" enctype="multipart/form-data" action="/ocms/delete_timetable/"> | ||
{% csrf_token %} | ||
<table class="ui fixed sortable celled table"> | ||
<thead> | ||
<tr> | ||
<th style="width: 20%;">Upload Time</th> | ||
<th style="width: 17%;">Programme</th> | ||
<th style="width: 12%;">Batch</th> | ||
<th style="width: 15%;">Branch</th> | ||
<th style="width: 46%;"> Timetable File</th> | ||
<th style="width:12%">Action</th> | ||
|
||
</tr> | ||
</thead> | ||
<tbody> | ||
|
||
{% for c in timetable %} | ||
<tr id="visualize_{{forloop.counter}}"> | ||
<td>{{ c.upload_date }}</td> | ||
<td>{{c.programme}}</td> | ||
<td>{{ c.batch }}</td> | ||
<td>{{ c.branch }}</td> | ||
<td> | ||
<div class="content"> | ||
<a href="../media/{{ c.time_table }}" class="header">Download</a> | ||
</div> | ||
</td> | ||
|
||
<!-- <div style="width:100%;height:100%" id='pdf_modal_{{forloop.counter}}' class="ui sixteen wide column fullscreen modal"> | ||
<i class="close icon"></i> | ||
<object style="width:100%;height:100%;align-self:center;" data="../media/{{c.time_table}}" type="application/pdf"> | ||
</div> | ||
<script type="text/javascript"> | ||
$(document).ready( | ||
function () { | ||
$('#visualize_{{forloop.counter}}').click(function () { | ||
$('#pdf_modal_{{forloop.counter}}').modal('show'); | ||
}); | ||
}) | ||
</script> --> | ||
|
||
<!-- <td><button type="submit" value="{{ c.time_table }}" name="delete"> | ||
<i class="trash icon" style="font-size:1.3vw;color:red;"></i></button></td> --> | ||
<td> <a href="#"><i class="trash icon" data-pk="{{c.pk}}" style="font-size:1.3vw;color:red;"></i></a></td> | ||
|
||
</tr> | ||
{% endfor %} | ||
|
||
|
||
</tbody> | ||
</table> | ||
</form> | ||
{% endif %} | ||
</div> | ||
|
||
{% endblock %} |
581 changes: 426 additions & 155 deletions
581
FusionIIIT/templates/coursemanagement/viewcourse.html
Large diffs are not rendered by default.
Oops, something went wrong.
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,29 @@ | ||
{% load static %} | ||
{% block sidepanel %} | ||
{% load notifications_tags %} | ||
{% for notice in notifications %} | ||
{% if notice.unread %} | ||
{% if notice.data.module == 'Course Management' %} | ||
{% if notice.data.course == course.pk %} | ||
<div class="ui icon message"> | ||
<i class="inbox icon"></i> | ||
<div class="content"> | ||
<div class="header"> | ||
<a href="{% url 'notifications:mark_as_read_and_redirect' notice.slug %}"> | ||
{{notice.data.cname}} | ||
</a> | ||
|
||
</div> | ||
<p>{{ notice.verb }}</p> | ||
</div> | ||
<div class="ui right floated"> | ||
<a href="{% url 'notifications:delete' notice.slug %}"> | ||
<i class="close icon"></i> | ||
</a> | ||
</div> | ||
</div> | ||
{% endif%} | ||
{% endif%} | ||
{% endif %} | ||
{% endfor %} | ||
{% endblock %} |