Skip to content
This repository has been archived by the owner on Feb 10, 2019. It is now read-only.

Commit

Permalink
Design improvements overall, continued work on assignment workflow
Browse files Browse the repository at this point in the history
- Added landing page, fixes #18
- Added about and help pages
- Added description to assignment creation, #17
- Added submission exceptions (WIP)
- Added course landing pages in all views
- Changed naming convention, grades -> courses, fixes #24
- Added inactive courses to data model
- Fixed nav-menu-link to use RouterModule
- Started work on #23, #25, #26
  • Loading branch information
CaerusKaru committed Jul 16, 2017
1 parent 79580bf commit fa3c1b3
Show file tree
Hide file tree
Showing 65 changed files with 981 additions and 193 deletions.
69 changes: 69 additions & 0 deletions src/app/admin/admin-course/admin-course.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<div class="md-padding" *ngIf="course" fxLayout="column">
<a class="mat-caption" routerLink="../">Back</a>
<h2 class="mat-heading">{{course['name']}}</h2>

<h4 class="mat-heading">Course Actions</h4>
<md-card fxLayout="row" fxLayoutGap="20px">
<button md-raised-button color="primary" routerLink="create">ADD</button>
<button md-raised-button color="primary">GRADEBOOK</button>
<button md-raised-button color="primary">GRADERS</button>
<button md-raised-button color="primary">CALENDAR</button>
</md-card>

<span fxFlex="10px"></span>

<h4 class="mat-heading">Assignments</h4>
<div fxLayout="column" fxLayoutGap="35px">
<md-card fxLayout="row" fxLayout="row" *ngFor="let assign of course['assigns']" fxLayoutGap="20px"
md-ripple class="admin-box" routerLink="{{assign}}">
<div fxLayout="column" fxLayoutGap="5px" fxLayoutAlign="center center">
<div class="mat-caption">
Name
</div>
<div class="mat-body-2">
{{assign}}
</div>
</div>
<div fxLayout="column" fxLayoutGap="5px" fxLayoutAlign="center center">
<div class="mat-caption">
Submissions
</div>
<div class="mat-body-2">
25
</div>
</div>
<div fxLayout="column" fxLayoutGap="5px" fxLayoutAlign="center center">
<div class="mat-caption">
Complete
</div>
<div class="mat-body-2">
12
</div>
</div>
<div fxLayout="column" fxLayoutGap="5px" fxLayoutAlign="center center">
<div class="mat-caption">
Remaining
</div>
<div class="mat-body-2">
13
</div>
</div>
<div fxLayout="column" fxLayoutGap="5px" fxLayoutAlign="center center">
<div class="mat-caption">
Start Date
</div>
<div class="mat-body-2">
Thurs Jan 13, 2017 12:12pm
</div>
</div>
<div fxLayout="column" fxLayoutGap="5px" fxLayoutAlign="center center">
<div class="mat-caption">
End Date
</div>
<div class="mat-body-2">
Fri Jan 14, 2017 12:15pm
</div>
</div>
</md-card>
</div>
</div>
4 changes: 4 additions & 0 deletions src/app/admin/admin-course/admin-course.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.admin-box {
cursor: pointer;
outline: none;
}
25 changes: 25 additions & 0 deletions src/app/admin/admin-course/admin-course.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { AdminCourseComponent } from './admin-course.component';

describe('AdminCourseComponent', () => {
let component: AdminCourseComponent;
let fixture: ComponentFixture<AdminCourseComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AdminCourseComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(AdminCourseComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should be created', () => {
expect(component).toBeTruthy();
});
});
42 changes: 42 additions & 0 deletions src/app/admin/admin-course/admin-course.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import {Component, OnDestroy, OnInit} from '@angular/core';
import {UserService} from '../../shared/services/user.service';
import {Subject} from 'rxjs/Subject';
import {takeUntil} from 'rxjs/operator/takeUntil';
import {ActivatedRoute} from '@angular/router';

