コード例 #1
0
        public ActionResult addQuestionsTOF(True_False Tof)
        {
            var tof = db.True_False.Add(Tof);

            tof.Course_Id = Session["c_id"].ToString();
            tof.Title_Id  = Session["title"].ToString();
            db.SaveChanges();
            ModelState.Clear();
            return(View());
        }
コード例 #2
0
 private void gradeSection(int sectionCode, Bitmap stretched, Sectionizer testSections, ExamSpecifics exam, double avRadius)
 {
     if (sectionCode == 0)
     {
         LineScannerSC    prelines = new LineScannerSC(testSections.studentCondition, avRadius);
         StudentCondition section1 = new StudentCondition(prelines.lineX, prelines.lineY, stretched, exam, avRadius);
         section1.scoreSection(stretched); // should be in a worker thread
         scannedScores[sectionCode] = (section1);
     }
     if (sectionCode == 1)
     {
         LineScannerMC   prelines = new LineScannerMC(testSections.multipleChoice, avRadius);
         Multiple_Choice section1 = new Multiple_Choice(prelines.lineX, prelines.lineY, stretched, exam, avRadius);
         section1.scoreSection(stretched); // should be in a worker thread
         scannedScores[sectionCode] = (section1);
     }
     else if (sectionCode == 2)
     {
         LineScannerPairing prelines = new LineScannerPairing(testSections.pairing, avRadius);
         Pairing            section2 = new Pairing(prelines.lineX, prelines.lineY, stretched, exam, avRadius);
         section2.scoreSection(stretched); // should be in a worker thread
         scannedScores[sectionCode] = (section2);
     }
     else if (sectionCode == 3)
     {
         LineScannerTF prelines = new LineScannerTF(testSections.trueFalse, avRadius);
         True_False    section3 = new True_False(prelines.lineX, prelines.lineY, stretched, exam, avRadius);
         section3.scoreSection(stretched); // should be in a worker thread
         scannedScores[sectionCode] = (section3);
     }
     else if (sectionCode == 4)
     {
         LineScannerCompletion prelines = new LineScannerCompletion(testSections.completion, avRadius);
         Completion            section4 = new Completion(prelines.lineX, prelines.lineY, stretched, exam, avRadius);
         section4.scoreSection(stretched); // should be in a worker thread
         scannedScores[sectionCode] = (section4);
     }
     else if (sectionCode == 5)
     {
         LineScannerSubjective prelines = new LineScannerSubjective(testSections.subjective, avRadius);
         Subjective            section4 = new Subjective(prelines.lineX, prelines.lineY, stretched, exam, avRadius);
         section4.scoreSection(stretched); // should be in a worker thread
         scannedScores[sectionCode] = (section4);
     }
 }
コード例 #3
0
        public DAL_Question(Question question)
        {
            if (question is Multiple_Choice)
            {
                Multiple_Choice myMC = (Multiple_Choice)question;
                Type = "mc";
                JsonQuestion json = JsonQuestion.getJsonQuestion(myMC.QuestionContent, myMC.ChoiceA, myMC.ChoiceB, myMC.ChoiceC, myMC.ChoiceD);
                QuestionContent = Newtonsoft.Json.JsonConvert.SerializeObject(json);
            }
            else if (question is Compound)
            {
                Compound myCP = (Compound)question;
                Type = "cp";
                JsonQuestion json = JsonQuestion.getJsonQuestion(myCP.QuestionContent, myCP.ChoiceA, myCP.ChoiceB, myCP.ChoiceC, myCP.ChoiceD);
                QuestionContent = Newtonsoft.Json.JsonConvert.SerializeObject(json);
            }
            else if (question is Fill_In)
            {
                Fill_In myFi = (Fill_In)question;
                Type = "fi";
                JsonQuestion json = JsonQuestion.getJsonQuestion(myFi.QuestionContent);
                QuestionContent = JsonConvert.SerializeObject(json);
            }
            else if (question is Fast)
            {
                Fast myFa = (Fast)question;
                Type = "fs";
                JsonQuestion json = JsonQuestion.getJsonQuestion(myFa.QuestionContent);
                QuestionContent = JsonConvert.SerializeObject(json);
            }
            else if (question is True_False)
            {
                True_False myTf = (True_False)question;
                Type = "tf";
                JsonQuestion json = JsonQuestion.getJsonQuestion(myTf.QuestionContent);
                QuestionContent = JsonConvert.SerializeObject(json);
            }

            AnswerKey         = question.AnswerKey;
            ImageBase64String = question.Image64String;
        }
コード例 #4
0
        public ActionResult questsTOF()
        {
            True_False q = null;

            if (TempData["questions"] != null)
            {
                Queue <True_False> qlist = (Queue <True_False>)TempData["questions"];
                if (qlist.Count > 0)
                {
                    q = qlist.Peek();
                    qlist.Dequeue();
                    TempData["questions"] = qlist;
                    TempData.Keep();
                }
                else
                {
                    return(RedirectToAction("Score"));
                }
            }

            return(PartialView(q));
        }