Skip to content

Commit dd7e20c

Browse files
cemersozDerekTBrown
authored andcommitted
* issue 32 fixed * removed swp * fixed nconf issues * issue 82, 84 fixes * fixed #82 * isse #77 * fixed tests * fixed files * fixed tests master * fixed comment * moved validator * removed duplicate file * fixed tests, removed duplicate underscore, publish * changes * fixed methods.ts import * fixed issues w methods * fixes * minor fixes * A * api changes * fixed api * comments * minor changes * minor fixes * api changes (#126) * issue 32 fixed * removed swp * fixed nconf issues * issue 82, 84 fixes * fixed #82 * isse #77 * fixed tests * fixed files * fixed tests master * fixed comment * moved validator * removed duplicate file * fixed tests, removed duplicate underscore, publish * changes * fixed methods.ts import * fixed issues w methods * fixes * minor fixes * A * api changes * fixed api * comments * minor changes * minor fixes * method implementations * before merge * removed testing change * fixed typo * fixed prepareLab * removed test methods * fix prepareLab * methods changes * removed swap file * fixed merge * fixes * prepareLab WORKS * further fixes * merge * all works * deleted debug line * fixed minor excess code * minor indentation fix * reference fixes * fixes to nextTask * merged with master * minor changes * fixed merge problems * fixed md view and swithces * fixed error messages * removed debug code * removed swp * fixes * fixed typescript warning * added student object * changed function calls * deleted unnecessary files * updated api, added md feedback * fixed ts warn * fixed example_data and partially tests * update validator, merge * fixed indentation * changes * it's pretty now * fixed #187, #188 * minor fixes * fixed indentation * added equal sign * updated example courses to match schema
1 parent 5590d87 commit dd7e20c

File tree

7 files changed

+193
-152
lines changed

7 files changed

+193
-152
lines changed

