Created
October 21, 2015 14:14
-
-
Save labra/adaadec0e6a2ecce2141 to your computer and use it in GitHub Desktop.
Fichero de pruebas corrector de exámenes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var assert = require('assert'); | |
var corrector = require("../Corrector"); | |
describe('Corrector', function() { | |
describe('método corrige()', function() { | |
it('debe corregir examen sencillo', function() { | |
var enunciado = [ { "pregunta": 1, "correcta": "a"} , | |
{ "pregunta": 2, "correcta": "b"} ]; | |
var examen = [ | |
{ "alumno": 2456, | |
"respuestas": [ {"pregunta": 1, "respuesta": "a"} , | |
{"pregunta": 2, "respuesta": "b"}] }, | |
{ "alumno": 4321, | |
"respuestas": [ {"pregunta": 1, "respuesta": "b"} , | |
{"pregunta": 2, "respuesta": "b"}] } | |
]; | |
var resultado = [{ "alumno": 2456, "nota": 2} , | |
{ "alumno": 4321, "nota": 0.75} ]; | |
assert.deepEqual(resultado,corrector().corrige(enunciado,examen)); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment