Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an example about files order #11

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .courseignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
README.md
README.md
/.run
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ It provides the list of files or directories that will be ignored in the final c

```text
README.md
/.run
```

You can find more information about the course preview in the [Course preview][ref:course.preview] section. Information
Expand Down
Binary file added common/src/main/resources/images/files-order.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions courseSection/courseLesson/lesson-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ content:
- theoryTask
- quizTask
- programmingTask
- multiFileTask
3 changes: 3 additions & 0 deletions courseSection/courseLesson/multiFileTask/src/Main.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fun main() {
helloWorld()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fun helloWorld(): Unit = println("Hello, world!")
18 changes: 18 additions & 0 deletions courseSection/courseLesson/multiFileTask/task-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
type: output
files:
- name: src/MainTaskFile.kt
visible: true
placeholders:
- offset: 25
length: 24
placeholder_text: TODO("Not implemented yet")
- name: src/Main.kt
visible: true
placeholders:
- offset: 17
length: 12
placeholder_text: // invoke the implemented functions here
- name: test/output.txt
visible: false
- name: test/input.txt
visible: false
8 changes: 8 additions & 0 deletions courseSection/courseLesson/multiFileTask/task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This is an example of an input/output task.
In this type of task, you can give an expected input and output to the program instead of implementing
your own tests.

This task also demonstrates how you can set up which file should be opened in the student mode if the task has several files.
You just need to put this file as the first file in the `task-info.yaml` config, e.g. in this task the `MainTaskFile.kt` will be opened:

![Expected behaviour](../../../common/src/main/resources/images/files-order.gif)
Empty file.
1 change: 1 addition & 0 deletions courseSection/courseLesson/multiFileTask/test/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello, world!
Loading