Commit 95848ad0 authored by Zac Wood's avatar Zac Wood
Browse files

Lots of work

parent ef6460e9
Pipeline #4114 failed with stage
in 2 minutes and 35 seconds
This diff is collapsed.
require 'json'
ratings = JSON.parse(File.read('db/data/sm18.json'))
semester = Semester.find_by!(season: 'Summer', year: "2018")
[['f18', 'Fall', '2018'], ['sp18', 'Spring', '2018'],
['f17', 'Fall', '2017'], ['sp17', 'Spring', '2017']].each do |arr|
puts arr
ratings = JSON.parse(File.read("db/data/#{arr[0]}.json"))
semester = Semester.find_by!(season: arr[1], year: arr[2])
ratings.each do |section, qs|
ratings.each do |section, qs|
section = section.split(',').first
subj = section.match(/[A-Z]+/)[0]
course = section.match(/[0-9]{3} /)[0].strip
......@@ -13,4 +16,5 @@ ratings.each do |section, qs|
next if s.nil?
s.rating_questions = qs
s.save!
end
end
......@@ -117,7 +117,7 @@ def main
[parser.parse_semesters[3]]
else
# expand to include however many semesters you want
parser.parse_semesters[0..1]
parser.parse_semesters[0..7]
end
puts "\tParsing subjects..."
......
require 'test_helper'
class CourseSectionsControllerTest < ActionDispatch::IntegrationTest
test "should get show" do
s = CourseSection.first
get course_section_url(s)
assert_response :success
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment