Ejemplo n.º 1
0
        // GET: Test/Details/5
        public ActionResult Details(int id)
        {
            var       test = serviceTest.GetById(id);
            TestModel ts   = new TestModel();

            ts.type     = test.type;
            ts.question = test.question;
            ts.reponse  = test.reponse;
            ts.choix1   = test.choix1;
            ts.choix2   = test.choix2;

            return(View(ts));
        }
Ejemplo n.º 2
0
        public IHttpActionResult GetTest(int id)
        {
            Test      test  = cs.GetById(id);
            TestModel testM = new TestModel();

            testM.reponse  = test.reponse;
            testM.question = test.question;
            testM.choix1   = test.choix1;
            testM.choix2   = test.choix2;
            testM.type     = test.type;



            if (test == null)
            {
                return(NotFound());
            }

            return(Ok(testM));
        }