Skip to content

Commit

Permalink
Simplifying exercises worflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
aubertc committed Sep 17, 2024
1 parent a53d869 commit 3c41494
Show file tree
Hide file tree
Showing 48 changed files with 130 additions and 161 deletions.
10 changes: 4 additions & 6 deletions source/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ LABS_DIR = labs/
# The folder where the exercises are located.
EXO_DIR = exercises/
# The folder where the exercises with solution are located.
EXO_W_SOL_DIR = $(EXO_DIR)w_sol
# The folder where the exercises without solution are located.
EXO_WO_SOL_DIR = $(EXO_DIR)wo_sol
EXO_W_SOL_DIR = exercises_w_sol/
# The folder where the projects (that is, the projects the students have to complete) are located.
PROJ_DIR = projects/
# The folder where the .cs code snippets and projects are located.
Expand Down Expand Up @@ -280,7 +278,7 @@ $(CLA_DIR)%.md: $(CLA_DIR)%.txt
tr '\n' ' ' < $@ > diag-temp.md && mv diag-temp.md $@

# Exercise without solution
$(EXO_WO_SOL_DIR)%.md: $(EXO_W_SOL_DIR)%.md
$(EXO_DIR)%.md: $(EXO_W_SOL_DIR)%.md
mkdir -p $(dir $@)
sed 's/<details>/&\\\n/g' $< > $@
sed -i '/<details>/,/<\/details>/d' $@
Expand All @@ -291,10 +289,10 @@ $(EXO_WO_SOL_DIR)%.md: $(EXO_W_SOL_DIR)%.md

# Rule to compile all the exercises in one go.
SOURCE_EXO_W_SOL := $(shell find $(EXO_W_SOL_DIR) -name '*.md')
TARGET_EXO_WO_SOL := $(subst w_sol,wo_sol,$(SOURCE_EXO_W_SOL)))
TARGET_EXO_WO_SOL := $(subst exercises_w_sol,exercises,$(SOURCE_EXO_W_SOL)))

exercise: $(TARGET_EXO_WO_SOL)

# -------------------------------
# Order file
# -------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
DO NOT EDIT THIS FILE
Edit exercises/w_sol/collections/1darrays.md, and run
make exercises/wo_sol/collections/1darrays.md
Edit exercises_w_sol/collections/1darrays.md, and run
make exercises/collections/1darrays.md
instead.
-->

Expand All @@ -14,7 +14,7 @@ tags:

# One-Dimensional Arrays

[Solutions for those exercises.](./exercises/w_sol/collections/1darrays)
[Solutions for those exercises.](./exercises_w_sol/collections/1darrays)

## Multiple Choices

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
DO NOT EDIT THIS FILE
Edit exercises/w_sol/collections/2darrays.md, and run
make exercises/wo_sol/collections/2darrays.md
Edit exercises_w_sol/collections/2darrays.md, and run
make exercises/collections/2darrays.md
instead.
-->

Expand All @@ -14,7 +14,7 @@ tags:

# Two-Dimensional Arrays

[Solutions for those exercises.](./exercises/w_sol/collections/2darrays)
[Solutions for those exercises.](./exercises_w_sol/collections/2darrays)

## Multiple Choices

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
DO NOT EDIT THIS FILE
Edit exercises/w_sol/datatypes/datatypes.md, and run
make exercises/wo_sol/datatypes/datatypes.md
Edit exercises_w_sol/datatypes/datatypes.md, and run
make exercises/datatypes/datatypes.md
instead.
-->

Expand Down
12 changes: 12 additions & 0 deletions source/exercises/datatypes/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!--
DO NOT EDIT THIS FILE
Edit exercises_w_sol/datatypes/index.md, and run
make exercises/datatypes/index.md
instead.
-->

---
title: Datatypes
---
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
DO NOT EDIT THIS FILE
Edit exercises/w_sol/datatypes/numerical.md, and run
make exercises/wo_sol/datatypes/numerical.md
Edit exercises_w_sol/datatypes/numerical.md, and run
make exercises/datatypes/numerical.md
instead.
-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
DO NOT EDIT THIS FILE
Edit exercises/w_sol/datatypes/strings.md, and run
make exercises/wo_sol/datatypes/strings.md
Edit exercises_w_sol/datatypes/strings.md, and run
make exercises/datatypes/strings.md
instead.
-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
DO NOT EDIT THIS FILE
Edit exercises/w_sol/flow/conditionals.md, and run
make exercises/wo_sol/flow/conditionals.md
Edit exercises_w_sol/flow/conditionals.md, and run
make exercises/flow/conditionals.md
instead.
-->

Expand Down
12 changes: 12 additions & 0 deletions source/exercises/flow/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!--
DO NOT EDIT THIS FILE
Edit exercises_w_sol/flow/index.md, and run
make exercises/flow/index.md
instead.
-->

