<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Chuang23</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Chuang23"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Chuang23"/>
	<updated>2026-07-15T17:50:41Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113243</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113243"/>
		<updated>2017-11-14T18:09:33Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_points&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_point_types&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. [https://www.webpagefx.com/tools/read-able/ Readability]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2.[https://developers.trello.com/reference#tokens Trello]'''====&lt;br /&gt;
Trello is a web-based project management application. It helps students to understand what tasks have been accomplished, what works are in progress and what jobs are waiting for being started by adding cards and writing down to-do lists inside, and it also helps instructors to keep track of how students work by looking into these cards and lists. &lt;br /&gt;
&lt;br /&gt;
It is useful for both coding projects and writing projects because we can fetch the information from the activities to calculate the percentages of the workloads for each group member, and this result can be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
For example, a group of students has a to-do list, which contains eight tasks. Student A finishes two tasks, Student B finishes one, and Student finishes one as well. We can use the information fetched from the activity of project from Trello RESTful API to calculate the percentage of finished jobs (which is 50%) and the proportions of contributions for each student (which are 50%, 25%, 25%, respectively). &lt;br /&gt;
&lt;br /&gt;
Using this data from Trello might be a good idea for being one of the grading metrics because we cannot merely conclude contributions by observing the number of additions and the number of deletions. What if a student just adjusts the indentation for all files in the project for an hour and the other student thinks about a complicated algorithm to get a correct answer for days or even weeks?&lt;br /&gt;
&lt;br /&gt;
However, the data from Trello offers a different aspect of the grading rubric; it concludes the contributions by calculating how many tasks are done by each student. Also, it can be used as a grading metric for both coding projects and writing projects because we only care about the todo-lists.&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
1.Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a metric_data_value table for each data type. Then we can change the the value field in table metric_data_points to the value_id, which help us to find the value in the corresponding metric_data_value table.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the &amp;lt;span style=&amp;quot;font-weight:bold&amp;quot;&amp;gt;factory pattern&amp;lt;/span&amp;gt; as shown in the figure below, and the string parameter “type” could be used for specifying which type of data is created. Each metric_data_point_type and metric combination could only have one metric_data_point, so if it already exists, the new data will replace the old one. Here each metric_data_point_type row actually represent one field of a metric. If two or more metric_data_point_type rows have the same value_type, their name should be different. So each row of metric_data_point_type is like a column header of a table, which make the database more extensible.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first utilize the has_many relationship between metric and metri_data_point to get all the metric_data_points. Then get the each metric_data_value table by the value_type field in the metric_data_point_type. Finally use the value_id in metric_data_points table to find the data.&lt;br /&gt;
&lt;br /&gt;
[[File:Metric_data_factory.png]]&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
For example, even if the new data type is an array, we could use the dimension field in metric_data_point_type to specify the length of the array, then use the value_id field in metric_data_point to specify the start id the array, finally in the corresponding &lt;br /&gt;
&lt;br /&gt;
metric_data_value table we can use the start id and the dimension to get all the elements in the array.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&lt;br /&gt;
==Design Schema==&lt;br /&gt;
&lt;br /&gt;
[[File: CSC517_Design_Schema_factory.png]]&lt;br /&gt;
&lt;br /&gt;
To implement all the parsers, we planned to use a factory pattern as shown in the diagram above. It allows further extension on new metric sources. For each parser class, we implement duck typing by defining the parse method with the same signature, so we don’t really need a super class or interface. The caller code could execute the parese method without knowing exactly which parser is created by the factory. Thus the caller code is close to modification.&lt;br /&gt;
&lt;br /&gt;
[[File:CSC517_Design_Schema_database.png]]&lt;br /&gt;
&lt;br /&gt;
Each parser will parse the given data source and use the metric data factory to create model for each data then use these data to create the metric model.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Given a valid url of GitHub, the GitHub parser could correctly get all the data.&lt;br /&gt;
&amp;lt;li&amp;gt;Given a valid url of Readability, the Readability parser could correctly get all the data.&lt;br /&gt;
&amp;lt;li&amp;gt;Given a valid url of Trello, the Trello parser could correctly get all the data.&lt;br /&gt;
&amp;lt;li&amp;gt;Test that the parser should correctly create metric_data_point_type if it doesn’t exist.&lt;br /&gt;
&amp;lt;li&amp;gt;Test that the parser should be able to create the correct type of metric_data_value model according to the type specified by the metric_data_point_type.&lt;br /&gt;
&amp;lt;li&amp;gt;Test that the parser should correctly create metric_data_value models if it doesn’t exist.&lt;br /&gt;
&amp;lt;li&amp;gt;Test that the parser should correctly update metric_data_value models if it already exist.&lt;br /&gt;
&amp;lt;li&amp;gt;Test that the metric_data_point_value could be correctly queried with the data from a given metric.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
#[https://www.webpagefx.com/tools/read-able/ Readability1]&lt;br /&gt;
#[https://raventools.com/blog/ultimate-list-of-online-content-readability-tests/ Readability2]&lt;br /&gt;
#[https://trello.com/ Trello1]&lt;br /&gt;
#[https://developers.trello.com/reference#tokens Trello2]&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113235</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113235"/>
		<updated>2017-11-14T16:19:42Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Model Improvement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_points&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_point_types&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. [https://www.webpagefx.com/tools/read-able/ Readability]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2.[https://developers.trello.com/reference#tokens Trello]'''====&lt;br /&gt;
Trello is a web-based project management application. It helps students to understand what tasks have been accomplished, what works are in progress and what jobs are waiting for being started by adding cards and writing down to-do lists inside, and it also helps instructors to keep track of how students work by looking into these cards and lists. &lt;br /&gt;
&lt;br /&gt;
It is useful for both coding projects and writing projects because we can fetch the information from the activities to calculate the percentages of the workloads for each group member, and this result can be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
For example, a group of students has a to-do list, which contains eight tasks. Student A finishes two tasks, Student B finishes one, and Student finishes one as well. We can use the information fetched from the activity of project from Trello RESTful API to calculate the percentage of finished jobs (which is 50%) and the proportions of contributions for each student (which are 50%, 25%, 25%, respectively). &lt;br /&gt;
&lt;br /&gt;
Using this data from Trello might be a good idea for being one of the grading metrics because we cannot merely conclude contributions by observing the number of additions and the number of deletions. What if a student just adjusts the indentation for all files in the project for an hour and the other student thinks about a complicated algorithm to get a correct answer for days or even weeks?&lt;br /&gt;
&lt;br /&gt;
However, the data from Trello offers a different aspect of the grading rubric; it concludes the contributions by calculating how many tasks are done by each student. Also, it can be used as a grading metric for both coding projects and writing projects because we only care about the todo-lists.&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
1.Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a metric_data_value table for each data type. Then we can change the the value field in table metric_data_points to the value_id, which help us to find the value in the corresponding metric_data_value table.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the &amp;lt;span style=&amp;quot;font-weight:bold&amp;quot;&amp;gt;factory pattern&amp;lt;/span&amp;gt; as shown in the figure below, and the string parameter “type” could be used for specifying which type of data is created. Each metric_data_point_type and metric combination could only have one metric_data_point, so if it already exists, the new data will replace the old one. Here each metric_data_point_type row actually represent one field of a metric. If two or more metric_data_point_type rows have the same value_type, their name should be different. So each row of metric_data_point_type is like a column header of a table, which make the database more extensible.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first utilize the has_many relationship between metric and metri_data_point to get all the metric_data_points. Then get the each metric_data_value table by the value_type field in the metric_data_point_type. Finally use the value_id in metric_data_points table to find the data.&lt;br /&gt;
&lt;br /&gt;
[[File:Metric_data_factory.png]]&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
For example, even if the new data type is an array, we could use the dimension field in metric_data_point_type to specify the length of the array, then use the value_id field in metric_data_point to specify the start id the array, finally in the corresponding &lt;br /&gt;
&lt;br /&gt;
metric_data_value table we can use the start id and the dimension to get all the elements in the array.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&lt;br /&gt;
==Design Schema==&lt;br /&gt;
&lt;br /&gt;
[[File: CSC517_Design_Schema_factory.png]]&lt;br /&gt;
&lt;br /&gt;
To implement all the parsers, we planned to use a factory pattern as shown in the diagram above. It allows further extension on new metric sources. For each parser class, we implement duck typing by defining the parse method with the same signature, so we don’t really need a super class or interface. The caller code could execute the parese method without knowing exactly which parser is created by the factory. Thus the caller code is close to modification.&lt;br /&gt;
&lt;br /&gt;
[[File:CSC517_Design_Schema_database.png]]&lt;br /&gt;
&lt;br /&gt;
Each parser will parse the given data source and use the metric data factory to create model for each data then use these data to create the metric model.&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
#[https://www.webpagefx.com/tools/read-able/ Readability1]&lt;br /&gt;
#[https://raventools.com/blog/ultimate-list-of-online-content-readability-tests/ Readability2]&lt;br /&gt;
#[https://trello.com/ Trello1]&lt;br /&gt;
#[https://developers.trello.com/reference#tokens Trello2]&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113234</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113234"/>
		<updated>2017-11-14T16:19:17Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Model Improvement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_points&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_point_types&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. [https://www.webpagefx.com/tools/read-able/ Readability]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2.[https://developers.trello.com/reference#tokens Trello]'''====&lt;br /&gt;
Trello is a web-based project management application. It helps students to understand what tasks have been accomplished, what works are in progress and what jobs are waiting for being started by adding cards and writing down to-do lists inside, and it also helps instructors to keep track of how students work by looking into these cards and lists. &lt;br /&gt;
&lt;br /&gt;
It is useful for both coding projects and writing projects because we can fetch the information from the activities to calculate the percentages of the workloads for each group member, and this result can be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
For example, a group of students has a to-do list, which contains eight tasks. Student A finishes two tasks, Student B finishes one, and Student finishes one as well. We can use the information fetched from the activity of project from Trello RESTful API to calculate the percentage of finished jobs (which is 50%) and the proportions of contributions for each student (which are 50%, 25%, 25%, respectively). &lt;br /&gt;
&lt;br /&gt;
Using this data from Trello might be a good idea for being one of the grading metrics because we cannot merely conclude contributions by observing the number of additions and the number of deletions. What if a student just adjusts the indentation for all files in the project for an hour and the other student thinks about a complicated algorithm to get a correct answer for days or even weeks?&lt;br /&gt;
&lt;br /&gt;
However, the data from Trello offers a different aspect of the grading rubric; it concludes the contributions by calculating how many tasks are done by each student. Also, it can be used as a grading metric for both coding projects and writing projects because we only care about the todo-lists.&lt;br /&gt;
&lt;br /&gt;
==Model Improvement==&lt;br /&gt;
&lt;br /&gt;
1.Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a metric_data_value table for each data type. Then we can change the the value field in table metric_data_points to the value_id, which help us to find the value in the corresponding metric_data_value table.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the &amp;lt;span style=&amp;quot;font-weight:bold&amp;quot;&amp;gt;factory pattern&amp;lt;/span&amp;gt; as shown in the figure below, and the string parameter “type” could be used for specifying which type of data is created. Each metric_data_point_type and metric combination could only have one metric_data_point, so if it already exists, the new data will replace the old one. Here each metric_data_point_type row actually represent one field of a metric. If two or more metric_data_point_type rows have the same value_type, their name should be different. So each row of metric_data_point_type is like a column header of a table, which make the database more extensible.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first utilize the has_many relationship between metric and metri_data_point to get all the metric_data_points. Then get the each metric_data_value table by the value_type field in the metric_data_point_type. Finally use the value_id in metric_data_points table to find the data.&lt;br /&gt;
&lt;br /&gt;
[[File:Metric_data_factory.png]]&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
For example, even if the new data type is an array, we could use the dimension field in metric_data_point_type to specify the length of the array, then use the value_id field in metric_data_point to specify the start id the array, finally in the corresponding &lt;br /&gt;
&lt;br /&gt;
metric_data_value table we can use the start id and the dimension to get all the elements in the array.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&lt;br /&gt;
==Design Schema==&lt;br /&gt;
&lt;br /&gt;
[[File: CSC517_Design_Schema_factory.png]]&lt;br /&gt;
&lt;br /&gt;
To implement all the parsers, we planned to use a factory pattern as shown in the diagram above. It allows further extension on new metric sources. For each parser class, we implement duck typing by defining the parse method with the same signature, so we don’t really need a super class or interface. The caller code could execute the parese method without knowing exactly which parser is created by the factory. Thus the caller code is close to modification.&lt;br /&gt;
&lt;br /&gt;
[[File:CSC517_Design_Schema_database.png]]&lt;br /&gt;
&lt;br /&gt;
Each parser will parse the given data source and use the metric data factory to create model for each data then use these data to create the metric model.&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
#[https://www.webpagefx.com/tools/read-able/ Readability1]&lt;br /&gt;
#[https://raventools.com/blog/ultimate-list-of-online-content-readability-tests/ Readability2]&lt;br /&gt;
#[https://trello.com/ Trello1]&lt;br /&gt;
#[https://developers.trello.com/reference#tokens Trello2]&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113233</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113233"/>
		<updated>2017-11-14T16:18:23Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Design Schema */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_points&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_point_types&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. [https://www.webpagefx.com/tools/read-able/ Readability]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2.[https://developers.trello.com/reference#tokens Trello]'''====&lt;br /&gt;
Trello is a web-based project management application. It helps students to understand what tasks have been accomplished, what works are in progress and what jobs are waiting for being started by adding cards and writing down to-do lists inside, and it also helps instructors to keep track of how students work by looking into these cards and lists. &lt;br /&gt;
&lt;br /&gt;
It is useful for both coding projects and writing projects because we can fetch the information from the activities to calculate the percentages of the workloads for each group member, and this result can be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
For example, a group of students has a to-do list, which contains eight tasks. Student A finishes two tasks, Student B finishes one, and Student finishes one as well. We can use the information fetched from the activity of project from Trello RESTful API to calculate the percentage of finished jobs (which is 50%) and the proportions of contributions for each student (which are 50%, 25%, 25%, respectively). &lt;br /&gt;
&lt;br /&gt;
Using this data from Trello might be a good idea for being one of the grading metrics because we cannot merely conclude contributions by observing the number of additions and the number of deletions. What if a student just adjusts the indentation for all files in the project for an hour and the other student thinks about a complicated algorithm to get a correct answer for days or even weeks?&lt;br /&gt;
&lt;br /&gt;
However, the data from Trello offers a different aspect of the grading rubric; it concludes the contributions by calculating how many tasks are done by each student. Also, it can be used as a grading metric for both coding projects and writing projects because we only care about the todo-lists.&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a table for each data type. Then we can change the value field in table metric_data_points to data_id, which is a foreign key of the corresponding data type.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the factory pattern, and the name of datatype could be used for specifying which type of data is created.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first get the model class by the type name, then use the data_id from table metric_data_points to data_id to find the data.&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Model Improvement==&lt;br /&gt;
&lt;br /&gt;
1.Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a metric_data_value table for each data type. Then we can change the the value field in table metric_data_points to the value_id, which help us to find the value in the corresponding metric_data_value table.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the &amp;lt;span style=&amp;quot;font-weight:bold&amp;quot;&amp;gt;factory pattern&amp;lt;/span&amp;gt; as shown in the figure below, and the string parameter “type” could be used for specifying which type of data is created. Each metric_data_point_type and metric combination could only have one metric_data_point, so if it already exists, the new data will replace the old one. Here each metric_data_point_type row actually represent one field of a metric. If two or more metric_data_point_type rows have the same value_type, their name should be different. So each row of metric_data_point_type is like a column header of a table, which make the database more extensible.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first utilize the has_many relationship between metric and metri_data_point to get all the metric_data_points. Then get the each metric_data_value table by the value_type field in the metric_data_point_type. Finally use the value_id in metric_data_points table to find the data.&lt;br /&gt;
&lt;br /&gt;
[[File:Metric_data_factory.png]]&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
For example, even if the new data type is an array, we could use the dimension field in metric_data_point_type to specify the length of the array, then use the value_id field in metric_data_point to specify the start id the array, finally in the corresponding &lt;br /&gt;
&lt;br /&gt;
metric_data_value table we can use the start id and the dimension to get all the elements in the array.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&lt;br /&gt;
==Design Schema==&lt;br /&gt;
&lt;br /&gt;
[[File: CSC517_Design_Schema_factory.png]]&lt;br /&gt;
&lt;br /&gt;
To implement all the parsers, we planned to use a factory pattern as shown in the diagram above. It allows further extension on new metric sources. For each parser class, we implement duck typing by defining the parse method with the same signature, so we don’t really need a super class or interface. The caller code could execute the parese method without knowing exactly which parser is created by the factory. Thus the caller code is close to modification.&lt;br /&gt;
&lt;br /&gt;
[[File:CSC517_Design_Schema_database.png]]&lt;br /&gt;
&lt;br /&gt;
Each parser will parse the given data source and use the metric data factory to create model for each data then use these data to create the metric model.&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
#[https://www.webpagefx.com/tools/read-able/ Readability1]&lt;br /&gt;
#[https://raventools.com/blog/ultimate-list-of-online-content-readability-tests/ Readability2]&lt;br /&gt;
#[https://trello.com/ Trello1]&lt;br /&gt;
#[https://developers.trello.com/reference#tokens Trello2]&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113232</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113232"/>
		<updated>2017-11-14T16:17:11Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Model Improvement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_points&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_point_types&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. [https://www.webpagefx.com/tools/read-able/ Readability]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2.[https://developers.trello.com/reference#tokens Trello]'''====&lt;br /&gt;
Trello is a web-based project management application. It helps students to understand what tasks have been accomplished, what works are in progress and what jobs are waiting for being started by adding cards and writing down to-do lists inside, and it also helps instructors to keep track of how students work by looking into these cards and lists. &lt;br /&gt;
&lt;br /&gt;
It is useful for both coding projects and writing projects because we can fetch the information from the activities to calculate the percentages of the workloads for each group member, and this result can be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
For example, a group of students has a to-do list, which contains eight tasks. Student A finishes two tasks, Student B finishes one, and Student finishes one as well. We can use the information fetched from the activity of project from Trello RESTful API to calculate the percentage of finished jobs (which is 50%) and the proportions of contributions for each student (which are 50%, 25%, 25%, respectively). &lt;br /&gt;
&lt;br /&gt;
Using this data from Trello might be a good idea for being one of the grading metrics because we cannot merely conclude contributions by observing the number of additions and the number of deletions. What if a student just adjusts the indentation for all files in the project for an hour and the other student thinks about a complicated algorithm to get a correct answer for days or even weeks?&lt;br /&gt;
&lt;br /&gt;
However, the data from Trello offers a different aspect of the grading rubric; it concludes the contributions by calculating how many tasks are done by each student. Also, it can be used as a grading metric for both coding projects and writing projects because we only care about the todo-lists.&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a table for each data type. Then we can change the value field in table metric_data_points to data_id, which is a foreign key of the corresponding data type.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the factory pattern, and the name of datatype could be used for specifying which type of data is created.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first get the model class by the type name, then use the data_id from table metric_data_points to data_id to find the data.&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Model Improvement==&lt;br /&gt;
&lt;br /&gt;
1.Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a metric_data_value table for each data type. Then we can change the the value field in table metric_data_points to the value_id, which help us to find the value in the corresponding metric_data_value table.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the &amp;lt;span style=&amp;quot;font-weight:bold&amp;quot;&amp;gt;factory pattern&amp;lt;/span&amp;gt; as shown in the figure below, and the string parameter “type” could be used for specifying which type of data is created. Each metric_data_point_type and metric combination could only have one metric_data_point, so if it already exists, the new data will replace the old one. Here each metric_data_point_type row actually represent one field of a metric. If two or more metric_data_point_type rows have the same value_type, their name should be different. So each row of metric_data_point_type is like a column header of a table, which make the database more extensible.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first utilize the has_many relationship between metric and metri_data_point to get all the metric_data_points. Then get the each metric_data_value table by the value_type field in the metric_data_point_type. Finally use the value_id in metric_data_points table to find the data.&lt;br /&gt;
&lt;br /&gt;
[[File:Metric_data_factory.png]]&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
For example, even if the new data type is an array, we could use the dimension field in metric_data_point_type to specify the length of the array, then use the value_id field in metric_data_point to specify the start id the array, finally in the corresponding &lt;br /&gt;
&lt;br /&gt;
metric_data_value table we can use the start id and the dimension to get all the elements in the array.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&lt;br /&gt;
==Design Schema==&lt;br /&gt;
&lt;br /&gt;
[[File: CSC517_Design_Schema_factory.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:CSC517_Design_Schema_database.png]]&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
#[https://www.webpagefx.com/tools/read-able/ Readability1]&lt;br /&gt;
#[https://raventools.com/blog/ultimate-list-of-online-content-readability-tests/ Readability2]&lt;br /&gt;
#[https://trello.com/ Trello1]&lt;br /&gt;
#[https://developers.trello.com/reference#tokens Trello2]&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Metric_data_factory.png&amp;diff=113231</id>
		<title>File:Metric data factory.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Metric_data_factory.png&amp;diff=113231"/>
		<updated>2017-11-14T16:11:48Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: uploaded a new version of &amp;amp;quot;File:Metric data factory.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Metric_data_factory.png&amp;diff=113230</id>
		<title>File:Metric data factory.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Metric_data_factory.png&amp;diff=113230"/>
		<updated>2017-11-14T16:11:10Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113229</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113229"/>
		<updated>2017-11-14T16:10:52Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Design Schema */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_points&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_point_types&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. [https://www.webpagefx.com/tools/read-able/ Readability]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2.[https://developers.trello.com/reference#tokens Trello]'''====&lt;br /&gt;
Trello is a web-based project management application. It helps students to understand what tasks have been accomplished, what works are in progress and what jobs are waiting for being started by adding cards and writing down to-do lists inside, and it also helps instructors to keep track of how students work by looking into these cards and lists. &lt;br /&gt;
&lt;br /&gt;
It is useful for both coding projects and writing projects because we can fetch the information from the activities to calculate the percentages of the workloads for each group member, and this result can be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
For example, a group of students has a to-do list, which contains eight tasks. Student A finishes two tasks, Student B finishes one, and Student finishes one as well. We can use the information fetched from the activity of project from Trello RESTful API to calculate the percentage of finished jobs (which is 50%) and the proportions of contributions for each student (which are 50%, 25%, 25%, respectively). &lt;br /&gt;
&lt;br /&gt;
Using this data from Trello might be a good idea for being one of the grading metrics because we cannot merely conclude contributions by observing the number of additions and the number of deletions. What if a student just adjusts the indentation for all files in the project for an hour and the other student thinks about a complicated algorithm to get a correct answer for days or even weeks?&lt;br /&gt;
&lt;br /&gt;
However, the data from Trello offers a different aspect of the grading rubric; it concludes the contributions by calculating how many tasks are done by each student. Also, it can be used as a grading metric for both coding projects and writing projects because we only care about the todo-lists.&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a table for each data type. Then we can change the value field in table metric_data_points to data_id, which is a foreign key of the corresponding data type.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the factory pattern, and the name of datatype could be used for specifying which type of data is created.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first get the model class by the type name, then use the data_id from table metric_data_points to data_id to find the data.&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Model Improvement==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Schema==&lt;br /&gt;
&lt;br /&gt;
[[File: CSC517_Design_Schema_factory.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:CSC517_Design_Schema_database.png]]&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
#[https://www.webpagefx.com/tools/read-able/ Readability1]&lt;br /&gt;
#[https://raventools.com/blog/ultimate-list-of-online-content-readability-tests/ Readability2]&lt;br /&gt;
#[https://trello.com/ Trello1]&lt;br /&gt;
#[https://developers.trello.com/reference#tokens Trello2]&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113142</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113142"/>
		<updated>2017-11-13T23:36:44Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Design Schema */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_points&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_point_types&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. [https://www.webpagefx.com/tools/read-able/ Readability]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2.[https://developers.trello.com/reference#tokens Trello]'''====&lt;br /&gt;
Trello is a web-based project management application. It helps students to understand what tasks have been accomplished, what works are in progress and what jobs are waiting for being started by adding cards and writing down to-do lists inside, and it also helps instructors to keep track of how students work by looking into these cards and lists. &lt;br /&gt;
&lt;br /&gt;
It is useful for both coding projects and writing projects because we can fetch the information from the activities to calculate the percentages of the workloads for each group member, and this result can be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
For example, a group of students has a to-do list, which contains eight tasks. Student A finishes two tasks, Student B finishes one, and Student finishes one as well. We can use the information fetched from the activity of project from Trello RESTful API to calculate the percentage of finished jobs (which is 50%) and the proportions of contributions for each student (which are 50%, 25%, 25%, respectively). &lt;br /&gt;
&lt;br /&gt;
Using this data from Trello might be a good idea for being one of the grading metrics because we cannot merely conclude contributions by observing the number of additions and the number of deletions. What if a student just adjusts the indentation for all files in the project for an hour and the other student thinks about a complicated algorithm to get a correct answer for days or even weeks?&lt;br /&gt;
&lt;br /&gt;
However, the data from Trello offers a different aspect of the grading rubric; it concludes the contributions by calculating how many tasks are done by each student. Also, it can be used as a grading metric for both coding projects and writing projects because we only care about the todo-lists.&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a table for each data type. Then we can change the value field in table metric_data_points to data_id, which is a foreign key of the corresponding data type.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the factory pattern, and the name of datatype could be used for specifying which type of data is created.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first get the model class by the type name, then use the data_id from table metric_data_points to data_id to find the data.&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Design Schema==&lt;br /&gt;
&lt;br /&gt;
[[File: CSC517_Design_Schema_factory.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:CSC517_Design_Schema_database.png]]&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
#[https://www.webpagefx.com/tools/read-able/ Readability1]&lt;br /&gt;
#[https://raventools.com/blog/ultimate-list-of-online-content-readability-tests/ Readability2]&lt;br /&gt;
#[https://trello.com/ Trello1]&lt;br /&gt;
#[https://developers.trello.com/reference#tokens Trello2]&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113141</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113141"/>
		<updated>2017-11-13T23:36:10Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Design Schema */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_points&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_point_types&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. [https://www.webpagefx.com/tools/read-able/ Readability]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2.[https://developers.trello.com/reference#tokens Trello]'''====&lt;br /&gt;
Trello is a web-based project management application. It helps students to understand what tasks have been accomplished, what works are in progress and what jobs are waiting for being started by adding cards and writing down to-do lists inside, and it also helps instructors to keep track of how students work by looking into these cards and lists. &lt;br /&gt;
&lt;br /&gt;
It is useful for both coding projects and writing projects because we can fetch the information from the activities to calculate the percentages of the workloads for each group member, and this result can be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
For example, a group of students has a to-do list, which contains eight tasks. Student A finishes two tasks, Student B finishes one, and Student finishes one as well. We can use the information fetched from the activity of project from Trello RESTful API to calculate the percentage of finished jobs (which is 50%) and the proportions of contributions for each student (which are 50%, 25%, 25%, respectively). &lt;br /&gt;
&lt;br /&gt;
Using this data from Trello might be a good idea for being one of the grading metrics because we cannot merely conclude contributions by observing the number of additions and the number of deletions. What if a student just adjusts the indentation for all files in the project for an hour and the other student thinks about a complicated algorithm to get a correct answer for days or even weeks?&lt;br /&gt;
&lt;br /&gt;
However, the data from Trello offers a different aspect of the grading rubric; it concludes the contributions by calculating how many tasks are done by each student. Also, it can be used as a grading metric for both coding projects and writing projects because we only care about the todo-lists.&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a table for each data type. Then we can change the value field in table metric_data_points to data_id, which is a foreign key of the corresponding data type.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the factory pattern, and the name of datatype could be used for specifying which type of data is created.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first get the model class by the type name, then use the data_id from table metric_data_points to data_id to find the data.&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Design Schema==&lt;br /&gt;
&lt;br /&gt;
[[File: CSC517_Design_Schema_factory.png]]&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
#[https://www.webpagefx.com/tools/read-able/ Readability1]&lt;br /&gt;
#[https://raventools.com/blog/ultimate-list-of-online-content-readability-tests/ Readability2]&lt;br /&gt;
#[https://trello.com/ Trello1]&lt;br /&gt;
#[https://developers.trello.com/reference#tokens Trello2]&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:CSC517_Design_Schema_database.png&amp;diff=113140</id>
		<title>File:CSC517 Design Schema database.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:CSC517_Design_Schema_database.png&amp;diff=113140"/>
		<updated>2017-11-13T23:35:05Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:CSC517_Design_Schema_factory.png&amp;diff=113139</id>
		<title>File:CSC517 Design Schema factory.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:CSC517_Design_Schema_factory.png&amp;diff=113139"/>
		<updated>2017-11-13T23:34:39Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113137</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113137"/>
		<updated>2017-11-13T23:16:46Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_points&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_point_types&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. [https://www.webpagefx.com/tools/read-able/ Readability]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2.[https://developers.trello.com/reference#tokens Trello]'''====&lt;br /&gt;
Trello is a web-based project management application. It helps students to understand what tasks have been accomplished, what works are in progress and what jobs are waiting for being started by adding cards and writing down to-do lists inside, and it also helps instructors to keep track of how students work by looking into these cards and lists. &lt;br /&gt;
&lt;br /&gt;
It is useful for both coding projects and writing projects because we can fetch the information from the activities to calculate the percentages of the workloads for each group member, and this result can be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
For example, a group of students has a to-do list, which contains eight tasks. Student A finishes two tasks, Student B finishes one, and Student finishes one as well. We can use the information fetched from the activity of project from Trello RESTful API to calculate the percentage of finished jobs (which is 50%) and the proportions of contributions for each student (which are 50%, 25%, 25%, respectively). &lt;br /&gt;
&lt;br /&gt;
Using this data from Trello might be a good idea for being one of the grading metrics because we cannot merely conclude contributions by observing the number of additions and the number of deletions. What if a student just adjusts the indentation for all files in the project for an hour and the other student thinks about a complicated algorithm to get a correct answer for days or even weeks?&lt;br /&gt;
&lt;br /&gt;
However, the data from Trello offers a different aspect of the grading rubric; it concludes the contributions by calculating how many tasks are done by each student. Also, it can be used as a grading metric for both coding projects and writing projects because we only care about the todo-lists.&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a table for each data type. Then we can change the value field in table metric_data_points to data_id, which is a foreign key of the corresponding data type.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the factory pattern, and the name of datatype could be used for specifying which type of data is created.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first get the model class by the type name, then use the data_id from table metric_data_points to data_id to find the data.&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Design Schema==&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
#[https://www.webpagefx.com/tools/read-able/ Readability1]&lt;br /&gt;
#[https://raventools.com/blog/ultimate-list-of-online-content-readability-tests/ Readability2]&lt;br /&gt;
#[https://trello.com/ Trello1]&lt;br /&gt;
#[https://developers.trello.com/reference#tokens Trello2]&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113136</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113136"/>
		<updated>2017-11-13T23:16:02Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_points&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_point_types&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. [https://www.webpagefx.com/tools/read-able/ Readability]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2.[https://developers.trello.com/reference#tokens Trello]'''====&lt;br /&gt;
Trello is a web-based project management application. It helps students to understand what tasks have been accomplished, what works are in progress and what jobs are waiting for being started by adding cards and writing down to-do lists inside, and it also helps instructors to keep track of how students work by looking into these cards and lists. &lt;br /&gt;
&lt;br /&gt;
It is useful for both coding projects and writing projects because we can fetch the information from the activities to calculate the percentages of the workloads for each group member, and this result can be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
For example, a group of students has a to-do list, which contains eight tasks. Student A finishes two tasks, Student B finishes one, and Student finishes one as well. We can use the information fetched from the activity of project from Trello RESTful API to calculate the percentage of finished jobs (which is 50%) and the proportions of contributions for each student (which are 50%, 25%, 25%, respectively). &lt;br /&gt;
&lt;br /&gt;
Using this data from Trello might be a good idea for being one of the grading metrics because we cannot merely conclude contributions by observing the number of additions and the number of deletions. What if a student just adjusts the indentation for all files in the project for an hour and the other student thinks about a complicated algorithm to get a correct answer for days or even weeks?&lt;br /&gt;
&lt;br /&gt;
However, the data from Trello offers a different aspect of the grading rubric; it concludes the contributions by calculating how many tasks are done by each student. Also, it can be used as a grading metric for both coding projects and writing projects because we only care about the todo-lists.&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a table for each data type. Then we can change the value field in table metric_data_points to data_id, which is a foreign key of the corresponding data type.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the factory pattern, and the name of datatype could be used for specifying which type of data is created.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first get the model class by the type name, then use the data_id from table metric_data_points to data_id to find the data.&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
#[https://www.webpagefx.com/tools/read-able/ Readability1]&lt;br /&gt;
#[https://raventools.com/blog/ultimate-list-of-online-content-readability-tests/ Readability2]&lt;br /&gt;
#[https://trello.com/ Trello1]&lt;br /&gt;
#[https://developers.trello.com/reference#tokens Trello2]&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113029</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113029"/>
		<updated>2017-11-13T17:16:26Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Model: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_points&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_point_types&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. [https://www.webpagefx.com/tools/read-able/ Readability]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2.[https://developers.trello.com/reference#tokens Trello]'''====&lt;br /&gt;
Trello is a web-based project management application. It helps students to understand what tasks have been accomplished, what works are in progress and what jobs are waiting for being started by adding cards and writing down to-do lists inside, and it also helps instructors to keep track of how students work by looking into these cards and lists. &lt;br /&gt;
&lt;br /&gt;
It is useful for both coding projects and writing projects because we can fetch the information from the activities to calculate the percentages of the workloads for each group member, and this result can be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
For example, a group of students has a to-do list, which contains eight tasks. Student A finishes two tasks, Student B finishes one, and Student finishes one as well. We can use the information fetched from the activity of project from Trello RESTful API to calculate the percentage of finished jobs (which is 50%) and the proportions of contributions for each student (which are 50%, 25%, 25%, respectively). &lt;br /&gt;
&lt;br /&gt;
Using this data from Trello might be a good idea for being one of the grading metrics because we cannot merely conclude contributions by observing the number of additions and the number of deletions. What if a student just adjusts the indentation for all files in the project for an hour and the other student thinks about a complicated algorithm to get a correct answer for days or even weeks?&lt;br /&gt;
&lt;br /&gt;
However, the data from Trello offers a different aspect of the grading rubric; it concludes the contributions by calculating how many tasks are done by each student. Also, it can be used as a grading metric for both coding projects and writing projects because we only care about the todo-lists.&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a table for each data type. Then we can change the value field in table metric_data_points to data_id, which is a foreign key of the corresponding data type.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the factory pattern, and the name of datatype could be used for specifying which type of data is created.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first get the model class by the type name, then use the data_id from table metric_data_points to data_id to find the data.&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
#[https://www.webpagefx.com/tools/read-able/ Readability1]&lt;br /&gt;
#[https://raventools.com/blog/ultimate-list-of-online-content-readability-tests/ Readability2]&lt;br /&gt;
#[https://trello.com/ Trello1]&lt;br /&gt;
#[https://developers.trello.com/reference#tokens Trello2]&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113028</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113028"/>
		<updated>2017-11-13T17:14:06Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Metric_data_point_types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_points&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_point_types&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. [https://www.webpagefx.com/tools/read-able/ Readability]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2.[https://developers.trello.com/reference#tokens Trello]'''====&lt;br /&gt;
Trello is a web-based project management application. It helps students to understand what tasks have been accomplished, what works are in progress and what jobs are waiting for being started by adding cards and writing down to-do lists inside, and it also helps instructors to keep track of how students work by looking into these cards and lists. &lt;br /&gt;
&lt;br /&gt;
It is useful for both coding projects and writing projects because we can fetch the information from the activities to calculate the percentages of the workloads for each group member, and this result can be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
For example, a group of students has a to-do list, which contains eight tasks. Student A finishes two tasks, Student B finishes one, and Student finishes one as well. We can use the information fetched from the activity of project from Trello RESTful API to calculate the percentage of finished jobs (which is 50%) and the proportions of contributions for each student (which are 50%, 25%, 25%, respectively). &lt;br /&gt;
&lt;br /&gt;
Using this data from Trello might be a good idea for being one of the grading metrics because we cannot merely conclude contributions by observing the number of additions and the number of deletions. What if a student just adjusts the indentation for all files in the project for an hour and the other student thinks about a complicated algorithm to get a correct answer for days or even weeks?&lt;br /&gt;
&lt;br /&gt;
However, the data from Trello offers a different aspect of the grading rubric; it concludes the contributions by calculating how many tasks are done by each student. Also, it can be used as a grading metric for both coding projects and writing projects because we only care about the todo-lists.&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a table for each data type. Then we can change the value field in table metric_data_points to data_id, which is a foreign key of the corresponding data type.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the factory pattern, and the name of datatype could be used for specifying which type of data is created.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first get the model class by the type name, then use the data_id from table metric_data_points to data_id to find the data.&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
#[https://www.webpagefx.com/tools/read-able/ Readability1]&lt;br /&gt;
#[https://raventools.com/blog/ultimate-list-of-online-content-readability-tests/ Readability2]&lt;br /&gt;
#[https://trello.com/ Trello1]&lt;br /&gt;
#[https://developers.trello.com/reference#tokens Trello2]&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113027</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113027"/>
		<updated>2017-11-13T17:13:38Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Metric */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_points&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. [https://www.webpagefx.com/tools/read-able/ Readability]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2.[https://developers.trello.com/reference#tokens Trello]'''====&lt;br /&gt;
Trello is a web-based project management application. It helps students to understand what tasks have been accomplished, what works are in progress and what jobs are waiting for being started by adding cards and writing down to-do lists inside, and it also helps instructors to keep track of how students work by looking into these cards and lists. &lt;br /&gt;
&lt;br /&gt;
It is useful for both coding projects and writing projects because we can fetch the information from the activities to calculate the percentages of the workloads for each group member, and this result can be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
For example, a group of students has a to-do list, which contains eight tasks. Student A finishes two tasks, Student B finishes one, and Student finishes one as well. We can use the information fetched from the activity of project from Trello RESTful API to calculate the percentage of finished jobs (which is 50%) and the proportions of contributions for each student (which are 50%, 25%, 25%, respectively). &lt;br /&gt;
&lt;br /&gt;
Using this data from Trello might be a good idea for being one of the grading metrics because we cannot merely conclude contributions by observing the number of additions and the number of deletions. What if a student just adjusts the indentation for all files in the project for an hour and the other student thinks about a complicated algorithm to get a correct answer for days or even weeks?&lt;br /&gt;
&lt;br /&gt;
However, the data from Trello offers a different aspect of the grading rubric; it concludes the contributions by calculating how many tasks are done by each student. Also, it can be used as a grading metric for both coding projects and writing projects because we only care about the todo-lists.&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a table for each data type. Then we can change the value field in table metric_data_points to data_id, which is a foreign key of the corresponding data type.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the factory pattern, and the name of datatype could be used for specifying which type of data is created.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first get the model class by the type name, then use the data_id from table metric_data_points to data_id to find the data.&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
#[https://www.webpagefx.com/tools/read-able/ Readability1]&lt;br /&gt;
#[https://raventools.com/blog/ultimate-list-of-online-content-readability-tests/ Readability2]&lt;br /&gt;
#[https://trello.com/ Trello1]&lt;br /&gt;
#[https://developers.trello.com/reference#tokens Trello2]&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113026</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113026"/>
		<updated>2017-11-13T17:13:22Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Metric_data_points */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: cornflowerblue&amp;quot;&amp;gt;Metric&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;Metric_data_points&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. [https://www.webpagefx.com/tools/read-able/ Readability]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2.[https://developers.trello.com/reference#tokens Trello]'''====&lt;br /&gt;
Trello is a web-based project management application. It helps students to understand what tasks have been accomplished, what works are in progress and what jobs are waiting for being started by adding cards and writing down to-do lists inside, and it also helps instructors to keep track of how students work by looking into these cards and lists. &lt;br /&gt;
&lt;br /&gt;
It is useful for both coding projects and writing projects because we can fetch the information from the activities to calculate the percentages of the workloads for each group member, and this result can be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
For example, a group of students has a to-do list, which contains eight tasks. Student A finishes two tasks, Student B finishes one, and Student finishes one as well. We can use the information fetched from the activity of project from Trello RESTful API to calculate the percentage of finished jobs (which is 50%) and the proportions of contributions for each student (which are 50%, 25%, 25%, respectively). &lt;br /&gt;
&lt;br /&gt;
Using this data from Trello might be a good idea for being one of the grading metrics because we cannot merely conclude contributions by observing the number of additions and the number of deletions. What if a student just adjusts the indentation for all files in the project for an hour and the other student thinks about a complicated algorithm to get a correct answer for days or even weeks?&lt;br /&gt;
&lt;br /&gt;
However, the data from Trello offers a different aspect of the grading rubric; it concludes the contributions by calculating how many tasks are done by each student. Also, it can be used as a grading metric for both coding projects and writing projects because we only care about the todo-lists.&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a table for each data type. Then we can change the value field in table metric_data_points to data_id, which is a foreign key of the corresponding data type.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the factory pattern, and the name of datatype could be used for specifying which type of data is created.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first get the model class by the type name, then use the data_id from table metric_data_points to data_id to find the data.&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
#[https://www.webpagefx.com/tools/read-able/ Readability1]&lt;br /&gt;
#[https://raventools.com/blog/ultimate-list-of-online-content-readability-tests/ Readability2]&lt;br /&gt;
#[https://trello.com/ Trello1]&lt;br /&gt;
#[https://developers.trello.com/reference#tokens Trello2]&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113025</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113025"/>
		<updated>2017-11-13T17:12:34Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Metric */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color: cornflowerblue&amp;quot;&amp;gt;Metric&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. [https://www.webpagefx.com/tools/read-able/ Readability]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2.[https://developers.trello.com/reference#tokens Trello]'''====&lt;br /&gt;
Trello is a web-based project management application. It helps students to understand what tasks have been accomplished, what works are in progress and what jobs are waiting for being started by adding cards and writing down to-do lists inside, and it also helps instructors to keep track of how students work by looking into these cards and lists. &lt;br /&gt;
&lt;br /&gt;
It is useful for both coding projects and writing projects because we can fetch the information from the activities to calculate the percentages of the workloads for each group member, and this result can be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
For example, a group of students has a to-do list, which contains eight tasks. Student A finishes two tasks, Student B finishes one, and Student finishes one as well. We can use the information fetched from the activity of project from Trello RESTful API to calculate the percentage of finished jobs (which is 50%) and the proportions of contributions for each student (which are 50%, 25%, 25%, respectively). &lt;br /&gt;
&lt;br /&gt;
Using this data from Trello might be a good idea for being one of the grading metrics because we cannot merely conclude contributions by observing the number of additions and the number of deletions. What if a student just adjusts the indentation for all files in the project for an hour and the other student thinks about a complicated algorithm to get a correct answer for days or even weeks?&lt;br /&gt;
&lt;br /&gt;
However, the data from Trello offers a different aspect of the grading rubric; it concludes the contributions by calculating how many tasks are done by each student. Also, it can be used as a grading metric for both coding projects and writing projects because we only care about the todo-lists.&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a table for each data type. Then we can change the value field in table metric_data_points to data_id, which is a foreign key of the corresponding data type.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the factory pattern, and the name of datatype could be used for specifying which type of data is created.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first get the model class by the type name, then use the data_id from table metric_data_points to data_id to find the data.&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
#[https://www.webpagefx.com/tools/read-able/ Readability1]&lt;br /&gt;
#[https://raventools.com/blog/ultimate-list-of-online-content-readability-tests/ Readability2]&lt;br /&gt;
#[https://trello.com/ Trello1]&lt;br /&gt;
#[https://developers.trello.com/reference#tokens Trello2]&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113023</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113023"/>
		<updated>2017-11-13T11:13:38Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* 2. Trello[3][4] */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===''Metric''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. [https://www.webpagefx.com/tools/read-able/ Readability]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2.[https://developers.trello.com/reference#tokens Trello]'''====&lt;br /&gt;
Trello is a web-based project management application. It helps students to understand what tasks have been accomplished, what works are in progress and what jobs are waiting for being started by adding cards and writing down to-do lists inside, and it also helps instructors to keep track of how students work by looking into these cards and lists. &lt;br /&gt;
&lt;br /&gt;
It is useful for both coding projects and writing projects because we can fetch the information from the activities to calculate the percentages of the workloads for each group member, and this result can be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
For example, a group of students has a to-do list, which contains eight tasks. Student A finishes two tasks, Student B finishes one, and Student finishes one as well. We can use the information fetched from the activity of project from Trello RESTful API to calculate the percentage of finished jobs (which is 50%) and the proportions of contributions for each student (which are 50%, 25%, 25%, respectively). &lt;br /&gt;
&lt;br /&gt;
Using this data from Trello might be a good idea for being one of the grading metrics because we cannot merely conclude contributions by observing the number of additions and the number of deletions. What if a student just adjusts the indentation for all files in the project for an hour and the other student thinks about a complicated algorithm to get a correct answer for days or even weeks?&lt;br /&gt;
&lt;br /&gt;
However, the data from Trello offers a different aspect of the grading rubric; it concludes the contributions by calculating how many tasks are done by each student. Also, it can be used as a grading metric for both coding projects and writing projects because we only care about the todo-lists.&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a table for each data type. Then we can change the value field in table metric_data_points to data_id, which is a foreign key of the corresponding data type.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the factory pattern, and the name of datatype could be used for specifying which type of data is created.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first get the model class by the type name, then use the data_id from table metric_data_points to data_id to find the data.&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
#[https://www.webpagefx.com/tools/read-able/ Readability1]&lt;br /&gt;
#[https://raventools.com/blog/ultimate-list-of-online-content-readability-tests/ Readability2]&lt;br /&gt;
#[https://trello.com/ Trello1]&lt;br /&gt;
#[https://developers.trello.com/reference#tokens Trello2]&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113022</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113022"/>
		<updated>2017-11-13T11:13:01Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===''Metric''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. [https://www.webpagefx.com/tools/read-able/ Readability]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2. Trello[3][4]'''====&lt;br /&gt;
Trello is a web-based project management application. It helps students to understand what tasks have been accomplished, what works are in progress and what jobs are waiting for being started by adding cards and writing down to-do lists inside, and it also helps instructors to keep track of how students work by looking into these cards and lists. &lt;br /&gt;
&lt;br /&gt;
It is useful for both coding projects and writing projects because we can fetch the information from the activities to calculate the percentages of the workloads for each group member, and this result can be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
For example, a group of students has a to-do list, which contains eight tasks. Student A finishes two tasks, Student B finishes one, and Student finishes one as well. We can use the information fetched from the activity of project from Trello RESTful API to calculate the percentage of finished jobs (which is 50%) and the proportions of contributions for each student (which are 50%, 25%, 25%, respectively). &lt;br /&gt;
&lt;br /&gt;
Using this data from Trello might be a good idea for being one of the grading metrics because we cannot merely conclude contributions by observing the number of additions and the number of deletions. What if a student just adjusts the indentation for all files in the project for an hour and the other student thinks about a complicated algorithm to get a correct answer for days or even weeks?&lt;br /&gt;
&lt;br /&gt;
However, the data from Trello offers a different aspect of the grading rubric; it concludes the contributions by calculating how many tasks are done by each student. Also, it can be used as a grading metric for both coding projects and writing projects because we only care about the todo-lists.&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a table for each data type. Then we can change the value field in table metric_data_points to data_id, which is a foreign key of the corresponding data type.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the factory pattern, and the name of datatype could be used for specifying which type of data is created.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first get the model class by the type name, then use the data_id from table metric_data_points to data_id to find the data.&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
#[https://www.webpagefx.com/tools/read-able/ Readability1]&lt;br /&gt;
#[https://raventools.com/blog/ultimate-list-of-online-content-readability-tests/ Readability2]&lt;br /&gt;
#[https://trello.com/ Trello1]&lt;br /&gt;
#[https://developers.trello.com/reference#tokens Trello2]&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113021</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113021"/>
		<updated>2017-11-13T11:10:29Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* 1. Readability[1][2] */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===''Metric''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. [https://www.webpagefx.com/tools/read-able/ Readability]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2. Trello[3][4]'''====&lt;br /&gt;
Trello is a web-based project management application. It helps students to understand what tasks have been accomplished, what works are in progress and what jobs are waiting for being started by adding cards and writing down to-do lists inside, and it also helps instructors to keep track of how students work by looking into these cards and lists. &lt;br /&gt;
&lt;br /&gt;
It is useful for both coding projects and writing projects because we can fetch the information from the activities to calculate the percentages of the workloads for each group member, and this result can be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
For example, a group of students has a to-do list, which contains eight tasks. Student A finishes two tasks, Student B finishes one, and Student finishes one as well. We can use the information fetched from the activity of project from Trello RESTful API to calculate the percentage of finished jobs (which is 50%) and the proportions of contributions for each student (which are 50%, 25%, 25%, respectively). &lt;br /&gt;
&lt;br /&gt;
Using this data from Trello might be a good idea for being one of the grading metrics because we cannot merely conclude contributions by observing the number of additions and the number of deletions. What if a student just adjusts the indentation for all files in the project for an hour and the other student thinks about a complicated algorithm to get a correct answer for days or even weeks?&lt;br /&gt;
&lt;br /&gt;
However, the data from Trello offers a different aspect of the grading rubric; it concludes the contributions by calculating how many tasks are done by each student. Also, it can be used as a grading metric for both coding projects and writing projects because we only care about the todo-lists.&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a table for each data type. Then we can change the value field in table metric_data_points to data_id, which is a foreign key of the corresponding data type.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the factory pattern, and the name of datatype could be used for specifying which type of data is created.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first get the model class by the type name, then use the data_id from table metric_data_points to data_id to find the data.&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113020</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113020"/>
		<updated>2017-11-13T11:04:34Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* 2. Trello[3][4] */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===''Metric''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. Readability[1][2]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2. Trello[3][4]'''====&lt;br /&gt;
Trello is a web-based project management application. It helps students to understand what tasks have been accomplished, what works are in progress and what jobs are waiting for being started by adding cards and writing down to-do lists inside, and it also helps instructors to keep track of how students work by looking into these cards and lists. &lt;br /&gt;
&lt;br /&gt;
It is useful for both coding projects and writing projects because we can fetch the information from the activities to calculate the percentages of the workloads for each group member, and this result can be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
For example, a group of students has a to-do list, which contains eight tasks. Student A finishes two tasks, Student B finishes one, and Student finishes one as well. We can use the information fetched from the activity of project from Trello RESTful API to calculate the percentage of finished jobs (which is 50%) and the proportions of contributions for each student (which are 50%, 25%, 25%, respectively). &lt;br /&gt;
&lt;br /&gt;
Using this data from Trello might be a good idea for being one of the grading metrics because we cannot merely conclude contributions by observing the number of additions and the number of deletions. What if a student just adjusts the indentation for all files in the project for an hour and the other student thinks about a complicated algorithm to get a correct answer for days or even weeks?&lt;br /&gt;
&lt;br /&gt;
However, the data from Trello offers a different aspect of the grading rubric; it concludes the contributions by calculating how many tasks are done by each student. Also, it can be used as a grading metric for both coding projects and writing projects because we only care about the todo-lists.&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Since each metric and metric_data_point_type could have many metric_data_points, we need to add has_many metric_data_points in those models. &lt;br /&gt;
&lt;br /&gt;
To make the database store different data types as they are, we can create a table for each data type. Then we can change the value field in table metric_data_points to data_id, which is a foreign key of the corresponding data type.&lt;br /&gt;
&lt;br /&gt;
When storing data in the database, we can create the new data using the factory pattern, and the name of datatype could be used for specifying which type of data is created.&lt;br /&gt;
&lt;br /&gt;
When querying data in the database, we can first get the model class by the type name, then use the data_id from table metric_data_points to data_id to find the data.&lt;br /&gt;
&lt;br /&gt;
This design could solve the problem discussed above. Each data would be stored as their original data type. Thus, we do not need to convert data type to/from strings which lead to precision loss or space problem. &lt;br /&gt;
&lt;br /&gt;
This design also follows &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. Each time when we need to add a new datatype, we don’t need to modify the previous schema, we only need to add a new model and schema.&lt;br /&gt;
&lt;br /&gt;
But this design has drawbacks too. First of all, the logic becomes more complex, it would be more difficult for a programmer to understand. Secondly, the table of each data type would need to store the id, which costs extra space. However, this overhead should be less than the overhead caused by string storage or frequent type casting. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
We also need to implement the data parser methods. The data parser methods will be implemented in the data source model class. We can utilize Ruby’s duck typing character to implement polymorphism, so when the application gets a data source object, it could invoke the parser method without knowing which type of data source it is. This ensures this program is closed to modification and the data source is open to extension.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113019</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113019"/>
		<updated>2017-11-13T11:01:58Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* 1. Readability[1][2] */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===''Metric''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. Readability[1][2]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
The readability indices contain: &lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
Based on a 0-100 scale. A high score means the text is easier to read. Low scores suggest the text is complicated to understand.&lt;br /&gt;
&lt;br /&gt;
206.835 - 1.015 x (words/sentences) - 84.6 x (syllables/words)&lt;br /&gt;
A value between 60 and 80 should be easy for a 12 to 15 year old to understand.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
0.39 x (words/sentences) + 11.8 x (syllables/words) - 15.59&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
0.4 x ( (words/sentences) + 100 x (complexWords/words) )&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
1.0430 x sqrt( 30 x complexWords/sentences ) + 3.1291&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
5.89 x (characters/words) - 0.3 x (sentences/words) - 15.8&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
4.71 x (characters/words) + 0.5 x (words/sentences) - 21.43&lt;br /&gt;
&lt;br /&gt;
To calculate these indices, we need to fetch the article to get the number of sentences, the number of words and the number of complex words, and then we can use these numbers to calculate the indices mentioned above to get the readability level.&lt;br /&gt;
&lt;br /&gt;
===='''2. Trello[3][4]'''====&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113018</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113018"/>
		<updated>2017-11-13T10:59:47Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Flesch Kincaid Reading Ease */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===''Metric''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. Readability[1][2]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
&lt;br /&gt;
===='''2. Trello[3][4]'''====&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113017</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113017"/>
		<updated>2017-11-13T10:59:27Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Proposed source for metrics: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===''Metric''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. Readability[1][2]'''====&lt;br /&gt;
&lt;br /&gt;
Sometimes, students only have project write-ups to submit (for example, this stage of the final project). As a result, there might be no GitHub commits to check the number of additions or deletions of the working repository. Here, we introduce some formulas for calculating &amp;quot;Readability&amp;quot; of those write-ups to be one of grading metrics.&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
&lt;br /&gt;
===='''2. Trello[3][4]'''====&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113016</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113016"/>
		<updated>2017-11-13T10:58:57Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Current source: GitHub */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===''Metric''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
Our first and current source for grading metrics is GitHub, and Zach and Tyler have implemented the integration with GitHub API for fetching the commit data. However, the integration looks that it is still in the first stage; the app can fetch the data and store into the database. We don't have actual implementations of getting the valid data and the usage of this data to be one of the grading metrics yet.&lt;br /&gt;
&lt;br /&gt;
From the API offered by GitHub, we can fetch the commit information that the number of additions and the number of deletions is made by each contributor in the repository. We can just use these numbers to calculate the contributions for the metrics, or we can put these numbers into some equations to get the impact factor to represent as contributions for each group member.&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. Readability[1][2]'''====&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
&lt;br /&gt;
===='''2. Trello[3][4]'''====&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113015</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113015"/>
		<updated>2017-11-13T10:58:05Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===''Metric''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. Readability[1][2]'''====&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
&lt;br /&gt;
===='''2. Trello[3][4]'''====&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113014</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113014"/>
		<updated>2017-11-13T10:57:21Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Proposed Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===''Metric''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===='''1. Readability[1][2]'''====&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Reading Ease'''=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====='''Flesch Kincaid Grade Level'''=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====='''Gunning Fog Score'''=====&lt;br /&gt;
&lt;br /&gt;
====='''SMOG Index'''=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====='''Coleman Liau Index'''=====&lt;br /&gt;
&lt;br /&gt;
====='''Automated Readability Index (ARI)'''=====&lt;br /&gt;
&lt;br /&gt;
===='''2. Trello[3][4]'''====&lt;br /&gt;
&lt;br /&gt;
====='''Model Improvement'''=====&lt;br /&gt;
&lt;br /&gt;
=='''Reference'''==&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113013</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113013"/>
		<updated>2017-11-13T10:55:11Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Proposed Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===''Metric''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;br /&gt;
&lt;br /&gt;
==='''Current source: GitHub'''===&lt;br /&gt;
&lt;br /&gt;
==='''Proposed source for metrics:'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''1. Readability[1][2]'''===&lt;br /&gt;
&lt;br /&gt;
==='''Flesch Kincaid Reading Ease'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Flesch Kincaid Grade Level'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Gunning Fog Score'''===&lt;br /&gt;
&lt;br /&gt;
==='''SMOG Index'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Coleman Liau Index'''===&lt;br /&gt;
&lt;br /&gt;
==='''Automated Readability Index (ARI)'''===&lt;br /&gt;
&lt;br /&gt;
==='''2. Trello[3][4]'''===&lt;br /&gt;
&lt;br /&gt;
==='''Model Improvement'''===&lt;br /&gt;
&lt;br /&gt;
==='''Reference'''===&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113012</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113012"/>
		<updated>2017-11-13T10:50:34Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Analysis of the Problem */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===''Metric''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;More external sources are needed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113011</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113011"/>
		<updated>2017-11-13T10:48:48Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Current Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===''Metric''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113010</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113010"/>
		<updated>2017-11-13T10:47:47Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Schema: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===''Metric''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113009</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113009"/>
		<updated>2017-11-13T10:47:21Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Model: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===''Metric''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:metric_data_point_types_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Metric_data_point_types_model.jpg&amp;diff=113008</id>
		<title>File:Metric data point types model.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Metric_data_point_types_model.jpg&amp;diff=113008"/>
		<updated>2017-11-13T10:46:53Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113007</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113007"/>
		<updated>2017-11-13T10:45:28Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Schema: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===''Metric''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File:metric_data_points_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
====Schema:====&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113006</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113006"/>
		<updated>2017-11-13T10:44:44Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Model: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===''Metric''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
&lt;br /&gt;
[[File:metric_data_points_model.jpg]]&lt;br /&gt;
&lt;br /&gt;
====Schema:====&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
====Schema:====&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Metric_data_points_model.jpg&amp;diff=113005</id>
		<title>File:Metric data points model.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Metric_data_points_model.jpg&amp;diff=113005"/>
		<updated>2017-11-13T10:44:10Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: uploaded a new version of &amp;amp;quot;File:Metric data points model.jpg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113004</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=113004"/>
		<updated>2017-11-13T10:41:57Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Schema: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===''Metric''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
[[File: metrics_schema.png]]&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
====Schema:====&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
====Schema:====&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Metric_data_point_types_schema.png&amp;diff=113003</id>
		<title>File:Metric data point types schema.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Metric_data_point_types_schema.png&amp;diff=113003"/>
		<updated>2017-11-13T10:40:45Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Metric_data_points_model.jpg&amp;diff=113002</id>
		<title>File:Metric data points model.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Metric_data_points_model.jpg&amp;diff=113002"/>
		<updated>2017-11-13T10:40:33Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Metric_data_points_schema.png&amp;diff=113001</id>
		<title>File:Metric data points schema.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Metric_data_points_schema.png&amp;diff=113001"/>
		<updated>2017-11-13T10:40:20Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Metrics_schema.png&amp;diff=113000</id>
		<title>File:Metrics schema.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Metrics_schema.png&amp;diff=113000"/>
		<updated>2017-11-13T10:40:04Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=112999</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=112999"/>
		<updated>2017-11-13T10:39:30Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Current Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
&lt;br /&gt;
===''Metric''===&lt;br /&gt;
====Model:====&lt;br /&gt;
[[File:Metrics_models.jpg ]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
====Schema:====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
====Schema:====&lt;br /&gt;
&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
====Schema:====&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=112998</id>
		<title>CSC/ECE 517 Fall 2017/E1790 Text metrics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1790_Text_metrics&amp;diff=112998"/>
		<updated>2017-11-13T10:15:27Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: Created page with &amp;quot;==Introduction== In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will intro...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Metrics_models.jpg&amp;diff=112997</id>
		<title>File:Metrics models.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Metrics_models.jpg&amp;diff=112997"/>
		<updated>2017-11-13T10:04:26Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
===''Metrics''===&lt;br /&gt;
====Models:====&lt;br /&gt;
[[File:Metrics_models.jpg]]&lt;br /&gt;
====Schema:====&lt;br /&gt;
===''Metric_data_points''===&lt;br /&gt;
====Model:====&lt;br /&gt;
====Schema:====&lt;br /&gt;
===''Metric_data_point_types''===&lt;br /&gt;
====Model:====&lt;br /&gt;
====Schema:====&lt;br /&gt;
The current framework only defined the schema, but the models are still empty, and the methods of the data parser have not been implemented yet.&lt;br /&gt;
&lt;br /&gt;
This schema is a clever design because it follows the &amp;quot;Open to Extension and Closed to Modification&amp;quot; principle. When new data is added to the database, developers don't have to change the metric_data_point_types and metric_data_points tables. The developers only need to add two methods to translate the data type to and from strings. By browsing the code, the most basic types already have those methods to meet our requirements. But it is not flawless, and we will talk about the problems in the next section.&lt;br /&gt;
&lt;br /&gt;
Besides, we only have GitHub to be our data source currently. As a result, we also need to find other data sources to be one of the grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Analysis of the Problem==&lt;br /&gt;
1.In model metric_data_points, it is defined that each metric_data_point belongs to a metric and a metric_data_point_type. However, in both model metric_data_point and metric, they haven’t defined has_many metric_data_points. So we can’t query all the metric_data_points of a metric or a metric_data_point_type.&lt;br /&gt;
&lt;br /&gt;
2.In schema metric_data_points, value has been defined as a string to accommodate different data type. But this requires the program to translate data into strings when storing the data and translating the string back to data when accessing it. To make it worse, using strings to store data types, such as float type or Time class, would either lose the precision or incur more abundant storage space.&lt;br /&gt;
&lt;br /&gt;
3.More external sources are needed.&lt;br /&gt;
&lt;br /&gt;
==Proposed Design==&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Metrics_models.jpg&amp;diff=112996</id>
		<title>File:Metrics models.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Metrics_models.jpg&amp;diff=112996"/>
		<updated>2017-11-13T09:58:47Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
In this final project “Text Metric”, first, we will integrate a couple of external sources such as Github, Trello to fetch information. Second, we will introduce the idea of &amp;quot;Readability.&amp;quot; To get the level of readability, we will import the content of write-ups written by students, split the sentences to get the number of sentences, the number of words, etc., and then we calculate the indices by using these numbers and formulas. &lt;br /&gt;
&lt;br /&gt;
Our primary task for the final project is to design tables which allow the Expertiza app to store data fetched from external sources, such as GitHub, Trello, and write-ups. For the next step, we would like to utilize this raw data for virtualized charts and grading metrics.&lt;br /&gt;
&lt;br /&gt;
==Current Design==&lt;br /&gt;
Currently, there are three models created to store the raw data from metrics source. (Metrics, Metric_data_points, Metric_data_point_types)&lt;br /&gt;
===&amp;quot;Metrics&amp;quot;===&lt;br /&gt;
====Models:====&lt;br /&gt;
[[File:Metrics_models.jpg]]&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Metrics_models.jpg&amp;diff=112995</id>
		<title>File:Metrics models.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Metrics_models.jpg&amp;diff=112995"/>
		<updated>2017-11-13T09:55:35Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017&amp;diff=112832</id>
		<title>CSC/ECE 517 Fall 2017</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017&amp;diff=112832"/>
		<updated>2017-11-12T18:03:43Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Design Project Documentation'''&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E17A2 Lightweight Badging System]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E17A8. Use a profiler to identify the problems / pages that take some time to load &amp;amp; fix them]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1793. Help students find teams to join]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1793. Help students find teams to join_Team1964]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1791. Track the time that students look at the other submissions - logging improvement]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1799 Improve self-review Link peer review &amp;amp; self-review to derive grades]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1797_Timestamps_for_students_submissions]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E17A1|CSC/ECE_517_Fall_2017/E17A1 - Let experts as well as students do reviews]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/M1753_OffscreenCanvas]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/M1754_Mutation_Testing]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1794. Student-generated questions added to rubric]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1792 OSS Visualizations for instructors]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment_Team34]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E17A7_Allow_Reviewers_to_bid_on_what_to_review]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E17A9 Lazy loading (infinite scroll) for assignments courses questionnaires and user lists with Jscroll]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E17A5 Allow users to create an account and submit work to an &amp;quot;assignment&amp;quot; (e.g., for conference reviewing)]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E17A3 Upgrade review input UI and sanitize text input]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E17AA Nomination for Badges]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1790 Text metrics]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Writing Assignment 2'''&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1779. Fix teammate advertisements and requests to join a team]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1774 Metareview fixes and improvements.rb]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1788 OSS project Maroon Heatmap fixes]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1781 Topic Management]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1745_Refactor_response_controller.rb]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1752 Refactor assignments controller]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1776_Enhance_Imports]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1756 TLD Refactor response.rb]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1772_Refactor reputation_web_service_controller.rb]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/M1753_OffscreenCanvas API]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/M1754_Mutation Testing on Servo]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1753 OSS project bidding tests]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1766_Test team functionality]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1767 Improve imports]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1786_OSS project Juniper Bookmark Enhancements]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1787_OSS project Bronze Score calculations]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1763 Fix Staggered-Deadline Assignments]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1757 Introduce a Student View for instructors]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1769_Refactor assignment_form.rb]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1754_Feature_test_of_rubric_advice]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1782 OSS Project Red Assignment Directories]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1761 Test First Development Refactor assignment.rb]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1780_OSS_Project_Teal_Email_Notification_Enhancements]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1762 Test various kinds of response-map hierarchies]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1759 ]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1749_Test First Development Refactor questionnaire_controller.rb]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1777 Coherent specification of review requirements.rb]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1771_Refactor_team.rb]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1784 Fix mass assignments reported by Brakeman.rb]]&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109594</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109594"/>
		<updated>2017-10-27T00:39:27Z</updated>

		<summary type="html">&lt;p&gt;Chuang23: /* Exception 2. AbstractController::ActionNotFound */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same fix can be used to fix each and every different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
