0% found this document useful (0 votes)
151 views

Autocode Intro

To complete exercises in Autocode, you must: 1. Clone the exercise repository to your local machine using either SSH or HTTPS. 2. Open the cloned repository in an IDE like IntelliJ and make code changes to pass the automated tests. 3. Commit your code changes with a description and push them to the Gitlab repository. 4. Return to Autocode to submit your solution and check if the automated tests pass, earning you points.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
151 views

Autocode Intro

To complete exercises in Autocode, you must: 1. Clone the exercise repository to your local machine using either SSH or HTTPS. 2. Open the cloned repository in an IDE like IntelliJ and make code changes to pass the automated tests. 3. Commit your code changes with a description and push them to the Gitlab repository. 4. Return to Autocode to submit your solution and check if the automated tests pass, earning you points.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

How to complete the exercises in Autocode:

Instructions

If you are unfamiliar with terms such as Git, Gitlab, repository, and commit, then we recommend exploring them first:

Video Course "Version Control with Git"


https://learn.epam.com/detailsPage?id=601f195a-d408-4439-a16d0630ed2a412e
Manual "Start using Git on the command line"
https://docs.gitlab.com/ee/gitlab-basics/start-using-git.html

Getting started
When you get a task, you will see its name and description.
To start working on the task, click Start.

Next, Autocode will create a copy of the initial exercise repository in your Gitlab account.
For all of this to work properly, you might need to access your profile and link the accounts in Autocode and Gitlab.

Now the link to the repository will appear below the main description:
The link will take you to the repository page in GitLab:
Repository

To complete an exercise, you need to clone it, or make a local copy of it on your computer.
To do this, click Clone and copy one of the available links:
SSH

To clone the repository using SSH, you will have to generate an SSH key for your computer and register it with Gitlab.
This way, Gitlab will understand that you are the one trying to access your own repository.
You can do this by following the simple instructions at https://docs.gitlab.com/ee/ssh/.

HTTPS

If you do not wish to generate an SSH key, you can use an HTTPS link.
Then, when accessing the Gitlab repository, you will have to go through authentication—you will need to enter your login
and password.
You will probably not need to do this every time; Windows has a special tool—Credential Manager—that automatically
memorizes Gitlab account data after the first entry.
IDE
We recommend using an IDE to complete the exercises.
In the examples below, IntelliJ IDEA v2021.2.3 is used.

To clone the repository, click Get from VCS.

If you have already opened another project and do not see this button, you can find the Clone command in the dropdown
Git menu.

One way or another, you will get a dialog where you can enter the link to the repository and the target directory on the
computer where you would like to clone it.

This is where you might need to enter your login and password to get access to the Gitlab repository.
After this, the repository will be imported into the IDE as a Maven project.
Now you can start working on the project.

The first exercise is simple—you only need to write one line:


Now you can check your solution locally –by launching the tests.
To do this, you can open the Maven menu (which is usually on the right), select the lifecycle stage test, and launch it:
If everything is correct, we will see the longed-for words "BUILD SUCCESS" in the Run window.

You can also launch the tests using the IDE tools; in IntelliJ IDEA, it is enough to right-click on the test class and select the
launch item.
Since the tests pass successfully, you can submit the solution.

Choose the Commit window (which can be invoked using Ctrl+K or the menu item Git -> Commit).

Select the files where the changes should be saved.


Save only the changes that refer to source code.
There is no need to save the IDE settings.
Remember: DO NOT change the code of the test files or pom.xml.

Here we enter a description of the changes, save them, and then click Commit.
Now the saved changes should be sent to the Gitlab repository.
To do this, we execute a push (Ctrl+Shift+K or Git -> Push).

Select the branches and commits that need to be synchronized (It is very unlikely that you will have to change any settings
here). Then click Push. The changes you made will be imported to the Gitlab repository.
Checking the solution
Now let's go back to the Gitlab repository.
It notifies you that it contains the latest changes, or the ones you just sent there.
If you click on the latest commit, you will see the changes it contains.
This is the solution we just executed a minute ago.
After making sure the changes have been imported to the Gitlab repository, return to Autocode.
Now you are ready to check the solution. Click Submit solution.
Autocode starts the verification process, and we can see the results.
Note that the number of attempts is always limited!

Autocode has completed the verification, and we got the maximum number of points—100.
Autocode performs the same tests we ran locally.
For this exercise, any result below 100 will be considered a failure.
If these tests are not successful, Autocode will show us the reported errors.
In most cases, if the tests are successful on your computer, everything should also be fine in Autocode.

Our first and last attempt was successful, so we can finish the exercise by clicking Finish.

You can leave feedback or report any trouble you had.

Now we see that the exercise has been completed successfully and can proceed to the next one.
Error identification
Compilation error
1. Click Compile and Show log.

2. Read the reasons carefully.

3. You need to roll back the project to its initial state and execute the solution again. Most often, this error is associated
with incorrectly moving the project skeleton to your programming environment—the Maven pom-file (changing the Java
JDK version).
4. If you have issues with completing Step 3, please contact Support.
Failed tests
1. Click Score and Details.

2. Carefully read every failed test and make changes to your code accordingly.

You might also like