---
title: Control Structures
---
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
DO NOT EDIT THIS FILE
Edit exercises/w_sol/flow/iteratives.md, and run
make exercises/wo_sol/flow/iteratives.md
Edit exercises_w_sol/flow/iteratives.md, and run
make exercises/flow/iteratives.md
instead.
-->

Expand Down
14 changes: 10 additions & 4 deletions source/exercises/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<!--
DO NOT EDIT THIS FILE
Edit exercises_w_sol/index.md, and run
make exercises/index.md
instead.
-->

---
title: Exercises
title: With Solution
---

This folder will contain exercises as they migrate from <https://csci-1301.github.io/#exercises>.
In the meantime, please refer to the previous link.
12 changes: 12 additions & 0 deletions source/exercises/io/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!--
DO NOT EDIT THIS FILE
Edit exercises_w_sol/io/index.md, and run
make exercises/io/index.md
instead.
-->

---
title: input / output
---
12 changes: 12 additions & 0 deletions source/exercises/oop/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!--
DO NOT EDIT THIS FILE
Edit exercises_w_sol/oop/index.md, and run
make exercises/oop/index.md
instead.
-->

---
title: OOP
---
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
DO NOT EDIT THIS FILE
Edit exercises/w_sol/oop/objects.md, and run
make exercises/wo_sol/oop/objects.md
Edit exercises_w_sol/oop/objects.md, and run
make exercises/oop/objects.md
instead.
-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
DO NOT EDIT THIS FILE
Edit exercises/w_sol/oop/oop.md, and run
make exercises/wo_sol/oop/oop.md
Edit exercises_w_sol/oop/oop.md, and run
make exercises/oop/oop.md
instead.
-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
DO NOT EDIT THIS FILE
Edit exercises/w_sol/oop/operations.md, and run
make exercises/wo_sol/oop/operations.md
Edit exercises_w_sol/oop/operations.md, and run
make exercises/oop/operations.md
instead.
-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
DO NOT EDIT THIS FILE
Edit exercises/w_sol/oop/structures.md, and run
make exercises/wo_sol/oop/structures.md
Edit exercises_w_sol/oop/structures.md, and run
make exercises/oop/structures.md
instead.
-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
DO NOT EDIT THIS FILE
Edit exercises/w_sol/past/exercises.md, and run
make exercises/wo_sol/past/exercises.md
Edit exercises_w_sol/past/exercises.md, and run
make exercises/past/exercises.md
instead.
-->

Expand All @@ -13,7 +13,7 @@ title: Exercises

# Homework #1

[Solutions for those exercises.](./exercises/w_sol/past/exercises)
[Solutions for those exercises.](./exercises_w_sol/past/exercises)

## Part I --- Questions

Expand Down Expand Up @@ -124,7 +124,7 @@ compiled, and executed.

# Homework #2

[Solutions for those exercises.](./exercises/w_sol/past/exercises)
[Solutions for those exercises.](./exercises_w_sol/past/exercises)

## Part I --- Questions

Expand Down Expand Up @@ -350,7 +350,7 @@ Make sure you feel ready before starting them, try to do them with limited time

# Homework #3

[Solutions for those exercises.](./exercises/w_sol/past/exercises)
[Solutions for those exercises.](./exercises_w_sol/past/exercises)

## Part I -- Questions

Expand Down Expand Up @@ -535,7 +535,7 @@ There is only one problem this time, and it is harder than what you'll be asked

# Homework #4

[Solutions for those exercises.](./exercises/w_sol/past/exercises)
[Solutions for those exercises.](./exercises_w_sol/past/exercises)

## Part I --- Questions

Expand Down Expand Up @@ -776,7 +776,7 @@ This time, the two exercises **do not** require a computer, and are here to craf

# Homework #5

[Solutions for those exercises.](./exercises/w_sol/past/exercises)
[Solutions for those exercises.](./exercises_w_sol/past/exercises)

## Part I --- Questions

Expand Down Expand Up @@ -873,7 +873,7 @@ This time, the two exercises **do not** require a computer, and are here to craf

# Homework #6

[Solutions for those exercises.](./exercises/w_sol/past/exercises)
[Solutions for those exercises.](./exercises_w_sol/past/exercises)

## Part I --- Questions

Expand Down Expand Up @@ -993,7 +993,7 @@ This time, the two exercises **do not** require a computer, and are here to craf

# Quizzes

[Solutions for those exercises.](./exercises/w_sol/past/exercises)
[Solutions for those exercises.](./exercises_w_sol/past/exercises)


Those quizzes are given as _examples_, to help you practise.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
DO NOT EDIT THIS FILE
Edit exercises/w_sol/past/mcq.md, and run
make exercises/wo_sol/past/mcq.md
Edit exercises_w_sol/past/mcq.md, and run
make exercises/past/mcq.md
instead.
-->

Expand Down
Loading

0 comments on commit 3c41494

Please sign in to comment.