Skip to content

Commit

Permalink
Adding problems, hints and model answers alaashafaee#429
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed Fadel authored and Mohamed Fadel committed May 17, 2014
1 parent a7eba04 commit 1ce4e10
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tutor/db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
Hint.create(message: "Do not Try to Solve CS problem-1", category: false, time: 5, submission_counter:10)
Hint.create(message: "Do not Try to Solve CS problem-2", category: true, time: 5, submission_counter:10)
Hint.create(message: "Do not Try to Solve CS problem-3", category: false, time: 5, submission_counter:10)
Hint.create(message: "No hints needed; very easy problem.", category: false, time: 1, submission_counter:10)
Hint.create(message: "No hints needed; very easy problem.", category: false, time: 1, submission_counter:10)

puts("# ----------------------- ModelAnswer ----------------------- ")
ModelAnswer.create(title: "Answer1", answer: "System.out.println('SQL baaaad')-1")
Expand All @@ -132,6 +134,8 @@
ModelAnswer.create(title: "Answer4", answer: "System.out.println('SQL baaaad')-4")
ModelAnswer.create(title: "Answer5", answer: "System.out.println('SQL baaaad')-5")
ModelAnswer.create(title: "Answer6", answer: "System.out.println('SQL baaaad')-6")
ModelAnswer.create(title: "Multiplication", answer: "int a, b, c; a = b*c; System.out.println(a);")
ModelAnswer.create(title: "Division", answer: "int a, b, c; a = b/c; System.out.println(a);")

puts("# ----------------------- Test Cases ----------------------- ")
TestCase.create(output: "hello World 1", input:"x = 0")
Expand Down Expand Up @@ -205,6 +209,10 @@
incomplete: true,
snippet: "public class CoolSoft {\n\tpublic static void main(String [] args)
{\n\t\t\n\t}\n}")
Problem.create(title: "Problem 6 - Multiplication", description: "Multiply a & b and print the result",
incomplete: false, seen: true, duplicated: false)
Problem.create(title: "Problem 7 - Division", description: "Divide a & b and print the result",
incomplete: false, seen: true, duplicated: false)

puts("# ----------------------- Tracks ----------------------- ")
Track.create(title: "Track 1", difficulty: 0)
Expand Down Expand Up @@ -421,6 +429,10 @@
Problem.find_by_id(2).model_answers << ModelAnswer.find_by_id(4)
Problem.find_by_id(3).model_answers << ModelAnswer.find_by_id(5)
Problem.find_by_id(3).model_answers << ModelAnswer.find_by_id(6)
Problem.find_by_id(6).model_answers << ModelAnswer.find_by_id(7)
Problem.find_by_id(7).model_answers << ModelAnswer.find_by_id(8)


## Solutions
AssignmentProblem.first.solutions << Solution.first
AssignmentProblem.first.solutions << Solution.find_by_id(4)
Expand Down Expand Up @@ -449,6 +461,8 @@
## Hints
Problem.first.model_answers.first.hints << Hint.first
Problem.first.model_answers.first.hints << Hint.all.second
Problem.find_by_id(6).model_answers.find_by_id(7).hints << Hint.find_by_id(4)
Problem.find_by_id(7).model_answers.find_by_id(8).hints << Hint.find_by_id(5)

puts("# ----------------------- Tracks ----------------------- ")
## Problems
Expand Down

0 comments on commit 1ce4e10

Please sign in to comment.