found during our review of other errors that some developers had used passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
So the solution might be just to remove the gem passenger from production environment.&amp;lt;br/&amp;gt; &lt;br /&gt;
For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
  http://localhost:3000/response/view?id=91251, the error is verified does not appear again. The last time this error occurred was 5&lt;br /&gt;
  months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
  is called and traced, which we couldn't find such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exception 2. AbstractController::ActionNotFound===&lt;br /&gt;
In most of the cases, the error is caused by an abusive use of RESTful routing provided in rails. &lt;br /&gt;
In the middle of somewhere of the app, an index or show action is considered &amp;quot;called&amp;quot; when the redirect url matches such an action which is undefined in the controller.&lt;br /&gt;
&lt;br /&gt;
By thoroughly investigating the controller in trouble and its routes, we came up with a solution that to either reroute the url to an effective url or abort the RESTful route.&lt;br /&gt;
&lt;br /&gt;
For one example, in '''app/controllers/auth_controller''', we found no show/index action defined or needed, but in '''/config/routes.rb''', we have the following:&lt;br /&gt;
&lt;br /&gt;
  '''=begin'''&lt;br /&gt;
  resources :auth , :except=&amp;gt;[:show,:index,:create,:destroy,:update,:edit,:new] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :login&lt;br /&gt;
      post :logout&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  '''=end'''&lt;br /&gt;
