2015-08-29 07:15:35 -07:00
// Update course data
// Usage:
// mongo <address>:<port>/<database> <script file> -u <username> -p <password>
// NOTE: uses name as unique identifier, so changing the name will insert a new course
2015-09-03 11:04:40 -07:00
// NOTE: concepts should match actual campaign levels
// NOTE: pricePerSeat in USD cents
2015-08-29 07:15:35 -07:00
var documents =
[
{
name : "Introduction to Computer Science" ,
slug : "introduction-to-computer-science" ,
campaignID : ObjectId ( "55b29efd1cd6abe8ce07db0d" ) ,
concepts : [ 'basic_syntax' , 'arguments' , 'while_loops' , 'strings' , 'variables' ] ,
description : "Learn basic syntax, while loops, and the CodeCombat environment." ,
2015-09-03 11:04:40 -07:00
pricePerSeat : NumberInt ( 0 ) ,
2015-08-29 07:15:35 -07:00
screenshot : "/images/pages/courses/101_info.png"
2015-09-03 11:04:40 -07:00
} ,
{
name : "Computer Science 2" ,
slug : "computer-science-2" ,
campaignID : ObjectId ( "55b29efd1cd6abe8ce07db0d" ) ,
concepts : [ 'basic_syntax' , 'arguments' , 'while_loops' , 'strings' , 'variables' , 'if_statements' ] ,
description : "Introduce Arguments, Variables, If Statements, and Arithmetic." ,
pricePerSeat : NumberInt ( 400 ) ,
screenshot : "/images/pages/courses/102_info.png"
} ,
{
name : "Computer Science 3" ,
slug : "computer-science-3" ,
campaignID : ObjectId ( "55b29efd1cd6abe8ce07db0d" ) ,
concepts : [ 'if_statements' , 'arithmetic' ] ,
description : "Learn how to handle input." ,
pricePerSeat : NumberInt ( 400 ) ,
screenshot : "/images/pages/courses/103_info.png"
2015-08-29 07:15:35 -07:00
}
] ;
for ( var i = 0 ; i < documents . length ; i ++ ) {
var doc = documents [ i ] ;
db . courses . update ( { name : doc . name } , doc , { upsert : true } ) ;
}
function log ( str ) {
print ( new Date ( ) . toISOString ( ) + " " + str ) ;
}