Ejemplo n.º 1
0
        /// <summary>
        /// Gets the number of microquestions that haven't yet a global grade
        /// </summary>
        /// <param Name="id"></param>
        /// <returns></returns>
        internal List <Grade> CountNonClosedMicroGrades(Class Class, GradeType GradeType)
        {
            DbDataReader dRead;
            DbCommand    cmd;
            List <Grade> ls = new List <Grade>();

            using (DbConnection conn = Connect())
            {
                string query = "SELECT Grades.idStudent, Count(*) as nGrades FROM Grades," +
                               "Grades AS Parents,Classes_Students" +
                               " WHERE Classes_Students.idStudent = Grades.idStudent" +
                               " AND Classes_Students.idClass =" + Class.IdClass.ToString() +
                               " AND Grades.idGradeType = '" + GradeType.IdGradeType + "'" +
                               " AND Parents.idGradeType = '" + GradeType.IdGradeTypeParent + "'" +
                               " AND Grades.idGradeParent = Parents.idGrade" +
                               " AND Parents.Value is null or Parents.Value = 0" +
                               " GROUP BY Grades.idStudent;";
                cmd   = new SQLiteCommand(query);
                dRead = cmd.ExecuteReader();
                while (dRead.Read())
                {
                    Grade g = new Grade();
                    g.IdStudent = (int)dRead["idStudent"];
                    g.DummyInt  = (int)dRead["nGrades"];
                }
                dRead.Dispose();
                cmd.Dispose();
            }
            return(ls);
        }
Ejemplo n.º 2
0
    public void SelectGrade(GradeType gd)
    {
        Grade = gd;
        switch (Grade)
        {
        case GradeType.Common:
            Color = Color.gray;
            break;

        case GradeType.Uncommon:
            Color = Color.green;
            break;

        case GradeType.Rare:
            Color = Color.blue;
            break;

        case GradeType.Epic:
            Color = Color.blue + Color.red;
            break;

        case GradeType.Legendary:
            Color = Color.red + Color.yellow;
            break;

        case GradeType.Unique:
            break;

        default:
            break;
        }
    }
Ejemplo n.º 3
0
    private void Start()
    {
        gradeType     = UserInfo.instance.GetUserCharacterInfo().characterGrade[(int)currentCharacter];
        playText.text = "Play\n" + UserInfo.instance.GetRemainRankingCount() + "/" + ConfigChart.instance.configChartInfo.RankingDailyCount;

        UISetting();
    }
