///<summary> ///Add a comment submitted by the learner. ///</summary> ///<param name="comment" direction="input"> ///the new comment object. Should contain the text of the comment. Timestamp will be filled automatically. ///</param> ///<remarks> ///Resizes the comment array, adds the new comment. Sets the timestamp for the comment. ///</remarks> public static void AddCommentFromLearner(commentTypeComment comment) { commentType newcomment = new commentType(); newcomment.comment = comment; newcomment.timestamp = new Scorm2004.DateTime(System.DateTime.Now); GetLearnerRecord().comments_from_learner.Add(newcomment); }
private void setComments(commentType cType) { //Mockup of an auto-commentary system, add comments from range according to data performance bool up201314 = tChart1[0].YValues.Count > 2 ? tChart1[0].YValues.Value[tChart1[0].Count - 2] > tChart1[0].YValues.Value[tChart1[0].Count - 3] : false; bool up201415 = tChart1[0].YValues.Count > 2 ? tChart1[0].YValues.Last > tChart1[0].YValues[tChart1[0].Count - 2] : false; textBox1.Clear(); string[] comments = new string[10]; int offset = 0; bool aboutCountry = false; switch (cType) { case commentType.global: comments[0] = "Overall situation"; comments[1] = ""; comments[2] = "Total sales summed are $" + tChart2[0].YValues.TotalABS.ToString("{0,0}"); break; case commentType.regional: comments[0] = "From " + activeRegion; aboutCountry = true; offset = 3; break; case commentType.country: aboutCountry = true; break; } if ((aboutCountry) && (activeCountry.ToLower() != "other")) { comments[0 + offset] = "Results for " + activeCountry; if ((up201314) && (!up201415)) { comments[2 + offset] = "Despite an upturn in 2014 results were disappointing as 2014 moved into 2015."; comments[3 + offset] = ""; } else if ((!up201314) && (up201415)) { comments[2 + offset] = "Last year's results were very encouraging as the downward trend of 2014 was turned-around for a positive beginning to 2015"; comments[3 + offset] = ""; } else if ((up201314) && (up201415)) { comments[2 + offset] = "Good progress in 2014 was consolidated for for a positive beginning to 2015."; comments[3 + offset] = ""; } else if ((!up201314) && (!up201415)) { comments[2 + offset] = "The slide for " + activeCountry + " hasn't been corrected yet; work is being done to bring the market into line for the current year"; comments[3 + offset] = ""; } } comments[4 + offset] = ""; comments[5 + offset] = ""; if (cType == commentType.global) { comments[6 + offset] = "Dollar has strengthened, supporting return currency conversion."; } textBox1.Lines = comments; }