Beispiel #1
0
 //
 // GET: /Result/
 public List<Result> questionsAnswers(int id)
 {
     //1
     var json = new Enlace().EjecutarAccion("http://localhost:3000/tests/get_answers.json?test_id=" + id, "GET");
     var serializer = new JavaScriptSerializer();
     List<Result> result = serializer.Deserialize<List<Result>>(json);
     return result;
 }
Beispiel #2
0
 public List<Answers> answersTest(int student_id, int test_id)
 {
     //1
     var json = new Enlace().EjecutarAccion("http://localhost:3000/tests/get_answers.json?student_id=" + student_id + "&test_id=" + test_id, "GET");
     var serializer = new JavaScriptSerializer();
     List<Answers> result = serializer.Deserialize<List<Answers>>(json);
     return result;
 }
Beispiel #3
0
 public List<Student> StudentsThatAnswer(int id)
 {
     //1
     var json = new Enlace().EjecutarAccion("http://localhost:3000/tests/students_that_answer.json?test_id=" + id, "GET");
     var serializer = new JavaScriptSerializer();
     List<Student> result = serializer.Deserialize<List<Student>>(json);
     return result;
 }
Beispiel #4
0
 public Questions find(int id)
 {
     var json = new Enlace().EjecutarAccion(url + "/" + id.ToString() + ".json", "GET");
     var serializer = new JavaScriptSerializer();
     Questions result = serializer.Deserialize<Questions>(json);
     return result;
 }
Beispiel #5
0
 public List<Questions> info()
 {
     var json = new Enlace().EjecutarAccion(url + ".json", "GET");
     var serializer = new JavaScriptSerializer();
     List<Questions> result = serializer.Deserialize<List<Questions>>(json);
     return result;
 }
Beispiel #6
0
 public List<student> studentAsociado(int id)
 {
     var json = new Enlace().EjecutarAccion(url + "/get_students.json?id=" + id.ToString(), "GET");
     var serializer = new JavaScriptSerializer();
     List<student> result = serializer.Deserialize<List<student>>(json);
     return result;
 }
Beispiel #7
0
 public Course detailCourse(int id)
 {
     var json = new Enlace().EjecutarAccion(url + "/" + id.ToString() + ".json", "GET");
     var serializer = new JavaScriptSerializer();
     Course result = serializer.Deserialize<Course>(json);
     return result;
 }
Beispiel #8
0
 public List<professors> professorCourse(int id)
 {
     var json = new Enlace().EjecutarAccion(url + "/get_professors.json?id=" + id.ToString(), "GET");
     var serializer = new JavaScriptSerializer();
     List<professors> result = serializer.Deserialize<List<professors>>(json);
     return result;
 }
Beispiel #9
0
 public log Login(LoginModel model, bool persistCookie = false)
 {
     string url2 = "http://localhost:3000/courses/login.json?";
     //bool result = false;
     //string url2 = "http://localhost:3000/courses/login.json";
     //bool result = false;
     string ver = model.UserName.ToString();
     var json = new Enlace().EjecutarAccion(url2 + "username="******"&password="******"GET");
     var serializer = new JavaScriptSerializer();
     log result2 = serializer.Deserialize<log>(json);
     //if (result2.value)
     //{
         //ViewBag.log = log;
         //return RedirectToAction("Index", "Home");
     //    Course result = serializer.Deserialize<Course>(json);
     //    result = true;
     //}
     //else
     //    result = false;
     return result2;
 }
Beispiel #10
0
 public List<Course> get_courses(int id)
 {
     var json = new Enlace().EjecutarAccion("http://localhost:3000/courses/get_courses_student.json?id=" + id, "GET");
     var serializer = new JavaScriptSerializer();
     List<Course> result = serializer.Deserialize<List<Course>>(json);
     return result;
 }
Beispiel #11
0
 public student find(int id)
 {
     var json = new Enlace().EjecutarAccion(url+"/"+id.ToString()+".json","GET");
     //client.DownloadString(url + "students/" + id.ToString() + ".json");
     var serializer = new JavaScriptSerializer();
     student result = serializer.Deserialize<student>(json);
     return result;
 }
Beispiel #12
0
 public List<Test> info(int idCourse = 0)
 {
     var json = new Enlace().EjecutarAccion(url + "/get_test.json?id="+idCourse, "GET");
     var serializer = new JavaScriptSerializer();
     List<Test> result = serializer.Deserialize<List<Test>>(json);
     return result;
 }