Ejemplo n.º 4
0
 public Student(string firstName, string lastName, GradeType grade)
 {
     this.FirstName = firstName;
     this.LastName  = lastName;
     this.Grade     = grade;
     this.Marks     = new List <Mark>();
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Updates or creates a resource based on the resource identifier. The PUT operation is used to update or create a resource by identifier.  If the resource doesn't exist, the resource will be created using that identifier.  Additionally, natural key values cannot be changed using this operation, and will not be modified in the database.  If the resource &quot;id&quot; is provided in the JSON body, it will be ignored as well.
        /// </summary>
        /// <param name="id">A resource identifier specifying the resource to be updated.</param>
        /// <param name="IfMatch">The ETag header value used to prevent the PUT from updating a resource modified by another consumer.</param>
        /// <param name="body">The JSON representation of the &quot;gradeType&quot; resource to be updated.</param>
        /// <returns>A RestSharp <see cref="IRestResponse"/> instance containing the API response details.</returns>
        public IRestResponse PutGradeType(string id, string IfMatch, GradeType body)
        {
            var request = new RestRequest("/gradeTypes/{id}", Method.PUT);

            request.RequestFormat = DataFormat.Json;

            request.AddUrlSegment("id", id);
            // verify required params are set
            if (id == null || body == null)
            {
                throw new ArgumentException("API method call is missing required parameters");
            }
            request.AddHeader("If-Match", IfMatch);
            request.AddBody(body);
            request.Parameters.First(param => param.Type == ParameterType.RequestBody).Name = "application/json";
            var response = client.Execute(request);

            var location = response.Headers.FirstOrDefault(x => x.Name == "Location");

            if (location != null && !string.IsNullOrWhiteSpace(location.Value.ToString()))
            {
                body.id = location.Value.ToString().Split('/').Last();
            }
            return(response);
        }
        public async Task <IActionResult> PostGrade([FromBody] GradeRecived grade)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            Student            student = _context.Student.Where(s => s.Username.Equals(grade.username)).FirstOrDefault();
            GradesToDiscipline gtd     = student.Grades.Where(g => g.Discipline.Nume.Equals(grade.materie)).FirstOrDefault();

            GradeType gt = GradeType.EXAMEN;

            if (grade.tipNota == "Examen final")
            {
                gt = GradeType.EXAMEN;
            }
            else if (grade.tipNota == "Laborator")
            {
                gt = GradeType.LAB;
            }

            if (grade.data == "")
            {
                grade.data = DateTime.Now.ToString("dd/MM/yyyy");
            }

            if (grade.idNota == "")
            {
                Grade newGrade = new Grade()
                {
                    GradeValue = double.Parse(grade.grade),
                    DataNotei  = grade.data,
                    Type       = gt
                };
                if (gt == GradeType.EXAMEN)
                {
                    if (gtd.Grades.Where(g => g.Type == GradeType.EXAMEN).FirstOrDefault() == null)
                    {
                        gtd.Grades.Add(newGrade);
                    }
                }
            }
            else
            {
                Grade recievedGrade = gtd.Grades.Where(g => g.Id == int.Parse(grade.idNota)).FirstOrDefault();
                recievedGrade.GradeValue = double.Parse(grade.grade);
                recievedGrade.DataNotei  = grade.data;
            }
            await _context.SaveChangesAsync();

            if (gt == GradeType.EXAMEN)
            {
                List <Student> students = new List <Student>();
                students.Add(_context.Student.Where(s => s.Username.Equals(grade.username)).FirstOrDefault());
                Service service = new Service(_context);
                service.SendMailToStudents(students, "Exam grade at " + grade.materie + " published", String.Format("Hello!\n\nYour teacher posted youe exam grade: {0}.\nWe hope you did good and we wish you the best of luck :)", grade.grade));
            }

            return(Ok());
        }
Ejemplo n.º 7
0
        public List <Grade> GetGradesByType(string username, string discipline, GradeType gradeType)
        {
            Student currentStudent = context.Student.Where(s => s.Username == username).Select(s => s).FirstOrDefault();

            return(currentStudent.Grades.Where(g => g.Discipline.Nume == discipline)
                   .Select(g => g.Grades).First().ToList()
                   .Where(g => g.Type == gradeType).ToList());
        }
Ejemplo n.º 8
0
 public Grade FindGrade(GradeType type)
 {
     if (Components.Exists(x => ((Grade)x).GradeNum == type))
     {
         return(Components.Find(x => ((Grade)x).GradeNum == type) as Grade);
     }
     return(null);
 }
Ejemplo n.º 9
0
 private void btnLabType_Click(object sender, EventArgs e)
 {
     clearButtons();
     btnLabType.Checked = true;
     type = GradeType.Lab;
     weight = 0.4;
     refreshGradesList();
     txtGrade.Focus();
 }
