Skip to content

Commit

Permalink
Add an example about files order
Browse files Browse the repository at this point in the history
  • Loading branch information
nbirillo committed Oct 24, 2023
1 parent d54951a commit 84607eb
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 1 deletion.
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!

0 comments on commit 84607eb

Please sign in to comment.