Code Monkey home page Code Monkey logo

uky-cs498-project's Introduction

Maintainability Rating Duplicated Lines (%)

ABET Submission System

This repository is being developed by Ethan Toney for use by the Computer Science department at the University of Kentucky. Only students of Ethan Toney's Fall 2019 CS498 course have permission to download and edit this repository for the purpose of accomplishing the final project.

Technologies/Terms

PostgreSQL - This is the database implementation.

Express - This is an api that handles hosting a website on a specific port and handling requests made to that website.

Objection - This is an orm (object relational mapper) api. It allows you to make database queries without having to write any mysql. I'm primary using it to resolve relations between tables since the equivalent mysql would be very difficult to manage.

Knex - This is a database migration tool. It will create database schemas and populate the tables with seed data.

Mustache - This is a logic-less templating engine for html. Basically just allows you to inject the value of a variable into html.

Mocha - This is the testing library used for this project.

Chai - This is the assertion library used for this project. This is the library you will be using to make assertions in your test cases.

System Outline

src/main/views - folder containing html templates

src/main/routes - folder containing express api handlers

src/main/common - folder containing common functions used throughout the app

src/main/lib - folder containing libraries of functions used by api handler

src/main/models - folder containing Objection JS object models

src/main/migrations - folder containing database migrations

Setup Guide

Install NPM

If you have a package manager on your machine I recommend using it to install npm.

Otherwise download and run the npm installer from https://nodejs.org/en/download/ (This repo has only been manually tested with version 10.16.3 LTS on Mac and Windows)

Make sure to add NPM to your PATH variable if you are on windows! The installer will do this by default as long as you don't disable the option.

Once installed run npm install from the command line in the root directory of the project. This will install all required npm packages.

Install PostgreSQL

If you have a package manager on your machine I recommend using it to install psql.

Otherwise, download and run the PostgreSQL installer from https://www.postgresql.org/download/

Once installed create the following database schemas abet_system_dev and abet_system_test, CREATE DATABASE abet_system_dev; CREATE DATABASE abet_system_test;.

Then open up the knexfile.js file located in the root of this project and add in your database connection information. Here is an example of what that modification could look like.

connection: {
	database: 'abet_system_dev',
	user: 'postgres',
	password: 'password'
}

Then run npm run setup_db. This will run all database migrations and seed both the test and dev servers.

Operation Guide

to run all test cases

npm run test

to run the express app

npm run start

to debug (this will automaticallty restart the express app on file modification)

npm run debug

to run database migrations

npm run migrate - run migrations on dev

npm run migrate:test - run migrations on test

to seed the database with dev data

npm run seed - seeds dev database

npm run seed:test - seeds test database

to run both database migrations and seed the database

npm run setup_db

to run scratch file

npm run scratch

uky-cs498-project's People

Contributors

davidsochill avatar bland34 avatar egtoney avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

uky-cs498-project's Issues

Course Page - New Course Data Validation

The system needs to validate new course information to make sure all fields are inputted correctly. If there's an error, the system needs to notify the user of this error and prevent any database queries with an invalid payload.

Acceptance Criteria: On the course portfolio submission, the system should make sure that none of the fields are missing. These fields are: department, course number, section, semester, year, number of students, and assigned student learning outcomes. If the submit button is pressed with one of the input fields missing, there should be an error message and the form shouldn't reset and they should remain on the same page.

Course Portfolio Due Date Functionality

There should be a due date in the database for each course portfolio. If the due date is expired, the course portfolio should be changed to archived status. The expiration date is always 2 weeks after the last day of finals, and will be hardcoded in the system when the finals dates are released.

Acceptance Criteria:

  • Before the due date is passed, the portfolio is designated as active in the system
  • When the due date passes, the portfolio will be designated as archived/inactive

Course Page - Landing Page Design

When going to /course, the landing page should display "Active Courses" and "Inactive Courses". Both "Active Courses" and "Inactive Courses" should have proper headers and a table with the following attributes: Course, semester, year, artifact progress, due date, and a link. The headers and the tables need to be styled utilizing Bootstrap 4 styles. "Active Courses" and "Inactive Courses" need to be separate Bootstrap 4 containers with borders.

Course Page - Course Portfolio Page Header Mustache Importing

On the course portfolio page, there is a course portfolio header. In this header, the header needs to display the department, course number, section, and type. These should be imported from the course portfolio model using Mustache. As well, the header text generated should capitalize the department text.

Acceptance Criteria

  • When visiting a course portfolio page, there should be a department, course number, section, year, and semester displayed in the theader
  • If the department is not capitalized beforehand, the department should be capitalized visually
  • If the first letter in semester is not capitalized beforehand, the first letter in semester should be capitalized visually
  • If the section doesn't have 3 numbers in the section value, append 0's to the front visually until reaching 3 numbers in the section value
  • For example, there is a course portfolio with: department: 'cs', course number: '498', section: '1', semester: 'fall', year: '2019'
    This course portfolio should display "CS498-001 Fall 2019 Course Portfolio"

Database Integration - Course Controller Error Handling

All course controller methods should be able to handle invalid input avoiding a SQL error or empty inputs on required attributes. This will be accomplished by sanitizing and verifying validity on all attributes of course model.

Acceptance Criteria

  • A method in the course controller class sanitizes and validates the "department_id" attribute by checking for a non-empty input and a valid integer
  • A method in the course controller class sanitizes and validates the "number" attribute by checking for a non-empty input and a valid integer

Login Page - Functionality

The login page should be a form enclosed in a container with two inputs for username and password. As well, the login page container should be placed in the middle of the screen below the top navigation bar. This front end implementation should utilize Bootstrap 4 styling when applicable.

Course Page - Course Portfolio Page Artifact Mustache Importing

On the course portfolio page, there will be three artifacts listed. For each artifact, the artifact will have a name that needs to be imported through mustache. Further, each artifact will have a grid underneath the artifact name, which lists students with inputs for student learning outcomes. Student indexes, student learning outcomes, and user-inputted student learning outcomes need to be imported through mustache.

Acceptance Criteria

  • When viewing a course portfolio page, each artifact will visually have the associated name
  • When viewing a course portfolio page, each artifact will have a grid below the artifact name that contains student indexes with input fields for student learning outcomes

Database Integration - Artifacts

Developer needs to be able to create, read, update, and delete artifacts through a controller class.

Acceptance Criteria: Database manipulations for artifacts are implemented in one class in the controller source directory.

Course Page - Course Portfolio Page Course Summary Mustache Importing

On the course portfolio page, there is a course summary that shows the student learning outcome statistics. The student learning statistics include 'Assessment Score', 'Exceeds Standards', 'Meets Standards', 'Partially Meets Standards', and 'Does Not Meet Standards'. These statistics should be displayed in a table grid. 'na' should be displayed for each corresponding field if that field hasn't been calculated yet.

Acceptance Criteria

  • There will be a course summary row that has header text "Course Summary"
  • On the course summary row, there will be a grid that has column header's including the student learning outcome details
  • On the course summary row, there will be a grid that has row header's including 'Assessment Score', 'Exceeds Standards', 'Partially Meets Standards', and 'Does not Meet Standards'
  • -The grid inside the course summary row should be importing data from the course portfolio model through mustache

Course Page - Course Portfolio Artifact Table Styling

On the course portfolio page, there will be three artifacts listed that have a table with form inputs. The tables with form inputs should be styled using Bootstrap 4. As well, the submit button and table headers should be styled using Bootstrap 4 when applicable.

Course Page - Edit and View Course Portfolio Interface

Based on implementation of #38, the course will be marked as inactive or active. Based on active or inactive status, the interface should change into different views. If active, the artifact table data should be modifiable. If inactive, the artifact table data shouldn't be modifiable.

Acceptance Criteria
A course portfolio marked as active:

  • Display header, course summary, and modifiable artifact table data

A course portfolio marked as inactive:

  • Display header, course summary, and nonmodifiable artifact table data

Database Integration - User Controller Error Handling

All user controller methods should be able to handle invalid input avoiding a SQL error or empty inputs on required attributes. This will be accomplished by sanitizing and verifying validity on all attributes of the user model.

Acceptance Criteria

  • A method in the user controller class sanitizes and validates the "linkblue_id" attribute by checking for a non-empty input and a valid string

Database Integration - Portfolio

Developer needs a controller class to create/edit/update portfolios in the persistent database.

Acceptance criteria: All database manipulations for a portfolio are implemented in one class in the controller source directory

Landing Page - Portfolio List from Database

User should be able to see a list of archived and active courses from the landing page.

Acceptance Criteria: Landing page loads courses from database and displays them as two tables (active/archived) with hyperlinks to view/edit the portfolio

Course Page - Random Student Selection

User needs a random subset of students to be selected for each portfolio based on the total number of students in the portfolio.

Acceptance Criteria: When creating a course portfolio, the user will be able to have a set number of students. Under each artifact in the course portfolio, the user should be able to see a list of randomally generated student indexes. The amount of randomly generated student indexes on each artifact will be based on:
< 10 students inputted = ALL student indexes presented
> 10 students && < 10 students = 20 students presented through random picking
> 50 students = 20% of students presented through random picking

Database Integration - Artifact Evaluation

Developer needs to be able to create, read, update, and delete artifact evaluations in an artifact evaluation class.

Acceptance criteria: All database manipulations for a artifact evaluation are implemented in one class in the controller source directory.

Database Integration - Course

Developer needs to be able to create, read, update, and delete courses through a controller class.

Acceptance criteria: All database manipulations for a course are implemented in one class in the controller source directory.

Database Integration - Artifact Evaluation Error Handling

All artifact evaluation controller methods should be able to handle invalid input avoiding a SQL error or empty inputs on required attributes. This will be accomplished by sanitizing and verifying validity on all attributes of the artifact evaluation model.

Acceptance Criteria

  • A method in the artifact evaluation controller class sanitizes and validates the "artifact_id" attribute by checking for a non-empty input and a valid integer
  • A method in the artifact evaluation controller class sanitizes and validates the "evaluation_index" attribute by checking for a non-empty input and a valid integer
  • A method in the artifact evaluation controller class sanitizes and validates the "student_index" attribute by checking for a non-empty input and a valid integer
  • A method in the artifact evaluation controller class sanitizes and validates the "evaluation" attribute by checking for a non-empty input and a valid json object

