Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #709 from tobioboye/issue_669_final
Issue 669 final
- Loading branch information
Showing
20 changed files
with
162 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,3 +214,4 @@ c7arnold,Arnold,Malcolm | |
g5ligeti,Ligeti,Gyorgy | ||
c8menott,Menotti,Gian Carlo | ||
c6stockh,Stockhausen,Karlheinz | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
# Standard admin | ||
Admin.create(:user_name => 'a', :first_name => 'admin', :last_name => 'admin') | ||
|
||
# Reid | ||
Admin.create(:user_name => 'reid', :first_name => 'Karen', :last_name => 'Reid') | ||
|
||
STUDENT_CSV = 'db/data/students.csv' | ||
|
||
if File.readable?(STUDENT_CSV) | ||
csv_students = File.new(STUDENT_CSV) | ||
User.upload_user_list(Student, csv_students, nil) | ||
end | ||
Ta.create(:user_name => 'c6conley', | ||
:first_name => 'Mike', | ||
:last_name => 'Conley') | ||
Ta.create(:user_name => 'c6gehwol', | ||
:first_name => 'Severin', | ||
:last_name => 'Gehwolf') | ||
Ta.create(:user_name => 'c9varoqu', | ||
:first_name => 'Nelle', | ||
:last_name => 'Varoquaux') | ||
# Assignments | ||
assignment_stat = AssignmentStat.new | ||
rule = NoLateSubmissionRule.new | ||
a = Assignment.create(:short_identifier => "A1", | ||
:description => "Conditionals and Loops", | ||
:message => "Learn to use conditional statements, and loops.", | ||
:group_min => 1, | ||
:group_max => 1, | ||
:student_form_groups => false, | ||
:group_name_autogenerated => true, | ||
:group_name_displayed => false, | ||
:repository_folder => "A1", | ||
:due_date => 1.minute.from_now, | ||
:marking_scheme_type => Assignment::MARKING_SCHEME_TYPE[:rubric], | ||
:allow_web_submits => true, | ||
:display_grader_names_to_students => false) | ||
|
||
a.submission_rule = rule | ||
a.assignment_stat = assignment_stat | ||
a.save | ||
|
||
rule = NoLateSubmissionRule.new | ||
assignment_stat = AssignmentStat.new | ||
a = Assignment.create(:short_identifier => "A2", | ||
:description => "Cats and Dogs", | ||
:message => "Basic exercise in Object Oriented | ||
Programming. Implement Animal, Cat, and Dog, as | ||
described in class.", | ||
:group_min => 2, | ||
:group_max => 3, | ||
:student_form_groups => true, | ||
:group_name_autogenerated => true, | ||
:group_name_displayed => false, | ||
:repository_folder => "A2", | ||
:due_date => 1.month.from_now, | ||
:marking_scheme_type => Assignment::MARKING_SCHEME_TYPE[:rubric], | ||
:allow_web_submits => true, | ||
:display_grader_names_to_students => false) | ||
a.submission_rule = rule | ||
a.assignment_stat = assignment_stat | ||
a.save | ||
# Let's create groups and groupings ! | ||
|
||
students = Student.all | ||
a = Assignment.find_by_short_identifier("A1") | ||
|
||
15.times do |time| | ||
student = students[time] | ||
group = Group.new | ||
group.group_name = student.user_name | ||
group.save | ||
grouping = Grouping.new | ||
grouping.group = group | ||
grouping.assignment = a | ||
grouping.save | ||
grouping.invite([student.user_name], | ||
StudentMembership::STATUSES[:inviter], | ||
invoked_by_admin=true) | ||
end | ||
|
||
|
||
# Let's populate students repository with nice data | ||
|
||
groups = Group.all | ||
assignment = Assignment.find_by_short_identifier("A1") | ||
|
||
file_dir = File.join(File.dirname(__FILE__), 'data') | ||
groups.each do |group| | ||
Dir.foreach(file_dir) do |filename| | ||
unless File.directory?(File.join(file_dir, filename)) | ||
file_contents = File.open(File.join(file_dir, filename)) | ||
file_contents.rewind | ||
group.access_repo do |repo| | ||
txn = repo.get_transaction(group.grouping_for_assignment( | ||
assignment.id | ||
).inviter.user_name) | ||
path = File.join(assignment.repository_folder, | ||
filename) | ||
txn.add(path, | ||
file_contents.read, | ||
'') | ||
repo.commit(txn) | ||
end | ||
end | ||
end | ||
end | ||
|
||
require 'faker' | ||
|
||
8.times do |time| | ||
rc = RubricCriterion.create( | ||
:id => time, | ||
:rubric_criterion_name => Faker::Lorem.sentence(1), | ||
:assignment_id => 1, | ||
:position => 1, | ||
:weight => rand(3) + 1, | ||
:level_0_name => Faker::Lorem.words(rand(5) + 1).join(" "), | ||
:level_0_description => Faker::Lorem.sentences(rand(5) + 1).join(" "), | ||
:level_1_name => Faker::Lorem.words(rand(5) + 1).join(" "), | ||
:level_1_description => Faker::Lorem.sentences(rand(5) + 1).join(" "), | ||
:level_2_name => Faker::Lorem.words(rand(5) + 1).join(" "), | ||
:level_2_description => Faker::Lorem.sentences(rand(5) + 1).join(" "), | ||
:level_3_name => Faker::Lorem.words(rand(5) + 1).join(" "), | ||
:level_3_description => Faker::Lorem.sentences(rand(5) + 1).join(" "), | ||
:level_4_name => Faker::Lorem.words(rand(5) + 1).join(" "), | ||
:level_4_description => Faker::Lorem.sentences(rand(5) + 1).join(" ") | ||
) | ||
rc.save | ||
end | ||
|
||
5.times do |time| | ||
ca = AnnotationCategory.new( | ||
:id => time, | ||
:assignment_id => 1, | ||
:annotation_category_name => Faker::Lorem.words( | ||
rand(3) + 1 | ||
).join(" ") | ||
) | ||
ca.save | ||
|
||
(rand(10) + 3).times do |t| | ||
a = AnnotationText.new( | ||
:id => t, | ||
:annotation_category_id => time, | ||
:content => Faker::Lorem.sentences(rand(3) + 1).join(" ") | ||
) | ||
a.save | ||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.