Browse Source

Merge pull request #95 from 01-edu/readmes

readmes for the exams, fprime and sortList
pull/104/head
Frenchris 6 years ago committed by GitHub
parent
commit
def54bde8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      docs/modular-steps-management.md
  2. 1
      subjects/doop.fr.md
  3. 30
      subjects/fprime.en.md
  4. 26
      subjects/revwstr.en.md
  5. 37
      subjects/sortList.en.md

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'.

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$
```

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