Database Integration - Portfolio Error Handling

All course portfolio controller methods should be able to handle invalid input avoiding a SQL error or empty inputs on required attributes. This will be accomplished by sanitizing and verifying validity on all attributes of the course portfolio model.

Acceptance Criteria

  • A method in the course portfolio controller class sanitizes and validates the "course_id" attribute by checking for a non-empty input and a valid integer
  • A method in the course portfolio controller class sanitizes and validates the "instructor_id" attribute by checking for a non-empty input and a valid integer
  • A method in the course portfolio controller class sanitizes and validates the "semester_term_id" attribute by checking for a non-empty input and a valid integer
  • A method in the course portfolio controller class sanitizes and validates the "num_students" attribute by checking for a non-empty input and a valid integer
  • A method in the course portfolio controller class sanitizes and validates the "section" attribute by checking for a non-empty input and a valid integer
  • A method in the course portfolio controller class sanitizes and validates the "year" attribute by checking for a non-empty input and a valid integer

Course Page - Course Portfolio Page Header Styling

On the course portfolio page, there should be a page header that displays the name of the course portfolio. This page header should be directly below the site navigation bar with sufficient padding. As well, the page header should be in a container with a visible border. All style modifications should be utilizing Bootstrap 4 when applicable.

Course Page - New Course Portfolio Page Header Styling

On the course portfolio page, there should be a page header that displays "New Course Portfolio". This page header should be directly below the site navigation bar with sufficient padding. As well, the page header should be in a container with a visible border. All style modifications should be utilizing Bootstrap 4 when applicable.

Course Page - Course Portfolio Course Summary Design

Below the header of the course portfolio page, there should be a course summary that includes the course portfolio's student learning outcome. This course summary should be styled using Bootstrap 4 when applicable.

Database Integration - Users

Developer needs to be able to create, read, update, and delete users through a controller class.

Acceptance criteria: All database manipulations for an user are implemented in one class in the controller source directory.

Data Validation - Initial Janitor Class

The developer needs to implement NFR9 efficiently. The Janitor class provides methods to sanitize input data.

Acceptance Criteria:
sanitizeInt() returns valid Int or NULL if sanitation is not possible.
sanitizeString() returns valid String or NULL if sanitation is not possible.
sanitizeInt() must take String, Int, or Float and return valid Int.
sanitizeString() must take String, Int, or Float and return valid String.

Database Integration - Portfolio SLOs

Developer needs to be able to create, read, update, and delete portfolio SLOs through a department class.

Acceptance criteria: All database manipulations for a portfolio SLO are implemented in one class in the controller source directory.

Course Page - Edit Artifact Names

When a course portfolio is generated, there will be three generated artifacts that do not have set names. The user needs to be able to rename these artifacts to an appropriate name.

Depends on #18

Acceptance Criteria: A hyperlink to edit the artifact name is added. The hyperlink converts the title to a text box where the name can be changed with a save and cancel button. The name change is persisted in the database upon clicking save. The text box reverts to the title if either button is clicked.

Database Integration - Portfolio SLO Controller Error Handling

All portfolio SLO controller methods should be able to handle invalid input avoiding a SQL error or empty inputs on required attributes. This will be accomplished by sanitizing and verifying validity on all attributes of the portfolio SLO model.

Acceptance Criteria

  • A method in the portfolio SLO controller class sanitizes and validates the "portfolio_id" attribute by checking for a non-empty input and a valid integer
  • A method in the portfolio SLO controller class sanitizes and validates the "slo_id" attribute by checking for a non-empty input and a valid integer

Database Integration - Artifact Controller Error Handling

All artifact controller methods should be able to handle invalid input avoiding a SQL error or empty inputs on required attributes. This will be accomplished by sanitizing and verifying validity on all attributes of the artifact model.

Acceptance Criteria

  • A method in the artifact controller class sanitizes and validates the "portfolio_slo_id" attribute by checking for a non-empty input and a valid integer
  • A method in the artifact controller class sanitizes and validates the "index" attribute by checking for a non-empty input and a valid integer
  • A method in the artifact controller class sanitizes and validates the "name" attribute by checking for a non-empty input and a valid integer

All Pages - Navigation Bar Functionality

On all pages, the text "Computer Science ABET System" text on the navigation bar should be clickable and direct the user to the login page if the user has not logged in or the course portfolio landing page if the user is logged in.

Acceptance Criteria:

  • "Computer Science ABET System" title is is visible on all pages
  • When user is logged in, title hyperlinks to home page
  • When user is not logged in, title hyperlinks to login page

Course Page - New Course Submission

User should be able to create a new course and input associated dept, number, section, semester, year, number of students, and learning outcomes.

Acceptance Criteria: On the course submission page, all input fields such as dept, number, section, semester, year, number of students, and learning outcomes should be presented. Then, after inputting into all fields, user will be able to click a submit button. This submit button will create a new course portfolio and navigate them to the course portfolio.

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.