Ejemplo n.º 1
0
        public virtual IActionResult GetRubric([FromRoute] string sourcedId)
        {
            AssessmentContextData data = new AssessmentContextData(_connectionString);

            try
            {
                Assessment value = data.GetAssessment(sourcedId);

                if (value != null)
                {
                    var example = RubricSetMapper.Map(value.Rubric).ToJson();
                    return(new ObjectResult(example));
                }
                else
                {
                    return(new NotFoundObjectResult(sourcedId));
                }
            }
            catch (Exception ex)
            {
                return(new ContentResult()
                {
                    Content = ex.Message
                });
            }
        }
Ejemplo n.º 2
0
        public virtual IActionResult GetAllRubrics([FromQuery] int?limit, [FromQuery] int?offset, [FromQuery] string sort, [FromQuery] string orderBy, [FromQuery] string filter, [FromQuery] List <string> fields)
        {
            AssessmentContextData data = new AssessmentContextData(_connectionString);

            try
            {
                List <Assessment> values = data.GetAssessments();

                var example = RubricSetMapper.Map(values).ToJson();
                return(new ObjectResult(example));
            }
            catch (Exception ex)
            {
                return(new ContentResult()
                {
                    Content = ex.Message
                });
            }
        }