# HG changeset patch # User jittat # Date 2008-11-15 17:29:55 # Node ID 15e1ee6d602b22065556c0c9bcdfe2ea9f88855f # Parent 627c39e673ecc9d97d8afcb3f4fc057f10bad6dc fixed submission view bug, reported by chalet git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@292 6386c4cd-e34a-4fa8-8920-d93eb39b512e diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -123,6 +123,11 @@ @submissions = nil else @problem = Problem.find_by_name(params[:id]) + if not @problem.available + redirect_to :action => 'list' + flash[:notice] = 'Error: submissions for that problem is not available' + return + end @submissions = Submission.find_all_by_user_problem(@user.id, @problem.id) end end