Browse Source

Merge branch 'master' into brackets

content-update
Frenchris 5 years ago committed by GitHub
parent
commit
3f7c6cc709
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CNAME
  2. 6
      docs/modular-steps-management.md
  3. 9
      scripts/install_client.sh
  4. 21
      scripts/system/etc/gdm3/PostLogin/Default
  5. 3
      scripts/system/etc/gdm3/PostSession/Default
  6. 11
      subjects/brackets.en.md
  7. 20
      subjects/doop.en.md
  8. 1
      subjects/doop.fr.md
  9. 30
      subjects/fprime.en.md
  10. 26
      subjects/revwstr.en.md
  11. 29
      subjects/rostring.en.md
  12. 37
      subjects/sortList.en.md

1
CNAME

@ -0,0 +1 @@
public.01-edu.org

6
docs/modular-steps-management.md

@ -36,6 +36,7 @@
<img width="1073" alt="Capture d’écran 2019-04-22 à 15 59 33" src="https://user-images.githubusercontent.com/35296671/56507445-3936ef00-6519-11e9-90c8-d85056e9330b.png">
* Add a new key **subtype** of type `String` with the exact value 'form-step'
* Add a new key **form** of type `Object`
* Form can have several sections. Each section is displayed with a title, and its inputs.
@ -48,12 +49,14 @@
> The values will be considered as the properties of your input.
#### Defining an input:
* A **type** key of type `String` must be declared. It defines the type of the input : `tel`, `text`, `date`, `select`, `radio`, `switch`, `checkbox`, `textarea`, `countries`.
* All other attributes needed for the input can be added to the object, according to the input type: `placeholder`, `id`, `required`, `label`, `items`, `emptyItems`, `index`, etc...
#### Important indication:
* The **index** property is used to order the inputs. It will not be passed onto the input. Be mindful not to set the same index twice.
* The **type** property is required. It will be used to determine the kind of input should be generated. It is passed onto the input only if the input type attribute is required (type 'tel' or 'text' for example, but not for type 'select' - in this case, we will generate a select element)
* A special type 'countries' has been added to the classicals. It generate a `Select` (containing all the countries) with a search bar. 'Items' property is handled by the app.
* It's recommended to add 'min' and 'max' properties to input type 'date' (no default value are set).
* `onChange` prop are ignored as the event is handled by the app.
@ -69,6 +72,7 @@
### Examples
Here is an example of the form step's attributes. It presents a form with two sections, and an example of each kind of input type.
> NB : this example object is provided in the admin, in the onboarding section: 'Form step example'.
```json
@ -169,6 +173,7 @@ Here is an example of the form step's attributes. It presents a form with two se
This 'form' step would look like this:
![form step example](https://user-images.githubusercontent.com/35296671/56816457-7cf06800-683b-11e9-9003-6f83b4545033.png)
## Settings for a `document to sign` step
@ -188,6 +193,7 @@ The newly created child can be customized with these attributes :
1. Edit you step object
2. Go to *Object attributes*
3. Add the following attributes:
* Add a new key **subtype** of type `String` with the exact value 'sign-step'
* Add a new key **text** of type `String` with the text of your document to sign as value
* Add a new key **buttonText** of type `String` with the text that you want to display in the submit button of your step. Default value for this attribute is 'Sign'.

9
scripts/install_client.sh

@ -60,14 +60,7 @@ cp -r system /tmp
cd /tmp/system
sed -i -e "s|::DISK::|$DISK|g" etc/udev/rules.d/10-local.rules
# Fourth local partition
PART=$(lsblk -o tran,kname,hotplug,type,fstype -pr |
grep -v usb |
grep '0 part' |
cut -d' ' -f2 |
sort |
head -n4 |
tail -n1)
PART=$(lsblk -pro kname,partlabel | grep 01-tmp-system | cut -d' ' -f1)
sed -i -e "s|::PART::|$PART|g" usr/share/initramfs-tools/scripts/init-premount/reformat
apt-get -y install overlayroot

21
scripts/system/etc/gdm3/PostLogin/Default

@ -3,8 +3,7 @@
# Mount home as an overlay filesystem
# Log stdout & stderr
exec > >(tee -i /tmp/gdm3_postlogin.log)
exec 2>&1
exec > >(tee -i /tmp/gdm3_postlogin.log) 2>&1
# Treat unset variables as an error when substituting.
set -u
@ -28,12 +27,8 @@ set -x
sleep 0.5
# Find the first removable F2FS partition
PART=$(lsblk -o tran,kname,hotplug,type,fstype -pr |
grep -e '1 part f2fs' -e '1 disk f2fs' |
cut -d' ' -f2 |
sort |
head -n1)
# Find the removable F2FS partition
PART=$(lsblk -pro kname,partlabel | grep 01-home | cut -d' ' -f1)
# Make sure the mountpoints are free
(
@ -46,14 +41,8 @@ if test "$PART"
then
mount -o noatime "$PART" /mnt
else
# No removable F2FS partition found, use the third local partition instead
PART=$(lsblk -o tran,kname,hotplug,type,fstype -pr |
grep -v usb |
grep '0 part' |
cut -d' ' -f2 |
sort |
head -n3 |
tail -n1)
# No removable F2FS partition found
PART=$(lsblk -pro kname,partlabel | grep 01-tmp-home | cut -d' ' -f1)
if test -z "$PART"
then

3
scripts/system/etc/gdm3/PostSession/Default

@ -1,8 +1,7 @@
#!/bin/bash
# Log stdout & stderr
exec > >(tee -i /tmp/gdm3_postsession.log)
exec 2>&1
exec > >(tee -i /tmp/gdm3_postsession.log) 2>&1
# Exit immediately if a command exits with a non-zero status.
set -e

11
subjects/brackets.en.md

@ -7,16 +7,18 @@ argument, the program prints on the standard output "OK" followed by a newline
if the expression is correctly bracketed, otherwise it prints "Error" followed by
a newline.
Symbols considered as 'brackets' are brackets '(' and ')', square brackets '['
and ']'and braces '{' and '}'. Every other symbols are simply ignored.
Symbols considered as `brackets` are brackets `(` and `)`, square brackets `[`
and `]`and braces `{` and `}`. Every other symbols are simply ignored.
An opening bracket must always be closed by the good closing bracket in the
correct order. A string which not contains any bracket is considered as a
correct order. A string which do not contains any bracket is considered as a
correctly bracketed string.
If there is no arguments, the program must print only a newline.
And its output :
Examples of outputs :
```console
student@ubuntu:~/student/brackets$ go build
@ -30,4 +32,5 @@ OK$
student@ubuntu:~/student/brackets$ ./brackets | cat -e
$
student@ubuntu:~/student/brackets$
```

20
subjects/doop.en.md

@ -10,29 +10,31 @@ The program has to be used with three arguments:
- An operator
- Another value
In case of an invalid entry the programs prints `0`.
In case of an invalid operator the programs prints `0`.
In case of an invalid number of arguments the program prints nothing.
The program has to handle the modulo and division operations by 0 as shown on the output examples below.
`fmt.Print` is authorized.
### Usage
Examples of outputs :
```console
student@ubuntu:~/piscine/test$ go build doop.go
student@ubuntu:~/piscine/test$ ./doop
student@ubuntu:~/piscine/test$ ./doop 1 + 1
2
student@ubuntu:~/piscine/test$ ./doop hello + 1
0
student@ubuntu:~/piscine/test$ ./doop hello + 1 | cat -e
0$
student@ubuntu:~/piscine/test$ ./doop 1 p 1
0
student@ubuntu:~/piscine/test$ ./doop 1 + 1
2
student@ubuntu:~/piscine/test$ ./doop 1 / 0
No division by 0
student@ubuntu:~/piscine/test$ ./doop 1 % 0
No modulo by 0
student@ubuntu:~/piscine/test$ ./doop 1 * 1
student@ubuntu:~/piscine/test$ ./doop 1 / 0 | cat -e
No division by 0$
student@ubuntu:~/piscine/test$ ./doop 1 % 0 | cat -e
No modulo by 0$
student@ubuntu:~/piscine/test$ ./doop 1 "*" 1
1
```

1
subjects/doop.fr.md

@ -10,6 +10,7 @@ Le programme doit être utilisé avec trois arguments:
- Un opérateur
- Une autre valeur
En cas d'opérateur invalide le programme affiche `0`.
En cas de nombre invalide d'arguments le programme affiche rien.

30
subjects/fprime.en.md

@ -0,0 +1,30 @@
## fprime
### Instructions
Write a program that takes a positive `int` and displays its prime factors on the standard output, followed by a newline.
- Factors must be displayed in ascending order and separated by `*`, so that the expression in the output gives the right result.
- If the number of parameters is not 1, the program displays a newline.
- The input, when there is one, will always be valid.
Example of output :
```console
student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./test 225225
3*3*5*5*7*11*13
student@ubuntu:~/piscine/test$ ./test 8333325
3*3*5*5*7*11*13*37
student@ubuntu:~/piscine/test$ ./test 9539
9539
student@ubuntu:~/piscine/test$ ./test 804577
804577
student@ubuntu:~/piscine/test$ ./test 42
2*3*7
student@ubuntu:~/piscine/test$ ./test
student@ubuntu:~/piscine/test$
```

26
subjects/revwstr.en.md

@ -0,0 +1,26 @@
## revWstr
### Instructions
Write a program that takes a string as a parameter, and prints its words in reverse.
- A word is a sequence of **alphanumerical** characters.
- If the number of parameters is different from 1, the program will display `\n`.
- In the parameters that are going to be tested, there will not be any additional spaces. (meaning that there will not be additionnal spaces at the beginning or at the end of the string, and words will always be separated by exactly one space).
Examples of outputs :
```console
student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./test "the time of contempt precedes that of indifference"
indifference of that precedes contempt of time the
student@ubuntu:~/piscine/test$ ./test "abcdefghijklm"
abcdefghijklm
student@ubuntu:~/piscine/test$ ./test "he stared at the mountain"
mountain the at stared he
student@ubuntu:~/piscine/test$ ./test
student@ubuntu:~/piscine/test$
```

29
subjects/rostring.en.md

@ -0,0 +1,29 @@
## rostring
### Instructions
Write a program that takes a string and displays this string after rotating it
one word to the left.
Thus, the first word becomes the last, and others stay in the same order.
A word is a sequence of **alphanumerical** characters.
Words will be separated by only one space in the output.
If the number of arguments is not one, the program displays a newline.
Examples of outputs :
```console
student@ubuntu:~/piscine/rostring$ go build
student@ubuntu:~/piscine/rostring$ ./rostring "abc " | cat -e
abc$
student@ubuntu:~/piscine/rostring$ ./rostring "Let there be light"
there be light There
student@ubuntu:~/piscine/rostring$ ./rostring " AkjhZ zLKIJz , 23y"
zLKIJz , 23y AkjhZ
student@ubuntu:~/piscine/rostring$ ./rostring | cat -e
$
student@ubuntu:~/piscine/rostring$
```

37
subjects/sortList.en.md

@ -0,0 +1,37 @@
## sortList
### Instructions
Write a function that must:
- Sort the list given as a parameter, using the function cmp to select the order to apply,
- Return a pointer to the first element of the sorted list.
Duplications must remain.
Inputs will always be consistent.
The `type NodeList` must be used.
Functions passed as `cmp` will always return `true` if `a` and `b` are in the right order, otherwise it will return `false`.
### Expected function
```go
func SortList (l *NodeList, cmp func(a,b int) bool) *NodeList{
}
```
- For example, the following function used as `cmp` will sort the list in ascending order :
```go
func ascending(a, b int) bool{
if a <= b {
return true
} else {
return false
}
}
```
Loading…
Cancel
Save