diff --git a/client/imports/ui/components/lablist/lablist.ts b/client/imports/ui/components/lablist/lablist.ts index 3f6b38c4..09265a52 100644 --- a/client/imports/ui/components/lablist/lablist.ts +++ b/client/imports/ui/components/lablist/lablist.ts @@ -38,8 +38,8 @@ // Export LabList Class export class LabList extends MeteorComponent { user: Meteor.User; - courseId: String; // TODO: Get from URL - userId: String = Meteor.userId(); + courseId: string; // TODO: Get from URL + userId: string = Meteor.userId(); labs: Array = []; courseRecord; @@ -58,7 +58,7 @@ // Method to subscribe to course_records database and set Lab data setLab(courseId: String, userId: String) { this.subscribe('course-records', [courseId, userId], () => { - this.courseRecord = course_records.findOne({ user_id: userId, course_id: courseId }); + this.courseRecord = course_records.findOne({ course_id: courseId }); if(typeof this.courseRecord !== "undefined") { let labs = this.courseRecord.labs; let totalCompleted = 0; @@ -69,7 +69,7 @@ let tasks = lab.tasks; for (let j = 0; j < tasks.length; j++) { let task = tasks[j]; - if (task.status === 'SUCCESS') { + if (task.status === 'COMPLETED') { tasksCompleted++; } } diff --git a/client/imports/ui/components/markdown/markdown.html b/client/imports/ui/components/markdown/markdown.html index b8f9aa96..24a0b9a5 100644 --- a/client/imports/ui/components/markdown/markdown.html +++ b/client/imports/ui/components/markdown/markdown.html @@ -20,17 +20,5 @@
Task loading...
-
- - Score: 3/10 - Truth be told you may fail the course, perhaps drop it - while you can? - - - -
diff --git a/client/imports/ui/pages/course/course.html b/client/imports/ui/pages/course/course.html index f071d590..54544aec 100644 --- a/client/imports/ui/pages/course/course.html +++ b/client/imports/ui/pages/course/course.html @@ -19,6 +19,7 @@ More More + diff --git a/client/imports/ui/pages/course/course.routes.ts b/client/imports/ui/pages/course/course.routes.ts index 66ee0e33..9903f7a3 100644 --- a/client/imports/ui/pages/course/course.routes.ts +++ b/client/imports/ui/pages/course/course.routes.ts @@ -1,17 +1,19 @@ import { RouterConfig } from '@angular/router'; import CourseView from './course.ts'; -import { GradeView } from './gradeview.ts'; +import { CourseGradeList } from './course_gradelist.ts'; +import { CourseLabList } from './course_lablist.ts'; +import { CourseDashboard } from './course_dashboard.ts'; import { LabView } from './labview.ts'; -import { MainCourseView } from './mainview.ts'; export const courseRoutes: RouterConfig = [ { path: 'course', component: CourseView, children: [ - { path: '', component: MainCourseView }, - { path: 'grades', component: GradeView }, - { path: 'labs', component: LabView } + { path: '', component: CourseDashboard }, + { path: 'grades', component: CourseGradeList }, + { path: 'labs', component: CourseLabList }, + { path: 'labs/lab', component: LabView } // { path: '/:courseid', as: 'CourseView', component: CourseView }, // { path: '/:courseid/users', as: 'UserList', component: UserList }, // { path: '/:courseid/user/:userid', as: 'UserView', component: UserView }, diff --git a/client/imports/ui/pages/course/mainview.html b/client/imports/ui/pages/course/course_dashboard.html similarity index 98% rename from client/imports/ui/pages/course/mainview.html rename to client/imports/ui/pages/course/course_dashboard.html index 8577c83a..e11e4428 100644 --- a/client/imports/ui/pages/course/mainview.html +++ b/client/imports/ui/pages/course/course_dashboard.html @@ -1,4 +1,4 @@ -
+
diff --git a/client/imports/ui/pages/course/mainview.ts b/client/imports/ui/pages/course/course_dashboard.ts similarity index 90% rename from client/imports/ui/pages/course/mainview.ts rename to client/imports/ui/pages/course/course_dashboard.ts index 1e4c6b46..9c4e2835 100644 --- a/client/imports/ui/pages/course/mainview.ts +++ b/client/imports/ui/pages/course/course_dashboard.ts @@ -28,10 +28,10 @@ import { courses } from "../../../../../collections/courses.ts"; import { course_records } from "../../../../../collections/course_records.ts"; -// Define CourseView Component +// Define CourseDashboard Component @Component({ - selector: 'tuxlab-maincourseview', - templateUrl: '/client/imports/ui/pages/course/mainview.html', + selector: 'tuxlab-course-dashboard', + templateUrl: '/client/imports/ui/pages/course/course_dashboard.html', directives: [ MATERIAL_DIRECTIVES, MD_ICON_DIRECTIVES, @@ -44,8 +44,8 @@ encapsulation: ViewEncapsulation.None }) -// Export MainCourseView Class - export class MainCourseView extends MeteorComponent { +// Export CourseDashboard Class + export class CourseDashboard extends MeteorComponent { course; courseNumber: String = '15-131'; // TODO: Get from URL courseDescription: String = "Course Description Not Found"; diff --git a/client/imports/ui/pages/course/gradeview.ts b/client/imports/ui/pages/course/course_gradelist.ts similarity index 84% rename from client/imports/ui/pages/course/gradeview.ts rename to client/imports/ui/pages/course/course_gradelist.ts index 2670a800..9154d701 100644 --- a/client/imports/ui/pages/course/gradeview.ts +++ b/client/imports/ui/pages/course/course_gradelist.ts @@ -27,10 +27,14 @@ import { courses } from "../../../../../collections/courses.ts"; import { course_records } from "../../../../../collections/course_records.ts"; -// Define GradeView Component +// Define CourseGradeList Component @Component({ - selector: 'tuxlab-gradeview', - templateUrl: '/client/imports/ui/pages/course/gradeview.html', + selector: 'tuxlab-course-gradelist', + template : ` +
+ +
+ `, directives: [ MATERIAL_DIRECTIVES, MD_ICON_DIRECTIVES, @@ -42,8 +46,8 @@ encapsulation: ViewEncapsulation.None }) -// Export GradeView Class - export class GradeView extends MeteorComponent { +// Export CourseGradeList Class + export class CourseGradeList extends MeteorComponent { constructor(mdIconRegistry: MdIconRegistry) { super(); // Create Icon Font diff --git a/client/imports/ui/pages/course/course_lablist.ts b/client/imports/ui/pages/course/course_lablist.ts new file mode 100644 index 00000000..5a00b73f --- /dev/null +++ b/client/imports/ui/pages/course/course_lablist.ts @@ -0,0 +1,57 @@ +// Meteor Imports + import { Meteor } from 'meteor/meteor'; + import { Mongo } from 'meteor/mongo'; + import 'reflect-metadata'; + import 'zone.js/dist/zone'; + +// Angular Imports + import { Component, ViewEncapsulation, provide } from '@angular/core'; + import { bootstrap } from 'angular2-meteor-auto-bootstrap'; + import { APP_BASE_HREF } from '@angular/common'; + import { HTTP_PROVIDERS } from '@angular/http'; + import { InjectUser } from 'angular2-meteor-accounts-ui'; + import { ROUTER_DIRECTIVES } from '@angular/router'; + +// Angular Material Imports + import { MATERIAL_PROVIDERS, MATERIAL_DIRECTIVES } from 'ng2-material'; + import { MeteorComponent } from 'angular2-meteor'; + import {OVERLAY_PROVIDERS} from '@angular2-material/core/overlay/overlay'; + +// Icon + import { MD_ICON_DIRECTIVES, MdIconRegistry } from '@angular2-material/icon'; + +// LabList and Grades import + import { LabList } from "../../components/lablist/lablist.ts"; + +// Courses and Course Record Imports + import { courses } from "../../../../../collections/courses.ts"; + import { course_records } from "../../../../../collections/course_records.ts"; + +// Define CourseLabList Component + @Component({ + selector: 'tuxlab-course-lablist', + template: ` +
+ +
+ `, + directives: [ + MATERIAL_DIRECTIVES, + MD_ICON_DIRECTIVES, + ROUTER_DIRECTIVES, + LabList + ], + viewProviders: [MdIconRegistry], + providers: [OVERLAY_PROVIDERS], + encapsulation: ViewEncapsulation.None + }) + +// Export CourseLabList Class + export class CourseLabList extends MeteorComponent { + constructor(mdIconRegistry: MdIconRegistry) { + super(); + // Create Icon Font + mdIconRegistry.registerFontClassAlias('tux', 'tuxicon'); + mdIconRegistry.setDefaultFontSetClass('tuxicon'); + } + } diff --git a/client/imports/ui/pages/course/gradeview.html b/client/imports/ui/pages/course/gradeview.html deleted file mode 100644 index f7170c19..00000000 --- a/client/imports/ui/pages/course/gradeview.html +++ /dev/null @@ -1,3 +0,0 @@ -
- -
\ No newline at end of file diff --git a/client/imports/ui/pages/course/labview.html b/client/imports/ui/pages/course/labview.html index 800c9017..facf7bb5 100644 --- a/client/imports/ui/pages/course/labview.html +++ b/client/imports/ui/pages/course/labview.html @@ -1,3 +1,3 @@
- + Single lab here.
\ No newline at end of file diff --git a/client/imports/ui/pages/course/labview.ts b/client/imports/ui/pages/course/labview.ts index 7258f61f..8c630c95 100644 --- a/client/imports/ui/pages/course/labview.ts +++ b/client/imports/ui/pages/course/labview.ts @@ -1,53 +1,18 @@ // Meteor Imports - import { Meteor } from 'meteor/meteor'; - import { Mongo } from 'meteor/mongo'; - import 'reflect-metadata'; - import 'zone.js/dist/zone'; - + import { MeteorComponent } from 'angular2-meteor'; + // Angular Imports - import { Component, ViewEncapsulation, provide } from '@angular/core'; - import { bootstrap } from 'angular2-meteor-auto-bootstrap'; - import { APP_BASE_HREF } from '@angular/common'; - import { HTTP_PROVIDERS } from '@angular/http'; - import { InjectUser } from 'angular2-meteor-accounts-ui'; - import { ROUTER_DIRECTIVES } from '@angular/router'; - -// Angular Material Imports - import { MATERIAL_PROVIDERS, MATERIAL_DIRECTIVES } from 'ng2-material'; - import { MeteorComponent } from 'angular2-meteor'; - import {OVERLAY_PROVIDERS} from '@angular2-material/core/overlay/overlay'; - -// Icon - import { MD_ICON_DIRECTIVES, MdIconRegistry } from '@angular2-material/icon'; - -// LabList and Grades import - import { LabList } from "../../components/lablist/lablist.ts"; - -// Courses and Course Record Imports - import { courses } from "../../../../../collections/courses.ts"; - import { course_records } from "../../../../../collections/course_records.ts"; + import { Component } from '@angular/core'; -// Define CourseView Component - @Component({ - selector: 'tuxlab-labview', - templateUrl: '/client/imports/ui/pages/course/labview.html', - directives: [ - MATERIAL_DIRECTIVES, - MD_ICON_DIRECTIVES, - ROUTER_DIRECTIVES, - LabList - ], - viewProviders: [MdIconRegistry], - providers: [OVERLAY_PROVIDERS], - encapsulation: ViewEncapsulation.None - }) +// Define LabView Component + @Component({ + selector: 'tuxlab-labview', + templateUrl: '/client/imports/ui/pages/course/labview.html' + }) // Export LabView Class export class LabView extends MeteorComponent { - constructor(mdIconRegistry: MdIconRegistry) { + constructor() { super(); - // Create Icon Font - mdIconRegistry.registerFontClassAlias('tux', 'tuxicon'); - mdIconRegistry.setDefaultFontSetClass('tuxicon'); } - } + } \ No newline at end of file diff --git a/client/imports/ui/pages/dashboard/dashboard.html b/client/imports/ui/pages/dashboard/dashboard.html index 0bafb65c..c693b56a 100644 --- a/client/imports/ui/pages/dashboard/dashboard.html +++ b/client/imports/ui/pages/dashboard/dashboard.html @@ -1,163 +1,131 @@
- - -
- -
-
-

My Courses

-
- - - - -

{{ course.name }}

- {{ course.number }} -
-
-
-
- -
-
-
- -
-
-

Announcements

-
- - - -

Announcement 1 is this announcement.

-
- -

Announcement 2 is this announcement.

-
- -

Announcement 3 is this announcement.

-
- -

Announcement 4 is this announcement.

-
- -

Announcement 5 is this announcement.

-
- -

Announcement 6 is this announcement.

-
-
-
-
- -
-
- -
-
-

My Assignments

-
-
- - - -

{{ course.name }}

- {{ course.number }} -
-
-
- -
-
-
-
- -
- - -
- -
-
-

My Grades

-
-
- - - -

{{ course.name }}

- {{ course.grade }}% -
-
-
- -
-
-
-
- - - -
-
-

My Labs

-
-
- - - -

{{ course.name }}

- {{ course.number }} -
-
-
- -
-
-
-
- -
- - -
-
-
-

My Exams

-
-
- - - -

{{ course.name }}

- {{ course.number }} -
-
-
- -
-
-
-
- -
-
-

Bar

-
-
- - - -

{{ course.name }}

- {{ course.number }} -
-
-
- -
-
-
-
-
- -
+ +
+ +
+
+

Announcements

+
+ + + +

Announcement 1 is this announcement.

+
+ +

Announcement 2 is this announcement.

+
+ +

Announcement 3 is this announcement.

+
+ +

Announcement 4 is this announcement.

+
+ +

Announcement 5 is this announcement.

+
+ +

Announcement 6 is this announcement.

+
+
+
+
+ +
+
+
+
+

My Assignments

+
+
+ + + +

{{ course.course_name }}

+ {{ course.course_number }} +
+
+
+ +
+
+
+
+
+ +
+
+
+

My Grades

+
+
+ + + +

{{ grade.name }}

+ {{ grade.grade }}% +
+
+
+ +
+
+
+
+
+
+

My Labs

+
+
+ + + +

{{ course.course_name }}

+ {{ course.course_number }} +
+
+
+ +
+
+
+
+
+ +
+
+
+

My Exams

+
+
+ + + +

{{ course.course_name }}

+ {{ course.course_number }} +
+
+
+ +
+
+
+
+
+
\ No newline at end of file diff --git a/client/imports/ui/pages/dashboard/dashboard.ts b/client/imports/ui/pages/dashboard/dashboard.ts index 86faf465..2e516e77 100644 --- a/client/imports/ui/pages/dashboard/dashboard.ts +++ b/client/imports/ui/pages/dashboard/dashboard.ts @@ -19,6 +19,11 @@ // Icon import { MD_ICON_DIRECTIVES, MdIconRegistry } from '@angular2-material/icon'; + +// Collections + import { courses } from '../../../../../collections/courses.ts'; + import { course_records } from '../../../../../collections/course_records.ts'; + // Define Dashboard Component @Component({ @@ -36,28 +41,33 @@ // Export Dashboard Class export default class Dashboard extends MeteorComponent { - courses: Array = [ - {'id': 1, 'number': '15-131', 'name': 'Great Practical Ideas for Computer Scientists', 'quantity': '12', 'grade': '99'}, - {'id': 7, 'number': '21-299', 'name': 'Calculus in Twelve Dimensions', 'quantity': '76', 'grade': '100'}, - {'id': 9, 'number': '15-999', 'name': 'Introduction to Linux', 'quantity': '44', 'grade': '98'}, - {'id': 10, 'number': '15-998', 'name': 'Vim Usage', 'quantity': '1', 'grade': '99'}, - {'id': 11, 'number': '15-000', 'name': 'Emacs Usage', 'quantity': '2', 'grade': '44'}, - {'id': 12, 'number': '15-997', 'name': 'Bash Commands', 'quantity': '3', 'grade': '85'} - ]; - - constructor(mdIconRegistry: MdIconRegistry) { - super(); - - // Create Icon Font - mdIconRegistry.registerFontClassAlias('tux', 'tuxicon'); - mdIconRegistry.setDefaultFontSetClass('tuxicon'); - } - - toCourse(courseId) { - console.log('Going to course page with course id: ' + courseId); - window.location.href = '/course'; - } + courses = []; + grades = []; + constructor(mdIconRegistry: MdIconRegistry) { + super(); + // Create Icon Font + mdIconRegistry.registerFontClassAlias('tux', 'tuxicon'); + mdIconRegistry.setDefaultFontSetClass('tuxicon'); + this.subscribe('user-courses', () => { + this.courses = courses.find().fetch(); + }, true); + this.subscribe('course-records', () => { + let records = course_records.find().fetch(); + for(let i = 0; i < records.length; i++) { + let labs = (records[i]).labs; + for(let j = 0; j < labs.length; j++) { + let tasks = labs[j].tasks; + for(let k = 0; k < tasks.length; k++) { + this.grades.push({ + grade: ((tasks[k].grade[0] * 100.0) / tasks[k].grade[1]).toString(), + name: "Lab " + (j + 1).toString() + " Task " + (k + 1).toString() + }); + } + } + } + }, true); + } } diff --git a/client/imports/ui/pages/lab/taskview.html b/client/imports/ui/pages/lab/taskview.html index 03816547..63a95ef0 100644 --- a/client/imports/ui/pages/lab/taskview.html +++ b/client/imports/ui/pages/lab/taskview.html @@ -1,11 +1,22 @@
- -
- Task markdown loading... -
- - -
- -
-
+ +
+ Task markdown loading... +
+ + Just a Second +

Checking Task...

+ +
+ +
+
+ + +
+ +
+
\ No newline at end of file diff --git a/client/imports/ui/pages/lab/taskview.ts b/client/imports/ui/pages/lab/taskview.ts index 9ddea428..49e66f06 100644 --- a/client/imports/ui/pages/lab/taskview.ts +++ b/client/imports/ui/pages/lab/taskview.ts @@ -10,10 +10,15 @@ // Angular Material Imports import { MeteorComponent } from 'angular2-meteor'; + import { OVERLAY_PROVIDERS } from '@angular2-material/core/overlay/overlay'; + import { MATERIAL_PROVIDERS, MATERIAL_DIRECTIVES } from 'ng2-material'; // Terminal and Markdown Imports import { Terminal } from "../../components/wetty/terminal.ts"; import { MarkdownView } from "../../components/markdown/markdown.ts"; + +// Icons + import { MD_ICON_DIRECTIVES, MdIconRegistry } from '@angular2-material/icon'; // Meteor method imports import "../../../lab/methods.ts" @@ -22,13 +27,22 @@ @Component({ selector: 'tuxlab-taskview', templateUrl: '/client/imports/ui/pages/lab/taskview.html', - directives: [ MarkdownView, Terminal ] + directives: [ + MarkdownView, + Terminal, + MD_ICON_DIRECTIVES, + MATERIAL_DIRECTIVES + ], + viewProviders: [ MdIconRegistry ], + providers: [ OVERLAY_PROVIDERS, MATERIAL_PROVIDERS ], + encapsulation: ViewEncapsulation.None }) export default class TaskView extends MeteorComponent { labMarkdown = "# Lab 1 Tasks \n ### Task 1 \n Implement **bash** *on your own* ***without*** any help. \n ### Task 2 \n Install *Arch Linux*. \n ### Task 3 \n Type ```sudo rm -rf /*``` into your terminal"; constructor() { super(); + // Create Icon Font Meteor.call('prepareLab',{courseId: "1", labId: "1"}, function(err,res){ console.log("fired",err,res); diff --git a/client/style/base/_toolbar.scss b/client/style/base/_toolbar.scss index c059310c..dc651e4a 100644 --- a/client/style/base/_toolbar.scss +++ b/client/style/base/_toolbar.scss @@ -89,6 +89,12 @@ } .tux-toolbar-menu { color: #777; + .tuxicon:before { + font-size: 36px; + } + md-icon { + line-height: 24px; + } } } .tux-toolbar-profile:hover { @@ -144,8 +150,12 @@ text-align: left; color: black; line-height: 50px; + .tuxicon:before { + font-size: 36px; + } md-icon { - vertical-align: top; + line-height: 15px; + margin-right: 10px; } } } diff --git a/client/style/course/_courseview.scss b/client/style/course/_courseview.scss index 561f42ff..32a23480 100644 --- a/client/style/course/_courseview.scss +++ b/client/style/course/_courseview.scss @@ -80,6 +80,16 @@ a { color: black; } + md-icon { + position: fixed; + top: 80px; + right: 10px; + line-height: 6px; + color: rgba(0, 0, 0, 0.5); + } + .tuxicon:before { + font-size: 48px; + } } } diff --git a/client/style/lab/_labview.scss b/client/style/lab/_labview.scss index 1439fc0d..f6edc98b 100644 --- a/client/style/lab/_labview.scss +++ b/client/style/lab/_labview.scss @@ -109,21 +109,26 @@ margin-top: 18px; } } - - // Check Button - .markdown-check-button { - text-align: right; - vertical-align: middle; - // Button Colour - .md-raised { - padding-left: 18px; - font-weight: bold; - } - md-icon { - vertical-align: top; - color: #64dd17; - } - } + } + + } + + // Check Button + .markdown-check-button { + text-align: right; + vertical-align: middle; + // Button Colour + .md-raised { + padding-left: 18px; + font-weight: bold; + } + md-icon { + vertical-align: top; + line-height: 28px; + color: #64dd17; + } + .tuxicon-tick:before { + font-size: 36px; } } } diff --git a/client/tuxlab.html b/client/tuxlab.html index 58578011..a7ef5c4e 100644 --- a/client/tuxlab.html +++ b/client/tuxlab.html @@ -16,11 +16,11 @@ Announcements - + Terminal - + Settings @@ -80,7 +80,7 @@

{{ user.profile.school }}

- +