Ejemplo n.º 10
0
        private void BuildHql()
        {
            StringBuilder hql = new StringBuilder();

            DateTime tmp   = dateStart.SelectedDate.Value;
            DateTime start = new DateTime(tmp.Year, tmp.Month, tmp.Day, 0, 0, 0);

            tmp = dateEnd.SelectedDate.Value;
            DateTime end = new DateTime(tmp.Year, tmp.Month, tmp.Day, 23, 59, 59);

            hql.Append(string.Format(" from SMSRecord as r where r.GradeType.IsSupervise = {0} and  r.WorkDate between '{1}' and '{2}' ",
                                     true, start, end));


            if (cboxStation.SelectedItem != null)
            {
                Organization org = cboxStation.SelectedItem as Organization;
                if (org != null)
                {
                    hql.Append(" and r.Organization.Id =" + org.Id);
                }
            }

            if (cboxGradeType.SelectedItem != null)
            {
                GradeType grade = cboxGradeType.SelectedItem as GradeType;
                if (grade != null)
                {
                    hql.Append(" and r.GradeType.Id =" + grade.Id);
                }
            }
            if (txtOper.Text != "")
            {
                if (!string.IsNullOrEmpty(txtOper.Text.Trim()))
                {
                    hql.Append(string.Format(" and r.WorkOfficer.Name like '%{0}%' ", txtOper.Text.Trim()));
                }
            }
            if (txtLeader.Text != "")
            {
                if (!string.IsNullOrEmpty(txtLeader.Text.Trim()))
                {
                    hql.Append(string.Format(" and r.Leader.Name like '%{0}%' ", txtLeader.Text.Trim()));
                }
            }

            queryCondition = new QueryCondition();

            string hqlStr = hql.ToString();

            queryCondition.HQL = "select r " + hqlStr + " order by r.WorkDate desc";

            queryCondition.TotalHQL = "select count(r) " + hqlStr;

            queryCondition.MaxResults = PageSize;
        }
Ejemplo n.º 11
0
        public void OnCellDoubleClick(object sender, RadRoutedEventArgs e)
        {
            GradeType obj = gv.SelectedItem as GradeType;

            if (obj != null)
            {
                GradeTypeForm form = new GradeTypeForm(obj, getData);
                Tools.OpenWindow("评分内容-编辑", form, null);
            }
        }
Ejemplo n.º 12
0
 public void EditGrade(long id, string icon, GradeType type)
 {
     if (ComponentsCache.ContainsKey(id))
     {
         Grade grade = ComponentsCache[id] as Grade;
         grade.GradeNum = type;
         grade.Icon     = icon ?? grade.Icon;
         LogChange(grade, ContentStatus.Edit);
     }
 }
Ejemplo n.º 13
0
 public GradeTypeForm(GradeType editObj, Action refreshAction)
     : this(refreshAction)
 {
     //复制可能被改变的属性,避免退出修改的刷新
     obj.Id     = editObj.Id;
     obj.Name   = editObj.Name;
     obj.Number = editObj.Number;
     obj.Score  = editObj.Score;
     obj.IsUsed = editObj.IsUsed;
 }
Ejemplo n.º 14
0
    protected Item(int id, string title, string desc, string slug, GradeType grade)
    {
        ID          = id;
        Title       = title;
        Description = desc;
        Slug        = slug;
        Grade       = grade;

        //Sprite TBD
    }
