CodEx-Introduction: Difference between revisions

From MT Talks
Jump to navigation Jump to search
No edit summary
No edit summary
Line 22: Line 22:
=== For non-CUNI students ===
=== For non-CUNI students ===


Please send an email to [mailto:mttalks@ufal.mff.cuni.cz?Subject=Request%20for%20CodEx%20account!%20MT%20talks&body=Hello!%0D%0A%0D%0APlease%20create%20a%20CodEx%20account%20for%20me.%20Thank%20you. Admin] to request an account. He will create the account for you.
Please send an email to [mailto:mttalks@ufal.mff.cuni.cz?Subject=Request%20for%20CodEx%20account!%20MT%20talks&body=Hello!%0D%0A%0D%0APlease%20create%20a%20CodEx%20account%20for%20me.%20Thank%20you. Admin] to request an account. He will create the account for you. Your account is added to '''MT talks''' group by default.




Line 31: Line 31:
Once you have your login alias/password, come back to the login page: https://codex3.ms.mff.cuni.cz/codex-trans. After logging in, you are directed to the welcome page which displays all documentations and news that relates to your account.
Once you have your login alias/password, come back to the login page: https://codex3.ms.mff.cuni.cz/codex-trans. After logging in, you are directed to the welcome page which displays all documentations and news that relates to your account.


From the welcome page, you could join all the groups that you are interested. Click the link '''group''' to open all groups available. The group represents the course that you take. When you join a group, you take all the responsibility to do the exercises which are assigned to that group.
On the left hand column, there is an internal link '''group'''. It directs to the list of all groups that you could join. Each group represents one course that you take. When you join a group, you are responsible to do all the exercises which are assigned to that group.


[[File:codex-group.png|thumb|200px|'''List of groups''']]
[[File:codex-group.png|thumb|200px|'''List of groups''']]


For the sake of MT talks, please join the group '''MT talks''' (shown in pictures: list of groups)
For the sake of MT talks, please join the group '''MT talks''' if you have not done it.(shown in pictures: list of groups)
 




Line 44: Line 43:
== How to pick, solve and submit solutions ==
== How to pick, solve and submit solutions ==


After joining a group, you are able to see all the exercises assigned to that group. Explore a exercise by clicking on its name. There are three options: ''read the specification, submit a new solution and manage old submissions''
After joining a group, you are able to see all the exercises assigned to that group.  
On left-handed column, under ''group -> task'', you will see three options associated with ''read the specification, submit a new solution'' and ''manage old submissions''


[[File:codex-submit.png|thumb|200px|'''Submit a new solution''']]
[[File:codex-submit.png|thumb|200px|'''Submit a new solution''']]
[[File:codex-eval.png|thumb|200px|'''Manage your submissions''']]
[[File:codex-eval.png|thumb|200px|'''Manage your submissions''']]


Please read the exercise specification carefully. Your program is expected to read input from a single file '''*.in''' and write to standard output. At the end, your program are expected to pass a number of tests (default: 10 tests)
For every exercise, please read the specification carefully. You are supposed to write a complete program in a programming language. The list of programming languages is: ''Pascal, C, C++, C#, Haskell, Python and Java''
You solution has to fit in one single file with standard input/output. The program takes only one parameter, which is the name of a input file.


To submit a solution, there are two ways:
To submit a solution, there are two ways:
* Upload from text area: You write your solution into the text box, select the extension according to your programming language, then submit.  
* Upload from text area: You write your solution into the text box, select the extension according to your programming language, then submit.  
* Upload from file: Simply write your solution into a file with an appropriate extension and submit
* Upload from file: Simply write your solution into a file with an appropriate extension and submit
In the evaluation process, your program is run several times with several input to validate the correctness. You will pass if your program success a ''threshold'' number of times.
=== Example ===
Exercise '''Hello World!''': Your task is to write a program which read the name of a person and say 'Hello' to him/her.
'''Input''': sample.in
John
Marry
Marry and Kate
'''Ouput'': <<standard output >>>
Hello John!
Hello Marry!
Hello Marry and Kate!
''' Sample solution''': Read the input file line-by-line, concatenate the line with "Hello " and "!" then print it.
'''Python'''
    #!/usr/bin/env python
    import fileinput
    if __name__ == '__main__':
        for line in fileinput.input():
            print "Hello {0}!".format(line)

Revision as of 22:33, 9 January 2015

Hi there,

You are reading this page, so you've already gone a long way towards good preparation of MT tasks. Nice work! There are only a couple of questions to answer before you could start your first tasks:

  • How to get a CodEx account
  • How to login to CodEx
  • How to pick a task to solve
  • How to submit a solution for evaluation

You heard the word CodEx (The Code Examiner: http://codex3.ms.mff.cuni.cz/). As you might know, all the tasks of MT talks are designed in CodEx system. This page serves as a guide for newcomers who has little to no experience with CodEx.

How to get a CodEx account

Before venturing your journey though all the tasks, you need to get an account. There are two options to obtain an account in CodEx

For CUNI students

Codex Registration CUNI students

Please access the SIS registration page: https://codex3.ms.mff.cuni.cz/codex-trans/?module=sisregistration. You will be asked to verify your account, then click verify. If everything is fine, you could proceed to create your own account by following the instruction.

For non-CUNI students

Please send an email to Admin to request an account. He will create the account for you. Your account is added to MT talks group by default.


How to login and join a group

Codex Welcome

Once you have your login alias/password, come back to the login page: https://codex3.ms.mff.cuni.cz/codex-trans. After logging in, you are directed to the welcome page which displays all documentations and news that relates to your account.

On the left hand column, there is an internal link group. It directs to the list of all groups that you could join. Each group represents one course that you take. When you join a group, you are responsible to do all the exercises which are assigned to that group.

List of groups

For the sake of MT talks, please join the group MT talks if you have not done it.(shown in pictures: list of groups)



How to pick, solve and submit solutions

After joining a group, you are able to see all the exercises assigned to that group. On left-handed column, under group -> task, you will see three options associated with read the specification, submit a new solution and manage old submissions

Submit a new solution
Manage your submissions

For every exercise, please read the specification carefully. You are supposed to write a complete program in a programming language. The list of programming languages is: Pascal, C, C++, C#, Haskell, Python and Java

You solution has to fit in one single file with standard input/output. The program takes only one parameter, which is the name of a input file.

To submit a solution, there are two ways:

  • Upload from text area: You write your solution into the text box, select the extension according to your programming language, then submit.
  • Upload from file: Simply write your solution into a file with an appropriate extension and submit

In the evaluation process, your program is run several times with several input to validate the correctness. You will pass if your program success a threshold number of times.

Example

Exercise Hello World!: Your task is to write a program which read the name of a person and say 'Hello' to him/her.

Input: sample.in

John Marry Marry and Kate

'Ouput: <<standard output >>>

Hello John! Hello Marry! Hello Marry and Kate!

Sample solution: Read the input file line-by-line, concatenate the line with "Hello " and "!" then print it.

Python

   #!/usr/bin/env python
   import fileinput
   if __name__ == '__main__':
       for line in fileinput.input():
           print "Hello {0}!".format(line)