# HG changeset patch # User jittat # Date 2008-05-04 03:04:09 # Node ID be38116d08d3f5230b30624832506a56f92a3817 # Parent 695a33fa7e55f6b3fb243b4e922b080855bfaed7 [web] added help page git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@225 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 @@ -27,6 +27,10 @@ prepare_list_information end + def help + @user = User.find(session[:user_id]) + end + def submit user = User.find(session[:user_id]) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -24,7 +24,8 @@ append_to menu_items, '[Tasks]', 'tasks', 'list' append_to menu_items, '[Submissions]', 'main', 'submission' append_to menu_items, '[Test]', 'test', 'index' - append_to menu_items, '[Settings]', 'users', 'index' + append_to menu_items, '[Help]', 'main', 'help' + #append_to menu_items, '[Settings]', 'users', 'index' append_to menu_items, '[Log out]', 'main', 'login' menu_items diff --git a/app/views/main/help.html.haml b/app/views/main/help.html.haml new file mode 100644 --- /dev/null +++ b/app/views/main/help.html.haml @@ -0,0 +1,56 @@ += user_title_bar(@user) + +.announcementbox + %span{:class => 'title'} + How to submit + .announcement + %p + You must specify the language you are using + in your program header. You can optionally + specify the task you are submitting to. + + %p + The possible language options are + C, C++, and Pascal. + The follow are examples. + + %table{:border => '1'} + %tr + %th{:width => '100px'} C + %th{:width => '100px'} C++ + %th{:width => '100px'} Pascal + %tr + %td= "/*
LANG: C
*/
" + %td= "/*
LANG: C++
*/
" + %td= "{
LANG: Pascal
}
" + + %p + The server will not accept your submission, + if you do not specify the language. + + %p + Optionally, you can also specify + the task with TASK: taskname. + On the first page, the taskname for each task is + shown in parentheses. + + %p + For example, suppose you are using C++ + to write task mobiles, you put + + %table{:border => '1'} + %tr + %td{:width => '100px'} + %tt /*
LANG: C++
TASK: mobiles
*/
+ + %p + on top of your source code. + If you are using Pascal to write the same task, + you'll use + + %table{:border => '1'} + %tr + %td{:width => '100px'} + %tt {
LANG: Pascal
TASK: mobiles
}
+ + diff --git a/app/views/main/list.html.haml b/app/views/main/list.html.haml --- a/app/views/main/list.html.haml +++ b/app/views/main/list.html.haml @@ -21,7 +21,7 @@ %th Results = render :partial => 'problem', :collection => @problems -%hr +%hr/ .submitbox = render :partial => 'submission_box'