By using resources:auth, rails actually creates index and show actions by default. Somewhere in the app, a redirect is made available to the user to an index or show view page which does not exist. Thus, in order to save the trouble finding the redirect, we simply redirect anything points to those invalid pages to a valid page, which is the root.The modified code is below:&lt;br /&gt;
&lt;br /&gt;
  '''post   '/auth/login'  ,to:&amp;quot;auth#login&amp;quot;'''&lt;br /&gt;
  '''post    '/auth/logout' ,to:&amp;quot;auth#logout&amp;quot;'''&lt;br /&gt;
  '''get '/auth/*path', to: redirect('/')'''&lt;br /&gt;
&lt;br /&gt;
Following the same principle, we have modified '''/config/routes.rb''' for routes that have caused the most exceptions due to exposure of invalid url redirection to the user. &lt;br /&gt;
     resources :response''', :except =&amp;gt;[:index]'''do&lt;br /&gt;
    collection do&lt;br /&gt;
      get :new_feedback&lt;br /&gt;
      get :view&lt;br /&gt;
      post :delete&lt;br /&gt;
      get :remove_hyperlink&lt;br /&gt;
      get :saving&lt;br /&gt;
      get :redirection&lt;br /&gt;
      get :show_calibration_results_for_student&lt;br /&gt;
      post :custom_create&lt;br /&gt;
      get :pending_surveys&lt;br /&gt;
      '''get '/*path', to: redirect('/response/pending_surveys')'''&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