Ejemplo n.º 15
0
 internal static bool CheckIfTypeOfAssessmentChosen(GradeType GradeType)
 {
     if (GradeType == null)
     {
         MessageBox.Show("Scegliere un tipo di valutazione", "Operazione non possibile",
                         MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         return(false);
     }
     return(true);
 }
Ejemplo n.º 16
0
 public CharacterChartInfo GetCharacterInfo(CharacterType characterType, GradeType gradeType)
 {
     for (int i = 0; i < characterChartInfos.Length; i++)
     {
         if (characterChartInfos[i].CharacterGroupId == characterType && characterChartInfos[i].Grade == gradeType)
         {
             return(characterChartInfos[i]);
         }
     }
     return(null);
 }
Ejemplo n.º 17
0
        private void btnEdit_Click(object sender, RoutedEventArgs e)
        {
            GradeType obj = gv.SelectedItem as GradeType;

            if (obj != null)
            {
                GradeTypeForm frm = new GradeTypeForm(obj, getData);

                Tools.OpenWindow("评分内容-编辑", frm, null);
            }
        }
Ejemplo n.º 18
0
        private Grade createGrade(GradeType gradeType, SchoolYearType schoolYear, string sectionId, string studentId, string studentSectionAssocation)
        {
            Grade grade = new Grade();
            grade.gradeType = gradeType;
            grade.schoolYear = schoolYear;
            grade.sectionId = sectionId;
            grade.studentId = studentId;
            grade.studentSectionAssociationId = studentSectionAssocation;

            return grade;
        }
Ejemplo n.º 19
0
 public StudentTask(int id, string name, GradeType gradetype, DateTime taskdate, int classid, string classname, string schoolid, string schoolname)
 {
     this.id         = id;
     this.name       = name;
     this.gradeType  = gradetype;
     this.taskDate   = taskdate;
     this.classID    = classid;
     this.className  = classname;
     this.schoolID   = schoolid;
     this.schoolName = schoolname;
 }
Ejemplo n.º 20
0
    // constructor - all parameter
    // use xml data format

    public ItemData(int _itemType, int _id, string _file, string _name, int _price, int _countLimit, string _guide, int _gradeType, int _step)
    {
        itemType   = ReturnType(_itemType);
        id         = _id;
        file       = _file;
        name       = _name;
        price      = _price;
        countLimit = _countLimit;
        guide      = _guide;
        gradeType  = ReturnGradeType(_gradeType);
        step       = _step;
    }
Ejemplo n.º 21
0
    void UserInfoSet()
    {
        UserCharacterInfo userCharacterInfo = UserInfo.instance.GetUserCharacterInfo();

        if (currentCharacter == CharacterType.없음)
        {
            currentCharacter = CharacterType.한별;
        }
        gradeType = userCharacterInfo.characterGrade[(int)currentCharacter];
        ImgSet();
        GradeTextSet();
    }
Ejemplo n.º 22
0
 // constructor - default
 public ItemData()
 {
     itemType   = ItemType.Default;
     id         = 0;
     file       = null;
     name       = null;
     price      = 0;
     countLimit = 0;
     guide      = null;
     gradeType  = GradeType.Default;
     step       = 0;
 }
Ejemplo n.º 23
0
    // Grade 정보 셋팅
    private void SetGradeInfo(GradeType grade)
    {
        curGradeData = gradeDataList.FirstOrDefault(list => list.grade == grade);  // 현재 Grade에 맞는 GradeData 로드

        // '블록 생성 확률' 배열 초기화
        curGradeData.arrayBlockRate = new int[] { curGradeData.ratePlane, curGradeData.rateHill, curGradeData.rateGap,
                                                  curGradeData.rateWall, curGradeData.rateCliff, curGradeData.rateEarthquake, curGradeData.rateValley };

        // '블록 개수' 배열 초기화
        curMapData.eachBlockCount = new int[] { curMapData.numPlane, curMapData.numHill, curMapData.numGap,
                                                curMapData.numWall, curMapData.numCliff, curMapData.numEarthquake, curMapData.numValley };
    }
Ejemplo n.º 24
0
        public frmGradesStudentsSummary(Student Student, string IdSchoolYear,
                                        GradeType GradeType, SchoolSubject SchoolSubject)
        {
            InitializeComponent();
            currentStudent       = Student;
            currentSchoolYear    = IdSchoolYear;
            currentGradeType     = GradeType;
            currentSchoolSubject = SchoolSubject;

            lblCurrentStudent.Text = $"{Student.LastName} {Student.FirstName}";
            currentAnnotation      = new StudentAnnotation();
        }
Ejemplo n.º 25
0
        internal frmMicroAssessment(frmMain CallingForm, Class Class, Student Student,
                                    GradeType GradeType, SchoolSubject Subject, Question Question)
        {
            InitializeComponent();

            callingForm          = CallingForm;
            currentClass         = Class;
            currentStudent       = Student;
            currentGradeType     = GradeType;
            currentSchoolSubject = Subject;
            currentQuestion      = Question;
        }
Ejemplo n.º 26
0
        public static Tuple <double, double, double, int, int, int, int> CalcStatistics(IList <TestForm> testForms)
        {
            int        totPoints  = 0;
            int        totTime    = 0;
            int        G          = 0;
            int        IG         = 0;
            int        VG         = 0;
            int        nCompleted = 0;
            List <int> scores     = new List <int>();

            foreach (TestForm tf in testForms)
            {
                if (tf.IsCompleted)
                {
                    nCompleted++;
                    GradeType grade = CalcGrade(tf);
                    switch (grade)
                    {
                    case GradeType.G:
                        G++;
                        break;

                    case GradeType.VG:
                        VG++;
                        break;

                    case GradeType.IG:
                        IG++;
                        break;
                    }
                    totTime   += tf.FinishedDate.Value.Minute - tf.StartDate.Value.Minute;
                    totPoints += tf.Score;
                    scores.Add(tf.Score);
                }
            }

            scores.Sort();

            double median = scores.Count == 0
                ? 0
                : scores.Count % 2 == 0
                    ? (double)(scores[scores.Count / 2] + scores[(scores.Count / 2) - 1]) / 2
                    : scores[(scores.Count - 1) / 2];

            return(nCompleted == 0
                ? null
                : Tuple.Create(
                       ((double)totPoints / nCompleted),
                       median,
                       ((double)totTime / nCompleted),
                       G, VG, IG, nCompleted));
        }
Ejemplo n.º 27
0
    public void LeftArrow()
    {
        int lengthCharacterType = System.Enum.GetValues(typeof(CharacterType)).Length;
        int nextCharacter       = (int)currentCharacter - 1;

        if (nextCharacter <= 0)
        {
            nextCharacter = lengthCharacterType - 1;
        }
        currentCharacter = (CharacterType)nextCharacter;
        gradeType        = UserInfo.instance.GetUserCharacterInfo().characterGrade[(int)currentCharacter];
        UISetting();
    }
        public frmGradesStudentsSummary(Student Student, string IdSchoolYear,
                                        GradeType GradeType, SchoolSubject SchoolSubject)
        {
            InitializeComponent();
            db                   = new  DbAndBusiness(Commons.PathAndFileDatabase);
            currentStudent       = Student;
            currentSchoolYear    = IdSchoolYear;
            currentGradeType     = GradeType;
            currentSchoolSubject = SchoolSubject;

            lblCurrentStudent.Text = $"{Student.LastName} {Student.FirstName}";
            currentAnnotation      = new StudentAnnotation();
        }
Ejemplo n.º 29
0
    /// <summary>
    /// 根据品质获得品质框的名称
    /// </summary>
    /// <param name="gradeType"></param>
    /// <returns></returns>
    public string GetFrameByGradeType(GradeType gradeType)
    {
        switch (gradeType)
        {
        case GradeType.Green:
            return("lv");

        case GradeType.Green1:
            return("lv1");

        case GradeType.Blue:
            return("lan");

        case GradeType.Blue1:
            return("lan1");

        case GradeType.Blue2:
            return("lan2");

        case GradeType.Purple:
            return("zi");

        case GradeType.Purple1:
            return("zi1");

        case GradeType.Purple2:
            return("zi2");

        case GradeType.Purple3:
            return("zi3");

        case GradeType.Orange:
        case GradeType.Orange1:
        case GradeType.Orange2:
        case GradeType.Orange3:
        case GradeType.Orange4:
            return("cheng");

        case GradeType.Red:
        case GradeType.Red1:
        case GradeType.Red2:
        case GradeType.Red3:
        case GradeType.Red4:
        case GradeType.Red5:
            return("hong");

        case GradeType.Gray:
        default:
            return("hui");
        }
    }
Ejemplo n.º 30
0
 public ItemData(int _itemType, int _id, string _file, string _name, int _price, int _countLimit, string _guide, int _gradeType, int _step, ref int[] _resourceIDSet, ref int[] _resourceCountSet)
 {
     itemType         = ReturnType(_itemType);
     id               = _id;
     file             = _file;
     name             = _name;
     price            = _price;
     countLimit       = _countLimit;
     guide            = _guide;
     gradeType        = ReturnGradeType(_gradeType);
     step             = _step;
     resourceIDSet    = _resourceIDSet;
     resourceCountSet = _resourceCountSet;
 }
Ejemplo n.º 31
0
    /// <summary>
    /// 根据品质获得名字颜色值
    /// </summary>
    /// <param name="type"></param>
    /// <returns></returns>
    public string GetNameColour(GradeType type)
    {
        string colour = "";

        switch (type)
        {
        case GradeType.Gray:
            colour = fc_white;
            break;

        case GradeType.Green:
        case GradeType.Green1:
            colour = fc_green;
            break;

        case GradeType.Blue:
        case GradeType.Blue1:
        case GradeType.Blue2:
            colour = fc_blue;
            break;

        case GradeType.Purple:
        case GradeType.Purple1:
        case GradeType.Purple2:
        case GradeType.Purple3:
            colour = fc_purple;
            break;

        case GradeType.Orange:
        case GradeType.Orange1:
        case GradeType.Orange2:
        case GradeType.Orange3:
        case GradeType.Orange4:
            colour = fc_orange;
            break;

        case GradeType.Red:
        case GradeType.Red1:
        case GradeType.Red2:
        case GradeType.Red3:
        case GradeType.Red4:
        case GradeType.Red5:
            colour = fc_red;
            break;

        default:
            break;
        }
        return(colour);
    }
Ejemplo n.º 32
0
 internal GradeType GetGradeTypeFromRow(DbDataReader Row)
 {
     if (Row.HasRows)
     {
         GradeType gt = new GradeType();
         gt.IdGradeType       = (string)Row["idGradeType"];
         gt.IdGradeTypeParent = Safe.String(Row["IdGradeTypeParent"]);
         gt.IdGradeCategory   = (string)Row["IdGradeCategory"];
         gt.Name          = (string)Row["Name"];
         gt.DefaultWeight = (double)Row["DefaultWeight"];
         gt.Desc          = (string)Row["Desc"];
         return(gt);
     }
     return(null);
 }
Ejemplo n.º 33
0
 public Grade(double grade, double weight, GradeType type)
 {
     this.grade = grade;
     this.weight = weight;
     this.type = type;
 }
		/// <summary>
		/// GetWgbhResources - Returns a resource list of WGBH search items.
		/// </summary>
		/// <param name="grade"></param>
		/// <param name="textSearch"></param>
		/// <param name="media"></param>
		/// <param name="language"></param>
		/// <returns>List</returns>
		private List<Resource> GetWgbhResources(bool search, List<string> grade = null, string textSearch = null,
			string media = null, string language = null)
		{
			if (grade == null) throw new ArgumentNullException("grade");
			if (textSearch == null) throw new ArgumentNullException("textSearch");
			if (media == null) throw new ArgumentNullException("media");
			if (language == null) throw new ArgumentNullException("language");

			var list = new List<Resource>();
			var learningMediaRequestFilter = new LearningMediaRequestFilter
			{
				SearchTerm = LearningMediaFacets.SearchTermAll,
				LanguageTypes = new List<LanguageType>(),
				AccessibilityTypes = new List<AccessibilityType>(),
				PermittedUseTypes = new List<PermittedUseType>(),
				GradeTypes = new List<GradeType>(),
				RequestedPage = 0
			};

			MediaType mediaType = new MediaType();
			if (media.IsNotNullOrWhiteSpace() && media != "-1")
				mediaType = (MediaType)Enum.Parse(typeof(MediaType), media);


			string[] validWGBHLanguages = { "English", "Spanish", "Navajo" };

			LanguageType languageType = new LanguageType();
			if (language.IsNotNullOrWhiteSpace() && language != "-1" && validWGBHLanguages.Contains(language))
				languageType = (LanguageType)Enum.Parse(typeof(LanguageType), language);

			if (grade.Count > 0)
			{
				foreach (string gradeList in grade)
				{
					if (gradeList.IsNotNullOrWhiteSpace() && gradeList != "-1")
					{
						GradeType gradeType = new GradeType();
						if (gradeList != "9_12" && gradeList != "PK")
							gradeType = (GradeType)Enum.Parse(typeof(GradeType), gradeList);

						if (gradeList == "9_12")
						{
							learningMediaRequestFilter.GradeTypes.Add(GradeType.Nine);
							learningMediaRequestFilter.GradeTypes.Add(GradeType.Ten);
							learningMediaRequestFilter.GradeTypes.Add(GradeType.Eleven);
							learningMediaRequestFilter.GradeTypes.Add(GradeType.Twelve);
						}
						else if (gradeList == "PK")
						{
							learningMediaRequestFilter.GradeTypes.Add(GradeType.PreK);
						}
						else
							learningMediaRequestFilter.GradeTypes.Add(gradeType);
					}
				}
			}

			learningMediaRequestFilter.SearchTerm = textSearch;
			learningMediaRequestFilter.MediaType = mediaType;
			learningMediaRequestFilter.LanguageTypes.Add(languageType);

			var wgbhUserName = ConfigurationManager.AppSettings["WGBHUserName"];
            NameValueCollection appSecureSettings =
                (NameValueCollection)ConfigurationManager.GetSection("appSecureSettings");
			var wgbhUserPassword = appSecureSettings["WGBHUserPassword"];
			var wgbhBaseRequestUri = ConfigurationManager.AppSettings["WGBHBaseRequestUri"];
			var wgbhRequestUri = ConfigurationManager.AppSettings["WGBHRequestUri"];

			var learningMediaProxy = new LearningMediaProxy();
			var resourceSearch = learningMediaProxy.SearchResources(wgbhUserName, wgbhUserPassword,
				new Uri(wgbhBaseRequestUri), learningMediaRequestFilter);

			if (!resourceSearch.IsNotNull()) return list;

			if (resourceSearch.LearningMediaResponseHeader.TotalPages > 10 && search)
			{
                TelerikWindowManager.RadAlert("Search Request exceeds 200 items. The first 200 have been returned.", 400,
                    100,
					PBSLearningMedia + " Response", "");
			}

			list = BuildResourceMediaList(resourceSearch.LearningMediaSearchResults);
			if (resourceSearch.LearningMediaResponseHeader.TotalPages > 1)
				for (int i = 1; i < resourceSearch.LearningMediaResponseHeader.TotalPages; i++)
				{
					if (i > 9) break;
					resourceSearch = learningMediaProxy.SearchNextPage(wgbhUserName, wgbhUserPassword,
						new Uri(wgbhRequestUri + resourceSearch.LearningMediaResponseHeader.NextPage));
					list.AddRange(BuildResourceMediaList(resourceSearch.LearningMediaSearchResults));
				}

			return list;
		}
Ejemplo n.º 35
0
        private double CalculateGrade(GradeType type)
        {
            double total = 0;
            double count = 0;
            foreach (Grade g in grades)
            {
                if (g.Type == type)
                {
                    total += g.GradeValue;
                    count++;
                }
            }

            return (count > 0) ? total / count : 0;
        }
 public frmGrading(GradeType type)
 {
     InitializeComponent();
 }
Ejemplo n.º 37
0
 private double Weight(GradeType type)
 {
     double[] weights = { 0.4, 0.4, 0.2 };
     return weights[(int)type];
 }