diff --git a/docs/modular-steps-management.md b/docs/modular-steps-management.md index 280f6dafe..38d3e1fe2 100644 --- a/docs/modular-steps-management.md +++ b/docs/modular-steps-management.md @@ -36,6 +36,7 @@ Capture d’écran 2019-04-22 à 15 59 33 + * 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'. diff --git a/subjects/doop.fr.md b/subjects/doop.fr.md index 904d0217c..5075e6cc2 100644 --- a/subjects/doop.fr.md +++ b/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. diff --git a/subjects/fprime.en.md b/subjects/fprime.en.md new file mode 100644 index 000000000..3335cdd2e --- /dev/null +++ b/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$ +``` diff --git a/subjects/revwstr.en.md b/subjects/revwstr.en.md new file mode 100644 index 000000000..a59eb631b --- /dev/null +++ b/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$ +``` diff --git a/subjects/sortList.en.md b/subjects/sortList.en.md new file mode 100644 index 000000000..16fe29c56 --- /dev/null +++ b/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 + } +} +```