Giter Club home page Giter Club logo

tin-chi-kma's Introduction

TIN-CHI-KMA

Module tích hợp để tương tác với hệ thống đăng ký tín chỉ của CMCSoft . Ví dụ:

ĐẠI HỌC HÀNG HẢI

ĐẠI HỌC VINH

...

CÀI ĐẶT

Cài từ npmjs:

npm install --save tin-chi-kma

Cài từ github:

npm install --save Notekunn/tin-chi-kma

KHỞI TẠO

HOST_API chính là phần url trước CMCSoft.IU.Web.info không bao gồm dấu /.

Khởi tạo api như sau:

    const login = require("tin-chi-kma")({ HOST_API: 'HOST_API CUA BAN' });
    login({ user: '', pass: '' }, function(error, api) {

    })

LOGIN

Đăng nhập vào trang đăng ký tín chỉ.

   login({user:'MA SINH VIEN', pass: 'Mat khau'}, function(error,api){
      /*
        Biến error chứa lỗi, mang giá trị undefined nếu không có lỗi
        Biến api là 1 object chứa các api hoặc undefined nếu bị lỗi
      */
   })
   // Hoặc
   login({user:'MA SINH VIEN', pass: 'Mat khau'})
    .then(api => {})
    .catch(error => {})

CÁC API

api.studyRegister

Các api để đăng ký tín chỉ

api.studyRegister.showAcademicYears

api lấy các năm học(khóa học)

   api.studyRegister.showAcademicYears(function(error, years){
       /*
       years là 1 mảng chứa các object { name: 'Tên Khóa', value: drpAcademicYear }
       */
   })
   //Hoặc
   api.studyRegister.showAcademicYears()
       .then()
       .catch();

api.studyRegister.showCourses

api lấy thông tin về các môn học

   api.studyRegister.showCourses(drpAcademicYear, function(error, courses){
       /*
       courses là 1 mảng chứa các object { name: 'Tên Môn HỌC', value: drpCourse }
       */
   })
   //Hoặc
   api.studyRegister.showCourses(drpAcademicYear)
       .then()
       .catch();

api.studyRegister.showClasses

api lấy các lớp học của môn học đó

    api.studyRegister.showClasses(drpAcademicYear, drpCourse, function(error, classes) {
        /*
        classes là mảng chứa các object về thông tin các lớp học
        */
    })
    //Hoặc
    api.studyRegister.showClasses(drpAcademicYear, drpCourse)
       .then()
       .catch();

api.studentTimeTable

các api liên quan đến thời khóa biểu

api.studyRegister.showSemesters

api lấy các học kỳ

    api.studyRegister.showSemesters(function(error, semesters) {
        /*
        semesters là mảng chứa các object về thông tin các học kỳ
           name: tên học kỳ
           value: chuỗi hash
        */
    })
    //Hoặc
    api.studyRegister.showSemesters()
        .then()
        .catch();

api.studentTimeTable.showTimeTable

api lấy thời khóa biểu

    api.studentTimeTable.showTimeTable(semester /* giá trị value ở trên hoặc để undefined nếu lấy thời khóa biểu khóa mới nhât */ , function(scheduleData) {
        /*
           Trả về mảng thời khóa biểu
        */
    })
    //Hoặc
    api.studyRegister.showTimeTable(semester)
        .then()
        .catch();

api.studentProfile

các api liên quan đến thông tin sinh viên

api.studentProfile.show

api show thông tin

    api.studentProfile.show(function(error, information) {
        /*
        information object chứa thông tin về thông tin các học kỳ
            displayName
            studentCode
            gender
            birthday
        */
    })
    //Hoặc
    api.studyRegister.show()
        .then()
        .catch();

tin-chi-kma's People

Contributors

dependabot[bot] avatar notekunn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.