@Component({
selector: 'vg-admin-course',
templateUrl: './admin-course.component.html',
styleUrls: ['./admin-course.component.scss']
})
export class AdminCourseComponent implements OnInit, OnDestroy {

courses = this._userService.admin;

private _course: string;
private _courses = [];
private _destroy = new Subject<void>();

constructor(
private _userService: UserService,
private _route: ActivatedRoute
) { }

ngOnInit() {
takeUntil.call(this._route.params, this._destroy).subscribe(params => {
this._course = params['course'];
});
takeUntil.call(this.courses, this._destroy).subscribe(data => {
this._courses = data;
});
}

ngOnDestroy() {
this._destroy.next();
this._destroy.complete();
}

get course() {
return this._courses.find(a => a['name'] === this._course);
}
}
50 changes: 35 additions & 15 deletions src/app/admin/admin-create/admin-create.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
<md-card>
<md-tab-group dynamicHeight="true" [(selectedIndex)]="tabIndex" md-stretch-tabs>
<md-tab label="Basic Info">
<div class="mat-caption md-padding">
This section sets the basic information for this submission step. As submission step is only one factor
in the composite assignment, and can be made up of multiple components itself. The settings below
allows you to configure when/what to accept from students, and it is what students will see when
submitting. If any custom alterations need to be made, they can be adjusted in the Advanced section.
</div>
<div fxFlex fxLayout="column" fxLayoutGap="10px" class="md-padding">
<div>
<md-input-container>
Expand Down Expand Up @@ -55,6 +61,13 @@
</md-tab>
<md-tab label="Components">
<div fxFlex class="accordion-inside" fxLayout="column">
<div class="mat-caption">
A component is a tool for organizing grading of an assignment. Students submitting are not aware of
the individual components, but you can assign certain parts of the assignment to different components,
and then assign graders to grade each component. Likewise, each component can have an individual score
that accumulates for the composite score of the assignment. Components can also be made optional by
marking them as Extra Credit.
</div>
<md-accordion formArrayName="components">
<md-expansion-panel *ngFor="let comp of comps.controls; index as i; last as end"
[formGroupName]="i"
Expand Down Expand Up @@ -126,34 +139,41 @@
type="button" (click)="addComp(currentStep)">ADD COMPONENT</button>
</div>
</md-tab>
<md-tab label="Advanced">
<div>Advanced content</div>
<md-tab label="Advanced" formArrayName="exceptions">
<div class="mat-caption">
This section is for advanced configuration of the assignment, including student exceptions, and more
customized parameters for accepting submissions (including file testing and pre-configuration).
</div>
<h3 class="mat-heading">Exceptions</h3>
<div *ngFor="let exception of exceptions.controls; index as i" [formGroupName]="i">
<span>Exception {{i+1}}</span>
</div>
<button md-button (click)="addException(currentStep)">ADD EXCEPTION</button>
</md-tab>
</md-tab-group>
</md-card>
</div>
</div>
<md-sidenav #stepsNav mode="side" opened="true" align="end" style="width: 250px; min-width: 250px; max-width: 250px">
<div class="md-padding" fxLayout="column" fxLayoutGap="10px" fxFlex>
<h3 class="mat-heading" fxLayoutAlign="start center">Create Assignment</h3>
<div fxLayoutGap="15px">
<md-input-container>
<input mdInput placeholder="Assignment Name" formControlName="name">
</md-input-container>
</div>
<div fxLayoutGap="15px">
<md-input-container>
<textarea mdInput mdTextareaAutosize placeholder="Description" formControlName="description"></textarea>
</md-input-container>
</div>
<div fxLayout="row" fxLayoutAlign="center center">
<span class="mat-body">or </span>
<span fxFlex="10px"></span>
<button md-raised-button>UPLOAD</button>
</div>
<div style="overflow-y: auto;" class="accordion-inside" formArrayName="steps">
<!--<md-accordion displayMode="default" multi="true">-->
<!--<md-expansion-panel *ngFor="let step of steps.controls; index as i; last as end"-->
<!--[formGroupName]="i"-->
<!--[expanded]="end">-->
<!--<md-expansion-panel-header>{{i+1}}. {{step.get('name').value}}</md-expansion-panel-header>-->
<!--<div>-->
<!--<button md-button (click)="select(i)">SELECT</button>-->
<!--</div>-->
<!--<md-action-row>-->
<!--<button md-button (click)="removeStep(i)" type="button">DELETE</button>-->
<!--</md-action-row>-->
<!--</md-expansion-panel>-->
<!--</md-accordion>-->
<h4 class="mat-heading" fxLayoutAlign="start center">Submission Steps</h4>
<div fxLayout="row" *ngFor="let step of steps.controls; index as i">
<button md-button (click)="select(i)" type="button">
{{i+1}}. {{step.get('name').value}}
Expand Down
34 changes: 30 additions & 4 deletions src/app/admin/admin-create/admin-create.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component, OnInit} from '@angular/core';
import {Component, OnDestroy, OnInit} from '@angular/core';
import {SubmissionStep} from '../../shared/classes/submission-step';
import {GradingComponent} from '../../shared/classes/grading-component';
import {takeUntil} from 'rxjs/operator/takeUntil';
Expand All @@ -13,7 +13,7 @@ import {FormArray, FormBuilder, FormGroup, Validators} from '@angular/forms';
templateUrl: './admin-create.component.html',
styleUrls: ['./admin-create.component.scss']
})
export class AdminCreateComponent implements OnInit {
export class AdminCreateComponent implements OnInit, OnDestroy {

newStep = 'New Step';
newComp = 'New Component';
Expand All @@ -23,7 +23,7 @@ export class AdminCreateComponent implements OnInit {
createForm: FormGroup;

private _destroy = new Subject<void>();
private _currentIndex: number;
private _currentIndex = 0;

constructor(
private _route: ActivatedRoute,
Expand All @@ -38,6 +38,11 @@ export class AdminCreateComponent implements OnInit {
});
}

ngOnDestroy() {
this._destroy.next();
this._destroy.complete();
}

get steps(): FormArray {
return this.createForm.get('steps') as FormArray;
};
Expand All @@ -49,6 +54,13 @@ export class AdminCreateComponent implements OnInit {
return this.currentStep.get('components') as FormArray;
}

get exceptions(): FormArray {
if (this.currentStep === null) {
return null;
}
return this.currentStep.get('exceptions') as FormArray;
}

get currentStep(): FormGroup {
return this.steps.at(this._currentIndex) as FormGroup;
}
Expand All @@ -66,6 +78,10 @@ export class AdminCreateComponent implements OnInit {
this._currentIndex = this.steps.length - 1;
}

addException(step) {
step.get('exceptions').push(this._setException());
}

addComp(step) {
step.get('components').push(this._setComps());
}
Expand Down Expand Up @@ -110,6 +126,7 @@ export class AdminCreateComponent implements OnInit {
private _createForm() {
this.createForm = this._fb.group({
name: ['', [Validators.required]],
description: '',
steps: this._fb.array([this._setSteps()])
});
}
Expand All @@ -123,7 +140,8 @@ export class AdminCreateComponent implements OnInit {
new_file: '',
files: this._fb.array([]),
allow_other_files: false,
components: this._fb.array([this._setComps()])
components: this._fb.array([this._setComps()]),
exceptions: this._fb.array([])
})
}

Expand All @@ -138,4 +156,12 @@ export class AdminCreateComponent implements OnInit {
graders: this._fb.array([])
});
}

