Esempio n. 1
0
 public ExamRecord(int?examID, int disabledID, ExamState state, bool evaluated)
 {
     ExamID     = examID;
     DisabledID = disabledID;
     State      = state;
     Evaluated  = evaluated;
 }
Esempio n. 2
0
 public ExamRecord(int?examID, int disabledID, ExamState state, int first)
 {
     ExamID     = examID;
     DisabledID = disabledID;
     State      = state;
     First      = first;
 }
Esempio n. 3
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     ExamState state = (ExamState) value;
     if (state == VisibleState)
     {
         return Visibility.Visible;
     }
     return Visibility.Collapsed;
 }
Esempio n. 4
0
 public static void ChangeStudentState(Student s,ExamState e)
 {
     if (StudentCollection.ContainsKey(s))
     {
         StudentCollection[s] = e;
     }
     else
     {
         StudentCollection.Add(s, e);
     }
 }
Esempio n. 5
0
	public void CreateAssessment(string type){
		assessmentId = "";
		es = ExamState.Loading;
		if (type == "career") {
			type = "career-deck";
		} else
			type = "super-hero";

		string url = GenURLBase("assessments");
		string jsonstring = "{ \"deck_id\":\""+type+"\" }";
		StartCoroutine(wwwget.FetchDataAuthPost(url,PopulateAssessmentID,GenAuthString(),jsonstring));
	}
Esempio n. 6
0
	void PopulatePersonality(string dump){ print (dump);
		JSONObject json = new JSONObject (dump);
		JSONObject personalitytypes =  json ["personality_types"] ;
		int total = personalitytypes.Count;
		pt = new PersonalityType[7];
		for (int i=0; i<total; i++) {
			pt[i] = new PersonalityType();
			JSONObject eachjson = personalitytypes[i]; 
			print (eachjson["score"]);
			pt[i].score = eachjson["score"].n;
			JSONObject personalitytype = eachjson["personality_type"];
			pt[i].name = personalitytype["name"].str;
			pt[i].desc = personalitytype["description"].str;
			JSONObject badge = personalitytype["badge"];
			pt[i].badgeImageURL = badge["image_large"].str;
			//TODO StartCoroutine(wwwget.FetchDataTexture(pt[i].badgeImageURL,AssignBadgeImage));
			pt[i].keywords = personalitytype["keywords"].str;
		}
		es = ExamState.TypeLoaded;
	}
Esempio n. 7
0
	void DoneLoadingImages(){
		print ("Done with images! Loaded: "+texSlidesPortrait.Length);
		es = ExamState.Loaded;
	}
Esempio n. 8
0
 public ExamRecord(int?examID, int disabledID, ExamState state)
 {
     ExamID     = examID;
     DisabledID = disabledID;
     State      = state;
 }
Esempio n. 9
0
 private void SaveTargetExam(int disabledID, string ExamName, ExamState state, Boolean flag, int?nextID)
 {
     if (!string.IsNullOrEmpty(ExamName))
     {
         Exam exam  = db.Exams.Single(a => a.Name == ExamName);
         bool exist = db.ExamRecords.Count(a => a.Exam.Name == ExamName && a.DisabledID == disabledID) > 0;
         if (!exist)
         {
             bool     f    = true;
             string[] list = { "偏瘫", "脑瘫", "脊髓", "肢体" };
             foreach (var item in list)
             {
                 if (exam.Name == item)
                 {
                     f = false;
                 }
             }
             if (f)
             {
                 var num    = db.ExamRecords.Count(x => x.DisabledID == disabledID && x.State == ExamState.待评估);
                 var record = db.ExamRecords.Where(x => x.DisabledID == disabledID && x.State == ExamState.待评估);
                 if (num == 1 || num == 4)
                 {
                     db.ExamRecords.RemoveRange(record);
                 }
                 var examRecord = new ExamRecord(exam.ID, disabledID, state, flag, nextID);
                 db.ExamRecords.Add(examRecord);
             }
             else
             {
                 var num    = db.ExamRecords.Count(x => x.DisabledID == disabledID && x.State == ExamState.待评估);
                 var record = db.ExamRecords.Where(x => x.DisabledID == disabledID && x.State == ExamState.待评估);
                 if (num == 1)
                 {
                     bool t = false;
                     foreach (var item in list)
                     {
                         if (record.FirstOrDefault().Exam.Name == item)
                         {
                             t = true;
                         }
                     }
                     if (!t)
                     {
                         db.ExamRecords.RemoveRange(record);
                     }
                 }
                 var examRecord = new ExamRecord(exam.ID, disabledID, state, flag, nextID);
                 var user       = db.Disableds.Where(x => x.ID == disabledID).FirstOrDefault();
                 db.ExamRecords.Add(examRecord);
             }
         }
         else
         {
             var examRecord = db.ExamRecords.FirstOrDefault(x => x.DisabledID == disabledID && x.ExamID == exam.ID);
             //转存机构审核
             if (nextID == 1)
             {
                 if ((examRecord.State == ExamState.待评估 && examRecord.NextID == 3) || (examRecord.State == ExamState.待完成 && examRecord.NextID == 2))
                 {
                     examRecord.DisabledID = disabledID;
                     examRecord.ExamID     = exam.ID;
                     examRecord.State      = state;
                     examRecord.Evaluated  = flag;
                     examRecord.NextID     = nextID;
                 }
             }
             //转存康复服务机构
             else if (nextID == 2)
             {
                 if ((examRecord.State == ExamState.待评估 && examRecord.NextID == 3) || (examRecord.State == ExamState.待审核 && examRecord.NextID == 1))
                 {
                     examRecord.DisabledID = disabledID;
                     examRecord.ExamID     = exam.ID;
                     examRecord.State      = state;
                     examRecord.Evaluated  = flag;
                     examRecord.NextID     = nextID;
                 }
             }
             //转存上门评估
             else if (nextID == 3)
             {
                 if ((examRecord.State == ExamState.待审核 && examRecord.NextID == 1) || (examRecord.State == ExamState.待完成 && examRecord.NextID == 2))
                 {
                     examRecord.DisabledID = disabledID;
                     examRecord.ExamID     = exam.ID;
                     examRecord.State      = state;
                     examRecord.Evaluated  = flag;
                     examRecord.NextID     = nextID;
                 }
             }
         }
         db.SaveChanges();
     }
 }