Description:
Merge branch 'master' into codejom (bug fix)
Commit status:
[Not Reviewed]
References:
merge default
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r236:879e1963b565 - - 1 file changed: 2 inserted, 0 deleted

@@ -110,28 +110,30
110 test_num += 1
110 test_num += 1
111 end
111 end
112 return test_num > 1
112 return test_num > 1
113 end
113 end
114
114
115 def import_problem_description(dirname)
115 def import_problem_description(dirname)
116 html_files = Dir["#{dirname}/*.html"]
116 html_files = Dir["#{dirname}/*.html"]
117 markdown_files = Dir["#{dirname}/*.md"] + Dir["#{dirname}/*.markdown"]
117 markdown_files = Dir["#{dirname}/*.md"] + Dir["#{dirname}/*.markdown"]
118 if (html_files.length != 0) or (markdown_files.length != 0)
118 if (html_files.length != 0) or (markdown_files.length != 0)
119 description = @problem.description || Description.new
119 description = @problem.description || Description.new
120
120
121 if html_files.length != 0
121 if html_files.length != 0
122 filename = html_files[0]
122 filename = html_files[0]
123 description.markdowned = false
123 description.markdowned = false
124 else
124 else
125 filename = markdown_files[0]
125 filename = markdown_files[0]
126 description.markdowned = true
126 description.markdowned = true
127 end
127 end
128
128
129 description.body = open(filename).read
129 description.body = open(filename).read
130 description.save
130 description.save
131 @problem.description = description
131 @problem.description = description
132 @problem.save
132 @problem.save
133 return "\nProblem description imported from #{filename}."
133 return "\nProblem description imported from #{filename}."
134 + else
135 + return ''
134 end
136 end
135 end
137 end
136
138
137 end
139 end
You need to be logged in to leave comments. Login now