There are 10 similar errors in Top 40 errors involved 5 controllers, which are ResponseController, AuthController, AdminController, ImpersonateController and PublishingController. If a controller mentioned above never uses a method declared by resources, we delete the relevant resources and add the routes of method separately, otherwise we use except expression to exclude methods we don't use.&lt;br /&gt;
&lt;br /&gt;
===Exception 3. ActionController::InvalidAuthenticityToken===&lt;br /&gt;
&lt;br /&gt;
 Error Message: You submitted a form with an outdated or missing authenticity token. Try reloading the page you just submitted and submit the form again.&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''config/initializers/request_forgery_protection_mod.rb'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''response#create'''&lt;br /&gt;
&lt;br /&gt;
The background of this problem is that The authenticity token is a random value&lt;br /&gt;
generated in your view to prove a request is submitted from a form on your site,&lt;br /&gt;
not somewhere else. This protects against CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
The expertiza problem could be the user session expired and the solution can be&lt;br /&gt;
delete the code in the '''config/initializers/request_forgery_protection_mod.rb''', &lt;br /&gt;
and redirect or just refresh the page, which would not raise error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exception 4. RuntimeError: This topic has too many reviews; please select another one===&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''app/models/review_assignment.rb:171'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''review_mapping#assign_reviewer_dynamically'''&lt;br /&gt;
&lt;br /&gt;
The intuition is that the review to a topic should be assigned dynamically and&lt;br /&gt;
&amp;quot;too many reviews&amp;quot; problem should be handled by action '''revew_mapping#assign_reviewer_dynamically'''.&lt;br /&gt;
So we could add the below condition in the above controller action to handle this problem.&lt;br /&gt;
&lt;br /&gt;
Instead of raising an error, we could simply handle this problem, which can make&lt;br /&gt;
&amp;quot;flash danger message&amp;quot; unnecessary.&lt;/div&gt;</summary>
		<author><name>Chuang23</name></author>
	</entry>
</feed>