- •Постановка завдання
- •1. Опис використаних технологій
- •1.2. JavaScript
- •1.3. Jquery
- •1.4. Html
- •1.7. Ajax
- •2. Діаграми uml об’єктної моделі системи
- •2.1 Діаграма варіантів використання
- •2.3 Діаграма послідовності
- •2.2 Діаграма дій
- •2.4. Діаграма кооперацій
- •2.5. Діаграми класів
- •2.6. Діаграми станів
- •3. Опис програмної реалізації
- •3.1. Опис серверної частини проекту
- •3.2. Опис клієнтської частини проекту
- •If(!groupInfo.CheckError)
- •If(checkNullUndefined(group))
- •3.3 Реалізація бази даних
- •3.4. Опис реалізованого функціоналу
- •Висновок
- •Список використаної літератури:
- •If(checkNullUndefined(groupId))
- •If(!groupInfo.CheckError)
- •If(!groupInfo.CheckError)
- •If(checkNullUndefined(groupId) && checkNullUndefined(newGroupId))
- •If(checkNullUndefined(groupId))
- •If(checkNullUndefined(studentId))
- •If(checkNullUndefined(studentId))
- •If(checkNullUndefined(studentId))
- •If(!studentInfo.CheckError)
- •If(!studentInfo.CheckError)
- •If(checkNullUndefined(studentId))
- •If(checkNullUndefined(group))
- •If(checkNullUndefined(group))
- •If(checkNullUndefined(student))
- •If(checkNullUndefined)
- •If(item.ClassList.Contains('popupWrapBox'))
If(checkNullUndefined(group))
{
this.addNewGroup(group);
callbackFunc();
}
},
this.basicErrorHandler
);
};
this.editGroup = ({name, curatorNameLast, speciality, groupId}, callbackFunc) =>
{
AjaxController('editGroup',
'groupController',
{name, curatorNameLast, speciality, groupId},
({data: {group}}) =>
{
If(checkNullUndefined(group))
{
this.updateGroup(group);
callbackFunc();
}
},
this.basicErrorHandler
);
};
this.exchangeGroupStudents = ({groupId, newGroupId}, callbackFunc) =>
{
AjaxController('exchangeGroupStudents',
'groupController',
{groupId, newGroupId},
() => callbackFunc(),
this.basicErrorHandler
);
};
this.emptyGroup = ({groupId}, callbackFunc) =>
{
AjaxController('emptyGroup',
'groupController',
{groupId},
() => callbackFunc(),
this.basicErrorHandler
);
};
}
/assets/js/models/StudentModel.js
function StudentModel()
{
this.studentsArr = [];
this.addNewStudent = (student) =>
{
this.studentsArr.push(student);
};
this.updateStudent = (student) =>
{
var studentId = student.id;
this.studentsArr.some((item, i) =>
{
if(item.id === studentId)
{
this.studentsArr[i] = student;
return true;
}
});
};
this.geleteStudent = (studentId) =>
{
this.studentsArr.forEach((item, i) =>
{
if(item.id === studentId)
{
this.studentsArr.splice(i, 1);
}
});
};
this.replaceGroupStudents = (fromGroupId, toGroupId) =>
{
this.studentsArr.forEach((item) =>
{
if(item.groupId === fromGroupId)
{
item.groupId = toGroupId;
}
});
};
this.getGroupStudents = (groupId) =>
{
var studentsArr = [];
this.studentsArr.forEach((item) =>
{
if(item.groupId === groupId)
{
studentsArr.push(item);
}
});
return studentsArr;
};
this.createStudent = ({firstName, lastName, surName, birtday, groupId, gender}, callbackFunc) =>
{
AjaxController('createStudent',
'studentController',
{firstName, lastName, surName, birtday, groupId, gender},
({data: {student}}) =>
{
If(checkNullUndefined(student))
{
this.addNewStudent(student);
callbackFunc();
}
},
this.basicErrorHandler
);
};
this.editStudent = ({firstName, lastName, surName, birtday, groupId, gender, studentId}, callbackFunc) =>
{
AjaxController('editStudent',
'studentController',
{firstName, lastName, surName, birtday, groupId, gender, studentId},
({data: {student}}) =>
{