private _setException() {
return this._fb.group({
user: ['', [Validators.required]],
date: new Date(),
reason: ''
})
}
}
62 changes: 39 additions & 23 deletions src/app/admin/admin-home/admin-home.component.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,42 @@
<div fxLayout="column" class="md-padding">
<div fxLayout="column" class="md-padding" fxLayoutGap="25px">
<div *ngFor="let course of courses | async">
<h1>{{course.name}}</h1>
<div fxLayoutWrap fxLayoutAlign="start stretch" fxLayoutGap="20px">
<h3 *ngIf="course.assigns.length === 0">No assignments available</h3>
<md-card fxLayout="column" fxLayoutAlign="center center" fxLayoutGap="10px">
<button md-raised-button color="primary" routerLink="{{course.name}}/create">CREATE</button>
<button md-raised-button color="primary" routerLink="{{course.name}}/manage">MANAGE</button>
</md-card>
<md-card *ngFor="let assign of course.assigns">
<md-card-header>
<md-card-title><h3>{{assign}}</h3></md-card-title>
<md-card-subtitle>n submissions remaining</md-card-subtitle>
</md-card-header>
<md-card-content>
<md-progress-bar color="primary" mode="determinate" [value]="37"></md-progress-bar>
</md-card-content>
<md-card-actions>
<button md-raised-button color="primary" routerLink="{{course.name}}/{{assign}}">VIEW</button>
<span fxFlex></span>
<button md-button>STATS</button>
</md-card-actions>
</md-card>
</div>
<md-card fxLayout="row"
fxLayoutAlign="start center"
fxLayoutGap="40px"
md-ripple
class="admin-box"
routerLink="{{course['name']}}">
<div fxLayout="column" fxLayoutGap="5px" fxLayoutAlign="center center">
<div class="mat-caption">
Name
</div>
<div class="mat-body-2">
{{course['name']}}
</div>
</div>
<div fxLayout="column" fxLayoutGap="5px" fxLayoutAlign="center center">
<div class="mat-caption">
Assignments
</div>
<div class="mat-body-2">
{{course['assigns'].length}}
</div>
</div>
<div fxLayout="column" fxLayoutGap="5px" fxLayoutAlign="center center">
<div class="mat-caption">
Enrollment
</div>
<div class="mat-body-2">
97
</div>
</div>
<span fxFlex></span>
<div>
<button md-raised-button>GRADEBOOK</button>
</div>
<div>
<button md-raised-button routerLink="{{course['name']}}/create">ADD</button>
</div>
</md-card>
</div>
</div>
4 changes: 4 additions & 0 deletions src/app/admin/admin-home/admin-home.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.admin-box {
cursor: pointer;
outline: none;
}
2 changes: 1 addition & 1 deletion src/app/admin/admin-item/admin-item.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div fxFlex class="md-padding" fxLayout="column">
<div>
<a class="mat-caption" routerLink="../../">Back</a>
<a class="mat-caption" routerLink="../">Back</a>
<h1 class="mat-heading">Assignment: {{id}}</h1>
</div>
<div class="mat-elevation-z8">
Expand Down
Loading

0 comments on commit fa3c1b3

Please sign in to comment.