Advertisement
andruhovski

Untitled

Apr 6th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. public ActionResult PostRawBuffer(FormCollection collection)
  2. {
  3. var quizInfo = new QuizInfo
  4. {
  5. QuizMakerVersion = collection["v"],
  6. Points = double.Parse(collection["sp"]),
  7. PassingPercent = double.Parse(collection["psp"]),
  8. GainedScore = double.Parse(collection["tp"]),
  9. UserName = collection["sn"],
  10. Email = collection["se"],
  11. QuizTitle = collection["qt"]
  12. };
  13. _db.QuizInfos.Add(quizInfo);
  14. _db.SaveChanges();
  15. var ser = new XmlSerializer(typeof(quizReport));
  16. var wrapper = (quizReport)ser.Deserialize(new StringReader(collection["dr"]));
  17. foreach (var item in wrapper.questions.Items)
  18. {
  19. System.IO.File.AppendAllText(@"C:\abc\WriteLines.txt", item.id);
  20. System.IO.File.AppendAllText(@"C:\abc\WriteLines.txt", item.direction);
  21. if (!(item is TrueFalseQuestion)) continue;
  22.  
  23. }
  24. //System.IO.File.WriteAllText(@"C:\abc\WriteLines.txt", collection["dr"]);
  25. return new HttpStatusCodeResult(HttpStatusCode.OK);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement