Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

[#342] [FEATURE] Affichage de la zone de correction pour les challenges QROCM-ind (US-385) #342

Merged
merged 94 commits into from
Apr 11, 2017

Conversation

MBrandone
Copy link
Contributor

No description provided.


function _updateExistingAnswer(existingAnswer, newAnswer, reply) {
solutionRepository
.get(existingAnswer.get('challengeId'))
.then((solution) => {
const answerCorrectness = solutionService.match(newAnswer, solution);
const answerCorrectness = solutionService.validate(newAnswer, solution);
new Answer({ id: existingAnswer.id })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je trouve que la méthode est longue, elle est dense.
Peut-être la sortir ?

@@ -4,21 +4,25 @@ const answerSerializer = require('../../infrastructure/serializers/jsonapi/answe
const solutionRepository = require('../../infrastructure/repositories/solution-repository');
const answerRepository = require('../../infrastructure/repositories/answer-repository');
const solutionService = require('../../domain/services/solution-service');
const jsYaml = require('js-yaml');

function _updateExistingAnswer(existingAnswer, newAnswer, reply) {
solutionRepository
.get(existingAnswer.get('challengeId'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je pense qu'une méthode plus explicite en Newspaper dans le style : findSolutionByChallengeId.
Parce qu'on ne sait pas trop ce qu'il fait sans avoir lu la suite

@@ -1,53 +1,47 @@
const utils = require('./solution-service-utils');
const deactivationsService = require('./deactivations-service');
const _ = require('../../infrastructure/utils/lodash-utils');
const { t1, t2, applyPreTreatments } = require('./validation-treatments');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t1, t2 what ???

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on n'a pas le choix c'est le vocabulaire métier, malheureusement. et pourtant je me suis battu contre...



function _calculateResult(validations, deactivations) {
function _formatResult(validations, deactivations) {

if (deactivationsService.isDefault(deactivations)) {
if (validations.t1t2t3Ratio <= 0.25) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t1t2t3Ratio ??? une issue peut-être?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ça fait partie des bouts de code qu'on a préféré ne pas toucher car sinon c'était encore 2 semaines dans la vue.

if (_.isNotString(yamlAnswer)
|| _.isNotString(yamlSolution)
// Input checking
if (!_.isString(yamlAnswer)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pourquoi avez-vous enlevé la vérification sur la solution ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

car c'est pris en compte dans la condition d'après (cdf. le code de la méthode dans Lodash, et le fait que si tu retires la ligne ça ne plante pas les tests)

}

function _areApproximatevelyEqualAccordingToLevenshteinDistanceRatio(answer, solutionVariants) {
let smallestLevenshteinDistance = answer.length;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Les Lignes 21 - 26 me rappellent : _getSmallestLevenshteinDistance dans api/lib/domain/services/validation-comparison.js

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

à terme, _getSmallestLevenshteinDistance doit jarter. et la méthode _areApproximatevelyEqualAccordingToLevenshteinDistanceRatio devra effectivement être mutualiser de façon intelligente. mais dans le cas de notre story on ne pouvait pas.

describe('Unit | Service | Validation Comparison', function () {

/**
* #_getSmallestLevenshteinDistance(str1, str2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A voir si les tests de fonctions privées sont pertinents

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c'était pertinent pour nous pour refactorer. on ne pourra les retirer que quand on aura réussi à mutualiser correctement la validation auto des épreuves.

expect(t3(data.userAnswer, data.solutions)).to.equal(data.expected);
});

// The following test cases are the old ones from deprecated class "solution-service-utiles_test.js"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed !

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done + rename 'userAnswer' => 'answer' ; 'adminAnswers' => 'solution'

@@ -28,11 +28,8 @@ const QrocSolutionPanel = Ember.Component.extend({
if (!solutionVariants){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Petit refacto au passage :

const resultValue = {
ok: 'correction-qroc-box__input-right-answer',
ko: 'correction-qroc-box__input-wrong-answer',
aband: 'orrection-qroc-box__input-no-answer'
}

inputClass : Ember.computed('answer.result', function(){
return resultValue[this.get('answer.result')] || '';
});

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refacto fait avec quelques ajustements de renommage

@@ -58,8 +58,8 @@ const ComparisonWindow = Ember.Component.extend({
isAssessmentChallengeTypeQcm: Ember.computed.equal('challenge.type', 'QCM'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moyen d'en faire une map maybe ?

Copy link
Contributor Author

@MBrandone MBrandone Apr 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ces computed properties sont utilisées pour avoir à gérer des booléens dans le hbs (+ de lisibilité).
Après réflexion rapide, j'ai pas trouvé de manière plus claire avec une map.
Je suis preneur d'idées, et je pense que c'est pas un point bloquant.

import resultDetailsAsObject from 'pix-live/utils/result-details-as-object';

function _computeAnswerOutcome(answers, resultDetails, labelKey) {
if (answers[labelKey] === '') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'aurai fait comme ceci:

const myMap = {
'': 'empty',
true: 'ok'
};

function _computeAnswerOutcome(answers, resultDetails, labelKey) {
return myMap[answers[labelKey]] || 'ko';
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai l'impression que ça complexifie pas mal. On extrait une map, d'une fonction privé. Peut-etre à la limite, on peut créer la map pour la computed property directement.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quelle est selon la complexité ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je pense que je va islaisser tel quel, à part si une tierce personne départage pour la solution avec la map.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je veux bien que tu poses la question à un tiers

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refacto fait ensemble

if (answers[labelKey] === '') {
return 'empty';
}
if (resultDetails[labelKey]) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est normal qu'on ait un coup answers[labelKey] et un coup resultDetails[labelKey] ?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 94.575% when pulling 3c6e74b on 385-compare-answers-solutions-qrocm-ind into 4bc5ddc on dev.

@jbuget
Copy link
Contributor

jbuget commented Apr 10, 2017

I've deployed this PR to http://385-compare-answers-solutions-qrocm-ind.pix.beta.gouv.fr. Please check it out

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 94.582% when pulling 30c3f28 on 385-compare-answers-solutions-qrocm-ind into 4bc5ddc on dev.

@jbuget
Copy link
Contributor

jbuget commented Apr 11, 2017

I've deployed this PR to http://385-compare-answers-solutions-qrocm-ind.pix.beta.gouv.fr. Please check it out

@@ -1,6 +1,9 @@
/* global jsyaml */

export default function resultDetailsAsObject(yamlResultDetails) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1,6 +1,9 @@
/* global jsyaml */

export default function resultDetailsAsObject(yamlResultDetails) {
const resultDetailsAsObject = jsyaml.safeLoad(yamlResultDetails);
let resultDetailsAsObject = {};
if (yamlResultDetails != 'null\n'){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attention au !=

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modifié en !==

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 94.582% when pulling 1ab8cba on 385-compare-answers-solutions-qrocm-ind into 4bc5ddc on dev.

@jbuget
Copy link
Contributor

jbuget commented Apr 11, 2017

I've deployed this PR to http://385-compare-answers-solutions-qrocm-ind.pix.beta.gouv.fr. Please check it out

@MBrandone MBrandone merged commit 4e99bf3 into dev Apr 11, 2017
@MBrandone MBrandone deleted the 385-compare-answers-solutions-qrocm-ind branch April 11, 2017 15:00
jbuget pushed a commit that referenced this pull request Apr 20, 2017
…oduction et suppression de scripts d'import (US-449) (#372)

* [#353][BUGFIX] Fix placement-tests HTML and route for placeholder images (#353)

[#353] [BUGFIX] Correction du rendu de la route /placement-tests (US-425).

* [#357] [FEATURE] Sauvegarder le temps écoulé pour chaque épreuve (US-361). (#357)

* New migration to add elapsed time to Answers table

* Add elapsedTime attributes in answer-serializer

* Add test to answer-controller-update

* Api is ready to receive elapsed time

* improve node version for coverage

* Update answer model

* component save time elapsed but no test added

* Fix review comments

* [#364] [INFRA] Extraction des identifiants Airtable dans des variables d'environnement (US-430). (#364)

* Add tasks to configure environment for development

* Fix build

* Remove useless description in README.md

* shutdown pretender server on app destroy (#362)

This fixes a "You created a second Pretender instance
while there was already one running" warning during
acceptance tests.

See miragejs/ember-cli-mirage#915

* de-duplicate email validation code (#361)

Use an utility function for validating email adresses (rather than a
full-blown service).

IMO Services should be used when the service is a object with several
method. In this case instantiating a service makes sense.

When the code is a simple function, an utility in `utils/` is simpler,
and involves less boilerplate.

This commit has the nice side-effect of actually simplifying the code
that uses the email validation: no need to inject a custom service,
or to define a private helper function.

* [#366] [INFRA] Correction d'avertissements dans les tests : "unsafe CSS bindings" (#366)

* progress-bar: escape CSS style

Fix a Glimmer warning about unescaped classes.

* timeout-jauge: escape CSS style

Fix a Glimmer warning about unescaped classes.

* [#360] [CLEANUP] Meilleure gestion des conditions de tests liées à l'environnement (issue #335). (#360)

* Add variable spy in config to detect if Env is test

* fix lint errors

* Fix all

* delete useless space

* Add Env variables according to theirs intents to components where they are used

* delete intestMode variable

* Attache env variables to APP context

* Fix bug en staging le timer enregistrait toujours 0 dans le temps écoulé (#369)

* [#368] [BUGFIX] Enlever le séparateur de la zone de réponse pour les QROCM (US-369) (#368)

* transform hr to br and add margin beetween inputs

* second commit to have a review app

* delete breakline for qroc which appear sometimes

* [#342] [FEATURE] Affichage de la zone de correction pour les challenges QROCM-ind (US-385) (#342)

* first commit

* create component

* ajout test intégration sur comparison window

* continuer sur box de comparaison pour QROC

* implem QROC sans les tests

* make previous tests pass

* add unit test on component qroc-answer-comparison-box

* add integration test on qroc-answer-comparison-box

* refacto jerem

* refacto

* add acceptance tests

* add acceptance tests1

* rename pour qroc-solution-panel and create qrocm solution panel

* Fix tests

* back-up for qrocm-ind

* commit to change branch

* rename component

* wip regex labels treatments

* create component qrocm-ind and first computed property

* labelstodiplay done with test, reflexion on answers to dispay

* wip

* wip reflexion comment organiser les donner à envoyer hbs

* computed property to formate the data, done and tested

* computed property done with bug

* no bug anymore, wip on dataToDisplay

* tentative avec proposalsAsBlock

* utilise le proposal block, reste à derterminer comment on connait la validité de chacune des reponse

* succeed parse des label avec ${} \o/

* basic front done mais retour du bug avec pas de grisement derrière la popin

* tentative de resolution de bug

* add unit test to computed property and about to start the html/css

* refacto computed property to facilitate css of right/wrong/no Asnwer possibility on front

* front done, il manque juste un alignement de la bonne reponse en dessous de l'input

* alignement reponse/solution done

* display only one solution on front and start integration test skull

* delete a log

* integration tests done

* refacto real unit test

* finish unit test

* fix regression sur qroc (affiche la reponse meme quand c'est bon)

* add unit test

* fix bug for qrocm passed answer and refacto computed property

* delete .only in test

* fix make tests pass

* delete comment

* computed properties of qrocm-ind passed to utils, need to be refacto

* delete comment

* delete comment

* refacto

* end of the merge

* Try to fix circle.yml for bower

* refacto 1

* adds from tech review

* regler bug benjamin sur la review app et ajout de test

* delete .only

* click sur zone grisé fait sortir de la modale + test

* test to save resultDetails done

* ajout de la propriété enabledTreatments dans le serializer airtable de solution. refacto emplacement de t1, t2 et t3 + ajout de tests pour ces fonctions. modification de applyTreatments onSolutions en utilisant les fonction t1 t2 t3, wip modification des tests de match dans solution-service-qrocmind en ajoutant le champs enabledTreatments

* refacto solution-service-qrocm-ind

* Fucking code

* Fucking code

* aaaaaaaah resolved test :)

* make tests pass after pull

* refacto tests

* Fix the fucking tests

* add save of resultDetails in dataBase

* resolve api answer serializer, implement fronts

* debut refacto, le nouveau answersAsObjects ne fonctionne pas comme on le veut avec reduce, A VOIR

* Fix the build

* Oops

* Refactor solution-services-x

* Some refactoring

* Continue to refactor

* Continue to refactor

* Continue to refactor

* Rename solution-service#match into #revalidate

* Take into account code review remarks

* delete comment and rename en camelCase

* refacto sur nom de variables test api

* continuing refacto

* refacto with pierre and florian dans qrocm ind solution panel

* gestion du cas où le challenge QROCM-ind est passé (null\n est enregistré en base)

* fix when resultdetailsYaml is null

* last change from jeremy review (!= to !==)

* delete import dir

* reactivate mailjet

* keep sqlite in package .json
Akhilian pushed a commit that referenced this pull request Apr 20, 2017
…oduction et suppression de scripts d'import (US-449) (#372)

* [#353][BUGFIX] Fix placement-tests HTML and route for placeholder images (#353)

[#353] [BUGFIX] Correction du rendu de la route /placement-tests (US-425).

* [#357] [FEATURE] Sauvegarder le temps écoulé pour chaque épreuve (US-361). (#357)

* New migration to add elapsed time to Answers table

* Add elapsedTime attributes in answer-serializer

* Add test to answer-controller-update

* Api is ready to receive elapsed time

* improve node version for coverage

* Update answer model

* component save time elapsed but no test added

* Fix review comments

* [#364] [INFRA] Extraction des identifiants Airtable dans des variables d'environnement (US-430). (#364)

* Add tasks to configure environment for development

* Fix build

* Remove useless description in README.md

* shutdown pretender server on app destroy (#362)

This fixes a "You created a second Pretender instance
while there was already one running" warning during
acceptance tests.

See miragejs/ember-cli-mirage#915

* de-duplicate email validation code (#361)

Use an utility function for validating email adresses (rather than a
full-blown service).

IMO Services should be used when the service is a object with several
method. In this case instantiating a service makes sense.

When the code is a simple function, an utility in `utils/` is simpler,
and involves less boilerplate.

This commit has the nice side-effect of actually simplifying the code
that uses the email validation: no need to inject a custom service,
or to define a private helper function.

* [#366] [INFRA] Correction d'avertissements dans les tests : "unsafe CSS bindings" (#366)

* progress-bar: escape CSS style

Fix a Glimmer warning about unescaped classes.

* timeout-jauge: escape CSS style

Fix a Glimmer warning about unescaped classes.

* [#360] [CLEANUP] Meilleure gestion des conditions de tests liées à l'environnement (issue #335). (#360)

* Add variable spy in config to detect if Env is test

* fix lint errors

* Fix all

* delete useless space

* Add Env variables according to theirs intents to components where they are used

* delete intestMode variable

* Attache env variables to APP context

* Fix bug en staging le timer enregistrait toujours 0 dans le temps écoulé (#369)

* [#368] [BUGFIX] Enlever le séparateur de la zone de réponse pour les QROCM (US-369) (#368)

* transform hr to br and add margin beetween inputs

* second commit to have a review app

* delete breakline for qroc which appear sometimes

* [#342] [FEATURE] Affichage de la zone de correction pour les challenges QROCM-ind (US-385) (#342)

* first commit

* create component

* ajout test intégration sur comparison window

* continuer sur box de comparaison pour QROC

* implem QROC sans les tests

* make previous tests pass

* add unit test on component qroc-answer-comparison-box

* add integration test on qroc-answer-comparison-box

* refacto jerem

* refacto

* add acceptance tests

* add acceptance tests1

* rename pour qroc-solution-panel and create qrocm solution panel

* Fix tests

* back-up for qrocm-ind

* commit to change branch

* rename component

* wip regex labels treatments

* create component qrocm-ind and first computed property

* labelstodiplay done with test, reflexion on answers to dispay

* wip

* wip reflexion comment organiser les donner à envoyer hbs

* computed property to formate the data, done and tested

* computed property done with bug

* no bug anymore, wip on dataToDisplay

* tentative avec proposalsAsBlock

* utilise le proposal block, reste à derterminer comment on connait la validité de chacune des reponse

* succeed parse des label avec ${} \o/

* basic front done mais retour du bug avec pas de grisement derrière la popin

* tentative de resolution de bug

* add unit test to computed property and about to start the html/css

* refacto computed property to facilitate css of right/wrong/no Asnwer possibility on front

* front done, il manque juste un alignement de la bonne reponse en dessous de l'input

* alignement reponse/solution done

* display only one solution on front and start integration test skull

* delete a log

* integration tests done

* refacto real unit test

* finish unit test

* fix regression sur qroc (affiche la reponse meme quand c'est bon)

* add unit test

* fix bug for qrocm passed answer and refacto computed property

* delete .only in test

* fix make tests pass

* delete comment

* computed properties of qrocm-ind passed to utils, need to be refacto

* delete comment

* delete comment

* refacto

* end of the merge

* Try to fix circle.yml for bower

* refacto 1

* adds from tech review

* regler bug benjamin sur la review app et ajout de test

* delete .only

* click sur zone grisé fait sortir de la modale + test

* test to save resultDetails done

* ajout de la propriété enabledTreatments dans le serializer airtable de solution. refacto emplacement de t1, t2 et t3 + ajout de tests pour ces fonctions. modification de applyTreatments onSolutions en utilisant les fonction t1 t2 t3, wip modification des tests de match dans solution-service-qrocmind en ajoutant le champs enabledTreatments

* refacto solution-service-qrocm-ind

* Fucking code

* Fucking code

* aaaaaaaah resolved test :)

* make tests pass after pull

* refacto tests

* Fix the fucking tests

* add save of resultDetails in dataBase

* resolve api answer serializer, implement fronts

* debut refacto, le nouveau answersAsObjects ne fonctionne pas comme on le veut avec reduce, A VOIR

* Fix the build

* Oops

* Refactor solution-services-x

* Some refactoring

* Continue to refactor

* Continue to refactor

* Continue to refactor

* Rename solution-service#match into #revalidate

* Take into account code review remarks

* delete comment and rename en camelCase

* refacto sur nom de variables test api

* continuing refacto

* refacto with pierre and florian dans qrocm ind solution panel

* gestion du cas où le challenge QROCM-ind est passé (null\n est enregistré en base)

* fix when resultdetailsYaml is null

* last change from jeremy review (!= to !==)

* delete import dir

* reactivate mailjet

* keep sqlite in package .json
jbuget pushed a commit that referenced this pull request Apr 24, 2017
…lit avec master + MAJ de dev sur Master (#378)

* try to restore prod

* [#370] [CLEANUP] Suppression des positional params. (#370)

* Remove deprecated and unused components app-header and app-footer

* Remove positional params for component comparison-window

* Oops (forgotten .only in tests)

* Remove positional params for component challenge-statement

* Declare 'challenge' as a component property for challenge-statement

* Remove positional params for component feedback-panel

* Remove positional params for component qroc-solution-panel

* Fix tests

* On expose un nouvel endpoint avec les infos api sur /api (#375)

[#375] [FEATURE] On expose un nouvel endpoint avec les infos api sur /api (US-453).

* Changement de version 1.6.2 vers 1.6.3

* Update CHANGELOG.md

* [#283] [FEATURE] Ajout des acquis aux épreuves pour calculer le niveau de l'apprenant (US-360). (#283)

* Add knowledge (acquis) to challengeSerializer

* Add acquix to acquired / not_acquired arrays

* Add tests for assessment level estimation

* Fix tests for computing level of assessments

* Add unit tests and compute PIX score

* Fallback when history is empty or challenge has no knowledge

* Take review into account

* Rename variable

* Make a service for populating scores in assessments

* Add unit tests

* Refactor code

* Cleanup

* Extracting getScoredAssessment in the assessment service

* Refactoring ChallengeService#getKnowledgeData

* Missing semicolon on changes

* Extracting the performance statistics in a specific file + creating tests

* Lets refactor the Scoring#getPerformanceStats function

* Adding tests on Scoring#computeDiagnosis

* Refactoring #populateScore into #_completeAssessmentWithScore

* Refactoring assessmentService#getScoredAssessment and creating tests

* Introducing a 404 error when the assessment does not exist

* Renamming skill to knowledge to preserve consistency

* Add forgotten important test

* Fix test

* Refactor old for..in form into lo-dash _.forOwn

* [#372] [CLEANUP] Importation des followers dans base de données de production et suppression de scripts d'import (US-449) (#372)

* [#353][BUGFIX] Fix placement-tests HTML and route for placeholder images (#353)

[#353] [BUGFIX] Correction du rendu de la route /placement-tests (US-425).

* [#357] [FEATURE] Sauvegarder le temps écoulé pour chaque épreuve (US-361). (#357)

* New migration to add elapsed time to Answers table

* Add elapsedTime attributes in answer-serializer

* Add test to answer-controller-update

* Api is ready to receive elapsed time

* improve node version for coverage

* Update answer model

* component save time elapsed but no test added

* Fix review comments

* [#364] [INFRA] Extraction des identifiants Airtable dans des variables d'environnement (US-430). (#364)

* Add tasks to configure environment for development

* Fix build

* Remove useless description in README.md

* shutdown pretender server on app destroy (#362)

This fixes a "You created a second Pretender instance
while there was already one running" warning during
acceptance tests.

See miragejs/ember-cli-mirage#915

* de-duplicate email validation code (#361)

Use an utility function for validating email adresses (rather than a
full-blown service).

IMO Services should be used when the service is a object with several
method. In this case instantiating a service makes sense.

When the code is a simple function, an utility in `utils/` is simpler,
and involves less boilerplate.

This commit has the nice side-effect of actually simplifying the code
that uses the email validation: no need to inject a custom service,
or to define a private helper function.

* [#366] [INFRA] Correction d'avertissements dans les tests : "unsafe CSS bindings" (#366)

* progress-bar: escape CSS style

Fix a Glimmer warning about unescaped classes.

* timeout-jauge: escape CSS style

Fix a Glimmer warning about unescaped classes.

* [#360] [CLEANUP] Meilleure gestion des conditions de tests liées à l'environnement (issue #335). (#360)

* Add variable spy in config to detect if Env is test

* fix lint errors

* Fix all

* delete useless space

* Add Env variables according to theirs intents to components where they are used

* delete intestMode variable

* Attache env variables to APP context

* Fix bug en staging le timer enregistrait toujours 0 dans le temps écoulé (#369)

* [#368] [BUGFIX] Enlever le séparateur de la zone de réponse pour les QROCM (US-369) (#368)

* transform hr to br and add margin beetween inputs

* second commit to have a review app

* delete breakline for qroc which appear sometimes

* [#342] [FEATURE] Affichage de la zone de correction pour les challenges QROCM-ind (US-385) (#342)

* first commit

* create component

* ajout test intégration sur comparison window

* continuer sur box de comparaison pour QROC

* implem QROC sans les tests

* make previous tests pass

* add unit test on component qroc-answer-comparison-box

* add integration test on qroc-answer-comparison-box

* refacto jerem

* refacto

* add acceptance tests

* add acceptance tests1

* rename pour qroc-solution-panel and create qrocm solution panel

* Fix tests

* back-up for qrocm-ind

* commit to change branch

* rename component

* wip regex labels treatments

* create component qrocm-ind and first computed property

* labelstodiplay done with test, reflexion on answers to dispay

* wip

* wip reflexion comment organiser les donner à envoyer hbs

* computed property to formate the data, done and tested

* computed property done with bug

* no bug anymore, wip on dataToDisplay

* tentative avec proposalsAsBlock

* utilise le proposal block, reste à derterminer comment on connait la validité de chacune des reponse

* succeed parse des label avec ${} \o/

* basic front done mais retour du bug avec pas de grisement derrière la popin

* tentative de resolution de bug

* add unit test to computed property and about to start the html/css

* refacto computed property to facilitate css of right/wrong/no Asnwer possibility on front

* front done, il manque juste un alignement de la bonne reponse en dessous de l'input

* alignement reponse/solution done

* display only one solution on front and start integration test skull

* delete a log

* integration tests done

* refacto real unit test

* finish unit test

* fix regression sur qroc (affiche la reponse meme quand c'est bon)

* add unit test

* fix bug for qrocm passed answer and refacto computed property

* delete .only in test

* fix make tests pass

* delete comment

* computed properties of qrocm-ind passed to utils, need to be refacto

* delete comment

* delete comment

* refacto

* end of the merge

* Try to fix circle.yml for bower

* refacto 1

* adds from tech review

* regler bug benjamin sur la review app et ajout de test

* delete .only

* click sur zone grisé fait sortir de la modale + test

* test to save resultDetails done

* ajout de la propriété enabledTreatments dans le serializer airtable de solution. refacto emplacement de t1, t2 et t3 + ajout de tests pour ces fonctions. modification de applyTreatments onSolutions en utilisant les fonction t1 t2 t3, wip modification des tests de match dans solution-service-qrocmind en ajoutant le champs enabledTreatments

* refacto solution-service-qrocm-ind

* Fucking code

* Fucking code

* aaaaaaaah resolved test :)

* make tests pass after pull

* refacto tests

* Fix the fucking tests

* add save of resultDetails in dataBase

* resolve api answer serializer, implement fronts

* debut refacto, le nouveau answersAsObjects ne fonctionne pas comme on le veut avec reduce, A VOIR

* Fix the build

* Oops

* Refactor solution-services-x

* Some refactoring

* Continue to refactor

* Continue to refactor

* Continue to refactor

* Rename solution-service#match into #revalidate

* Take into account code review remarks

* delete comment and rename en camelCase

* refacto sur nom de variables test api

* continuing refacto

* refacto with pierre and florian dans qrocm ind solution panel

* gestion du cas où le challenge QROCM-ind est passé (null\n est enregistré en base)

* fix when resultdetailsYaml is null

* last change from jeremy review (!= to !==)

* delete import dir

* reactivate mailjet

* keep sqlite in package .json

* [376] [CLEANUP] Amélioration de l'image de présentation sur la page d'accueil (US-417). (#376)

* Replace index hero image by new one

* Decrease home page image height

* [#373] [BUGFIX] Affichage de l'avertissement 'epreuve timée' lorsque deux challenges du même type se suivent (US-424) (#373)

* resolve bug, about to add a test

* add acceptance test

* Restore dotenv sample file

* Refactor component to follow team standards elements of a component order

* Nouvelle version du projet : v1.7.0 (précédement v1.6.3)

* Update CHANGELOG.md

* [INFRA] Mise à jour du script pour gèrer les problèmes de conflit avec master
@jbuget jbuget modified the milestone: v1.6.1 Apr 25, 2017
jbuget pushed a commit that referenced this pull request Jul 12, 2017
…ement dédié (US-456). (#461)

* try to restore prod

* [#370] [CLEANUP] Suppression des positional params. (#370)

* Remove deprecated and unused components app-header and app-footer

* Remove positional params for component comparison-window

* Oops (forgotten .only in tests)

* Remove positional params for component challenge-statement

* Declare 'challenge' as a component property for challenge-statement

* Remove positional params for component feedback-panel

* Remove positional params for component qroc-solution-panel

* Fix tests

* On expose un nouvel endpoint avec les infos api sur /api (#375)

[#375] [FEATURE] On expose un nouvel endpoint avec les infos api sur /api (US-453).

* Changement de version 1.6.2 vers 1.6.3

* Update CHANGELOG.md

* [#283] [FEATURE] Ajout des acquis aux épreuves pour calculer le niveau de l'apprenant (US-360). (#283)

* Add knowledge (acquis) to challengeSerializer

* Add acquix to acquired / not_acquired arrays

* Add tests for assessment level estimation

* Fix tests for computing level of assessments

* Add unit tests and compute PIX score

* Fallback when history is empty or challenge has no knowledge

* Take review into account

* Rename variable

* Make a service for populating scores in assessments

* Add unit tests

* Refactor code

* Cleanup

* Extracting getScoredAssessment in the assessment service

* Refactoring ChallengeService#getKnowledgeData

* Missing semicolon on changes

* Extracting the performance statistics in a specific file + creating tests

* Lets refactor the Scoring#getPerformanceStats function

* Adding tests on Scoring#computeDiagnosis

* Refactoring #populateScore into #_completeAssessmentWithScore

* Refactoring assessmentService#getScoredAssessment and creating tests

* Introducing a 404 error when the assessment does not exist

* Renamming skill to knowledge to preserve consistency

* Add forgotten important test

* Fix test

* Refactor old for..in form into lo-dash _.forOwn

* [#372] [CLEANUP] Importation des followers dans base de données de production et suppression de scripts d'import (US-449) (#372)

* [#353][BUGFIX] Fix placement-tests HTML and route for placeholder images (#353)

[#353] [BUGFIX] Correction du rendu de la route /placement-tests (US-425).

* [#357] [FEATURE] Sauvegarder le temps écoulé pour chaque épreuve (US-361). (#357)

* New migration to add elapsed time to Answers table

* Add elapsedTime attributes in answer-serializer

* Add test to answer-controller-update

* Api is ready to receive elapsed time

* improve node version for coverage

* Update answer model

* component save time elapsed but no test added

* Fix review comments

* [#364] [INFRA] Extraction des identifiants Airtable dans des variables d'environnement (US-430). (#364)

* Add tasks to configure environment for development

* Fix build

* Remove useless description in README.md

* shutdown pretender server on app destroy (#362)

This fixes a "You created a second Pretender instance
while there was already one running" warning during
acceptance tests.

See miragejs/ember-cli-mirage#915

* de-duplicate email validation code (#361)

Use an utility function for validating email adresses (rather than a
full-blown service).

IMO Services should be used when the service is a object with several
method. In this case instantiating a service makes sense.

When the code is a simple function, an utility in `utils/` is simpler,
and involves less boilerplate.

This commit has the nice side-effect of actually simplifying the code
that uses the email validation: no need to inject a custom service,
or to define a private helper function.

* [#366] [INFRA] Correction d'avertissements dans les tests : "unsafe CSS bindings" (#366)

* progress-bar: escape CSS style

Fix a Glimmer warning about unescaped classes.

* timeout-jauge: escape CSS style

Fix a Glimmer warning about unescaped classes.

* [#360] [CLEANUP] Meilleure gestion des conditions de tests liées à l'environnement (issue #335). (#360)

* Add variable spy in config to detect if Env is test

* fix lint errors

* Fix all

* delete useless space

* Add Env variables according to theirs intents to components where they are used

* delete intestMode variable

* Attache env variables to APP context

* Fix bug en staging le timer enregistrait toujours 0 dans le temps écoulé (#369)

* [#368] [BUGFIX] Enlever le séparateur de la zone de réponse pour les QROCM (US-369) (#368)

* transform hr to br and add margin beetween inputs

* second commit to have a review app

* delete breakline for qroc which appear sometimes

* [#342] [FEATURE] Affichage de la zone de correction pour les challenges QROCM-ind (US-385) (#342)

* first commit

* create component

* ajout test intégration sur comparison window

* continuer sur box de comparaison pour QROC

* implem QROC sans les tests

* make previous tests pass

* add unit test on component qroc-answer-comparison-box

* add integration test on qroc-answer-comparison-box

* refacto jerem

* refacto

* add acceptance tests

* add acceptance tests1

* rename pour qroc-solution-panel and create qrocm solution panel

* Fix tests

* back-up for qrocm-ind

* commit to change branch

* rename component

* wip regex labels treatments

* create component qrocm-ind and first computed property

* labelstodiplay done with test, reflexion on answers to dispay

* wip

* wip reflexion comment organiser les donner à envoyer hbs

* computed property to formate the data, done and tested

* computed property done with bug

* no bug anymore, wip on dataToDisplay

* tentative avec proposalsAsBlock

* utilise le proposal block, reste à derterminer comment on connait la validité de chacune des reponse

* succeed parse des label avec ${} \o/

* basic front done mais retour du bug avec pas de grisement derrière la popin

* tentative de resolution de bug

* add unit test to computed property and about to start the html/css

* refacto computed property to facilitate css of right/wrong/no Asnwer possibility on front

* front done, il manque juste un alignement de la bonne reponse en dessous de l'input

* alignement reponse/solution done

* display only one solution on front and start integration test skull

* delete a log

* integration tests done

* refacto real unit test

* finish unit test

* fix regression sur qroc (affiche la reponse meme quand c'est bon)

* add unit test

* fix bug for qrocm passed answer and refacto computed property

* delete .only in test

* fix make tests pass

* delete comment

* computed properties of qrocm-ind passed to utils, need to be refacto

* delete comment

* delete comment

* refacto

* end of the merge

* Try to fix circle.yml for bower

* refacto 1

* adds from tech review

* regler bug benjamin sur la review app et ajout de test

* delete .only

* click sur zone grisé fait sortir de la modale + test

* test to save resultDetails done

* ajout de la propriété enabledTreatments dans le serializer airtable de solution. refacto emplacement de t1, t2 et t3 + ajout de tests pour ces fonctions. modification de applyTreatments onSolutions en utilisant les fonction t1 t2 t3, wip modification des tests de match dans solution-service-qrocmind en ajoutant le champs enabledTreatments

* refacto solution-service-qrocm-ind

* Fucking code

* Fucking code

* aaaaaaaah resolved test :)

* make tests pass after pull

* refacto tests

* Fix the fucking tests

* add save of resultDetails in dataBase

* resolve api answer serializer, implement fronts

* debut refacto, le nouveau answersAsObjects ne fonctionne pas comme on le veut avec reduce, A VOIR

* Fix the build

* Oops

* Refactor solution-services-x

* Some refactoring

* Continue to refactor

* Continue to refactor

* Continue to refactor

* Rename solution-service#match into #revalidate

* Take into account code review remarks

* delete comment and rename en camelCase

* refacto sur nom de variables test api

* continuing refacto

* refacto with pierre and florian dans qrocm ind solution panel

* gestion du cas où le challenge QROCM-ind est passé (null\n est enregistré en base)

* fix when resultdetailsYaml is null

* last change from jeremy review (!= to !==)

* delete import dir

* reactivate mailjet

* keep sqlite in package .json

* [376] [CLEANUP] Amélioration de l'image de présentation sur la page d'accueil (US-417). (#376)

* Replace index hero image by new one

* Decrease home page image height

* [#373] [BUGFIX] Affichage de l'avertissement 'epreuve timée' lorsque deux challenges du même type se suivent (US-424) (#373)

* resolve bug, about to add a test

* add acceptance test

* Restore dotenv sample file

* Refactor component to follow team standards elements of a component order

* Nouvelle version du projet : v1.7.0 (précédement v1.6.3)

* Update CHANGELOG.md

* Creating a new command to update Preview
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants