public ActionResult StartPoging(int examenid)
        {
            Examen examen = db.examens.Find(examenid);
            Poging p      = new Poging();

            p.Examen = examen;
            db.pogingen.Add(p);
            db.SaveChanges();
            ViewBag.pogingen   = db.pogingen;
            ViewBag.antwoorden = db.antwoorden;
            return(View("StartExamen", examen));
        }
        public ActionResult ToonVraag(int vraagindex, int pogingid)
        {
            testDTO td = new testDTO();

            td.antwoord     = new Antwoord();
            td.huidigeIndex = vraagindex;
            Poging poging = db.pogingen.Find(pogingid);

            td.poging = poging;
            td.examen = db.examens.Find(poging.Examen.ExamenId);
            Console.WriteLine(td.examen.questions.Count + "<<<<<<");
            td.huidigeVraag = td.examen.questions[vraagindex];
            if (vraagindex > 0)
            {
                td.vorigeVraag = td.examen.questions[vraagindex - 1];
            }
            if (vraagindex < td.examen.questions.Count - 1)
            {
                td.volgendeVraag = td.examen.questions[vraagindex + 1];
            }
            ViewBag.tdtd = td;
            return(View(td));
        }
示例#3
0
 public void Add(Poging poging)
 {
     _pogingen.Add(poging);
 }