Skip to content

Instantly share code, notes, and snippets.

View apangeajwrubel's full-sized avatar

Jim Wrubel apangeajwrubel

View GitHub Profile
pathway = Pathway.find([:id])
s = Student.all
s.each do |student|
Enrollment.create(student_id: student.id, pathway_id: pathway.id)
end
@apangeajwrubel
apangeajwrubel / gist:3090433
Created July 11, 2012 13:42
live activity data for focus player
{"lessonData":{"image":"http://ttm-content.s3.amazonaws.com/uploads/image/image/6543/LF4GuessWhatItIs.swf","title":"FL4. Interpret Graphs of Real-World Situations Lesson","type":"interactive_chapterized","chapters":[{"activity_id":59,"title":"Introduction","internal_title":"Introduction","order":1,"subtitles":[{"chapter_id":71,"created_at":"2012-06-01T00:23:44Z","display_text":"Subtitle","id":268,"position":1,"updated_at":"2012-06-01T00:23:44Z"}]},{"activity_id":59,"title":"Three Meanings","internal_title":"Three Meanings","order":2,"subtitles":[{"chapter_id":72,"created_at":"2012-06-01T00:23:44Z","display_text":"subtitle","id":269,"position":1,"updated_at":"2012-06-01T00:23:44Z"}]},{"activity_id":59,"title":"Ending","internal_title":"Ending","order":3,"subtitles":[{"chapter_id":73,"created_at":"2012-06-01T00:23:45Z","display_text":"subtitle","id":270,"position":1,"updated_at":"2012-06-01T00:23:45Z"}]}]}}
@apangeajwrubel
apangeajwrubel / gist:3188201
Created July 27, 2012 14:04
updating Activities to make them published
@activities = Activity.all
@activities.each do |activity|
activity.state = "Published"
activity.save
end
@apangeajwrubel
apangeajwrubel / gist:3212653
Created July 31, 2012 01:47
adding position to Hints on ItemSteps
@item_steps = ItemStep.all
@item_steps.each do |item_step|
item_step.hints.each_with_index do |hint, index|
hint.position = index
hint.save
end
end
@apangeajwrubel
apangeajwrubel / gist:3275901
Created August 6, 2012 15:56
latest flash json
{"language":"en","lessonData":{"fileName":"http://content.thinkthroughmath.com/uploads/image/image/44224/g3_fl1.swf","title":"G3FL1 Place Value with Whole Numbers Lesson","type":"JIT","chapters":[{"activity_id":1385,"title":"Place Value \u2013 Ones and Tens","internal_title":"JIT 1","order":1,"subtitles":[{"chapter_id":1028,"file_name":"http://ttm-content.s3.amazonaws.com/legacy-audio/4604970d-7430-4918-980e-d23d4b9551f7/F4604970d-7430-4918-980e-d23d4b9551f7.mp3"},{"chapter_id":1028,"file_name":"http://ttm-content.s3.amazonaws.com/legacy-audio/218c8a8b-2edd-4b7b-b8b4-be0f4c601e7f/F218c8a8b-2edd-4b7b-b8b4-be0f4c601e7f.mp3"},{"chapter_id":1028,"file_name":"http://ttm-content.s3.amazonaws.com/legacy-audio/f468e9d3-f9b1-4c03-a57c-17ec5c648ce9/Ff468e9d3-f9b1-4c03-a57c-17ec5c648ce9.mp3"}]},{"activity_id":1385,"title":"Comparing Numbers","internal_title":"JIT 2","order":2,"subtitles":[{"chapter_id":1029,"file_name":"http://ttm-content.s3.amazonaws.com/legacy-audio/7b8a2b21-dbdc-4575-9573-c83bf7c2846c/F7b8a2b21-dbdc-
@apangeajwrubel
apangeajwrubel / gist:3398045
Created August 19, 2012 22:03
fixing students with orphaned attempts
# first one
item_step = Item.find(829).item_steps.first
bad_item_step_id = 829
Attempt.where("attemptable_type = 'ItemStep' and attemptable_id = ?", bad_item_step_id).each do |a|
a.attemptable_id = item_step.id
if a.correct
a.response_id = item_step.correct_responses.first.id
else
a.response_id = item_step.incorrect_responses.first.id
end
@apangeajwrubel
apangeajwrubel / gist:3398053
Created August 19, 2012 22:05
finding the itemstep ids in an activity
@activity = Activity.find(1085)
@activity.items.each do |item|
p item.item_steps.first.id
end
@apangeajwrubel
apangeajwrubel / gist:3503792
Created August 28, 2012 20:25
updating version_of_ attributes
std = $stdout
$stdout = File.new('console.out', 'w')
ActiveRecord::Base.logger = nil
Item.published.all.each do |item|
next if (item.active == false)
#item = Item.find_by_item_number_and_state(60124, "Published")
@apangeajwrubel
apangeajwrubel / gist:4025370
Created November 6, 2012 15:21
Triathletes make great developers

My name is Jim Wrubel - I'm the Chief Technical Officer at Think Through Math, one of Highgroove's clients. In my spare time (such as it is) I'm a long-course triathlete and marathoner. Recently we partnered with Highgroove to rebuild our core e-learning platform. During the process I realized that there are a lot of similarities between training for an endurance event like triathlon and launching a major web initiative.

###The work you put in during the build determines your success in the event. If you haven't put in the time, no amount of last-minute workouts or coding will make up for it. This is something developers know instinctively - unfortunately it's not common knowledge among managers. Also, in product launches and major races, you usually have a specific date that is set in stone. But if you haven't done the work in the months leading up to the event, be prepared for a rough day. Coincidentally, training for an Ironman and developing a significant web app both take about the same amount of effor

@apangeajwrubel
apangeajwrubel / gist:4242901
Created December 9, 2012 01:29
Test failures and outcomes
Pathway Reports Integration Test
ERROR (0.00220s) (24:00:22.962) 0001 can get all lesson enrollments for a partially completed enrollment
Couldn't find Pathway with id=254
Message Integration Test::Viewing messages::as a teacher
ERROR (0.64553s) (23:00:05.036) 0001 shouldn't show an error page if there aren't any contest messages
no link or button 'Messages' found
-- This link was commented out for launch. Skip the test for now