collections/labs.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,13 @@ labs.allow({
5151
},
5252
course_id: {
5353
type: String,
54-
regEx: SimpleSchema.RegEx.Id,
5554
custom: function() {
5655
let currentCourse = Collections.courses.findOne({ _id: this.value });
5756
let instructors = currentCourse.instructor_ids;
5857

5958
// Check existence of course
6059
if(currentCourse === "undefined") {
61-
labSchema.addInvalidKeys([{name: "course_id", type: "nonexistantCourse"}]);
60+
labSchema.addInvalidKeys([{name: "course_id", type: "nonexistentCourse"}]);
6261
}
6362
else{
6463
return;

server/imports/api/lab.env.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env.prototype.labVm = '';
2323
env.prototype.docker = null;
2424
env.prototype.vmList = {};
2525
env.prototype.usr = null;
26-
env.prototype.helixKey = null;
26+
env.prototype.dnsKey = null;
2727
env.prototype.redRouterKey = null;
2828

2929
//sets user
@@ -53,13 +53,13 @@ env.deleteRecords = function(user,callback){
5353
}
5454
},
5555
function(cb){
56-
if(this.helixKey){
57-
etcd.del(this.helixKey,{recursive: true}, function(err, res){
56+
if(this.dnsKey){
57+
etcd.del(this.dnsKey,{recursive: true}, function(err, res){
5858
cb(err);
5959
});
6060
}
6161
else{
62-
cb(new Error('silly', 'No HelixKey to Delete.'));
62+
cb(new Error('silly', 'No DNS Key to Delete.'));
6363
}
6464
}
6565
], function(err, results){
@@ -175,7 +175,9 @@ env.prototype.init = function(opts){
175175
//create etcd directory for helix record
176176
var dir = slf.root_dom.split('.');
177177
dir.reverse().push(slf.usr,'A');
178-
slf.helixKey = dir.join('/');
178+
slf.dnsKey = dir.join('/');
179+
slf.dnsKey = "/skydns/"+slf.dnsKey;
180+
179181
slf.redRouterKey = '/redrouter/SSH::'+slf.usr;
180182

181183
//set etcd record for redrouter
@@ -192,13 +194,11 @@ env.prototype.init = function(opts){
192194
if(err){
193195
TuxLog.log('warn', err);
194196
reject(err);
195-
//TODO: get the actual information that we actually want. Perhaps change this entirely
196-
//TODO: @Aaron
197197
}
198198
else{
199-
199+
var dnsIP = container.Node.IP;
200200
//set etcd record for helix
201-
etcd.set(slf.helixKey,container.NetworkSettings,function(err,res){
201+
etcd.set(slf.helixKey,{host: dnsIP},function(err,res){
202202
if(err){
203203
TuxLog.log('warn',err);
204204
reject(err);

server/imports/lab/checkLab.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = function(labfile){
1212
else{
1313
try{
1414
var lab_obj = eval(labfile);
15-
if(typeof lab_obj == undefined || typeof lab_obj == null){ //check for lab object
15+
if(typeof lab_obj === "undefined" || typeof lab_obj === "null"){ //check for lab object
1616
throw new Error("tux is undefined/null");
1717
}
1818

tests/example_data/courses/courses.js

Lines changed: 143 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -4,55 +4,61 @@
44

55
module.exports = [
66
{
7-
_id: "1",
8-
course_name: "Great Practical Ideas for Computer Scientists",
9-
course_number: "15-131",
10-
instructors: [
11-
{
12-
name: "Derek Brown",
13-
id: "1"
14-
},
15-
{
16-
name: "Tom Cortina",
17-
id: "2"
18-
}
19-
],
20-
course_description: {
21-
content: `
22-
Throughout your education as a Computer Scientist at Carnegie Mellon,
23-
you will take courses on programming, theoretical ideas, logic, systems,
24-
etc. As you progress, you will be expected to pick up the so-called “tools of the trade.”
25-
This course is intended to help you learn what you need to know in a friendly, low-stress,
26-
high-support way. We will discuss UNIX, LaTeX, debugging and many other essential tools.
27-
`,
28-
syllabus: "The syllabus is here."
29-
},
30-
permissions:{
31-
meta : true,
32-
content: "any",
33-
enroll: "any"
34-
},
35-
hidden: false,
36-
disabled: false,
37-
featured: true,
38-
labs: []
7+
_id: "1",
8+
course_name: "Great Practical Ideas for Computer Scientists",
9+
course_number: "15-131",
10+
instructors: [
11+
{
12+
name: "Super User",
13+
id: "10"
14+
},
15+
{
16+
name: "Derek Brown",
17+
id: "1"
18+
},
19+
{
20+
name: "Tom Cortina",
21+
id: "2"
22+
}
23+
],
24+
course_description: {
25+
content: `
26+
Throughout your education as a Computer Scientist at Carnegie Mellon,
27+
you will take courses on programming, theoretical ideas, logic, systems,
28+
etc. As you progress, you will be expected to pick up the so-called “tools of the trade.”
29+
This course is intended to help you learn what you need to know in a friendly, low-stress,
30+
high-support way. We will discuss UNIX, LaTeX, debugging and many other essential tools.
31+
`,
32+
syllabus: "The syllabus is here."
33+
},
34+
permissions:{
35+
meta : true,
36+
content: "any",
37+
enroll: "any"
38+
},
39+
featured: true,
40+
labs: []
3941
},
4042
{
41-
_id : "2",
42-
course_number: '15-112',
43-
course_name: 'Fundamentals of Programming',
44-
instructors: [
45-
{
46-
name: "Aaron Mortenson",
47-
id: "3"
48-
},
49-
{
50-
name: "Cem Ersoz",
51-
id: "4"
52-
}
53-
],
54-
course_description: {
55-
content: `
43+
_id : "2",
44+
course_number: '15-112',
45+
course_name: 'Fundamentals of Programming',
46+
instructors: [
47+
{
48+
name: "Super User",
49+
id: "10"
50+
},
51+
{
52+
name: "Aaron Mortenson",
53+
id: "3"
54+
},
55+
{
56+
name: "Cem Ersoz",
57+
id: "4"
58+
}
59+
],
60+
course_description: {
61+
content: `
5662
A technical introduction to the fundamentals of programming with an
5763
emphasis on producing clear, robust, and reasonably efficient code using
5864
top-down design, informal analysis, and effective testing and debugging.
@@ -62,97 +68,103 @@ module.exports = [
6268
standalone programs, shell scripts, and web-based applications. This
6369
course assumes no prior programming experience.
6470
`,
65-
syllabus: 'The syllabus is here.'
66-
},
67-
permissions:{
68-
meta: true,
69-
content: "auth",
70-
enroll: "none"
71-
},
72-
hidden: false,
73-
disabled: false,
74-
featured: true,
75-
labs: []
71+
syllabus: 'The syllabus is here.'
72+
},
73+
permissions:{
74+
meta: true,
75+
content: "auth",
76+
enroll: "none"
77+
},
78+
featured: true,
79+
labs: []
7680
},
7781
{
78-
_id: "3",
79-
course_number: '15-122',
80-
course_name: 'Principles of Imperative Computation',
81-
instructors: [
82-
{
83-
name: "Tom Cortina",
84-
id: "2"
85-
},
86-
{
87-
name: "Sander Shi",
88-
id: "5"
89-
}
90-
],
91-
course_description: {
92-
content: `
82+
_id: "3",
83+
course_number: '15-122',
84+
course_name: 'Principles of Imperative Computation',
85+
instructors: [
86+
{
87+
name: "Super User",
88+
id: "10"
89+
},
90+
{
91+
name: "Tom Cortina",
92+
id: "2"
93+
},
94+
{
95+
name: "Sander Shi",
96+
id: "5"
97+
}
98+
],
99+
course_description: {
100+
content: `
93101
This course teaches imperative programming and methods for ensuring the
94102
correctness of programs. It is intended for students with a basic
95103
understanding of programming (variables, expressions, loops, arrays,
96-
functions). Students will learn the process and concepts needed to go
97-
from high-level descriptions of algorithms to correct imperative
98-
implementations, with specific applications to basic data structures
99-
and algorithms. Much of the course will be conducted in a subset of C
100-
amenable to verification, with a transition to full C near the end.
104+
functions). Students will learn the process and concepts needed to go
105+
from high-level descriptions of algorithms to correct imperative
106+
implementations, with specific applications to basic data structures
107+
and algorithms. Much of the course will be conducted in a subset of C
108+
amenable to verification, with a transition to full C near the end.
101109
`,
102-
syllabus: 'The syllabus is here.'
103-
},
104-
permissions: {
105-
meta: true,
106-
content: "any",
107-
enroll: "any"
108-
},
109-
hidden: false,
110-
disabled: false,
111-
featured: true,
112-
labs: []
110+
syllabus: 'The syllabus is here.'
111+
},
112+
permissions: {
113+
meta: true,
114+
content: "any",
115+
enroll: "any"
116+
},
117+
featured: true,
118+
labs: []
113119
},
114120
{
115-
_id: "4",
116-
course_number: '15-150',
117-
course_name: 'Principles of Functional Programming',
118-
instructors: [
119-
{
120-
name: "Cem Ersoz",
121-
id: "4"
122-
}
123-
],
124-
course_description: {
125-
content: `
121+
_id: "4",
122+
course_number: '15-150',
123+
course_name: 'Principles of Functional Programming',
124+
instructors: [
125+
{
126+
name: "Super User",
127+
id: "10"
128+
},
129+
{
130+
name: "Cem Ersoz",
131+
id: "4"
132+
}
133+
],
134+
course_description: {
135+
content: `
126136
Upon completion of this course, students will have acquired a mastery of
127137
basic functional programming techniques, including the design of programs
128138
using types, the development of programs using mathematical techniques
129139
for verification and analysis, the use of abstract types and modules to
130140
structure code, and the exploitation of parallelism in applications.
131141
`,
132-
syllabus: 'The syllabus is here.'
133-
},
134-
permissions:{
135-
meta: true,
136-
content: "any",
137-
enroll: "none"
138-
},
139-
hidden: false,
140-
disabled: false,
141-
featured: true,
142-
labs: []
142+
syllabus: 'The syllabus is here.'
143+
},
144+
permissions:{
145+
meta: true,
146+
content: "any",
147+
enroll: "none"
148+
},
149+
featured: true,
150+
labs: []
143151
},
144152
{
145-
_id: "5",
146-
course_number: '15-251',
147-
course_name: 'Great Theoretical Ideas for Computer Scientists',
148-
instructors: [
149-
{
150-
name: "Aaron Mortenson",
151-
id: "3"
152-
}
153-
],
154-
course_description: {
155-
content: `
153+
_id: "5",
154+
course_number: '15-251',
155+
course_name: 'Great Theoretical Ideas for Computer Scientists',
156+
instructors: [
157+
{
158+
name: "Super User",
159+
id: "10"
160+
},
161+
{
162+
name: "Aaron Mortenson",
163+
id: "3"
164+
}
165+
],
166+
course_description: {
167+
content: `
156168
This course is about how to use theoretical ideas to formulate and solve
157169
problems in computer science. It integrates mathematical material with
158170
general problem solving techniques and computer science applications.
@@ -161,16 +173,14 @@ module.exports = [
161173
and combinatorics. Assignments involve both mathematical proofs and
162174
programming.
163175
`,
164-
syllabus: 'The syllabus is here.'
165-
},
166-
permissions:{
167-
meta: true,
168-
content: "any",
169-
enroll: "any"
170-
},
171-
hidden: false,
172-
disabled: false,
173-
featured: true,
174-
labs: []
176+
syllabus: 'The syllabus is here.'
177+
},
178+
permissions:{
179+
meta: true,
180+
content: "any",
181+
enroll: "any"
182+
},
183+
featured: true,
184+
labs: []
175185
}
176186
]

0 commit comments

Comments
 (0)