<?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=Dasoni</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=Dasoni"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Dasoni"/>
	<updated>2026-05-09T07:20:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102293</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102293"/>
		<updated>2016-04-25T15:35:30Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Tasks To Do */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza. Instructor can create badges using this service and assign to students.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
===System Requirements===&lt;br /&gt;
The system requirements focuses on adding a 'badging' functionality in Expertiza. This feature allows instructors to assign badges to students based on their performance and accomplishments. Badges are of types - course-level and assignment-level. Badges can be pre-selected while creating an assignment and automatically triggered when student finished the assignment or assignment is closed. Badges can also be awarded manually by instructor to an individual or a team. An instructor can also create new badges anytime and award to students. A leaderboard gives an account of standing of students in terms of badges earned. In order to implement a badging system, a third party badge manager will be utilized called Credly. Credly provides a way for users to accumulate and display badges they earn in a centralized way. By utilizing Credly, the development of the actual badges and badge management can be abstracted away from the project.&lt;br /&gt;
&lt;br /&gt;
The testing of these requirements will use Rspec testing framework for all non-user interface related modifications. All user-interface modifications resulting from the user requirements will be tested manually.&lt;br /&gt;
&lt;br /&gt;
===Use Case===&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
&lt;br /&gt;
[[File:Use_case.PNG]]&lt;br /&gt;
&lt;br /&gt;
====Use Case Scenarios====&lt;br /&gt;
* '''Student Views Leaderboard'''&lt;br /&gt;
** Actor: Student&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Mouse over Home&lt;br /&gt;
**# Select Leaderboard &lt;br /&gt;
* '''Instructor Views Assignment Leaderboard'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select Assignments&lt;br /&gt;
**# Select View Badges on assignment&lt;br /&gt;
* '''Instructor Edits Assignment Badges'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select Assignments&lt;br /&gt;
**# Select Edit Assignments&lt;br /&gt;
**# Select Badges tab&lt;br /&gt;
**# Check enable badges&lt;br /&gt;
**# Check Score Threshold&lt;br /&gt;
**# Enter 95.5 as scoring threshold&lt;br /&gt;
**# Select Save&lt;br /&gt;
* '''Instructor Creates Course Badges'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select LeaderBoard&lt;br /&gt;
**# Select Award Badges&lt;br /&gt;
**# Select Create new badge&lt;br /&gt;
**# Create new badge using Credly&lt;br /&gt;
**# Select Save&lt;br /&gt;
&lt;br /&gt;
===Tasks Done===&lt;br /&gt;
*Create db table to store the participants with badges.&lt;br /&gt;
*Write code for calling the service and calculating/identifying badges based on the scores of students on all assignments.&lt;br /&gt;
*Add badge specification to course details and assignment details page for the instructor to specify the badges.&lt;br /&gt;
*Create views for both students and instructors. Students should be able to view their badges from different courses and instructors should be able to see the badges awarded/earned for their class.&lt;br /&gt;
*Display a subset of the badge holders on the leaderboard page. Also, student can view badges of other students in the course.&lt;br /&gt;
*Criteria to be followed for awarding badges:&lt;br /&gt;
#Top scores for an assignment. (configured at assignment page)&lt;br /&gt;
#All scores more than a threshold for an assignment. (configured at assignment page)&lt;br /&gt;
#Mean score of selected assignments being greater than threshold. (configured at course page)&lt;br /&gt;
#Top mean score of selected assignments. (configured at course page)&lt;br /&gt;
#Discretionary merit badges for projects that exceed expectations.&lt;br /&gt;
&lt;br /&gt;
===Files Used===&lt;br /&gt;
Files that are modified or are added can be found [http://github.com/expertiza/expertiza/pull/673/files here]&lt;br /&gt;
&lt;br /&gt;
*Modified files:&lt;br /&gt;
**app/controllers/student_task_controller.rb  4&lt;br /&gt;
**app/controllers/users_controller.rb  4&lt;br /&gt;
**app/controllers/tree_display_controller.rb   4&lt;br /&gt;
**app/controllers/leaderboard_controller.rb    4&lt;br /&gt;
**app/controllers/assignments_controller.rb   4&lt;br /&gt;
**app/models/user.rb  4&lt;br /&gt;
**app/models/leaderboard.rb  4&lt;br /&gt;
**app/models/badge_user.rb   4&lt;br /&gt;
**app/models/assignment_form.rb   4&lt;br /&gt;
**app/models/assignment.rb   4&lt;br /&gt;
**app/views/leaderboard/index.html.erb  4&lt;br /&gt;
**app/views/leaderboard/_leaderBoards.html.erb  4&lt;br /&gt;
**app/views/leaderboard/_achievementLeaderBoards.html.erb&lt;br /&gt;
**app/views/course/edit.html.erb&lt;br /&gt;
**app/views/tree_display/actions/_courses_actions.html.erb  4&lt;br /&gt;
**config/routes.rb  4&lt;br /&gt;
**db/schema.rb  4&lt;br /&gt;
**app/views/leaderboard/view.html.erb  4&lt;br /&gt;
**app/views/auth/_login.html.erb   4&lt;br /&gt;
**app/views/assignments/edit.html.erb   4&lt;br /&gt;
**app/helpers/leaderboard_helper.rb   4&lt;br /&gt;
**app/helpers/assignment_helper.rb    4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Newly added files:&lt;br /&gt;
**app/models/badge.rb   4&lt;br /&gt;
**app/models/badge_groups.rb  4&lt;br /&gt;
**app/models/assignment_group.rb  4&lt;br /&gt;
**app/controllers/badges_controller.rb  4&lt;br /&gt;
**app/controllers/badge_groups_controller.rb   4&lt;br /&gt;
**app/views/users/credly_register.html.erb  4&lt;br /&gt;
**app/views/assignments/edit/_badges.html.erb  4&lt;br /&gt;
**app/views/badges/   4&lt;br /&gt;
**app/views/badge_groups/   4&lt;br /&gt;
**app/views/assignments/edit/_select_badge.html.erb  4&lt;br /&gt;
**app/helpers/credly_helper.rb  4&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From the above rubrics, we decided to use Credly as our web service for badging system.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project.&lt;br /&gt;
&lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || varchar || Description of the badge&lt;br /&gt;
|-&lt;br /&gt;
| credly_badge_id || int || Corresponding badge id with Credly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Referenced from badges table&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || varchar || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Assigned badge id.&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Course for which group is formed.&lt;br /&gt;
|-&lt;br /&gt;
| is_course_level_group || boolean || Whether group is for course &lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:badging_class_diagram.png]]&lt;br /&gt;
&lt;br /&gt;
==Walkthrough==&lt;br /&gt;
Below is a walkthrough of the changes to implement the Badging System:&lt;br /&gt;
===Instructor===&lt;br /&gt;
Instructors may configure badges on the course page using the new badge configuration icon:&lt;br /&gt;
&lt;br /&gt;
[[File:Manage_courses_badges.jpg]]&lt;br /&gt;
&lt;br /&gt;
Upon clicking the badge configuration icon, the user will be presented with two items: create groups and view all existing groups. Users may also edit and delete groups. A group is a set of assignments to present badges for.&lt;br /&gt;
&lt;br /&gt;
[[File:badges_configuration.jpg]]&lt;br /&gt;
&lt;br /&gt;
A new group may be created using the form below. This form allows instructors to create a new badge while creating a group for which they will be redirected to Credly. The form page must be refreshed upon creating a new badge so it may appear in the interface. The result of this form will create a new record in badge_groups and assignment_groups tables. &lt;br /&gt;
&lt;br /&gt;
[[File:badges_new.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
The Expertiza badging system will largely be driven by academic achievement from students. By using student’s scores as a way to provide badges it will be easy to automate the badge reward system upon closing an assignment. For instance, an instructor may decide to reward badges to the top 3 scores on an assignment so once the assignment closes those students will automatically be given those badges. &lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must turn on badging for their assignment upon creating or editing an assignment. When turning on the badging system the instructor may specify how many badges will be distributed, or choose to distribute them based off of a scoring threshold that students must achieve. &lt;br /&gt;
&lt;br /&gt;
Following the completion of an assignment an instructor may view the awarded badges on the assignment page. A student will be able to view their earned badges on their homepage categorized by course and assignment. &lt;br /&gt;
&lt;br /&gt;
The layout of each page will match with the currently existing design standards in Expertiza we will continue to use the header and will use headings and links much like other pages. Figure 1 below shows what the leaderboard may look like from a student perspective. Each course the student has participated in will be displayed on the page and by clicking the “Show Badges” the page will generate a list of each of the participants sorted by the number of badges they have earned. In order to display the badges the application will make a call to Credly to query about student badges.&lt;br /&gt;
&lt;br /&gt;
[[File: StudentLeaderboard.png]]&lt;br /&gt;
Figure 1: Student Leaderboard&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next figures are all from the perspective of an inspector or admin. In Figure 3 below an instructor may view the badges earned for a given assignment or course in which they own. They will get to his page by clicking a badges button from either the assignments or courses page. The title of the page will be the name of either the course of assignment. Like the previous figure, by clicking show badges the list of course participants will appear sorted by the number of badges they have earned. Another link, “Award Badges” will be used to manually grant a badge. When an instructor or admin clicks on the link, they will be directed to the credly page in order to grant the badge to the student.  &lt;br /&gt;
&lt;br /&gt;
[[File: InstructorAssignment.png]]&lt;br /&gt;
Figure 2: Instructor assignment / course badge view&lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must first enable them for the assignment. The badges will be enabled by default. The figure below shows some of the settings associated with the badges system. Instructors may choose to automatically grant badges to students based off of their performance on the assignment. When editing or creating a new assignment they may come to the new badges tab and configure how they want the badges granted. Instructors may choose to grant some number of badges to the top scores of the group defined by the number the input, or they may decide to grant badges to anyone who may achieve a score past the provided scoring threshold. &lt;br /&gt;
&lt;br /&gt;
[[File: EditAssignmentBadges.png]]&lt;br /&gt;
Figure 3: Assignment Badge Settings&lt;br /&gt;
&lt;br /&gt;
Like assignments, courses also need to have some settings to configure badges. In Figure 4, instructors may automatically grant badges for students based on mean scores of multiple assignments throughout the course. First the instructor must check all of the assignments they would like to include in the mean then they must select a scoring strategy. Like the previous figure, they may choose between granting a badge to the top number of participants based on instructor input, or they may set a threshold on a mean score and any student who has achieved a score past the mean will be granted a badge. &lt;br /&gt;
&lt;br /&gt;
[[File: BadgeCourseOptions.png]]&lt;br /&gt;
Figure 4: Edit Course&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102292</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102292"/>
		<updated>2016-04-25T15:35:01Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Files Used */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza. Instructor can create badges using this service and assign to students.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
===System Requirements===&lt;br /&gt;
The system requirements focuses on adding a 'badging' functionality in Expertiza. This feature allows instructors to assign badges to students based on their performance and accomplishments. Badges are of types - course-level and assignment-level. Badges can be pre-selected while creating an assignment and automatically triggered when student finished the assignment or assignment is closed. Badges can also be awarded manually by instructor to an individual or a team. An instructor can also create new badges anytime and award to students. A leaderboard gives an account of standing of students in terms of badges earned. In order to implement a badging system, a third party badge manager will be utilized called Credly. Credly provides a way for users to accumulate and display badges they earn in a centralized way. By utilizing Credly, the development of the actual badges and badge management can be abstracted away from the project.&lt;br /&gt;
&lt;br /&gt;
The testing of these requirements will use Rspec testing framework for all non-user interface related modifications. All user-interface modifications resulting from the user requirements will be tested manually.&lt;br /&gt;
&lt;br /&gt;
===Use Case===&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
&lt;br /&gt;
[[File:Use_case.PNG]]&lt;br /&gt;
&lt;br /&gt;
====Use Case Scenarios====&lt;br /&gt;
* '''Student Views Leaderboard'''&lt;br /&gt;
** Actor: Student&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Mouse over Home&lt;br /&gt;
**# Select Leaderboard &lt;br /&gt;
* '''Instructor Views Assignment Leaderboard'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select Assignments&lt;br /&gt;
**# Select View Badges on assignment&lt;br /&gt;
* '''Instructor Edits Assignment Badges'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select Assignments&lt;br /&gt;
**# Select Edit Assignments&lt;br /&gt;
**# Select Badges tab&lt;br /&gt;
**# Check enable badges&lt;br /&gt;
**# Check Score Threshold&lt;br /&gt;
**# Enter 95.5 as scoring threshold&lt;br /&gt;
**# Select Save&lt;br /&gt;
* '''Instructor Creates Course Badges'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select LeaderBoard&lt;br /&gt;
**# Select Award Badges&lt;br /&gt;
**# Select Create new badge&lt;br /&gt;
**# Create new badge using Credly&lt;br /&gt;
**# Select Save&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
*Create db table to store the participants with badges.&lt;br /&gt;
*Write code for calling the service and calculating/identifying badges based on the scores of students on all assignments.&lt;br /&gt;
*Add badge specification to course details and assignment details page for the instructor to specify the badges.&lt;br /&gt;
*Create views for both students and instructors. Students should be able to view their badges from different courses and instructors should be able to see the badges awarded/earned for their class.&lt;br /&gt;
*Display a subset of the badge holders on the leaderboard page. Also, student can view badges of other students in the course.&lt;br /&gt;
*Criteria to be followed for awarding badges:&lt;br /&gt;
#Top scores for an assignment. (configured at assignment page)&lt;br /&gt;
#All scores more than a threshold for an assignment. (configured at assignment page)&lt;br /&gt;
#Mean score of selected assignments being greater than threshold. (configured at course page)&lt;br /&gt;
#Top mean score of selected assignments. (configured at course page)&lt;br /&gt;
#Discretionary merit badges for projects that exceed expectations.&lt;br /&gt;
&lt;br /&gt;
===Files Used===&lt;br /&gt;
Files that are modified or are added can be found [http://github.com/expertiza/expertiza/pull/673/files here]&lt;br /&gt;
&lt;br /&gt;
*Modified files:&lt;br /&gt;
**app/controllers/student_task_controller.rb  4&lt;br /&gt;
**app/controllers/users_controller.rb  4&lt;br /&gt;
**app/controllers/tree_display_controller.rb   4&lt;br /&gt;
**app/controllers/leaderboard_controller.rb    4&lt;br /&gt;
**app/controllers/assignments_controller.rb   4&lt;br /&gt;
**app/models/user.rb  4&lt;br /&gt;
**app/models/leaderboard.rb  4&lt;br /&gt;
**app/models/badge_user.rb   4&lt;br /&gt;
**app/models/assignment_form.rb   4&lt;br /&gt;
**app/models/assignment.rb   4&lt;br /&gt;
**app/views/leaderboard/index.html.erb  4&lt;br /&gt;
**app/views/leaderboard/_leaderBoards.html.erb  4&lt;br /&gt;
**app/views/leaderboard/_achievementLeaderBoards.html.erb&lt;br /&gt;
**app/views/course/edit.html.erb&lt;br /&gt;
**app/views/tree_display/actions/_courses_actions.html.erb  4&lt;br /&gt;
**config/routes.rb  4&lt;br /&gt;
**db/schema.rb  4&lt;br /&gt;
**app/views/leaderboard/view.html.erb  4&lt;br /&gt;
**app/views/auth/_login.html.erb   4&lt;br /&gt;
**app/views/assignments/edit.html.erb   4&lt;br /&gt;
**app/helpers/leaderboard_helper.rb   4&lt;br /&gt;
**app/helpers/assignment_helper.rb    4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Newly added files:&lt;br /&gt;
**app/models/badge.rb   4&lt;br /&gt;
**app/models/badge_groups.rb  4&lt;br /&gt;
**app/models/assignment_group.rb  4&lt;br /&gt;
**app/controllers/badges_controller.rb  4&lt;br /&gt;
**app/controllers/badge_groups_controller.rb   4&lt;br /&gt;
**app/views/users/credly_register.html.erb  4&lt;br /&gt;
**app/views/assignments/edit/_badges.html.erb  4&lt;br /&gt;
**app/views/badges/   4&lt;br /&gt;
**app/views/badge_groups/   4&lt;br /&gt;
**app/views/assignments/edit/_select_badge.html.erb  4&lt;br /&gt;
**app/helpers/credly_helper.rb  4&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From the above rubrics, we decided to use Credly as our web service for badging system.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project.&lt;br /&gt;
&lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || varchar || Description of the badge&lt;br /&gt;
|-&lt;br /&gt;
| credly_badge_id || int || Corresponding badge id with Credly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Referenced from badges table&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || varchar || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Assigned badge id.&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Course for which group is formed.&lt;br /&gt;
|-&lt;br /&gt;
| is_course_level_group || boolean || Whether group is for course &lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:badging_class_diagram.png]]&lt;br /&gt;
&lt;br /&gt;
==Walkthrough==&lt;br /&gt;
Below is a walkthrough of the changes to implement the Badging System:&lt;br /&gt;
===Instructor===&lt;br /&gt;
Instructors may configure badges on the course page using the new badge configuration icon:&lt;br /&gt;
&lt;br /&gt;
[[File:Manage_courses_badges.jpg]]&lt;br /&gt;
&lt;br /&gt;
Upon clicking the badge configuration icon, the user will be presented with two items: create groups and view all existing groups. Users may also edit and delete groups. A group is a set of assignments to present badges for.&lt;br /&gt;
&lt;br /&gt;
[[File:badges_configuration.jpg]]&lt;br /&gt;
&lt;br /&gt;
A new group may be created using the form below. This form allows instructors to create a new badge while creating a group for which they will be redirected to Credly. The form page must be refreshed upon creating a new badge so it may appear in the interface. The result of this form will create a new record in badge_groups and assignment_groups tables. &lt;br /&gt;
&lt;br /&gt;
[[File:badges_new.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
The Expertiza badging system will largely be driven by academic achievement from students. By using student’s scores as a way to provide badges it will be easy to automate the badge reward system upon closing an assignment. For instance, an instructor may decide to reward badges to the top 3 scores on an assignment so once the assignment closes those students will automatically be given those badges. &lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must turn on badging for their assignment upon creating or editing an assignment. When turning on the badging system the instructor may specify how many badges will be distributed, or choose to distribute them based off of a scoring threshold that students must achieve. &lt;br /&gt;
&lt;br /&gt;
Following the completion of an assignment an instructor may view the awarded badges on the assignment page. A student will be able to view their earned badges on their homepage categorized by course and assignment. &lt;br /&gt;
&lt;br /&gt;
The layout of each page will match with the currently existing design standards in Expertiza we will continue to use the header and will use headings and links much like other pages. Figure 1 below shows what the leaderboard may look like from a student perspective. Each course the student has participated in will be displayed on the page and by clicking the “Show Badges” the page will generate a list of each of the participants sorted by the number of badges they have earned. In order to display the badges the application will make a call to Credly to query about student badges.&lt;br /&gt;
&lt;br /&gt;
[[File: StudentLeaderboard.png]]&lt;br /&gt;
Figure 1: Student Leaderboard&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next figures are all from the perspective of an inspector or admin. In Figure 3 below an instructor may view the badges earned for a given assignment or course in which they own. They will get to his page by clicking a badges button from either the assignments or courses page. The title of the page will be the name of either the course of assignment. Like the previous figure, by clicking show badges the list of course participants will appear sorted by the number of badges they have earned. Another link, “Award Badges” will be used to manually grant a badge. When an instructor or admin clicks on the link, they will be directed to the credly page in order to grant the badge to the student.  &lt;br /&gt;
&lt;br /&gt;
[[File: InstructorAssignment.png]]&lt;br /&gt;
Figure 2: Instructor assignment / course badge view&lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must first enable them for the assignment. The badges will be enabled by default. The figure below shows some of the settings associated with the badges system. Instructors may choose to automatically grant badges to students based off of their performance on the assignment. When editing or creating a new assignment they may come to the new badges tab and configure how they want the badges granted. Instructors may choose to grant some number of badges to the top scores of the group defined by the number the input, or they may decide to grant badges to anyone who may achieve a score past the provided scoring threshold. &lt;br /&gt;
&lt;br /&gt;
[[File: EditAssignmentBadges.png]]&lt;br /&gt;
Figure 3: Assignment Badge Settings&lt;br /&gt;
&lt;br /&gt;
Like assignments, courses also need to have some settings to configure badges. In Figure 4, instructors may automatically grant badges for students based on mean scores of multiple assignments throughout the course. First the instructor must check all of the assignments they would like to include in the mean then they must select a scoring strategy. Like the previous figure, they may choose between granting a badge to the top number of participants based on instructor input, or they may set a threshold on a mean score and any student who has achieved a score past the mean will be granted a badge. &lt;br /&gt;
&lt;br /&gt;
[[File: BadgeCourseOptions.png]]&lt;br /&gt;
Figure 4: Edit Course&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102291</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102291"/>
		<updated>2016-04-25T15:31:21Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza. Instructor can create badges using this service and assign to students.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
===System Requirements===&lt;br /&gt;
The system requirements focuses on adding a 'badging' functionality in Expertiza. This feature allows instructors to assign badges to students based on their performance and accomplishments. Badges are of types - course-level and assignment-level. Badges can be pre-selected while creating an assignment and automatically triggered when student finished the assignment or assignment is closed. Badges can also be awarded manually by instructor to an individual or a team. An instructor can also create new badges anytime and award to students. A leaderboard gives an account of standing of students in terms of badges earned. In order to implement a badging system, a third party badge manager will be utilized called Credly. Credly provides a way for users to accumulate and display badges they earn in a centralized way. By utilizing Credly, the development of the actual badges and badge management can be abstracted away from the project.&lt;br /&gt;
&lt;br /&gt;
The testing of these requirements will use Rspec testing framework for all non-user interface related modifications. All user-interface modifications resulting from the user requirements will be tested manually.&lt;br /&gt;
&lt;br /&gt;
===Use Case===&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
&lt;br /&gt;
[[File:Use_case.PNG]]&lt;br /&gt;
&lt;br /&gt;
====Use Case Scenarios====&lt;br /&gt;
* '''Student Views Leaderboard'''&lt;br /&gt;
** Actor: Student&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Mouse over Home&lt;br /&gt;
**# Select Leaderboard &lt;br /&gt;
* '''Instructor Views Assignment Leaderboard'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select Assignments&lt;br /&gt;
**# Select View Badges on assignment&lt;br /&gt;
* '''Instructor Edits Assignment Badges'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select Assignments&lt;br /&gt;
**# Select Edit Assignments&lt;br /&gt;
**# Select Badges tab&lt;br /&gt;
**# Check enable badges&lt;br /&gt;
**# Check Score Threshold&lt;br /&gt;
**# Enter 95.5 as scoring threshold&lt;br /&gt;
**# Select Save&lt;br /&gt;
* '''Instructor Creates Course Badges'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select LeaderBoard&lt;br /&gt;
**# Select Award Badges&lt;br /&gt;
**# Select Create new badge&lt;br /&gt;
**# Create new badge using Credly&lt;br /&gt;
**# Select Save&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
*Create db table to store the participants with badges.&lt;br /&gt;
*Write code for calling the service and calculating/identifying badges based on the scores of students on all assignments.&lt;br /&gt;
*Add badge specification to course details and assignment details page for the instructor to specify the badges.&lt;br /&gt;
*Create views for both students and instructors. Students should be able to view their badges from different courses and instructors should be able to see the badges awarded/earned for their class.&lt;br /&gt;
*Display a subset of the badge holders on the leaderboard page. Also, student can view badges of other students in the course.&lt;br /&gt;
*Criteria to be followed for awarding badges:&lt;br /&gt;
#Top scores for an assignment. (configured at assignment page)&lt;br /&gt;
#All scores more than a threshold for an assignment. (configured at assignment page)&lt;br /&gt;
#Mean score of selected assignments being greater than threshold. (configured at course page)&lt;br /&gt;
#Top mean score of selected assignments. (configured at course page)&lt;br /&gt;
#Discretionary merit badges for projects that exceed expectations.&lt;br /&gt;
&lt;br /&gt;
===Files Used===&lt;br /&gt;
Files that are modified or are added can be found [http://github.com/expertiza/expertiza/pull/673/files here]&lt;br /&gt;
&lt;br /&gt;
*Modified files:&lt;br /&gt;
**app/controllers/student_task_controller.rb  4&lt;br /&gt;
**app/controllers/users_controller.rb  4&lt;br /&gt;
**app/controllers/tree_display_controller.rb   4&lt;br /&gt;
**app/controllers/leaderboard_controller.rb    4&lt;br /&gt;
**app/controllers/assignments_controller.rb   4&lt;br /&gt;
**app/models/user.rb  4&lt;br /&gt;
**app/models/leaderboard.rb  4&lt;br /&gt;
**app/models/badge_user.rb   4&lt;br /&gt;
**app/models/assignment_form.rb   4&lt;br /&gt;
**app/models/assignment.rb   4&lt;br /&gt;
**app/views/leaderboard/index.html.erb&lt;br /&gt;
**app/views/leaderboard/_top3LeaderBoards.html.erb&lt;br /&gt;
**app/views/leaderboard/_achievementLeaderBoards.html.erb&lt;br /&gt;
**app/views/course/edit.html.erb&lt;br /&gt;
**app/views/tree_display/actions/_courses_actions.html.erb  4&lt;br /&gt;
**config/routes.rb  4&lt;br /&gt;
**db/schema.rb  4&lt;br /&gt;
**app/views/leaderboard/view.html.erb  4&lt;br /&gt;
**app/views/auth/_login.html.erb   4&lt;br /&gt;
**app/views/assignments/edit.html.erb   4&lt;br /&gt;
**app/helpers/leaderboard_helper.rb   4&lt;br /&gt;
**app/helpers/assignment_helper.rb    4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Newly added files:&lt;br /&gt;
**app/models/badge.rb   4&lt;br /&gt;
**app/models/badge_groups.rb  4&lt;br /&gt;
**app/models/assignment_group.rb  4&lt;br /&gt;
**app/controllers/badges_controller.rb  4&lt;br /&gt;
**app/controllers/badge_groups_controller.rb   4&lt;br /&gt;
**app/views/users/credly_register.html.erb  4&lt;br /&gt;
**app/views/assignments/edit/_badges.html.erb  4&lt;br /&gt;
**app/views/badges/   4&lt;br /&gt;
**app/views/badge_groups/   4&lt;br /&gt;
**app/views/assignments/edit/_select_badge.html.erb  4&lt;br /&gt;
**app/helpers/credly_helper.rb  4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From the above rubrics, we decided to use Credly as our web service for badging system.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project.&lt;br /&gt;
&lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || varchar || Description of the badge&lt;br /&gt;
|-&lt;br /&gt;
| credly_badge_id || int || Corresponding badge id with Credly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Referenced from badges table&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || varchar || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Assigned badge id.&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Course for which group is formed.&lt;br /&gt;
|-&lt;br /&gt;
| is_course_level_group || boolean || Whether group is for course &lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:badging_class_diagram.png]]&lt;br /&gt;
&lt;br /&gt;
==Walkthrough==&lt;br /&gt;
Below is a walkthrough of the changes to implement the Badging System:&lt;br /&gt;
===Instructor===&lt;br /&gt;
Instructors may configure badges on the course page using the new badge configuration icon:&lt;br /&gt;
&lt;br /&gt;
[[File:Manage_courses_badges.jpg]]&lt;br /&gt;
&lt;br /&gt;
Upon clicking the badge configuration icon, the user will be presented with two items: create groups and view all existing groups. Users may also edit and delete groups. A group is a set of assignments to present badges for.&lt;br /&gt;
&lt;br /&gt;
[[File:badges_configuration.jpg]]&lt;br /&gt;
&lt;br /&gt;
A new group may be created using the form below. This form allows instructors to create a new badge while creating a group for which they will be redirected to Credly. The form page must be refreshed upon creating a new badge so it may appear in the interface. The result of this form will create a new record in badge_groups and assignment_groups tables. &lt;br /&gt;
&lt;br /&gt;
[[File:badges_new.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
The Expertiza badging system will largely be driven by academic achievement from students. By using student’s scores as a way to provide badges it will be easy to automate the badge reward system upon closing an assignment. For instance, an instructor may decide to reward badges to the top 3 scores on an assignment so once the assignment closes those students will automatically be given those badges. &lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must turn on badging for their assignment upon creating or editing an assignment. When turning on the badging system the instructor may specify how many badges will be distributed, or choose to distribute them based off of a scoring threshold that students must achieve. &lt;br /&gt;
&lt;br /&gt;
Following the completion of an assignment an instructor may view the awarded badges on the assignment page. A student will be able to view their earned badges on their homepage categorized by course and assignment. &lt;br /&gt;
&lt;br /&gt;
The layout of each page will match with the currently existing design standards in Expertiza we will continue to use the header and will use headings and links much like other pages. Figure 1 below shows what the leaderboard may look like from a student perspective. Each course the student has participated in will be displayed on the page and by clicking the “Show Badges” the page will generate a list of each of the participants sorted by the number of badges they have earned. In order to display the badges the application will make a call to Credly to query about student badges.&lt;br /&gt;
&lt;br /&gt;
[[File: StudentLeaderboard.png]]&lt;br /&gt;
Figure 1: Student Leaderboard&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next figures are all from the perspective of an inspector or admin. In Figure 3 below an instructor may view the badges earned for a given assignment or course in which they own. They will get to his page by clicking a badges button from either the assignments or courses page. The title of the page will be the name of either the course of assignment. Like the previous figure, by clicking show badges the list of course participants will appear sorted by the number of badges they have earned. Another link, “Award Badges” will be used to manually grant a badge. When an instructor or admin clicks on the link, they will be directed to the credly page in order to grant the badge to the student.  &lt;br /&gt;
&lt;br /&gt;
[[File: InstructorAssignment.png]]&lt;br /&gt;
Figure 2: Instructor assignment / course badge view&lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must first enable them for the assignment. The badges will be enabled by default. The figure below shows some of the settings associated with the badges system. Instructors may choose to automatically grant badges to students based off of their performance on the assignment. When editing or creating a new assignment they may come to the new badges tab and configure how they want the badges granted. Instructors may choose to grant some number of badges to the top scores of the group defined by the number the input, or they may decide to grant badges to anyone who may achieve a score past the provided scoring threshold. &lt;br /&gt;
&lt;br /&gt;
[[File: EditAssignmentBadges.png]]&lt;br /&gt;
Figure 3: Assignment Badge Settings&lt;br /&gt;
&lt;br /&gt;
Like assignments, courses also need to have some settings to configure badges. In Figure 4, instructors may automatically grant badges for students based on mean scores of multiple assignments throughout the course. First the instructor must check all of the assignments they would like to include in the mean then they must select a scoring strategy. Like the previous figure, they may choose between granting a badge to the top number of participants based on instructor input, or they may set a threshold on a mean score and any student who has achieved a score past the mean will be granted a badge. &lt;br /&gt;
&lt;br /&gt;
[[File: BadgeCourseOptions.png]]&lt;br /&gt;
Figure 4: Edit Course&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102283</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102283"/>
		<updated>2016-04-24T16:50:24Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza. Instructor can create badges using this service and assign to students.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
===System Requirements===&lt;br /&gt;
The system requirements focuses on adding a 'badging' functionality in Expertiza. This feature allows instructors to assign badges to students based on their performance and accomplishments. Badges are of types - course-level and assignment-level. Badges can be pre-selected while creating an assignment and automatically triggered when student finished the assignment or assignment is closed. Badges can also be awarded manually by instructor to an individual or a team. An instructor can also create new badges anytime and award to students. A leaderboard gives an account of standing of students in terms of badges earned. In order to implement a badging system, a third party badge manager will be utilized called Credly. Credly provides a way for users to accumulate and display badges they earn in a centralized way. By utilizing Credly, the development of the actual badges and badge management can be abstracted away from the project.&lt;br /&gt;
&lt;br /&gt;
The testing of these requirements will use Rspec testing framework for all non-user interface related modifications. All user-interface modifications resulting from the user requirements will be tested manually.&lt;br /&gt;
&lt;br /&gt;
===Use Case===&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
&lt;br /&gt;
[[File:Use_case.PNG]]&lt;br /&gt;
&lt;br /&gt;
====Use Case Scenarios====&lt;br /&gt;
* '''Student Views Leaderboard'''&lt;br /&gt;
** Actor: Student&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Mouse over Home&lt;br /&gt;
**# Select Leaderboard &lt;br /&gt;
* '''Instructor Views Assignment Leaderboard'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select Assignments&lt;br /&gt;
**# Select View Badges on assignment&lt;br /&gt;
* '''Instructor Edits Assignment Badges'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select Assignments&lt;br /&gt;
**# Select Edit Assignments&lt;br /&gt;
**# Select Badges tab&lt;br /&gt;
**# Check enable badges&lt;br /&gt;
**# Check Score Threshold&lt;br /&gt;
**# Enter 95.5 as scoring threshold&lt;br /&gt;
**# Select Save&lt;br /&gt;
* '''Instructor Creates Course Badges'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select LeaderBoard&lt;br /&gt;
**# Select Award Badges&lt;br /&gt;
**# Select Create new badge&lt;br /&gt;
**# Create new badge using Credly&lt;br /&gt;
**# Select Save&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
*Create db table to store the participants with badges.&lt;br /&gt;
*Write code for calling the service and calculating/identifying badges based on the scores of students on all assignments.&lt;br /&gt;
*Add badge specification to course details and assignment details page for the instructor to specify the badges.&lt;br /&gt;
*Create views for both students and instructors. Students should be able to view their badges from different courses and instructors should be able to see the badges awarded/earned for their class.&lt;br /&gt;
*Display a subset of the badge holders on the leaderboard page. Also, student can view badges of other students in the course.&lt;br /&gt;
*Criteria to be followed for awarding badges:&lt;br /&gt;
#Top scores for an assignment. (configured at assignment page)&lt;br /&gt;
#All scores more than a threshold for an assignment. (configured at assignment page)&lt;br /&gt;
#Mean score of selected assignments being greater than threshold. (configured at course page)&lt;br /&gt;
#Top mean score of selected assignments. (configured at course page)&lt;br /&gt;
#Discretionary merit badges for projects that exceed expectations.&lt;br /&gt;
&lt;br /&gt;
===Files Identified===&lt;br /&gt;
*Modified files:&lt;br /&gt;
**app/controllers/student_task_controller.rb&lt;br /&gt;
**app/controllers/users_controller.rb&lt;br /&gt;
**app/models/user.rb&lt;br /&gt;
**app/views/leaderboard/index.html.erb&lt;br /&gt;
**app/views/leaderboard/_top3LeaderBoards.html.erb&lt;br /&gt;
**app/views/leaderboard/_achievementLeaderBoards.html.erb&lt;br /&gt;
**app/views/course/edit.html.erb&lt;br /&gt;
**config/routes.rb&lt;br /&gt;
&lt;br /&gt;
*Newly added files:&lt;br /&gt;
**app/models/badges.rb&lt;br /&gt;
**app/models/badge_groups.rb&lt;br /&gt;
**app/controllers/badges_controller.rb&lt;br /&gt;
**app/controllers/badge_groups_controller.rb&lt;br /&gt;
**app/views/users/credly_register.html.erb&lt;br /&gt;
**app/views/assignments/edit/_badges_configuration.html.erb&lt;br /&gt;
**app/views/badges/&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From the above rubrics, we decided to use Credly as our web service for badging system.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project.&lt;br /&gt;
&lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || varchar || Description of the badge&lt;br /&gt;
|-&lt;br /&gt;
| credly_badge_id || int || Corresponding badge id with Credly&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Referenced from badges table&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || varchar || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Assigned badge id.&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Course for which group is formed.&lt;br /&gt;
|-&lt;br /&gt;
| is_course_level_group || boolean || Whether group is for course &lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:badging_class_diagram.png]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
The Expertiza badging system will largely be driven by academic achievement from students. By using student’s scores as a way to provide badges it will be easy to automate the badge reward system upon closing an assignment. For instance, an instructor may decide to reward badges to the top 3 scores on an assignment so once the assignment closes those students will automatically be given those badges. &lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must turn on badging for their assignment upon creating or editing an assignment. When turning on the badging system the instructor may specify how many badges will be distributed, or choose to distribute them based off of a scoring threshold that students must achieve. &lt;br /&gt;
&lt;br /&gt;
Following the completion of an assignment an instructor may view the awarded badges on the assignment page. A student will be able to view their earned badges on their homepage categorized by course and assignment. &lt;br /&gt;
&lt;br /&gt;
The layout of each page will match with the currently existing design standards in Expertiza we will continue to use the header and will use headings and links much like other pages. Figure 1 below shows what the leaderboard may look like from a student perspective. Each course the student has participated in will be displayed on the page and by clicking the “Show Badges” the page will generate a list of each of the participants sorted by the number of badges they have earned. In order to display the badges the application will make a call to Credly to query about student badges.&lt;br /&gt;
&lt;br /&gt;
[[File: StudentLeaderboard.png]]&lt;br /&gt;
Figure 1: Student Leaderboard&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next figures are all from the perspective of an inspector or admin. In Figure 3 below an instructor may view the badges earned for a given assignment or course in which they own. They will get to his page by clicking a badges button from either the assignments or courses page. The title of the page will be the name of either the course of assignment. Like the previous figure, by clicking show badges the list of course participants will appear sorted by the number of badges they have earned. Another link, “Award Badges” will be used to manually grant a badge. When an instructor or admin clicks on the link, they will be directed to the credly page in order to grant the badge to the student.  &lt;br /&gt;
&lt;br /&gt;
[[File: InstructorAssignment.png]]&lt;br /&gt;
Figure 2: Instructor assignment / course badge view&lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must first enable them for the assignment. The badges will be enabled by default. The figure below shows some of the settings associated with the badges system. Instructors may choose to automatically grant badges to students based off of their performance on the assignment. When editing or creating a new assignment they may come to the new badges tab and configure how they want the badges granted. Instructors may choose to grant some number of badges to the top scores of the group defined by the number the input, or they may decide to grant badges to anyone who may achieve a score past the provided scoring threshold. &lt;br /&gt;
&lt;br /&gt;
[[File: EditAssignmentBadges.png]]&lt;br /&gt;
Figure 3: Assignment Badge Settings&lt;br /&gt;
&lt;br /&gt;
Like assignments, courses also need to have some settings to configure badges. In Figure 4, instructors may automatically grant badges for students based on mean scores of multiple assignments throughout the course. First the instructor must check all of the assignments they would like to include in the mean then they must select a scoring strategy. Like the previous figure, they may choose between granting a badge to the top number of participants based on instructor input, or they may set a threshold on a mean score and any student who has achieved a score past the mean will be granted a badge. &lt;br /&gt;
&lt;br /&gt;
[[File: BadgeCourseOptions.png]]&lt;br /&gt;
Figure 4: Edit Course&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102250</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102250"/>
		<updated>2016-04-12T03:04:15Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* System Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza. Instructor can create badges using this service and assign to students.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
===System Requirements===&lt;br /&gt;
The system requirements focuses on adding a 'badging' functionality in Expertiza. This feature allows instructors to assign badges to students based on their performance and accomplishments. Badges are of types - course-level and assignment-level. Badges can be pre-selected while creating an assignment and automatically triggered when student finished the assignment or assignment is closed. Badges can also be awarded manually by instructor to an individual or a team. An instructor can also create new badges anytime and award to students. A leaderboard gives an account of standing of students in terms of badges earned. In order to implement a badging system, a third party badge manager will be utilized called Credly. Credly provides a way for users to accumulate and display badges they earn in a centralized way. By utilizing Credly, the development of the actual badges and badge management can be abstracted away from the project.&lt;br /&gt;
&lt;br /&gt;
The testing of these requirements will use Rspec testing framework for all non-user interface related modifications. All user-interface modifications resulting from the user requirements will be tested manually.&lt;br /&gt;
&lt;br /&gt;
===Use Case===&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
&lt;br /&gt;
[[File:Use_case.PNG]]&lt;br /&gt;
&lt;br /&gt;
====Use Case Scenarios====&lt;br /&gt;
* '''Student Views Leaderboard'''&lt;br /&gt;
** Actor: Student&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Mouse over Home&lt;br /&gt;
**# Select Leaderboard &lt;br /&gt;
* '''Instructor Views Assignment Leaderboard'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select Assignments&lt;br /&gt;
**# Select View Badges on assignment&lt;br /&gt;
* '''Instructor Edits Assignment Badges'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select Assignments&lt;br /&gt;
**# Select Edit Assignments&lt;br /&gt;
**# Select Badges tab&lt;br /&gt;
**# Check enable badges&lt;br /&gt;
**# Check Score Threshold&lt;br /&gt;
**# Enter 95.5 as scoring threshold&lt;br /&gt;
**# Select Save&lt;br /&gt;
* '''Instructor Creates Course Badges'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select LeaderBoard&lt;br /&gt;
**# Select Award Badges&lt;br /&gt;
**# Select Create new badge&lt;br /&gt;
**# Create new badge using Credly&lt;br /&gt;
**# Select Save&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
*Create db table to store the participants with badges.&lt;br /&gt;
*Write code for calling the service and calculating/identifying badges based on the scores of students on all assignments.&lt;br /&gt;
*Add badge specification to course details and assignment details page for the instructor to specify the badges.&lt;br /&gt;
*Create views for both students and instructors. Students should be able to view their badges from different courses and instructors should be able to see the badges awarded/earned for their class.&lt;br /&gt;
*Display a subset of the badge holders on the leaderboard page. Also, student can view badges of other students in the course.&lt;br /&gt;
*Criteria to be followed for awarding badges:&lt;br /&gt;
#Top scores for an assignment. (configured at assignment page)&lt;br /&gt;
#All scores more than a threshold for an assignment. (configured at assignment page)&lt;br /&gt;
#Mean score of selected assignments being greater than threshold. (configured at course page)&lt;br /&gt;
#Top mean score of selected assignments. (configured at course page)&lt;br /&gt;
#Discretionary merit badges for projects that exceed expectations.&lt;br /&gt;
&lt;br /&gt;
===Files Identified===&lt;br /&gt;
*Modified files:&lt;br /&gt;
**app/controllers/student_task_controller.rb&lt;br /&gt;
**app/controllers/users_controller.rb&lt;br /&gt;
**app/models/user.rb&lt;br /&gt;
**app/views/leaderboard/index.html.erb&lt;br /&gt;
**app/views/leaderboard/_top3LeaderBoards.html.erb&lt;br /&gt;
**app/views/leaderboard/_achievementLeaderBoards.html.erb&lt;br /&gt;
**app/views/course/edit.html.erb&lt;br /&gt;
**config/routes.rb&lt;br /&gt;
&lt;br /&gt;
*Newly added files:&lt;br /&gt;
**app/models/badges.rb&lt;br /&gt;
**app/models/badge_groups.rb&lt;br /&gt;
**app/controllers/badges_controller.rb&lt;br /&gt;
**app/controllers/badge_groups_controller.rb&lt;br /&gt;
**app/views/users/credly_register.html.erb&lt;br /&gt;
**app/views/assignments/edit/_badges_configuration.html.erb&lt;br /&gt;
**app/views/badges/&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From the above rubrics, we decided to use Credly as our web service for badging system.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project.&lt;br /&gt;
&lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_user_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Referenced from badges table&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:badging_class_diagram.png]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
The Expertiza badging system will largely be driven by academic achievement from students. By using student’s scores as a way to provide badges it will be easy to automate the badge reward system upon closing an assignment. For instance, an instructor may decide to reward badges to the top 3 scores on an assignment so once the assignment closes those students will automatically be given those badges. &lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must turn on badging for their assignment upon creating or editing an assignment. When turning on the badging system the instructor may specify how many badges will be distributed, or choose to distribute them based off of a scoring threshold that students must achieve. &lt;br /&gt;
&lt;br /&gt;
Following the completion of an assignment an instructor may view the awarded badges on the assignment page. A student will be able to view their earned badges on their homepage categorized by course and assignment. &lt;br /&gt;
&lt;br /&gt;
The layout of each page will match with the currently existing design standards in Expertiza we will continue to use the header and will use headings and links much like other pages. Figure 1 below shows what the leaderboard may look like from a student perspective. Each course the student has participated in will be displayed on the page and by clicking the “Show Badges” the page will generate a list of each of the participants sorted by the number of badges they have earned. In order to display the badges the application will make a call to Credly to query about student badges.&lt;br /&gt;
&lt;br /&gt;
[[File: StudentLeaderboard.png]]&lt;br /&gt;
Figure 1: Student Leaderboard&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next figures are all from the perspective of an inspector or admin. In Figure 3 below an instructor may view the badges earned for a given assignment or course in which they own. They will get to his page by clicking a badges button from either the assignments or courses page. The title of the page will be the name of either the course of assignment. Like the previous figure, by clicking show badges the list of course participants will appear sorted by the number of badges they have earned. Another link, “Award Badges” will be used to manually grant a badge. When an instructor or admin clicks on the link, they will be directed to the credly page in order to grant the badge to the student.  &lt;br /&gt;
&lt;br /&gt;
[[File: InstructorAssignment.png]]&lt;br /&gt;
Figure 2: Instructor assignment / course badge view&lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must first enable them for the assignment. The badges will be enabled by default. The figure below shows some of the settings associated with the badges system. Instructors may choose to automatically grant badges to students based off of their performance on the assignment. When editing or creating a new assignment they may come to the new badges tab and configure how they want the badges granted. Instructors may choose to grant some number of badges to the top scores of the group defined by the number the input, or they may decide to grant badges to anyone who may achieve a score past the provided scoring threshold. &lt;br /&gt;
&lt;br /&gt;
[[File: EditAssignmentBadges.png]]&lt;br /&gt;
Figure 3: Assignment Badge Settings&lt;br /&gt;
&lt;br /&gt;
Like assignments, courses also need to have some settings to configure badges. In Figure 4, instructors may automatically grant badges for students based on mean scores of multiple assignments throughout the course. First the instructor must check all of the assignments they would like to include in the mean then they must select a scoring strategy. Like the previous figure, they may choose between granting a badge to the top number of participants based on instructor input, or they may set a threshold on a mean score and any student who has achieved a score past the mean will be granted a badge. &lt;br /&gt;
&lt;br /&gt;
[[File: BadgeCourseOptions.png]]&lt;br /&gt;
Figure 4: Edit Course&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102249</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102249"/>
		<updated>2016-04-12T03:03:38Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* System Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza. Instructor can create badges using this service and assign to students.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
===System Requirements===&lt;br /&gt;
The system requirements focuses on adding a 'badging' functionality in Expertiza. This feature allows instructors to assign badges to students based on their performance and accomplishments. Badges are of types - course-level and assignment-level. Badges can be pre-selected while creating an assignment and automatically triggered when student finished the assignment or assignment is closed. Badges can also be awarded manually by instructor to an individual or a team. An instructor can also create badges anytime and award to students. A leaderboard gives an account of standing of students in terms of badges earned. In order to implement a badging system, a third party badge manager will be utilized called Credly. Credly provides a way for users to accumulate and display badges they earn in a centralized way. By utilizing Credly, the development of the actual badges and badge management can be abstracted away from the project.&lt;br /&gt;
&lt;br /&gt;
The testing of these requirements will use Rspec testing framework for all non-user interface related modifications. All user-interface modifications resulting from the user requirements will be tested manually.&lt;br /&gt;
&lt;br /&gt;
===Use Case===&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
&lt;br /&gt;
[[File:Use_case.PNG]]&lt;br /&gt;
&lt;br /&gt;
====Use Case Scenarios====&lt;br /&gt;
* '''Student Views Leaderboard'''&lt;br /&gt;
** Actor: Student&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Mouse over Home&lt;br /&gt;
**# Select Leaderboard &lt;br /&gt;
* '''Instructor Views Assignment Leaderboard'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select Assignments&lt;br /&gt;
**# Select View Badges on assignment&lt;br /&gt;
* '''Instructor Edits Assignment Badges'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select Assignments&lt;br /&gt;
**# Select Edit Assignments&lt;br /&gt;
**# Select Badges tab&lt;br /&gt;
**# Check enable badges&lt;br /&gt;
**# Check Score Threshold&lt;br /&gt;
**# Enter 95.5 as scoring threshold&lt;br /&gt;
**# Select Save&lt;br /&gt;
* '''Instructor Creates Course Badges'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select LeaderBoard&lt;br /&gt;
**# Select Award Badges&lt;br /&gt;
**# Select Create new badge&lt;br /&gt;
**# Create new badge using Credly&lt;br /&gt;
**# Select Save&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
*Create db table to store the participants with badges.&lt;br /&gt;
*Write code for calling the service and calculating/identifying badges based on the scores of students on all assignments.&lt;br /&gt;
*Add badge specification to course details and assignment details page for the instructor to specify the badges.&lt;br /&gt;
*Create views for both students and instructors. Students should be able to view their badges from different courses and instructors should be able to see the badges awarded/earned for their class.&lt;br /&gt;
*Display a subset of the badge holders on the leaderboard page. Also, student can view badges of other students in the course.&lt;br /&gt;
*Criteria to be followed for awarding badges:&lt;br /&gt;
#Top scores for an assignment. (configured at assignment page)&lt;br /&gt;
#All scores more than a threshold for an assignment. (configured at assignment page)&lt;br /&gt;
#Mean score of selected assignments being greater than threshold. (configured at course page)&lt;br /&gt;
#Top mean score of selected assignments. (configured at course page)&lt;br /&gt;
#Discretionary merit badges for projects that exceed expectations.&lt;br /&gt;
&lt;br /&gt;
===Files Identified===&lt;br /&gt;
*Modified files:&lt;br /&gt;
**app/controllers/student_task_controller.rb&lt;br /&gt;
**app/controllers/users_controller.rb&lt;br /&gt;
**app/models/user.rb&lt;br /&gt;
**app/views/leaderboard/index.html.erb&lt;br /&gt;
**app/views/leaderboard/_top3LeaderBoards.html.erb&lt;br /&gt;
**app/views/leaderboard/_achievementLeaderBoards.html.erb&lt;br /&gt;
**app/views/course/edit.html.erb&lt;br /&gt;
**config/routes.rb&lt;br /&gt;
&lt;br /&gt;
*Newly added files:&lt;br /&gt;
**app/models/badges.rb&lt;br /&gt;
**app/models/badge_groups.rb&lt;br /&gt;
**app/controllers/badges_controller.rb&lt;br /&gt;
**app/controllers/badge_groups_controller.rb&lt;br /&gt;
**app/views/users/credly_register.html.erb&lt;br /&gt;
**app/views/assignments/edit/_badges_configuration.html.erb&lt;br /&gt;
**app/views/badges/&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From the above rubrics, we decided to use Credly as our web service for badging system.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project.&lt;br /&gt;
&lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_user_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Referenced from badges table&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:badging_class_diagram.png]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
The Expertiza badging system will largely be driven by academic achievement from students. By using student’s scores as a way to provide badges it will be easy to automate the badge reward system upon closing an assignment. For instance, an instructor may decide to reward badges to the top 3 scores on an assignment so once the assignment closes those students will automatically be given those badges. &lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must turn on badging for their assignment upon creating or editing an assignment. When turning on the badging system the instructor may specify how many badges will be distributed, or choose to distribute them based off of a scoring threshold that students must achieve. &lt;br /&gt;
&lt;br /&gt;
Following the completion of an assignment an instructor may view the awarded badges on the assignment page. A student will be able to view their earned badges on their homepage categorized by course and assignment. &lt;br /&gt;
&lt;br /&gt;
The layout of each page will match with the currently existing design standards in Expertiza we will continue to use the header and will use headings and links much like other pages. Figure 1 below shows what the leaderboard may look like from a student perspective. Each course the student has participated in will be displayed on the page and by clicking the “Show Badges” the page will generate a list of each of the participants sorted by the number of badges they have earned. In order to display the badges the application will make a call to Credly to query about student badges.&lt;br /&gt;
&lt;br /&gt;
[[File: StudentLeaderboard.png]]&lt;br /&gt;
Figure 1: Student Leaderboard&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next figures are all from the perspective of an inspector or admin. In Figure 3 below an instructor may view the badges earned for a given assignment or course in which they own. They will get to his page by clicking a badges button from either the assignments or courses page. The title of the page will be the name of either the course of assignment. Like the previous figure, by clicking show badges the list of course participants will appear sorted by the number of badges they have earned. Another link, “Award Badges” will be used to manually grant a badge. When an instructor or admin clicks on the link, they will be directed to the credly page in order to grant the badge to the student.  &lt;br /&gt;
&lt;br /&gt;
[[File: InstructorAssignment.png]]&lt;br /&gt;
Figure 2: Instructor assignment / course badge view&lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must first enable them for the assignment. The badges will be enabled by default. The figure below shows some of the settings associated with the badges system. Instructors may choose to automatically grant badges to students based off of their performance on the assignment. When editing or creating a new assignment they may come to the new badges tab and configure how they want the badges granted. Instructors may choose to grant some number of badges to the top scores of the group defined by the number the input, or they may decide to grant badges to anyone who may achieve a score past the provided scoring threshold. &lt;br /&gt;
&lt;br /&gt;
[[File: EditAssignmentBadges.png]]&lt;br /&gt;
Figure 3: Assignment Badge Settings&lt;br /&gt;
&lt;br /&gt;
Like assignments, courses also need to have some settings to configure badges. In Figure 4, instructors may automatically grant badges for students based on mean scores of multiple assignments throughout the course. First the instructor must check all of the assignments they would like to include in the mean then they must select a scoring strategy. Like the previous figure, they may choose between granting a badge to the top number of participants based on instructor input, or they may set a threshold on a mean score and any student who has achieved a score past the mean will be granted a badge. &lt;br /&gt;
&lt;br /&gt;
[[File: BadgeCourseOptions.png]]&lt;br /&gt;
Figure 4: Edit Course&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102243</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102243"/>
		<updated>2016-04-12T02:58:51Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Use Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza. Instructor can create badges using this service and assign to students.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
===System Requirements===&lt;br /&gt;
The system requirements focuses on adding a 'badging' functionality in Expertiza. This feature allows instructors to assign badges to students based on their performance and accomplishments. Badges are of types - course-level and assignment-level. Badges can be pre-selected while creating an assignment and automatically triggered when student finished the assignment or assignment is closed. Badges can also be awarded manually by instructor to an individual or a team. A leaderboard gives an account of standing of students in terms of badges earned. In order to implement a badging system, a third party badge manager will be utilized called Credly. Credly provides a way for users to accumulate and display badges they earn in a centralized way. By utilizing Credly, the development of the actual badges and badge management can be abstracted away from the project.&lt;br /&gt;
&lt;br /&gt;
The testing of these requirements will use Rspec testing framework for all non-user interface related modifications. All user-interface modifications resulting from the user requirements will be tested manually.&lt;br /&gt;
===Use Case===&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
&lt;br /&gt;
[[File:Use_case.PNG]]&lt;br /&gt;
&lt;br /&gt;
====Use Case Scenarios====&lt;br /&gt;
* '''Student Views Leaderboard'''&lt;br /&gt;
** Actor: Student&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Mouse over Home&lt;br /&gt;
**# Select Leaderboard &lt;br /&gt;
* '''Instructor Views Assignment Leaderboard'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select Assignments&lt;br /&gt;
**# Select View Badges on assignment&lt;br /&gt;
* '''Instructor Edits Assignment Badges'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select Assignments&lt;br /&gt;
**# Select Edit Assignments&lt;br /&gt;
**# Select Badges tab&lt;br /&gt;
**# Check enable badges&lt;br /&gt;
**# Check Score Threshold&lt;br /&gt;
**# Enter 95.5 as scoring threshold&lt;br /&gt;
**# Select Save&lt;br /&gt;
* '''Instructor Creates Course Badges'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select LeaderBoard&lt;br /&gt;
**# Select Award Badges&lt;br /&gt;
**# Select Create new badge&lt;br /&gt;
**# Create new badge using Credly&lt;br /&gt;
**# Select Save&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
*Create db table to store the participants with badges.&lt;br /&gt;
*Write code for calling the service and calculating/identifying badges based on the scores of students on all assignments.&lt;br /&gt;
*Add badge specification to course details and assignment details page for the instructor to specify the badges.&lt;br /&gt;
*Create views for both students and instructors. Students should be able to view their badges from different courses and instructors should be able to see the badges awarded/earned for their class.&lt;br /&gt;
*Display a subset of the badge holders on the leaderboard page. Also, student can view badges of other students in the course.&lt;br /&gt;
*Criteria to be followed for awarding badges:&lt;br /&gt;
#Top scores for an assignment. (configured at assignment page)&lt;br /&gt;
#All scores more than a threshold for an assignment. (configured at assignment page)&lt;br /&gt;
#Mean score of selected assignments being greater than threshold. (configured at course page)&lt;br /&gt;
#Top mean score of selected assignments. (configured at course page)&lt;br /&gt;
#Discretionary merit badges for projects that exceed expectations.&lt;br /&gt;
&lt;br /&gt;
===Files Identified===&lt;br /&gt;
*Modified files:&lt;br /&gt;
**app/controllers/student_task_controller.rb&lt;br /&gt;
**app/controllers/users_controller.rb&lt;br /&gt;
**app/models/user.rb&lt;br /&gt;
**app/views/leaderboard/index.html.erb&lt;br /&gt;
**app/views/leaderboard/_top3LeaderBoards.html.erb&lt;br /&gt;
**app/views/leaderboard/_achievementLeaderBoards.html.erb&lt;br /&gt;
**app/views/course/edit.html.erb&lt;br /&gt;
**config/routes.rb&lt;br /&gt;
&lt;br /&gt;
*Newly added files:&lt;br /&gt;
**app/models/badges.rb&lt;br /&gt;
**app/models/badge_groups.rb&lt;br /&gt;
**app/controllers/badges_controller.rb&lt;br /&gt;
**app/controllers/badge_groups_controller.rb&lt;br /&gt;
**app/views/users/credly_register.html.erb&lt;br /&gt;
**app/views/assignments/edit/_badges_configuration.html.erb&lt;br /&gt;
**app/views/badges/&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From the above rubrics, we decided to use Credly as our web service for badging system.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project.&lt;br /&gt;
&lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_user_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Referenced from badges table&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:badging_class_diagram.png]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
The Expertiza badging system will largely be driven by academic achievement from students. By using student’s scores as a way to provide badges it will be easy to automate the badge reward system upon closing an assignment. For instance, an instructor may decide to reward badges to the top 3 scores on an assignment so once the assignment closes those students will automatically be given those badges. &lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must turn on badging for their assignment upon creating or editing an assignment. When turning on the badging system the instructor may specify how many badges will be distributed, or choose to distribute them based off of a scoring threshold that students must achieve. &lt;br /&gt;
&lt;br /&gt;
Following the completion of an assignment an instructor may view the awarded badges on the assignment page. A student will be able to view their earned badges on their homepage categorized by course and assignment. &lt;br /&gt;
&lt;br /&gt;
The layout of each page will match with the currently existing design standards in Expertiza we will continue to use the header and will use headings and links much like other pages. Figure 1 below shows what the leaderboard may look like from a student perspective. Each course the student has participated in will be displayed on the page and by clicking the “Show Badges” the page will generate a list of each of the participants sorted by the number of badges they have earned. In order to display the badges the application will make a call to Credly to query about student badges.&lt;br /&gt;
&lt;br /&gt;
[[File: StudentLeaderboard.png]]&lt;br /&gt;
Figure 1: Student Leaderboard&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next figures are all from the perspective of an inspector or admin. In Figure 3 below an instructor may view the badges earned for a given assignment or course in which they own. They will get to his page by clicking a badges button from either the assignments or courses page. The title of the page will be the name of either the course of assignment. Like the previous figure, by clicking show badges the list of course participants will appear sorted by the number of badges they have earned. Another link, “Award Badges” will be used to manually grant a badge. When an instructor or admin clicks on the link, they will be directed to the credly page in order to grant the badge to the student.  &lt;br /&gt;
&lt;br /&gt;
[[File: InstructorAssignment.png]]&lt;br /&gt;
Figure 2: Instructor assignment / course badge view&lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must first enable them for the assignment. The badges will be enabled by default. The figure below shows some of the settings associated with the badges system. Instructors may choose to automatically grant badges to students based off of their performance on the assignment. When editing or creating a new assignment they may come to the new badges tab and configure how they want the badges granted. Instructors may choose to grant some number of badges to the top scores of the group defined by the number the input, or they may decide to grant badges to anyone who may achieve a score past the provided scoring threshold. &lt;br /&gt;
&lt;br /&gt;
[[File: EditAssignmentBadges.png]]&lt;br /&gt;
Figure 3: Assignment Badge Settings&lt;br /&gt;
&lt;br /&gt;
Like assignments, courses also need to have some settings to configure badges. In Figure 4, instructors may automatically grant badges for students based on mean scores of multiple assignments throughout the course. First the instructor must check all of the assignments they would like to include in the mean then they must select a scoring strategy. Like the previous figure, they may choose between granting a badge to the top number of participants based on instructor input, or they may set a threshold on a mean score and any student who has achieved a score past the mean will be granted a badge. &lt;br /&gt;
&lt;br /&gt;
[[File: BadgeCourseOptions.png]]&lt;br /&gt;
Figure 4: Edit Course&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102237</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102237"/>
		<updated>2016-04-12T02:56:06Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza. Instructor can create badges using this service and assign to students.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
===System Requirements===&lt;br /&gt;
The system requirements focuses on adding a 'badging' functionality in Expertiza. This feature allows instructors to assign badges to students based on their performance and accomplishments. Badges are of types - course-level and assignment-level. Badges can be pre-selected while creating an assignment and automatically triggered when student finished the assignment or assignment is closed. Badges can also be awarded manually by instructor to an individual or a team. A leaderboard gives an account of standing of students in terms of badges earned. In order to implement a badging system, a third party badge manager will be utilized called Credly. Credly provides a way for users to accumulate and display badges they earn in a centralized way. By utilizing Credly, the development of the actual badges and badge management can be abstracted away from the project.&lt;br /&gt;
&lt;br /&gt;
The testing of these requirements will use Rspec testing framework for all non-user interface related modifications. All user-interface modifications resulting from the user requirements will be tested manually.&lt;br /&gt;
===Use Case===&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
&lt;br /&gt;
[[File:Use_case.PNG]]&lt;br /&gt;
&lt;br /&gt;
====Use Cases====&lt;br /&gt;
* '''Student Views Leaderboard'''&lt;br /&gt;
** Actor: Student&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Mouse over Home&lt;br /&gt;
**# Select Leaderboard &lt;br /&gt;
* '''Instructor Views Assignment Leaderboard'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select Assignments&lt;br /&gt;
**# Select View Badges on assignment&lt;br /&gt;
* '''Instructor Edits Assignment Badges'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select Assignments&lt;br /&gt;
**# Select Edit Assignments&lt;br /&gt;
**# Select Badges tab&lt;br /&gt;
**# Check enable badges&lt;br /&gt;
**# Check Score Threshold&lt;br /&gt;
**# Enter 95.5 as scoring threshold&lt;br /&gt;
**# Select Save&lt;br /&gt;
* '''Instructor Creates Course Badges'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select LeaderBoard&lt;br /&gt;
**# Select Award Badges&lt;br /&gt;
**# Select Create new badge&lt;br /&gt;
**# Create new badge using Credly&lt;br /&gt;
**# Select Save&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
*Create db table to store the participants with badges.&lt;br /&gt;
*Write code for calling the service and calculating/identifying badges based on the scores of students on all assignments.&lt;br /&gt;
*Add badge specification to course details and assignment details page for the instructor to specify the badges.&lt;br /&gt;
*Create views for both students and instructors. Students should be able to view their badges from different courses and instructors should be able to see the badges awarded/earned for their class.&lt;br /&gt;
*Display a subset of the badge holders on the leaderboard page. Also, student can view badges of other students in the course.&lt;br /&gt;
*Criteria to be followed for awarding badges:&lt;br /&gt;
#Top scores for an assignment. (configured at assignment page)&lt;br /&gt;
#All scores more than a threshold for an assignment. (configured at assignment page)&lt;br /&gt;
#Mean score of selected assignments being greater than threshold. (configured at course page)&lt;br /&gt;
#Top mean score of selected assignments. (configured at course page)&lt;br /&gt;
#Discretionary merit badges for projects that exceed expectations.&lt;br /&gt;
&lt;br /&gt;
===Files Identified===&lt;br /&gt;
*Modified files:&lt;br /&gt;
**app/controllers/student_task_controller.rb&lt;br /&gt;
**app/controllers/users_controller.rb&lt;br /&gt;
**app/models/user.rb&lt;br /&gt;
**app/views/leaderboard/index.html.erb&lt;br /&gt;
**app/views/leaderboard/_top3LeaderBoards.html.erb&lt;br /&gt;
**app/views/leaderboard/_achievementLeaderBoards.html.erb&lt;br /&gt;
**app/views/course/edit.html.erb&lt;br /&gt;
**config/routes.rb&lt;br /&gt;
&lt;br /&gt;
*Newly added files:&lt;br /&gt;
**app/models/badges.rb&lt;br /&gt;
**app/models/badge_groups.rb&lt;br /&gt;
**app/controllers/badges_controller.rb&lt;br /&gt;
**app/controllers/badge_groups_controller.rb&lt;br /&gt;
**app/views/users/credly_register.html.erb&lt;br /&gt;
**app/views/assignments/edit/_badges_configuration.html.erb&lt;br /&gt;
**app/views/badges/&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From the above rubrics, we decided to use Credly as our web service for badging system.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project.&lt;br /&gt;
&lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_user_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Referenced from badges table&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:badging_class_diagram.png]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
The Expertiza badging system will largely be driven by academic achievement from students. By using student’s scores as a way to provide badges it will be easy to automate the badge reward system upon closing an assignment. For instance, an instructor may decide to reward badges to the top 3 scores on an assignment so once the assignment closes those students will automatically be given those badges. &lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must turn on badging for their assignment upon creating or editing an assignment. When turning on the badging system the instructor may specify how many badges will be distributed, or choose to distribute them based off of a scoring threshold that students must achieve. &lt;br /&gt;
&lt;br /&gt;
Following the completion of an assignment an instructor may view the awarded badges on the assignment page. A student will be able to view their earned badges on their homepage categorized by course and assignment. &lt;br /&gt;
&lt;br /&gt;
The layout of each page will match with the currently existing design standards in Expertiza we will continue to use the header and will use headings and links much like other pages. Figure 1 below shows what the leaderboard may look like from a student perspective. Each course the student has participated in will be displayed on the page and by clicking the “Show Badges” the page will generate a list of each of the participants sorted by the number of badges they have earned. In order to display the badges the application will make a call to Credly to query about student badges.&lt;br /&gt;
&lt;br /&gt;
[[File: StudentLeaderboard.png]]&lt;br /&gt;
Figure 1: Student Leaderboard&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next figures are all from the perspective of an inspector or admin. In Figure 3 below an instructor may view the badges earned for a given assignment or course in which they own. They will get to his page by clicking a badges button from either the assignments or courses page. The title of the page will be the name of either the course of assignment. Like the previous figure, by clicking show badges the list of course participants will appear sorted by the number of badges they have earned. Another link, “Award Badges” will be used to manually grant a badge. When an instructor or admin clicks on the link, they will be directed to the credly page in order to grant the badge to the student.  &lt;br /&gt;
&lt;br /&gt;
[[File: InstructorAssignment.png]]&lt;br /&gt;
Figure 2: Instructor assignment / course badge view&lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must first enable them for the assignment. The badges will be enabled by default. The figure below shows some of the settings associated with the badges system. Instructors may choose to automatically grant badges to students based off of their performance on the assignment. When editing or creating a new assignment they may come to the new badges tab and configure how they want the badges granted. Instructors may choose to grant some number of badges to the top scores of the group defined by the number the input, or they may decide to grant badges to anyone who may achieve a score past the provided scoring threshold. &lt;br /&gt;
&lt;br /&gt;
[[File: EditAssignmentBadges.png]]&lt;br /&gt;
Figure 3: Assignment Badge Settings&lt;br /&gt;
&lt;br /&gt;
Like assignments, courses also need to have some settings to configure badges. In Figure 4, instructors may automatically grant badges for students based on mean scores of multiple assignments throughout the course. First the instructor must check all of the assignments they would like to include in the mean then they must select a scoring strategy. Like the previous figure, they may choose between granting a badge to the top number of participants based on instructor input, or they may set a threshold on a mean score and any student who has achieved a score past the mean will be granted a badge. &lt;br /&gt;
&lt;br /&gt;
[[File: BadgeCourseOptions.png]]&lt;br /&gt;
Figure 4: Edit Course&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102155</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102155"/>
		<updated>2016-04-11T22:31:03Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Mockups */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
===System Requirements===&lt;br /&gt;
The system requirements focuses on adding a 'badging' functionality in Expertiza. This feature allows instructors to assign badges to students based on their performance and accomplishments. Badges are of types - course-level and assignment-level. Badges can be pre-selected while creating an assignment and automatically triggered when student finished the assignment or assignment is closed. Badges can also be awarded manually by instructor to an individual or a team. A leaderboard gives an account of standing of students in terms of badges earned. In order to implement a badging system, a third party badge manager will be utilized called Credly. Credly provides a way for users to accumulate and display badges they earn in a centralized way. By utilizing Credly, the development of the actual badges and badge management can be abstracted away from the project.&lt;br /&gt;
&lt;br /&gt;
The testing of these requirements will use Rspec testing framework for all non-user interface related modifications. All user-interface modifications resulting from the user requirements will be tested manually.&lt;br /&gt;
===Use Case===&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
&lt;br /&gt;
[[File:Use_case.PNG]]&lt;br /&gt;
&lt;br /&gt;
====Use Cases====&lt;br /&gt;
* '''Student Views Leaderboard'''&lt;br /&gt;
** Actor: Student&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Mouse over Home&lt;br /&gt;
**# Select Leaderboard &lt;br /&gt;
* '''Instructor Views Assignment Leaderboard'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select Assignments&lt;br /&gt;
**# Select View Badges on assignment&lt;br /&gt;
* '''Instructor Edits Assignment Badges'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select Assignments&lt;br /&gt;
**# Select Edit Assignments&lt;br /&gt;
**# Select Badges tab&lt;br /&gt;
**# Check enable badges&lt;br /&gt;
* '''Instructor Creates Course Badges'''&lt;br /&gt;
** Actor: Instructor&lt;br /&gt;
** Other Participants: None&lt;br /&gt;
** Primary Sequence:&lt;br /&gt;
**# Log into Expertiza&lt;br /&gt;
**# Select Courses&lt;br /&gt;
**# Select Edit Badges&lt;br /&gt;
**# Check assignments&lt;br /&gt;
**# Check Score Threshold&lt;br /&gt;
**# Enter 95.5 as scoring threshold&lt;br /&gt;
**# Select Submit&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
*Create db table to store the participants with badges.&lt;br /&gt;
*Write code for calling the service and calculating/identifying badges based on the scores of students on all assignments.&lt;br /&gt;
*Add badge specification to course details and assignment details page for the instructor to specify the badges.&lt;br /&gt;
*Create views for both students and instructors. Students should be able to view their badges from different courses and instructors should be able to see the badges awarded/earned for their class.&lt;br /&gt;
*Display a subset of the badge holders on the leaderboard page. Also, student can view badges of other students in the course.&lt;br /&gt;
*Criteria to be followed for awarding badges:&lt;br /&gt;
#Top scores for an assignment. (configured at assignment page)&lt;br /&gt;
#All scores more than a threshold for an assignment. (configured at assignment page)&lt;br /&gt;
#Mean score of selected assignments being greater than threshold. (configured at course page)&lt;br /&gt;
#Top mean score of selected assignments. (configured at course page)&lt;br /&gt;
#Discretionary merit badges for projects that exceed expectations.&lt;br /&gt;
&lt;br /&gt;
===Files Identified===&lt;br /&gt;
Associated files goes here.&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From the above rubrics, we decided to use Credly as our web service for badging system.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project.&lt;br /&gt;
&lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_user_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Referenced from badges table&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:Cap1.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
The Expertiza badging system will largely be driven by academic achievement from students. By using student’s scores as a way to provide badges it will be easy to automate the badge reward system upon closing an assignment. For instance, an instructor may decide to reward badges to the top 3 scores on an assignment so once the assignment closes those students will automatically be given those badges. &lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must turn on badging for their assignment upon creating or editing an assignment. When turning on the badging system the instructor may specify how many badges will be distributed, or choose to distribute them based off of a scoring threshold that students must achieve. &lt;br /&gt;
&lt;br /&gt;
Following the completion of an assignment an instructor may view the awarded badges on the assignment page. A student will be able to view their earned badges on their homepage categorized by course and assignment. &lt;br /&gt;
&lt;br /&gt;
The layout of each page will match with the currently existing design standards in Expertiza we will continue to use the header and will use headings and links much like other pages. Figure 1 below shows what the leaderboard may look like from a student perspective. Each course the student has participated in will be displayed on the page and by clicking the “Show Badges” the page will generate a list of each of the participants sorted by the number of badges they have earned. In order to display the badges the application will make a call to Credly to query about student badges.&lt;br /&gt;
&lt;br /&gt;
[[File: StudentLeaderboard.png]]&lt;br /&gt;
Figure 1: Student Leaderboard&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next figures are all from the perspective of an inspector or admin. In Figure 3 below an instructor may view the badges earned for a given assignment or course in which they own. They will get to his page by clicking a badges button from either the assignments or courses page. The title of the page will be the name of either the course of assignment. Like the previous figure, by clicking show badges the list of course participants will appear sorted by the number of badges they have earned. Another link, “Award Badges” will be used to manually grant a badge. When an instructor or admin clicks on the link, they will be directed to the credly page in order to grant the badge to the student.  &lt;br /&gt;
&lt;br /&gt;
[[File: InstructorAssignment.png]]&lt;br /&gt;
Figure 2: Instructor assignment / course badge view&lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must first enable them for the assignment. The badges will be enabled by default. The figure below shows some of the settings associated with the badges system. Instructors may choose to automatically grant badges to students based off of their performance on the assignment. When editing or creating a new assignment they may come to the new badges tab and configure how they want the badges granted. Instructors may choose to grant some number of badges to the top scores of the group defined by the number the input, or they may decide to grant badges to anyone who may achieve a score past the provided scoring threshold. &lt;br /&gt;
&lt;br /&gt;
[[File: EditAssignmentBadges.png]]&lt;br /&gt;
Figure 3: Assignment Badge Settings&lt;br /&gt;
&lt;br /&gt;
Like assignments, courses also need to have some settings to configure badges. In Figure 4, instructors may automatically grant badges for students based on mean scores of multiple assignments throughout the course. First the instructor must check all of the assignments they would like to include in the mean then they must select a scoring strategy. Like the previous figure, they may choose between granting a badge to the top number of participants based on instructor input, or they may set a threshold on a mean score and any student who has achieved a score past the mean will be granted a badge. &lt;br /&gt;
&lt;br /&gt;
[[File: BadgeCourseOptions.png]]&lt;br /&gt;
Figure 4: Edit Course&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102128</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102128"/>
		<updated>2016-04-11T21:34:45Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
===System Requirements===&lt;br /&gt;
The system requirements focuses on adding a 'badging' functionality in Expertiza. This feature allows instructors to assign badges to students based on their performance and accomplishments. Badges are of types - course-level and assignment-level. Badges can be pre-selected while creating an assignment and automatically triggered when student finished the assignment or assignment is closed. Badges can also be awarded manually by instructor to an individual or a team. A leaderboard gives an account of standing of students in terms of badges earned. In order to implement a badging system, a third party badge manager will be utilized called Credly. Credly provides a way for users to accumulate and display badges they earn in a centralized way. By utilizing Credly, the development of the actual badges and badge management can be abstracted away from the project.&lt;br /&gt;
&lt;br /&gt;
The testing of these requirements will use Rspec testing framework for all non-user interface related modifications. All user-interface modifications resulting from the user requirements will be tested manually.&lt;br /&gt;
===Use Case===&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
&lt;br /&gt;
[[File:Use_case.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
*Create db table to store the participants with badges.&lt;br /&gt;
*Write code for calling the service and calculating/identifying badges based on the scores of students on all assignments.&lt;br /&gt;
*Add badge specification to course details and assignment details page for the instructor to specify the badges.&lt;br /&gt;
*Create views for both students and instructors. Students should be able to view their badges from different courses and instructors should be able to see the badges awarded/earned for their class.&lt;br /&gt;
*Display a subset of the badge holders on the leaderboard page. Also, student can view badges of other students in the course.&lt;br /&gt;
*Criteria to be followed for awarding badges:&lt;br /&gt;
#Top scores for an assignment. (configured at assignment page)&lt;br /&gt;
#All scores more than a threshold for an assignment. (configured at assignment page)&lt;br /&gt;
#Mean score of selected assignments being greater than threshold. (configured at course page)&lt;br /&gt;
#Top mean score of selected assignments. (configured at course page)&lt;br /&gt;
#Discretionary merit badges for projects that exceed expectations.&lt;br /&gt;
&lt;br /&gt;
===Files Identified===&lt;br /&gt;
Associated files goes here.&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From the above rubrics, we decided to use Credly as our web service for badging system.&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
The Expertiza badging system will largely be driven by academic achievement from students. By using student’s scores as a way to provide badges it will be easy to automate the badge reward system upon closing an assignment. For instance, an instructor may decide to reward badges to the top 3 scores on an assignment so once the assignment closes those students will automatically be given those badges. &lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must turn on badging for their assignment upon creating or editing an assignment. When turning on the badging system the instructor may specify how many badges will be distributed, or choose to distribute them based off of a scoring threshold that students must achieve. &lt;br /&gt;
&lt;br /&gt;
Following the completion of an assignment an instructor may view the awarded badges on the assignment page. A student will be able to view their earned badges on their homepage categorized by course and assignment. &lt;br /&gt;
. &lt;br /&gt;
The layout of each page will match with the currently existing design standards in Expertiza we will continue to use the header and will use headings and links much like other pages. Figure 1 below shows what the leaderboard may look like from a student perspective. Each course the student has participated in will be displayed on the page and by clicking the “Show Badges” the page will generate a list of each of the participants sorted by the number of badges they have earned. In order to display the badges the application will make a call to Credly to query about student badges.&lt;br /&gt;
&lt;br /&gt;
[[File: Badge_student_leaderboard.png |600x454px]]&lt;br /&gt;
Figure 1: Student Leaderboard&lt;br /&gt;
&lt;br /&gt;
The next figures are all from the perspective of an inspector or admin. In Figure 3 below an instructor may view the badges earned for a given assignment or course in which they own. They will get to his page by clicking a badges button from either the assignments or courses page. The title of the page will be the name of either the course of assignment. Like the previous figure, by clicking show badges the list of course participants will appear sorted by the number of badges they have earned. Another link, “Award Badges” will be used to manually grant a badge. When an instructor or admin clicks on the link, they will be directed to the credly page in order to grant the badge to the student.  &lt;br /&gt;
&lt;br /&gt;
[[File: example.jpg]]&lt;br /&gt;
Figure 2: Instructor assignment / course badge view&lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must first enable them for the assignment. The badges will be enabled by default. The figure below shows some of the settings associated with the badges system. Instructors may choose to automatically grant badges to students based off of their performance on the assignment. When editing or creating a new assignment they may come to the new badges tab and configure how they want the badges granted. Instructors may choose to grant some number of badges to the top scores of the group defined by the number the input, or they may decide to grant badges to anyone who may achieve a score past the provided scoring threshold. &lt;br /&gt;
&lt;br /&gt;
[[File: example.jpg]]&lt;br /&gt;
Figure 3: Assignment Badge Settings&lt;br /&gt;
&lt;br /&gt;
Like assignments, courses also need to have some settings to configure badges. In Figure 4, instructors may automatically grant badges for students based on mean scores of multiple assignments throughout the course. First the instructor must check all of the assignments they would like to include in the mean then they must select a scoring strategy. Like the previous figure, they may choose between granting a badge to the top number of participants based on instructor input, or they may set a threshold on a mean score and any student who has achieved a score past the mean will be granted a badge. &lt;br /&gt;
&lt;br /&gt;
[[File: example.jpg]]&lt;br /&gt;
Figure 4: Edit Course&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project.&lt;br /&gt;
&lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_user_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Referenced from badges table&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:Cap1.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
&lt;br /&gt;
Mockup goes here&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102126</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102126"/>
		<updated>2016-04-11T21:33:10Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
===System Requirements===&lt;br /&gt;
The system requirements focuses on adding a 'badging' functionality in Expertiza. This feature allows instructors to assign badges to students based on their performance and accomplishments. Badges are of types - course-level and assignment-level. Badges can be pre-selected while creating an assignment and automatically triggered when student finished the assignment or assignment is closed. Badges can also be awarded manually by instructor to an individual or a team. A leaderboard gives an account of standing of students in terms of badges earned. In order to implement a badging system, a third party badge manager will be utilized called Credly. Credly provides a way for users to accumulate and display badges they earn in a centralized way. By utilizing Credly, the development of the actual badges and badge management can be abstracted away from the project.&lt;br /&gt;
&lt;br /&gt;
The testing of these requirements will use Rspec testing framework for all non-user interface related modifications. All user-interface modifications resulting from the user requirements will be tested manually.&lt;br /&gt;
===Use Case===&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
&lt;br /&gt;
[[File:Use_case.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
*Create db table to store the participants with badges.&lt;br /&gt;
*Write code for calling the service and calculating/identifying badges based on the scores of students on all assignments.&lt;br /&gt;
*Add badge specification to course details and assignment details page for the instructor to specify the badges.&lt;br /&gt;
*Create views for both students and instructors. Students should be able to view their badges from different courses and instructors should be able to see the badges awarded/earned for their class.&lt;br /&gt;
*Display a subset of the badge holders on the leaderboard page. Also, student can view badges of other students in the course.&lt;br /&gt;
*Criteria to be followed for awarding badges:&lt;br /&gt;
#Top scores for an assignment. (configured at assignment page)&lt;br /&gt;
#All scores more than a threshold for an assignment. (configured at assignment page)&lt;br /&gt;
#Mean score of selected assignments being greater than threshold. (configured at course page)&lt;br /&gt;
#Top mean score of selected assignments. (configured at course page)&lt;br /&gt;
#Discretionary merit badges for projects that exceed expectations.&lt;br /&gt;
&lt;br /&gt;
===Files Identified===&lt;br /&gt;
Associated files goes here.&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From the above rubrics, we decided to use Credly as our web service for badging system.&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
The Expertiza badging system will largely be driven by academic achievement from students. By using student’s scores as a way to provide badges it will be easy to automate the badge reward system upon closing an assignment. For instance, an instructor may decide to reward badges to the top 3 scores on an assignment so once the assignment closes those students will automatically be given those badges. &lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must turn on badging for their assignment upon creating or editing an assignment. When turning on the badging system the instructor may specify how many badges will be distributed, or choose to distribute them based off of a scoring threshold that students must achieve. &lt;br /&gt;
&lt;br /&gt;
Following the completion of an assignment an instructor may view the awarded badges on the assignment page. A student will be able to view their earned badges on their homepage categorized by course and assignment. &lt;br /&gt;
&lt;br /&gt;
In order to implement a badging system, a third party badge manager will be utilized called Credly. Credly provides a way for users to accumulate and display badges they earn in a centralized way. By utilizing Credly, the development of the actual badges and badge management can be abstracted away from the project. &lt;br /&gt;
&lt;br /&gt;
The layout of each page will match with the currently existing design standards in Expertiza we will continue to use the header and will use headings and links much like other pages. Figure 1 below shows what the leaderboard may look like from a student perspective. Each course the student has participated in will be displayed on the page and by clicking the “Show Badges” the page will generate a list of each of the participants sorted by the number of badges they have earned. In order to display the badges the application will make a call to Credly to query about student badges.&lt;br /&gt;
&lt;br /&gt;
[[File: Badge_student_leaderboard.png]]&lt;br /&gt;
Figure 1: Student Leaderboard&lt;br /&gt;
&lt;br /&gt;
The next figures are all from the perspective of an inspector or admin. In Figure 3 below an instructor may view the badges earned for a given assignment or course in which they own. They will get to his page by clicking a badges button from either the assignments or courses page. The title of the page will be the name of either the course of assignment. Like the previous figure, by clicking show badges the list of course participants will appear sorted by the number of badges they have earned. Another link, “Award Badges” will be used to manually grant a badge. When an instructor or admin clicks on the link, they will be directed to the credly page in order to grant the badge to the student.  &lt;br /&gt;
&lt;br /&gt;
[[File: example.jpg]]&lt;br /&gt;
Figure 2: Instructor assignment / course badge view&lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must first enable them for the assignment. The badges will be enabled by default. The figure below shows some of the settings associated with the badges system. Instructors may choose to automatically grant badges to students based off of their performance on the assignment. When editing or creating a new assignment they may come to the new badges tab and configure how they want the badges granted. Instructors may choose to grant some number of badges to the top scores of the group defined by the number the input, or they may decide to grant badges to anyone who may achieve a score past the provided scoring threshold. &lt;br /&gt;
&lt;br /&gt;
[[File: example.jpg]]&lt;br /&gt;
Figure 3: Assignment Badge Settings&lt;br /&gt;
&lt;br /&gt;
Like assignments, courses also need to have some settings to configure badges. In Figure 4, instructors may automatically grant badges for students based on mean scores of multiple assignments throughout the course. First the instructor must check all of the assignments they would like to include in the mean then they must select a scoring strategy. Like the previous figure, they may choose between granting a badge to the top number of participants based on instructor input, or they may set a threshold on a mean score and any student who has achieved a score past the mean will be granted a badge. &lt;br /&gt;
&lt;br /&gt;
[[File: example.jpg]]&lt;br /&gt;
Figure 4: Edit Course&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project.&lt;br /&gt;
&lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_user_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Referenced from badges table&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:Cap1.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
&lt;br /&gt;
Mockup goes here&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102120</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102120"/>
		<updated>2016-04-11T21:28:07Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
===System Requirements===&lt;br /&gt;
The system requirements focuses on adding a 'badging' functionality in Expertiza. This feature allows instructors to assign badges to students based on their performance and accomplishments. Badges are of types - course-level and assignment-level. Badges can be pre-selected while creating an assignment and automatically triggered when student finished the assignment or assignment is closed. Badges can also be awarded manually by instructor to an individual or a team. A leaderboard gives an account of standing of students in terms of badges earned. In order to implement a badging system, a third party badge manager will be utilized called Credly. Credly provides a way for users to accumulate and display badges they earn in a centralized way. By utilizing Credly, the development of the actual badges and badge management can be abstracted away from the project.&lt;br /&gt;
&lt;br /&gt;
The testing of these requirements will use Rspec testing framework for all non-user interface related modifications. All user-interface modifications resulting from the user requirements will be tested manually.&lt;br /&gt;
===Use Case===&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
&lt;br /&gt;
[[File:Use_case.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
*Create db table to store the participants with badges.&lt;br /&gt;
*Write code for calling the service and calculating/identifying badges based on the scores of students on all assignments.&lt;br /&gt;
*Add badge specification to course details and assignment details page for the instructor to specify the badges.&lt;br /&gt;
*Create views for both students and instructors. Students should be able to view their badges from different courses and instructors should be able to see the badges awarded/earned for their class.&lt;br /&gt;
*Display a subset of the badge holders on the leaderboard page. Also, student can view badges of other students in the course.&lt;br /&gt;
*Criteria to be followed for awarding badges:&lt;br /&gt;
#Top scores for an assignment. (configured at assignment page)&lt;br /&gt;
#All scores more than a threshold for an assignment. (configured at assignment page)&lt;br /&gt;
#Mean score of selected assignments being greater than threshold. (configured at course page)&lt;br /&gt;
#Top mean score of selected assignments. (configured at course page)&lt;br /&gt;
#Discretionary merit badges for projects that exceed expectations.&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From the above rubrics, we decided to use Credly as our web service for badging system.&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
The Expertiza badging system will largely be driven by academic achievement from students. By using student’s scores as a way to provide badges it will be easy to automate the badge reward system upon closing an assignment. For instance, an instructor may decide to reward badges to the top 3 scores on an assignment so once the assignment closes those students will automatically be given those badges. &lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must turn on badging for their assignment upon creating or editing an assignment. When turning on the badging system the instructor may specify how many badges will be distributed, or choose to distribute them based off of a scoring threshold that students must achieve. &lt;br /&gt;
&lt;br /&gt;
Following the completion of an assignment an instructor may view the awarded badges on the assignment page. A student will be able to view their earned badges on their homepage categorized by course and assignment. &lt;br /&gt;
&lt;br /&gt;
In order to implement a badging system, a third party badge manager will be utilized called Credly. Credly provides a way for users to accumulate and display badges they earn in a centralized way. By utilizing Credly, the development of the actual badges and badge management can be abstracted away from the project. &lt;br /&gt;
&lt;br /&gt;
The layout of each page will match with the currently existing design standards in Expertiza we will continue to use the header and will use headings and links much like other pages. Figure 1 below shows what the leaderboard may look like from a student perspective. Each course the student has participated in will be displayed on the page and by clicking the “Show Badges” the page will generate a list of each of the participants sorted by the number of badges they have earned. In order to display the badges the application will make a call to Credly to query about student badges.&lt;br /&gt;
&lt;br /&gt;
[[File: example.jpg]]&lt;br /&gt;
Figure 1: Student Leaderboard&lt;br /&gt;
&lt;br /&gt;
The next figures are all from the perspective of an inspector or admin. In Figure 3 below an instructor may view the badges earned for a given assignment or course in which they own. They will get to his page by clicking a badges button from either the assignments or courses page. The title of the page will be the name of either the course of assignment. Like the previous figure, by clicking show badges the list of course participants will appear sorted by the number of badges they have earned. Another link, “Award Badges” will be used to manually grant a badge. When an instructor or admin clicks on the link, they will be directed to the credly page in order to grant the badge to the student.  &lt;br /&gt;
&lt;br /&gt;
[[File: example.jpg]]&lt;br /&gt;
Figure 2: Instructor assignment / course badge view&lt;br /&gt;
&lt;br /&gt;
In order to use badges for an assignment, an instructor must first enable them for the assignment. The badges will be enabled by default. The figure below shows some of the settings associated with the badges system. Instructors may choose to automatically grant badges to students based off of their performance on the assignment. When editing or creating a new assignment they may come to the new badges tab and configure how they want the badges granted. Instructors may choose to grant some number of badges to the top scores of the group defined by the number the input, or they may decide to grant badges to anyone who may achieve a score past the provided scoring threshold. &lt;br /&gt;
&lt;br /&gt;
[[File: example.jpg]]&lt;br /&gt;
Figure 3: Assignment Badge Settings&lt;br /&gt;
&lt;br /&gt;
Like assignments, courses also need to have some settings to configure badges. In Figure 4, instructors may automatically grant badges for students based on mean scores of multiple assignments throughout the course. First the instructor must check all of the assignments they would like to include in the mean then they must select a scoring strategy. Like the previous figure, they may choose between granting a badge to the top number of participants based on instructor input, or they may set a threshold on a mean score and any student who has achieved a score past the mean will be granted a badge. &lt;br /&gt;
&lt;br /&gt;
[[File: example.jpg]]&lt;br /&gt;
Figure 4: Edit Course&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project.&lt;br /&gt;
&lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_user_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Referenced from badges table&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:Cap1.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
&lt;br /&gt;
Mockup goes here&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102113</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102113"/>
		<updated>2016-04-11T21:09:50Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Object Oriented Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
===Use Case===&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
&lt;br /&gt;
[[File:Use_case.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
*Create db table to store the participants with badges.&lt;br /&gt;
*Write code for calling the service and calculating/identifying badges based on the scores of students on all assignments.&lt;br /&gt;
*Add badge specification to course details and assignment details page for the instructor to specify the badges.&lt;br /&gt;
*Create views for both students and instructors. Students should be able to view their badges from different courses and instructors should be able to see the badges awarded/earned for their class.&lt;br /&gt;
*Display a subset of the badge holders on the leaderboard page. Also, student can view badges of other students in the course.&lt;br /&gt;
*Criteria to be followed for awarding badges:&lt;br /&gt;
#Top scores for an assignment. (configured at assignment page)&lt;br /&gt;
#All scores more than a threshold for an assignment. (configured at assignment page)&lt;br /&gt;
#Mean score of selected assignments being greater than threshold. (configured at course page)&lt;br /&gt;
#Top mean score of selected assignments. (configured at course page)&lt;br /&gt;
#Discretionary merit badges for projects that exceed expectations.&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From the above rubrics, we decided to use Credly as our web service for badging system.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project.&lt;br /&gt;
&lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_user_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Referenced from badges table&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:Cap1.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
&lt;br /&gt;
Mockup goes here&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Cap1.PNG&amp;diff=102112</id>
		<title>File:Cap1.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Cap1.PNG&amp;diff=102112"/>
		<updated>2016-04-11T21:09:15Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102111</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102111"/>
		<updated>2016-04-11T21:02:06Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Tasks To Do */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
===Use Case===&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
&lt;br /&gt;
[[File:Use_case.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
*Create db table to store the participants with badges.&lt;br /&gt;
*Write code for calling the service and calculating/identifying badges based on the scores of students on all assignments.&lt;br /&gt;
*Add badge specification to course details and assignment details page for the instructor to specify the badges.&lt;br /&gt;
*Create views for both students and instructors. Students should be able to view their badges from different courses and instructors should be able to see the badges awarded/earned for their class.&lt;br /&gt;
*Display a subset of the badge holders on the leaderboard page. Also, student can view badges of other students in the course.&lt;br /&gt;
*Criteria to be followed for awarding badges:&lt;br /&gt;
#Top scores for an assignment. (configured at assignment page)&lt;br /&gt;
#All scores more than a threshold for an assignment. (configured at assignment page)&lt;br /&gt;
#Mean score of selected assignments being greater than threshold. (configured at course page)&lt;br /&gt;
#Top mean score of selected assignments. (configured at course page)&lt;br /&gt;
#Discretionary merit badges for projects that exceed expectations.&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From the above rubrics, we decided to use Credly as our web service for badging system.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project.&lt;br /&gt;
&lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_user_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Referenced from badges table&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
&lt;br /&gt;
Mockup goes here&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102104</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102104"/>
		<updated>2016-04-11T20:48:38Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Database Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
===Use Case===&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
&lt;br /&gt;
[[File:Use_case.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From the above rubrics, we decided to use Credly as our web service for badging system.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project.&lt;br /&gt;
&lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_user_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Referenced from badges table&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
&lt;br /&gt;
Mockup goes here&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102103</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102103"/>
		<updated>2016-04-11T20:47:57Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Deciding External Web Service */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
===Use Case===&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
&lt;br /&gt;
[[File:Use_case.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From the above rubrics, we decided to use Credly as our web service for badging system.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project. &lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_user_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Referenced from badges table&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
&lt;br /&gt;
Mockup goes here&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102101</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102101"/>
		<updated>2016-04-11T20:46:30Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Use Case */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
===Use Case===&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
&lt;br /&gt;
[[File:Use_case.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project. &lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
&lt;br /&gt;
Mockup goes here&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102100</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102100"/>
		<updated>2016-04-11T20:46:11Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Use Case */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
==Use Case==&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
&lt;br /&gt;
[[File:Use_case.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project. &lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
&lt;br /&gt;
Mockup goes here&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102099</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102099"/>
		<updated>2016-04-11T20:45:47Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Use Case */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
==Use Case==&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
[[File:Use_case.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project. &lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
&lt;br /&gt;
Mockup goes here&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102095</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102095"/>
		<updated>2016-04-11T20:43:49Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
==Use Case==&lt;br /&gt;
The following simple illustration shows the use cases of the system.&lt;br /&gt;
[[File:use_case.jpg]]&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project. &lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
&lt;br /&gt;
Mockup goes here&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Use_case.PNG&amp;diff=102090</id>
		<title>File:Use case.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Use_case.PNG&amp;diff=102090"/>
		<updated>2016-04-11T20:42:12Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: Use case diag&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Use case diag&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102073</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102073"/>
		<updated>2016-04-11T20:10:54Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Object Oriented Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project. &lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
&lt;br /&gt;
Mockup goes here&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102072</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102072"/>
		<updated>2016-04-11T20:10:21Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Object Oriented Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project. &lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
[[Media:Capture.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
&lt;br /&gt;
Mockup goes here&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Capture.PNG&amp;diff=102069</id>
		<title>File:Capture.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Capture.PNG&amp;diff=102069"/>
		<updated>2016-04-11T20:08:47Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: uploaded a new version of &amp;amp;quot;File:Capture.PNG&amp;amp;quot;: UML diagram&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102046</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102046"/>
		<updated>2016-04-11T17:11:20Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
&lt;br /&gt;
===Tasks To Do===&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project. &lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
&lt;br /&gt;
Mockup goes here&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102045</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102045"/>
		<updated>2016-04-11T17:04:14Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
&lt;br /&gt;
===Deciding External Web Service===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Factors !! Open Badges !! Credly !! Bestr&lt;br /&gt;
|-&lt;br /&gt;
| Native User Management || No || Yes. No need to store all records locally. || No&lt;br /&gt;
|-&lt;br /&gt;
| Extensive API Support || Yes. But many still in beta phase. || Yes. (Primary reason for choosing Credly) || No&lt;br /&gt;
|-&lt;br /&gt;
| Interactive Badge Builder SDK|| Yes. But still in beta phase. || Yes || Yes. But gives few options for cusromization.&lt;br /&gt;
|-&lt;br /&gt;
| Existing Integration with other systems || Few || Many || No&lt;br /&gt;
|-&lt;br /&gt;
| Monetary Costs || Free || Free tier as well as paid plans. || Paid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project. &lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
&lt;br /&gt;
Mockup goes here&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102044</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102044"/>
		<updated>2016-04-11T16:14:22Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project. &lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
&lt;br /&gt;
Mockup goes here&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102043</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102043"/>
		<updated>2016-04-11T16:03:48Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project. &lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
==Object Oriented Design==&lt;br /&gt;
As with most Ruby on Rails applications, this solution uses the Model-View-Controller&lt;br /&gt;
design pattern. The following diagram shows a workflow of the planned design along with the attributes and operations that are&lt;br /&gt;
relevant to the implementation of this solution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
&lt;br /&gt;
Mockup goes here&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102042</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102042"/>
		<updated>2016-04-11T15:55:31Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project. &lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Mockups==&lt;br /&gt;
&lt;br /&gt;
Mockup goes here&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102041</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102041"/>
		<updated>2016-04-11T15:48:56Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing online badging web service, Credly, and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project. &lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102040</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102040"/>
		<updated>2016-04-11T15:45:43Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Database Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital based badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing web service (probably Credly) and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
The following tables will be created to implement a solution for this project. &lt;br /&gt;
1. badges table - which stores badge_id and their descriptions.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table - which stores details about what badges are assignment to a user and related details.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups - which stores information about which badges should be assigned depending on the threshold score.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups - which stores details about the team badges.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# DRY Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102038</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102038"/>
		<updated>2016-04-11T15:01:52Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Database Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital based badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing web service (probably Credly) and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
1. badges table&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
2. badge_users table&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
3. badge_groups&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
4. assignment_groups&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102037</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102037"/>
		<updated>2016-04-11T15:01:15Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Database Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital based badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing web service (probably Credly) and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
# badges table&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| name || string || Description of the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
# badge_users table&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
# badge_groups&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|-&lt;br /&gt;
| threshold || int || Score required to award the badge&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
# assignment_groups&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| assignment_group_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| badge_group_id || int || Referenced from badge_groups table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102036</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102036"/>
		<updated>2016-04-11T14:54:22Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital based badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing web service (probably Credly) and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Database Design==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Column !! Type !! Comment&lt;br /&gt;
|-&lt;br /&gt;
| badge_id || int || Primary key. Auto-generated&lt;br /&gt;
|-&lt;br /&gt;
| user_id || int || Referenced from users table&lt;br /&gt;
|-&lt;br /&gt;
| course_id || int || Referenced from courses table&lt;br /&gt;
|-&lt;br /&gt;
| assignment_id || int || Referenced from assignments table&lt;br /&gt;
|-&lt;br /&gt;
| is_course_badge || boolean || Whether badge is a course-badge or individual-badge&lt;br /&gt;
|-&lt;br /&gt;
| strategy || string || Describes the strategy of awarding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102035</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102035"/>
		<updated>2016-04-11T14:11:55Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Design Pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital based badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing web service (probably Credly) and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
# MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
# Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102034</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102034"/>
		<updated>2016-04-11T14:11:37Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital based badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing web service (probably Credly) and integrate it with Expertiza.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
#1 MVC – The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
#2 Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Badging_System&amp;diff=102033</id>
		<title>Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Badging_System&amp;diff=102033"/>
		<updated>2016-04-11T14:00:12Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: moved Badging System to CSC/ECE 517 Spring 2016/Badging System&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[CSC/ECE 517 Spring 2016/Badging System]]&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102032</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102032"/>
		<updated>2016-04-11T14:00:12Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: moved Badging System to CSC/ECE 517 Spring 2016/Badging System&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====Introduction====&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital based badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing web service (probably Credly) and integrate it with Expertiza.&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102031</id>
		<title>Http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102031"/>
		<updated>2016-04-11T13:59:14Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: moved Http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE 517 Spring 2016/Badging System to Badging System&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Badging System]]&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102030</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102030"/>
		<updated>2016-04-11T13:59:14Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: moved Http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE 517 Spring 2016/Badging System to Badging System&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====Introduction====&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital based badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing web service (probably Credly) and integrate it with Expertiza.&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Dasoni&amp;diff=102029</id>
		<title>User:Dasoni</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Dasoni&amp;diff=102029"/>
		<updated>2016-04-11T13:58:41Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: moved User:Dasoni to Http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE 517 Spring 2016/Badging System&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE 517 Spring 2016/Badging System]]&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102028</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102028"/>
		<updated>2016-04-11T13:58:41Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: moved User:Dasoni to Http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE 517 Spring 2016/Badging System&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====Introduction====&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital based badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing web service (probably Credly) and integrate it with Expertiza.&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102027</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102027"/>
		<updated>2016-04-11T13:54:43Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====Introduction====&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital based badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing web service (probably Credly) and integrate it with Expertiza.&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102026</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102026"/>
		<updated>2016-04-11T13:54:27Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Introduction===&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital based badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing web service (probably Credly) and integrate it with Expertiza.&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102025</id>
		<title>CSC/ECE 517 Spring 2016/Badging System</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Badging_System&amp;diff=102025"/>
		<updated>2016-04-11T13:54:09Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: Created page with &amp;quot;===Introduction Much like physical badges in the army and youth scout troops, digital based badges are an assessment and credentialing mechanism that is housed and managed online...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Introduction&lt;br /&gt;
Much like physical badges in the army and youth scout troops, digital based badges are an assessment and credentialing mechanism that is housed and managed online. Badges are designed to make visible and validate learning in both formal and informal settings, and hold the potential to help transform where and how learning is valued. In other words, badges may be used in order to set goals and motivations for students and reward and may help to improve their academic scores. Badges can also be considered as a way to reward student’s success. Moreover, badges can be used by teachers for alternative assessment techniques.&lt;br /&gt;
&lt;br /&gt;
One request for the Expertiza system is to add a badging system as a way to measure student performance. Expertiza will take advantage of the motivations created from badges by awarding students with new badges based off providing a variety of factors within the Expertiza system. Some of these badges include: achieving a top percentage of scores in an assignment, achieving a high peer review score, performing well overall in a course and other manual accomplishments deemed necessary by the teaching staff for a course. Instead of implementing the whole badging system, we will call an existing web service (probably Credly) and integrate it with Expertiza.&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_different_question_types_from_quiz_feature&amp;diff=101602</id>
		<title>CSC/ECE 517 Spring 2016/Refactor different question types from quiz feature</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_different_question_types_from_quiz_feature&amp;diff=101602"/>
		<updated>2016-04-01T22:20:14Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1602 OSS assignment for Spring 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
====Background====&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. Expertiza has a quizzing feature which allow student authors to create quiz questions and test the peer reviewers. The idea behind this is, if a reviewer can answer the quiz questions which were created by the author correctly, we assume that the reviewer has read the artifact carefully enough and thereby we trust the peer-review.&lt;br /&gt;
&lt;br /&gt;
====Current Implementation and Problems====&lt;br /&gt;
* Following three different types of questions are supported in quizzing feature of Expertiza&lt;br /&gt;
# Multiple Choice Radio&lt;br /&gt;
# Multiple Choice Checkbox&lt;br /&gt;
# True/False&lt;br /&gt;
* The current implementation of Quizzing feature is not consistent with the current questions and questionnaires. Since Quiz questionnaire is one sub type of questionnaire, so it should follow the design of other type of questionnaires. But, the current implementation is inconsistent with other questionnaires.&lt;br /&gt;
* In order to create a quiz, the existing code is written in the views which has a series of if-then structures to implement the functionality of each different question type. This kind of implementation makes the code slower and violates the principles of MVC architecture.&lt;br /&gt;
* Current HTML code doesn't looks like source code.&lt;br /&gt;
* Code is repeated for different question types.&lt;br /&gt;
* Proper Ruby naming conventions are not followed&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* All logic moved to model. Four separate methods - &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;complete&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;view_completed_question&amp;lt;/tt&amp;gt; in order to generate the same HTML for each of the question types. We used polymorphism by declaring all these methods in &amp;lt;tt&amp;gt;QuizQuestion&amp;lt;/tt&amp;gt; which inherits from &amp;lt;tt&amp;gt;Question&amp;lt;/tt&amp;gt; and has sub-types &amp;lt;tt&amp;gt;MultipleChoiceRadio&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;MultipleChoiceCheckbox&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;TrueFalse&amp;lt;/tt&amp;gt;. &lt;br /&gt;
* When questionnaire author creates a quiz, &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt; is called. To call this on UI, you can login as a student, click 'create quiz' / 'edit quiz' on 'Your Works' page. The &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt; method is now called from &amp;lt;tt&amp;gt;/view/questionnaires/_quiz_question.html.erb&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When questions are viewed by the author or the instructor, &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt; method is called. To call this on UI, you can either login as a student, click 'view quiz' on 'Your works' page or login as an instructor, find an assignment with quizzing feature and click the icon 'view quiz questions'. The 'view_question_text' calls &amp;lt;tt&amp;gt;view/questionnaires/view.html.erb&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When the quiz takers tries to take the quiz, &amp;lt;tt&amp;gt;complete&amp;lt;/tt&amp;gt; is called. To call this on UI, you can login as a quiz taker, request a quiz to take on “Take quizzes” page, then click “begin”. This method is now called on &amp;lt;tt&amp;gt;view/student_quizzes/take_quiz&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* When the quiz taker finished taking a quiz and wants to view the quiz result again, &amp;lt;tt&amp;gt;view_completed_question&amp;lt;/tt&amp;gt; is called. To call this on UI, you can login as a quiz taker, find a finished quiz and click “view”. This method is called on &amp;lt;tt&amp;gt;view/student_quizzes/finished_quiz&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* Using polymorphism and DRY principles, code repetition has been virtually eliminated.&lt;br /&gt;
&lt;br /&gt;
== Refactoring &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt; method is called when the author of the quiz or the instructor views the quiz. The method is responsible for generating the HTML to display the question along with each of its choices. The correct choice(s) should be bolded. Prior to refactoring, this functionality was located in &amp;lt;tt&amp;gt;app/views/student_quizzes/review_questions.html.erb&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%questions = questionnaire.questions%&amp;gt;&lt;br /&gt;
      &amp;lt;% questions.each do |question| %&amp;gt;&lt;br /&gt;
        &amp;lt;b&amp;gt; &amp;lt;%= question.txt %&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
        &amp;lt;% question_type = question.get_formatted_question_type%&amp;gt;&lt;br /&gt;
        Question Type: &amp;lt;%= question_type %&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;% if question_type == 'True/False' %&amp;gt;&lt;br /&gt;
          Correct Answer: &amp;lt;%= (QuizQuestionChoice.where(question_id: question.id, iscorrect:1).first.txt) %&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
        &amp;lt;% elsif question_type == 'Multiple Choice - Radio' %&amp;gt;&lt;br /&gt;
          &amp;lt;% correct_answer = '' %&amp;gt;&lt;br /&gt;
          Answer Options:&amp;lt;br&amp;gt;&lt;br /&gt;
          &amp;lt;% QuizQuestionChoice.where(question_id: question.id).each do |choice| %&amp;gt;&lt;br /&gt;
            &amp;lt;% if choice.iscorrect == true  %&amp;gt;&lt;br /&gt;
              &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;B&amp;gt;&amp;lt;%= choice.txt %&amp;gt;&amp;lt;/B&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
              &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;%= choice.txt %&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
        &amp;lt;% elsif question_type == 'Multiple Choice - Checked' %&amp;gt;&lt;br /&gt;
          Answer Options:&amp;lt;br&amp;gt;&lt;br /&gt;
          &amp;lt;% QuizQuestionChoice.where(question_id: question.id).each do |choice| %&amp;gt;&lt;br /&gt;
            &amp;lt;% if choice.iscorrect == true  %&amp;gt;&lt;br /&gt;
              &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;B&amp;gt;&amp;lt;%= choice.txt %&amp;gt;&amp;lt;/B&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
              &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;%= choice.txt %&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&amp;lt;hr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This logic has been moved to &amp;lt;tt&amp;gt;app/models/quiz_question.rb&amp;lt;/tt&amp;gt;, so now the view simply needs to call the method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%questions = questionnaire.questions%&amp;gt;&lt;br /&gt;
      &amp;lt;%questions.each do |question| %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%if question.is_a? Question%&amp;gt;&lt;br /&gt;
          &amp;lt;%=question.view_question_text.html_safe%&amp;gt;&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
      &amp;lt;% end %&amp;gt;&amp;lt;hr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unit tests were added to &amp;lt;tt&amp;gt;spec/models/quiz_question_spec.rb&amp;lt;/tt&amp;gt; covering all three types of questions to ensure that the correct HTML is generated.&lt;br /&gt;
&lt;br /&gt;
== Refactoring &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt; method is called when the author creates or edits a quiz. It makes every element of the quiz editable. Prior to refactoring, the HTML was in &amp;lt;tt&amp;gt;app/views/questionnaires/_quiz_questionnaire.html.erb&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @questionnaire.type == 'QuizQuestionnaire' %&amp;gt;        &lt;br /&gt;
  &amp;lt;!--handle a questionnaire differently if it is a quiz--&amp;gt;&lt;br /&gt;
    &amp;lt;table id=&amp;quot;questions_table&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;% if $disp_flag != 1 %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;td align=left width=300&amp;gt;Questions:&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;%  if @questionnaire.type != 'QuizQuestionnaire' %&amp;gt;&amp;lt;td align=left&amp;gt;weight&amp;lt;/td&amp;gt;&amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;% for @question in @questionnaire.questions %&amp;gt;&lt;br /&gt;
          &amp;lt;% questionnum=@question.id %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;% if $disp_flag != 1 %&amp;gt;&lt;br /&gt;
            &amp;lt;td &amp;gt; &amp;lt;%= text_area &amp;quot;question[]&amp;quot;, 'txt', :cols=&amp;gt;100 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;%  @quiz_question_choices = QuizQuestionChoice.where(question_id: @question.id) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;% i=1 %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;% for @quiz_question_choice in @quiz_question_choices %&amp;gt;&lt;br /&gt;
          &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&lt;br /&gt;
            &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
              &amp;lt;% if @question.type==&amp;quot;MultipleChoiceCheckbox&amp;quot; %&amp;gt;&lt;br /&gt;
                  &amp;lt;%= hidden_field_tag(&amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceCheckbox][#{i}][iscorrect]&amp;quot;,'0') %&amp;gt;&lt;br /&gt;
                  &amp;lt;%= check_box_tag(&amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceCheckbox][#{i}][iscorrect]&amp;quot;,'1', @quiz_question_choice.iscorrect) %&amp;gt;&lt;br /&gt;
                  &amp;amp;nbsp;&amp;lt;%= text_field_tag &amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceCheckbox][#{i}][txt]&amp;quot;, @quiz_question_choice.txt, :size=&amp;gt;40 %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;%if @question.type==&amp;quot;MultipleChoiceRadio&amp;quot; %&amp;gt;&lt;br /&gt;
                &amp;lt;%= radio_button_tag(&amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceRadio][correctindex]&amp;quot;, &amp;quot;#{i}&amp;quot;, @quiz_question_choice.iscorrect)%&amp;gt;&lt;br /&gt;
                &amp;amp;nbsp;&amp;lt;%= text_field_tag &amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceRadio][#{i}][txt]&amp;quot;, @quiz_question_choice.txt, :size=&amp;gt;40 %&amp;gt;&lt;br /&gt;
              &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;%if @question.type==&amp;quot;TrueFalse&amp;quot; %&amp;gt;&lt;br /&gt;
                &amp;lt;% if @quiz_question_choice.txt==&amp;quot;True&amp;quot;%&amp;gt;&lt;br /&gt;
                  &amp;lt;%= radio_button_tag(&amp;quot;quiz_question_choices[#{questionnum}][TrueFalse][1][iscorrect]&amp;quot;, 'True', @quiz_question_choice.iscorrect) %&amp;gt;   True&lt;br /&gt;
                &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;% if @quiz_question_choice.txt==&amp;quot;False&amp;quot;%&amp;gt;&lt;br /&gt;
                    &amp;lt;%= radio_button_tag(&amp;quot;quiz_question_choices[#{questionnum}][TrueFalse][1][iscorrect]&amp;quot;, 'False', @quiz_question_choice.iscorrect) %&amp;gt;   False&lt;br /&gt;
                &amp;lt;%end%&amp;gt;&lt;br /&gt;
              &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;/tr&amp;gt;&lt;br /&gt;
          &amp;lt;% i+=1 %&amp;gt;&lt;br /&gt;
        &amp;lt;%end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/table&amp;gt; &lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After refactoring, the same file looked like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @questionnaire.type == 'QuizQuestionnaire' %&amp;gt;&lt;br /&gt;
  &amp;lt;!--handle a questionnaire differently if it is a quiz--&amp;gt;&lt;br /&gt;
    &amp;lt;table id=&amp;quot;questions_table&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;% if $disp_flag != 1 %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;td align=left width=300&amp;gt;Questions:&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;%  if @questionnaire.type != 'QuizQuestionnaire' %&amp;gt;&amp;lt;td align=left&amp;gt;weight&amp;lt;/td&amp;gt;&amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;% for @question in @questionnaire.questions %&amp;gt;&lt;br /&gt;
      &amp;lt;% i=1 %&amp;gt;&lt;br /&gt;
         &amp;lt;%= @question.edit(i) %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/table&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Refactoring &amp;lt;tt&amp;gt;complete&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
Logic is written in multiple_choice_checkbox model for multiple choice checkbox question type. Similarly, same process is followed for remaining question types. To begin a quiz, &amp;lt;tt&amp;gt;complete&amp;lt;/tt&amp;gt; is called from the model.&lt;br /&gt;
     @question = self&lt;br /&gt;
     html = &amp;quot;&amp;quot;&lt;br /&gt;
     html += label_tag(&amp;quot;#{question.id}&amp;quot;, question.txt) +&amp;quot;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;
     quiz_question_choices = QuizQuestionChoice.where(question_id: @question.id)&lt;br /&gt;
     quiz_question_choices.each do |choice|&lt;br /&gt;
       if answer==&amp;quot;view&amp;quot;&lt;br /&gt;
         html += check_box_tag (&amp;quot;#{question.id}[]&amp;quot;, &amp;quot;#{choice.txt}&amp;quot;, choice.iscorrect)&lt;br /&gt;
         html += label_tag(&amp;quot;#{choice.txt}&amp;quot;, choice.txt) + &amp;quot;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;
       end&lt;br /&gt;
       if answer==&amp;quot;take&amp;quot;&lt;br /&gt;
         html += check_box_tag (&amp;quot;#{question.id}[]&amp;quot;, &amp;quot;#{choice.txt}&amp;quot;)&lt;br /&gt;
         html += label_tag(&amp;quot;#{choice.txt}&amp;quot;, choice.txt) + &amp;quot;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;
       end&lt;br /&gt;
       html.html_safe&lt;br /&gt;
     end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
== Refactoring &amp;lt;tt&amp;gt;view_completed_question&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
The logic for viewing completed question and their answers is written in &amp;lt;tt&amp;gt;app/views/student_quizzes/finished_quiz.html.erb&amp;lt;/tt&amp;gt; using a redundant if-elsif structure as shown below. &lt;br /&gt;
 &amp;lt;% if question_type.eql? 'MultipleChoiceRadio' %&amp;gt;&lt;br /&gt;
    &amp;lt;% QuizQuestionChoice.where(question_id: question.id).each do |answer|  %&amp;gt;&lt;br /&gt;
      &amp;lt;% if(answer.iscorrect) %&amp;gt;&lt;br /&gt;
        &amp;lt;b&amp;gt;&amp;lt;%= p answer.txt  %&amp;gt;&amp;lt;/b&amp;gt; -- Correct &amp;lt;br&amp;gt;&lt;br /&gt;
      &amp;lt;%else%&amp;gt;&lt;br /&gt;
        &amp;lt;%= p answer.txt  %&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;br&amp;gt;&lt;br /&gt;
    &amp;lt;%user_answer=Answer.where(response_id: @response.id, question_id:  question.id).first%&amp;gt;&lt;br /&gt;
    Your answer is: &amp;lt;b&amp;gt;&amp;lt;%= user_answer.comments  %&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
    &amp;lt;%if user_answer.answer==1%&amp;gt;&lt;br /&gt;
      &amp;lt;img src=&amp;quot;/assets/Check-icon.png&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;%else%&amp;gt;&lt;br /&gt;
      &amp;lt;img src=&amp;quot;/assets/delete_icon.png&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;%end%&amp;gt;&lt;br /&gt;
    &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
    &amp;lt;% elsif question_type.eql? 'MultipleChoiceCheckbox' %&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;% elsif(question_type == 'TrueFalse') %&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
The &amp;lt;tt&amp;gt;app/views/student_quizzes/finished_quiz.html.erb&amp;lt;/tt&amp;gt; was refactored by removing the logic from the view and making it clean. We used a single construct which determines question type and answer type by calling view_completed_question method declared in quiz class as shown below.&lt;br /&gt;
 &amp;lt;%user_answer=Answer.where(response_id: @response.id, question_id:  question.id)%&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Question &amp;lt;%= i %&amp;gt;: &amp;lt;/b&amp;gt;&amp;lt;%= label_tag &amp;quot;#{question.id}&amp;quot;, question.txt %&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;%= question.view_completed_question(i,user_answer) %&amp;gt;&lt;br /&gt;
 &amp;lt;% i += 1 %&amp;gt;&lt;br /&gt;
Similarly, logic was written in models for each of the question types. Following code snippet shows &amp;lt;tt&amp;gt;view_completed_question&amp;lt;/tt&amp;gt; for true/false question type.&lt;br /&gt;
def view_completed_question(count, answer)&lt;br /&gt;
     @question = self&lt;br /&gt;
     html=&amp;quot;&amp;quot;&lt;br /&gt;
     html+= &amp;quot;Correct Answer is: &amp;lt;b&amp;gt;&amp;quot;&lt;br /&gt;
     html+= QuizQuestionChoice.where(question_id: @question.id,iscorrect: 1).first.txt&lt;br /&gt;
     html+= &amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&amp;quot;&lt;br /&gt;
     html+= &amp;quot;Your answer is: &amp;lt;b&amp;gt;&amp;quot;&lt;br /&gt;
     html+= answer.first.coments + &amp;quot;&amp;lt;/b&amp;gt;&amp;quot;&lt;br /&gt;
     if(answer.first.answer == 1)&lt;br /&gt;
       html+= &amp;quot;&amp;lt;img src=/assets/Check-icon.png/&amp;gt;&amp;quot;&lt;br /&gt;
     else&lt;br /&gt;
       html+= &amp;quot;&amp;lt;img src=/assets/delete_icon.png/&amp;gt;&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
     html+= &amp;quot;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
'''Remove irrelevant comments from the student_quizzes_controller'''&lt;br /&gt;
The &amp;lt;tt&amp;gt;student_quizzes_controller&amp;lt;/tt&amp;gt; has a few comments which are irrelevant and make the method bulky. These could be safely removed from the code.&lt;br /&gt;
&lt;br /&gt;
== Unit Testing ==&lt;br /&gt;
We added unit tests in &amp;lt;tt&amp;gt;spec/models/quiz_question_spec.rb&amp;lt;/tt&amp;gt; which check the generated HTML for each of the refactored methods. by We used &amp;lt;tt&amp;gt;context&amp;lt;/tt&amp;gt; blocks to incorporate tests for each type of question. Here is an example of the tests for &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;view_question_text&amp;quot; do&lt;br /&gt;
    context &amp;quot;when the question is a multiple-choice radio&amp;quot; do&lt;br /&gt;
      it &amp;quot;contains the text of the question&amp;quot; do&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;In which city is NCSU located?&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;contains each of the choices&amp;quot; do&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;Raleigh&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;Atlanta&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;Charlotte&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;North Carolina&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;bolds the correct answer&amp;quot; do&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;&amp;lt;b&amp;gt;Raleigh&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;does not bold incorrect answers&amp;quot; do&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;Atlanta&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;Charlotte&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;North Carolina&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context &amp;quot;when the question is a multiple-choice checkbox&amp;quot; do&lt;br /&gt;
      it &amp;quot;contains the text of the question&amp;quot; do&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Which of the following are colors?&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;contains each of the choices&amp;quot; do&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Paint&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Blue&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Car&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Red&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;bolds the correct answers&amp;quot; do&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;&amp;lt;b&amp;gt;Blue&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;&amp;lt;b&amp;gt;Red&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;does not bold incorrect answers&amp;quot; do&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;Paint&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;Car&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context &amp;quot;when the question is true/false&amp;quot; do&lt;br /&gt;
      it &amp;quot;contains the text of the question&amp;quot; do&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).to include(&amp;quot;2+2=4&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;contains each of the choices&amp;quot; do&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).to include(&amp;quot;True&amp;quot;)&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).to include(&amp;quot;False&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;bolds the correct answer&amp;quot; do&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).to include(&amp;quot;&amp;lt;b&amp;gt;True&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;does not bold the incorrect answer&amp;quot; do&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;False&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== UI Testing ==&lt;br /&gt;
You may want to use the following information to make UI testing easier if you are using the link in the Expertiza submission:&lt;br /&gt;
&lt;br /&gt;
'''Assignment''': Quiz Assignment&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Instructor''': super_administrator2&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Students''': student15, student16, student17, student18, student19, student20&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using the link in the Expertiza submission, you do not need a password. We made this change to facilitate testing. The committed code ''does not'' make any change for authenticating users.&lt;br /&gt;
&lt;br /&gt;
Since this project involved code refactoring, no new functionality was added. But here are tests for each method to verify they are working correctly.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt; ===&lt;br /&gt;
# Login as a student.&lt;br /&gt;
# Select an assignment that has quizzing enabled (e.g. Quiz Assignment).&lt;br /&gt;
# Select &amp;quot;Your Work&amp;quot;&lt;br /&gt;
# If you haven't created a quiz yet, go ahead and create one by clicking the &amp;quot;Create Quiz&amp;quot; link.&lt;br /&gt;
# Select &amp;quot;View quiz&amp;quot;. &lt;br /&gt;
# You should see each question, followed by the choices. The correct choice(s) will be bolded.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt; ===&lt;br /&gt;
# Login as a student.&lt;br /&gt;
# Select an assignment that has quizzing enabled (e.g. Quiz Assignment).&lt;br /&gt;
# Select &amp;quot;Your Work&amp;quot;&lt;br /&gt;
# If you haven't created a quiz yet, go ahead and create one by clicking the &amp;quot;Create Quiz&amp;quot; link.&lt;br /&gt;
# Select &amp;quot;Edit quiz&amp;quot;.&lt;br /&gt;
# You should see each question, followed by the choices, each in an editable text field. The correct choice(s) will be checked.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;complete&amp;lt;/tt&amp;gt; ===&lt;br /&gt;
# Login as a student.&lt;br /&gt;
# Select an assignment that has quizzing enabled (e.g. Quiz Assignment).&lt;br /&gt;
# Select &amp;quot;Your Work&amp;quot;&lt;br /&gt;
# If you haven't created a quiz yet, go ahead and create one by clicking the &amp;quot;Create Quiz&amp;quot; link.&lt;br /&gt;
# Select &amp;quot;Take Quizzes&amp;quot;.&lt;br /&gt;
# Click 'Begin'.&lt;br /&gt;
# You should see each question, followed by the choices. You can record your answers for each questions and then click 'submit'. Your answers will be saved.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;view_completed_question&amp;lt;/tt&amp;gt; ===&lt;br /&gt;
# Login as a student.&lt;br /&gt;
# Select an assignment that has quizzing enabled (e.g. Quiz Assignment).&lt;br /&gt;
# Select &amp;quot;Your Work&amp;quot;&lt;br /&gt;
# If you haven't created/taken a quiz yet, go ahead and create one by clicking the &amp;quot;Create Quiz&amp;quot; link and take the quiz.&lt;br /&gt;
# Find a finished quiz and click on 'View'.&lt;br /&gt;
# You should see each question, followed by the choices. The correct choice(s) will be bolded and your recorded answer will be shown.&lt;br /&gt;
&lt;br /&gt;
N.B. The VCL image sometimes may take a longer time to load. But, it's up and running perfectly.&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_different_question_types_from_quiz_feature&amp;diff=101601</id>
		<title>CSC/ECE 517 Spring 2016/Refactor different question types from quiz feature</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_different_question_types_from_quiz_feature&amp;diff=101601"/>
		<updated>2016-04-01T22:18:27Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1602 OSS assignment for Spring 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
====Background====&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. Expertiza has a quizzing feature which allow student authors to create quiz questions and test the peer reviewers. The idea behind this is, if a reviewer can answer the quiz questions which were created by the author correctly, we assume that the reviewer has read the artifact carefully enough and thereby we trust the peer-review.&lt;br /&gt;
&lt;br /&gt;
====Current Implementation and Problems====&lt;br /&gt;
* Following three different types of questions are supported in quizzing feature of Expertiza&lt;br /&gt;
# Multiple Choice Radio&lt;br /&gt;
# Multiple Choice Checkbox&lt;br /&gt;
# True/False&lt;br /&gt;
* The current implementation of Quizzing feature is not consistent with the current questions and questionnaires. Since Quiz questionnaire is one sub type of questionnaire, so it should follow the design of other type of questionnaires. But, the current implementation is inconsistent with other questionnaires.&lt;br /&gt;
* In order to create a quiz, the existing code is written in the views which has a series of if-then structures to implement the functionality of each different question type. This kind of implementation makes the code slower and violates the principles of MVC architecture.&lt;br /&gt;
* Current HTML code doesn't looks like source code.&lt;br /&gt;
* Code is repeated for different question types.&lt;br /&gt;
* Proper Ruby naming conventions are not followed&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* All logic moved to model. Four separate methods - &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;complete&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;view_completed_question&amp;lt;/tt&amp;gt; in order to generate the same HTML for each of the question types. We used polymorphism by declaring all these methods in &amp;lt;tt&amp;gt;QuizQuestion&amp;lt;/tt&amp;gt; which inherits from &amp;lt;tt&amp;gt;Question&amp;lt;/tt&amp;gt; and has sub-types &amp;lt;tt&amp;gt;MultipleChoiceRadio&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;MultipleChoiceCheckbox&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;TrueFalse&amp;lt;/tt&amp;gt;. &lt;br /&gt;
* When questionnaire author creates a quiz, &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt; is called. To call this on UI, you can login as a student, click 'create quiz' / 'edit quiz' on 'Your Works' page. The &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt; method is now called from &amp;lt;tt&amp;gt;/view/questionnaires/_quiz_question.html.erb&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When questions are viewed by the author or the instructor, &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt; method is called. To call this on UI, you can either login as a student, click 'view quiz' on 'Your works' page or login as an instructor, find an assignment with quizzing feature and click the icon 'view quiz questions'. The 'view_question_text' calls &amp;lt;tt&amp;gt;view/questionnaires/view.html.erb&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When the quiz takers tries to take the quiz, &amp;lt;tt&amp;gt;complete&amp;lt;/tt&amp;gt; is called. To call this on UI, you can login as a quiz taker, request a quiz to take on “Take quizzes” page, then click “begin”. This method is now called on &amp;lt;tt&amp;gt;view/student_quizzes/take_quiz&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* When the quiz taker finished taking a quiz and wants to view the quiz result again, &amp;lt;tt&amp;gt;view_completed_question&amp;lt;/tt&amp;gt; is called. To call this on UI, you can login as a quiz taker, find a finished quiz and click “view”. This method is called on &amp;lt;tt&amp;gt;view/student_quizzes/finished_quiz&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* Using polymorphism and DRY principles, code repetition has been virtually eliminated.&lt;br /&gt;
&lt;br /&gt;
== Refactoring &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt; method is called when the author of the quiz or the instructor views the quiz. The method is responsible for generating the HTML to display the question along with each of its choices. The correct choice(s) should be bolded. Prior to refactoring, this functionality was located in &amp;lt;tt&amp;gt;app/views/student_quizzes/review_questions.html.erb&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%questions = questionnaire.questions%&amp;gt;&lt;br /&gt;
      &amp;lt;% questions.each do |question| %&amp;gt;&lt;br /&gt;
        &amp;lt;b&amp;gt; &amp;lt;%= question.txt %&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
        &amp;lt;% question_type = question.get_formatted_question_type%&amp;gt;&lt;br /&gt;
        Question Type: &amp;lt;%= question_type %&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;% if question_type == 'True/False' %&amp;gt;&lt;br /&gt;
          Correct Answer: &amp;lt;%= (QuizQuestionChoice.where(question_id: question.id, iscorrect:1).first.txt) %&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
        &amp;lt;% elsif question_type == 'Multiple Choice - Radio' %&amp;gt;&lt;br /&gt;
          &amp;lt;% correct_answer = '' %&amp;gt;&lt;br /&gt;
          Answer Options:&amp;lt;br&amp;gt;&lt;br /&gt;
          &amp;lt;% QuizQuestionChoice.where(question_id: question.id).each do |choice| %&amp;gt;&lt;br /&gt;
            &amp;lt;% if choice.iscorrect == true  %&amp;gt;&lt;br /&gt;
              &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;B&amp;gt;&amp;lt;%= choice.txt %&amp;gt;&amp;lt;/B&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
              &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;%= choice.txt %&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
        &amp;lt;% elsif question_type == 'Multiple Choice - Checked' %&amp;gt;&lt;br /&gt;
          Answer Options:&amp;lt;br&amp;gt;&lt;br /&gt;
          &amp;lt;% QuizQuestionChoice.where(question_id: question.id).each do |choice| %&amp;gt;&lt;br /&gt;
            &amp;lt;% if choice.iscorrect == true  %&amp;gt;&lt;br /&gt;
              &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;B&amp;gt;&amp;lt;%= choice.txt %&amp;gt;&amp;lt;/B&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
              &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;%= choice.txt %&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&amp;lt;hr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This logic has been moved to &amp;lt;tt&amp;gt;app/models/quiz_question.rb&amp;lt;/tt&amp;gt;, so now the view simply needs to call the method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%questions = questionnaire.questions%&amp;gt;&lt;br /&gt;
      &amp;lt;%questions.each do |question| %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%if question.is_a? Question%&amp;gt;&lt;br /&gt;
          &amp;lt;%=question.view_question_text.html_safe%&amp;gt;&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
      &amp;lt;% end %&amp;gt;&amp;lt;hr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unit tests were added to &amp;lt;tt&amp;gt;spec/models/quiz_question_spec.rb&amp;lt;/tt&amp;gt; covering all three types of questions to ensure that the correct HTML is generated.&lt;br /&gt;
&lt;br /&gt;
== Refactoring &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt; method is called when the author creates or edits a quiz. It makes every element of the quiz editable. Prior to refactoring, the HTML was in &amp;lt;tt&amp;gt;app/views/questionnaires/_quiz_questionnaire.html.erb&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @questionnaire.type == 'QuizQuestionnaire' %&amp;gt;        &lt;br /&gt;
  &amp;lt;!--handle a questionnaire differently if it is a quiz--&amp;gt;&lt;br /&gt;
    &amp;lt;table id=&amp;quot;questions_table&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;% if $disp_flag != 1 %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;td align=left width=300&amp;gt;Questions:&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;%  if @questionnaire.type != 'QuizQuestionnaire' %&amp;gt;&amp;lt;td align=left&amp;gt;weight&amp;lt;/td&amp;gt;&amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;% for @question in @questionnaire.questions %&amp;gt;&lt;br /&gt;
          &amp;lt;% questionnum=@question.id %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;% if $disp_flag != 1 %&amp;gt;&lt;br /&gt;
            &amp;lt;td &amp;gt; &amp;lt;%= text_area &amp;quot;question[]&amp;quot;, 'txt', :cols=&amp;gt;100 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;%  @quiz_question_choices = QuizQuestionChoice.where(question_id: @question.id) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;% i=1 %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;% for @quiz_question_choice in @quiz_question_choices %&amp;gt;&lt;br /&gt;
          &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&lt;br /&gt;
            &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
              &amp;lt;% if @question.type==&amp;quot;MultipleChoiceCheckbox&amp;quot; %&amp;gt;&lt;br /&gt;
                  &amp;lt;%= hidden_field_tag(&amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceCheckbox][#{i}][iscorrect]&amp;quot;,'0') %&amp;gt;&lt;br /&gt;
                  &amp;lt;%= check_box_tag(&amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceCheckbox][#{i}][iscorrect]&amp;quot;,'1', @quiz_question_choice.iscorrect) %&amp;gt;&lt;br /&gt;
                  &amp;amp;nbsp;&amp;lt;%= text_field_tag &amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceCheckbox][#{i}][txt]&amp;quot;, @quiz_question_choice.txt, :size=&amp;gt;40 %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;%if @question.type==&amp;quot;MultipleChoiceRadio&amp;quot; %&amp;gt;&lt;br /&gt;
                &amp;lt;%= radio_button_tag(&amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceRadio][correctindex]&amp;quot;, &amp;quot;#{i}&amp;quot;, @quiz_question_choice.iscorrect)%&amp;gt;&lt;br /&gt;
                &amp;amp;nbsp;&amp;lt;%= text_field_tag &amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceRadio][#{i}][txt]&amp;quot;, @quiz_question_choice.txt, :size=&amp;gt;40 %&amp;gt;&lt;br /&gt;
              &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;%if @question.type==&amp;quot;TrueFalse&amp;quot; %&amp;gt;&lt;br /&gt;
                &amp;lt;% if @quiz_question_choice.txt==&amp;quot;True&amp;quot;%&amp;gt;&lt;br /&gt;
                  &amp;lt;%= radio_button_tag(&amp;quot;quiz_question_choices[#{questionnum}][TrueFalse][1][iscorrect]&amp;quot;, 'True', @quiz_question_choice.iscorrect) %&amp;gt;   True&lt;br /&gt;
                &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;% if @quiz_question_choice.txt==&amp;quot;False&amp;quot;%&amp;gt;&lt;br /&gt;
                    &amp;lt;%= radio_button_tag(&amp;quot;quiz_question_choices[#{questionnum}][TrueFalse][1][iscorrect]&amp;quot;, 'False', @quiz_question_choice.iscorrect) %&amp;gt;   False&lt;br /&gt;
                &amp;lt;%end%&amp;gt;&lt;br /&gt;
              &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;/tr&amp;gt;&lt;br /&gt;
          &amp;lt;% i+=1 %&amp;gt;&lt;br /&gt;
        &amp;lt;%end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/table&amp;gt; &lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After refactoring, the same file looked like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @questionnaire.type == 'QuizQuestionnaire' %&amp;gt;&lt;br /&gt;
  &amp;lt;!--handle a questionnaire differently if it is a quiz--&amp;gt;&lt;br /&gt;
    &amp;lt;table id=&amp;quot;questions_table&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;% if $disp_flag != 1 %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;td align=left width=300&amp;gt;Questions:&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;%  if @questionnaire.type != 'QuizQuestionnaire' %&amp;gt;&amp;lt;td align=left&amp;gt;weight&amp;lt;/td&amp;gt;&amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;% for @question in @questionnaire.questions %&amp;gt;&lt;br /&gt;
      &amp;lt;% i=1 %&amp;gt;&lt;br /&gt;
         &amp;lt;%= @question.edit(i) %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/table&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Refactoring &amp;lt;tt&amp;gt;complete&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
Logic is written in multiple_choice_checkbox model for multiple choice checkbox question type. Similarly, same process is followed for remaining question types. To begin a quiz, &amp;lt;tt&amp;gt;complete&amp;lt;/tt&amp;gt; is called from the model.&lt;br /&gt;
     @question = self&lt;br /&gt;
     html = &amp;quot;&amp;quot;&lt;br /&gt;
     html += label_tag(&amp;quot;#{question.id}&amp;quot;, question.txt) +&amp;quot;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;
     quiz_question_choices = QuizQuestionChoice.where(question_id: @question.id)&lt;br /&gt;
     quiz_question_choices.each do |choice|&lt;br /&gt;
       if answer==&amp;quot;view&amp;quot;&lt;br /&gt;
         html += check_box_tag (&amp;quot;#{question.id}[]&amp;quot;, &amp;quot;#{choice.txt}&amp;quot;, choice.iscorrect)&lt;br /&gt;
         html += label_tag(&amp;quot;#{choice.txt}&amp;quot;, choice.txt) + &amp;quot;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;
       end&lt;br /&gt;
       if answer==&amp;quot;take&amp;quot;&lt;br /&gt;
         html += check_box_tag (&amp;quot;#{question.id}[]&amp;quot;, &amp;quot;#{choice.txt}&amp;quot;)&lt;br /&gt;
         html += label_tag(&amp;quot;#{choice.txt}&amp;quot;, choice.txt) + &amp;quot;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;
       end&lt;br /&gt;
       html.html_safe&lt;br /&gt;
     end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
== Refactoring &amp;lt;tt&amp;gt;view_completed_question&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
The logic for viewing completed question and their answers is written in &amp;lt;tt&amp;gt;app/views/student_quizzes/finished_quiz.html.erb&amp;lt;/tt&amp;gt; using a redundant if-elsif structure as shown below. &lt;br /&gt;
 &amp;lt;% if question_type.eql? 'MultipleChoiceRadio' %&amp;gt;&lt;br /&gt;
    &amp;lt;% QuizQuestionChoice.where(question_id: question.id).each do |answer|  %&amp;gt;&lt;br /&gt;
      &amp;lt;% if(answer.iscorrect) %&amp;gt;&lt;br /&gt;
        &amp;lt;b&amp;gt;&amp;lt;%= p answer.txt  %&amp;gt;&amp;lt;/b&amp;gt; -- Correct &amp;lt;br&amp;gt;&lt;br /&gt;
      &amp;lt;%else%&amp;gt;&lt;br /&gt;
        &amp;lt;%= p answer.txt  %&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;br&amp;gt;&lt;br /&gt;
    &amp;lt;%user_answer=Answer.where(response_id: @response.id, question_id:  question.id).first%&amp;gt;&lt;br /&gt;
    Your answer is: &amp;lt;b&amp;gt;&amp;lt;%= user_answer.comments  %&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
    &amp;lt;%if user_answer.answer==1%&amp;gt;&lt;br /&gt;
      &amp;lt;img src=&amp;quot;/assets/Check-icon.png&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;%else%&amp;gt;&lt;br /&gt;
      &amp;lt;img src=&amp;quot;/assets/delete_icon.png&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;%end%&amp;gt;&lt;br /&gt;
    &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
    &amp;lt;% elsif question_type.eql? 'MultipleChoiceCheckbox' %&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;% elsif(question_type == 'TrueFalse') %&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
The &amp;lt;tt&amp;gt;app/views/student_quizzes/finished_quiz.html.erb&amp;lt;/tt&amp;gt; was refactored by removing the logic from the view and making it clean. We used a single construct which determines question type and answer type by calling view_completed_question method declared in quiz class as shown below.&lt;br /&gt;
 &amp;lt;%user_answer=Answer.where(response_id: @response.id, question_id:  question.id)%&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Question &amp;lt;%= i %&amp;gt;: &amp;lt;/b&amp;gt;&amp;lt;%= label_tag &amp;quot;#{question.id}&amp;quot;, question.txt %&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;%= question.view_completed_question(i,user_answer) %&amp;gt;&lt;br /&gt;
 &amp;lt;% i += 1 %&amp;gt;&lt;br /&gt;
Similarly, logic was written in models for each of the question types. Following code snippet shows &amp;lt;tt&amp;gt;view_completed_question&amp;lt;/tt&amp;gt; for true/false question type.&lt;br /&gt;
def view_completed_question(count, answer)&lt;br /&gt;
     @question = self&lt;br /&gt;
     html=&amp;quot;&amp;quot;&lt;br /&gt;
     html+= &amp;quot;Correct Answer is: &amp;lt;b&amp;gt;&amp;quot;&lt;br /&gt;
     html+= QuizQuestionChoice.where(question_id: @question.id,iscorrect: 1).first.txt&lt;br /&gt;
     html+= &amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&amp;quot;&lt;br /&gt;
     html+= &amp;quot;Your answer is: &amp;lt;b&amp;gt;&amp;quot;&lt;br /&gt;
     html+= answer.first.coments + &amp;quot;&amp;lt;/b&amp;gt;&amp;quot;&lt;br /&gt;
     if(answer.first.answer == 1)&lt;br /&gt;
       html+= &amp;quot;&amp;lt;img src=/assets/Check-icon.png/&amp;gt;&amp;quot;&lt;br /&gt;
     else&lt;br /&gt;
       html+= &amp;quot;&amp;lt;img src=/assets/delete_icon.png/&amp;gt;&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
     html+= &amp;quot;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
'''Remove irrelevant comments from the student_quizzes_controller'''&lt;br /&gt;
The &amp;lt;tt&amp;gt;student_quizzes_controller&amp;lt;/tt&amp;gt; has a few comments which are irrelevant and make the method bulky. These could be safely removed from the code.&lt;br /&gt;
&lt;br /&gt;
== Unit Testing ==&lt;br /&gt;
We added unit tests in &amp;lt;tt&amp;gt;spec/models/quiz_question_spec.rb&amp;lt;/tt&amp;gt; which check the generated HTML for each of the refactored methods. by We used &amp;lt;tt&amp;gt;context&amp;lt;/tt&amp;gt; blocks to incorporate tests for each type of question. Here is an example of the tests for &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;view_question_text&amp;quot; do&lt;br /&gt;
    context &amp;quot;when the question is a multiple-choice radio&amp;quot; do&lt;br /&gt;
      it &amp;quot;contains the text of the question&amp;quot; do&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;In which city is NCSU located?&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;contains each of the choices&amp;quot; do&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;Raleigh&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;Atlanta&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;Charlotte&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;North Carolina&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;bolds the correct answer&amp;quot; do&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;&amp;lt;b&amp;gt;Raleigh&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;does not bold incorrect answers&amp;quot; do&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;Atlanta&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;Charlotte&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;North Carolina&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context &amp;quot;when the question is a multiple-choice checkbox&amp;quot; do&lt;br /&gt;
      it &amp;quot;contains the text of the question&amp;quot; do&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Which of the following are colors?&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;contains each of the choices&amp;quot; do&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Paint&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Blue&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Car&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Red&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;bolds the correct answers&amp;quot; do&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;&amp;lt;b&amp;gt;Blue&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;&amp;lt;b&amp;gt;Red&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;does not bold incorrect answers&amp;quot; do&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;Paint&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;Car&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context &amp;quot;when the question is true/false&amp;quot; do&lt;br /&gt;
      it &amp;quot;contains the text of the question&amp;quot; do&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).to include(&amp;quot;2+2=4&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;contains each of the choices&amp;quot; do&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).to include(&amp;quot;True&amp;quot;)&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).to include(&amp;quot;False&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;bolds the correct answer&amp;quot; do&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).to include(&amp;quot;&amp;lt;b&amp;gt;True&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;does not bold the incorrect answer&amp;quot; do&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;False&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== UI Testing ==&lt;br /&gt;
You may want to use the following information to make UI testing easier if you are using the link in the Expertiza submission:&lt;br /&gt;
&lt;br /&gt;
'''Assignment''': Quiz Assignment&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Instructor''': super_administrator2&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Students''': student15, student16, student17, student18, student19, student20&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using the link in the Expertiza submission, you do not need a password. We made this change to facilitate testing. The committed code ''does not'' make any change for authenticating users.&lt;br /&gt;
&lt;br /&gt;
Since this project involved code refactoring, no new functionality was added. But here are tests for each method to verify they are working correctly.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt; ===&lt;br /&gt;
# Login as a student.&lt;br /&gt;
# Select an assignment that has quizzing enabled (e.g. Quiz Assignment).&lt;br /&gt;
# Select &amp;quot;Your Work&amp;quot;&lt;br /&gt;
# If you haven't created a quiz yet, go ahead and create one by clicking the &amp;quot;Create Quiz&amp;quot; link.&lt;br /&gt;
# Select &amp;quot;View quiz&amp;quot;. &lt;br /&gt;
# You should see each question, followed by the choices. The correct choice(s) will be bolded.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt; ===&lt;br /&gt;
# Login as a student.&lt;br /&gt;
# Select an assignment that has quizzing enabled (e.g. Quiz Assignment).&lt;br /&gt;
# Select &amp;quot;Your Work&amp;quot;&lt;br /&gt;
# If you haven't created a quiz yet, go ahead and create one by clicking the &amp;quot;Create Quiz&amp;quot; link.&lt;br /&gt;
# Select &amp;quot;Edit quiz&amp;quot;.&lt;br /&gt;
# You should see each question, followed by the choices, each in an editable text field. The correct choice(s) will be checked.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;complete&amp;lt;/tt&amp;gt; ===&lt;br /&gt;
# Login as a student.&lt;br /&gt;
# Select an assignment that has quizzing enabled (e.g. Quiz Assignment).&lt;br /&gt;
# Select &amp;quot;Your Work&amp;quot;&lt;br /&gt;
# If you haven't created a quiz yet, go ahead and create one by clicking the &amp;quot;Create Quiz&amp;quot; link.&lt;br /&gt;
# Select &amp;quot;Take Quizzes&amp;quot;.&lt;br /&gt;
# Click 'Begin'.&lt;br /&gt;
# You should see each question, followed by the choices. You can record your answers for each questions and then click 'submit'. Your answers will be saved.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;view_completed_question&amp;lt;/tt&amp;gt; ===&lt;br /&gt;
# Login as a student.&lt;br /&gt;
# Select an assignment that has quizzing enabled (e.g. Quiz Assignment).&lt;br /&gt;
# Select &amp;quot;Your Work&amp;quot;&lt;br /&gt;
# If you haven't created/taken a quiz yet, go ahead and create one by clicking the &amp;quot;Create Quiz&amp;quot; link and take the quiz.&lt;br /&gt;
# Find a finished quiz and click on 'View'.&lt;br /&gt;
# You should see each question, followed by the choices. The correct choice(s) will be bolded and your recorded answer will be shown.&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_different_question_types_from_quiz_feature&amp;diff=101284</id>
		<title>CSC/ECE 517 Spring 2016/Refactor different question types from quiz feature</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_different_question_types_from_quiz_feature&amp;diff=101284"/>
		<updated>2016-03-24T02:34:30Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Refactoring view_completed_question */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1602 OSS assignment for Spring 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
====Background====&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. Expertiza has a quizzing feature which allow student authors to create quiz questions and test the peer reviewers. The idea behind this is, if a reviewer can answer the quiz questions which were created by the author correctly, we assume that the reviewer has read the artifact carefully enough and thereby we trust the peer-review.&lt;br /&gt;
&lt;br /&gt;
====Current Implementation and Problems====&lt;br /&gt;
* Following three different types of questions are supported in quizzing feature of Expertiza&lt;br /&gt;
# Multiple Choice Radio&lt;br /&gt;
# Multiple Choice Checkbox&lt;br /&gt;
# True/False&lt;br /&gt;
* The current implementation of Quizzing feature is not consistent with the current questions and questionnaires. Since Quiz questionnaire is one sub type of questionnaire, so it should follow the design of other type of questionnaires. But, the current implementation is inconsistent with other questionnaires.&lt;br /&gt;
* In order to create a quiz, the existing code is written in the views which has a series of if-then structures to implement the functionality of each different question type. This kind of implementation makes the code slower and violates the principles of MVC architecture.&lt;br /&gt;
* Current HTML code doesn't looks like source code.&lt;br /&gt;
* Code is repeated for different question types.&lt;br /&gt;
* Proper Ruby naming conventions are not followed&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* All logic moved to model. Four separate methods - &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;complete&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;view_completed_question&amp;lt;/tt&amp;gt; in order to generate the same HTML for each of the question types. We used polymorphism by declaring all these methods in &amp;lt;tt&amp;gt;QuizQuestion&amp;lt;/tt&amp;gt; which inherits from &amp;lt;tt&amp;gt;Question&amp;lt;/tt&amp;gt; and has sub-types &amp;lt;tt&amp;gt;MultipleChoiceRadio&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;MultipleChoiceCheckbox&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;TrueFalse&amp;lt;/tt&amp;gt;. &lt;br /&gt;
* When questionnaire author creates a quiz, &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt; is called. To call this on UI, you can login as a student, click 'create quiz' / 'edit quiz' on 'Your Works' page. The &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt; method is now called from &amp;lt;tt&amp;gt;/view/questionnaires/_quiz_question.html.erb&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When questions are viewed by the author or the instructor, &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt; method is called. To call this on UI, you can either login as a student, click 'view quiz' on 'Your works' page or login as an instructor, find an assignment with quizzing feature and click the icon 'view quiz questions'. The 'view_question_text' calls &amp;lt;tt&amp;gt;view/questionnaires/view.html.erb&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When the quiz takers tries to take the quiz, &amp;lt;tt&amp;gt;complete&amp;lt;/tt&amp;gt; is called. To call this on UI, you can login as a quiz taker, request a quiz to take on “Take quizzes” page, then click “begin”. This method is now called on &amp;lt;tt&amp;gt;view/student_quizzes/take_quiz&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* When the quiz taker finished taking a quiz and wants to view the quiz result again, &amp;lt;tt&amp;gt;view_completed_question&amp;lt;/tt&amp;gt; is called. To call this on UI, you can login as a quiz taker, find a finished quiz and click “view”. This method is called on &amp;lt;tt&amp;gt;view/student_quizzes/finished_quiz&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* Using polymorphism and DRY principles, code repetition has been virtually eliminated.&lt;br /&gt;
&lt;br /&gt;
== Refactoring &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt; method is called when the author of the quiz or the instructor views the quiz. The method is responsible for generating the HTML to display the question along with each of its choices. The correct choice(s) should be bolded. Prior to refactoring, this functionality was located in &amp;lt;tt&amp;gt;app/views/student_quizzes/review_questions.html.erb&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%questions = questionnaire.questions%&amp;gt;&lt;br /&gt;
      &amp;lt;% questions.each do |question| %&amp;gt;&lt;br /&gt;
        &amp;lt;b&amp;gt; &amp;lt;%= question.txt %&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
        &amp;lt;% question_type = question.get_formatted_question_type%&amp;gt;&lt;br /&gt;
        Question Type: &amp;lt;%= question_type %&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;% if question_type == 'True/False' %&amp;gt;&lt;br /&gt;
          Correct Answer: &amp;lt;%= (QuizQuestionChoice.where(question_id: question.id, iscorrect:1).first.txt) %&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
        &amp;lt;% elsif question_type == 'Multiple Choice - Radio' %&amp;gt;&lt;br /&gt;
          &amp;lt;% correct_answer = '' %&amp;gt;&lt;br /&gt;
          Answer Options:&amp;lt;br&amp;gt;&lt;br /&gt;
          &amp;lt;% QuizQuestionChoice.where(question_id: question.id).each do |choice| %&amp;gt;&lt;br /&gt;
            &amp;lt;% if choice.iscorrect == true  %&amp;gt;&lt;br /&gt;
              &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;B&amp;gt;&amp;lt;%= choice.txt %&amp;gt;&amp;lt;/B&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
              &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;%= choice.txt %&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
        &amp;lt;% elsif question_type == 'Multiple Choice - Checked' %&amp;gt;&lt;br /&gt;
          Answer Options:&amp;lt;br&amp;gt;&lt;br /&gt;
          &amp;lt;% QuizQuestionChoice.where(question_id: question.id).each do |choice| %&amp;gt;&lt;br /&gt;
            &amp;lt;% if choice.iscorrect == true  %&amp;gt;&lt;br /&gt;
              &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;B&amp;gt;&amp;lt;%= choice.txt %&amp;gt;&amp;lt;/B&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
              &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;%= choice.txt %&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&amp;lt;hr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This logic has been moved to &amp;lt;tt&amp;gt;app/models/quiz_question.rb&amp;lt;/tt&amp;gt;, so now the view simply needs to call the method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%questions = questionnaire.questions%&amp;gt;&lt;br /&gt;
      &amp;lt;%questions.each do |question| %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%if question.is_a? Question%&amp;gt;&lt;br /&gt;
          &amp;lt;%=question.view_question_text.html_safe%&amp;gt;&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
      &amp;lt;% end %&amp;gt;&amp;lt;hr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unit tests were added to &amp;lt;tt&amp;gt;spec/models/quiz_question_spec.rb&amp;lt;/tt&amp;gt; covering all three types of questions to ensure that the correct HTML is generated.&lt;br /&gt;
&lt;br /&gt;
== Refactoring &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt; method is called when the author creates or edits a quiz. It makes every element of the quiz editable. Prior to refactoring, the HTML was in &amp;lt;tt&amp;gt;app/views/questionnaires/_quiz_questionnaire.html.erb&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @questionnaire.type == 'QuizQuestionnaire' %&amp;gt;        &lt;br /&gt;
  &amp;lt;!--handle a questionnaire differently if it is a quiz--&amp;gt;&lt;br /&gt;
    &amp;lt;table id=&amp;quot;questions_table&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;% if $disp_flag != 1 %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;td align=left width=300&amp;gt;Questions:&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;%  if @questionnaire.type != 'QuizQuestionnaire' %&amp;gt;&amp;lt;td align=left&amp;gt;weight&amp;lt;/td&amp;gt;&amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;% for @question in @questionnaire.questions %&amp;gt;&lt;br /&gt;
          &amp;lt;% questionnum=@question.id %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;% if $disp_flag != 1 %&amp;gt;&lt;br /&gt;
            &amp;lt;td &amp;gt; &amp;lt;%= text_area &amp;quot;question[]&amp;quot;, 'txt', :cols=&amp;gt;100 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;%  @quiz_question_choices = QuizQuestionChoice.where(question_id: @question.id) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;% i=1 %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;% for @quiz_question_choice in @quiz_question_choices %&amp;gt;&lt;br /&gt;
          &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&lt;br /&gt;
            &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
              &amp;lt;% if @question.type==&amp;quot;MultipleChoiceCheckbox&amp;quot; %&amp;gt;&lt;br /&gt;
                  &amp;lt;%= hidden_field_tag(&amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceCheckbox][#{i}][iscorrect]&amp;quot;,'0') %&amp;gt;&lt;br /&gt;
                  &amp;lt;%= check_box_tag(&amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceCheckbox][#{i}][iscorrect]&amp;quot;,'1', @quiz_question_choice.iscorrect) %&amp;gt;&lt;br /&gt;
                  &amp;amp;nbsp;&amp;lt;%= text_field_tag &amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceCheckbox][#{i}][txt]&amp;quot;, @quiz_question_choice.txt, :size=&amp;gt;40 %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;%if @question.type==&amp;quot;MultipleChoiceRadio&amp;quot; %&amp;gt;&lt;br /&gt;
                &amp;lt;%= radio_button_tag(&amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceRadio][correctindex]&amp;quot;, &amp;quot;#{i}&amp;quot;, @quiz_question_choice.iscorrect)%&amp;gt;&lt;br /&gt;
                &amp;amp;nbsp;&amp;lt;%= text_field_tag &amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceRadio][#{i}][txt]&amp;quot;, @quiz_question_choice.txt, :size=&amp;gt;40 %&amp;gt;&lt;br /&gt;
              &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;%if @question.type==&amp;quot;TrueFalse&amp;quot; %&amp;gt;&lt;br /&gt;
                &amp;lt;% if @quiz_question_choice.txt==&amp;quot;True&amp;quot;%&amp;gt;&lt;br /&gt;
                  &amp;lt;%= radio_button_tag(&amp;quot;quiz_question_choices[#{questionnum}][TrueFalse][1][iscorrect]&amp;quot;, 'True', @quiz_question_choice.iscorrect) %&amp;gt;   True&lt;br /&gt;
                &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;% if @quiz_question_choice.txt==&amp;quot;False&amp;quot;%&amp;gt;&lt;br /&gt;
                    &amp;lt;%= radio_button_tag(&amp;quot;quiz_question_choices[#{questionnum}][TrueFalse][1][iscorrect]&amp;quot;, 'False', @quiz_question_choice.iscorrect) %&amp;gt;   False&lt;br /&gt;
                &amp;lt;%end%&amp;gt;&lt;br /&gt;
              &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;/tr&amp;gt;&lt;br /&gt;
          &amp;lt;% i+=1 %&amp;gt;&lt;br /&gt;
        &amp;lt;%end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/table&amp;gt; &lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After refactoring, the same file looked like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @questionnaire.type == 'QuizQuestionnaire' %&amp;gt;&lt;br /&gt;
  &amp;lt;!--handle a questionnaire differently if it is a quiz--&amp;gt;&lt;br /&gt;
    &amp;lt;table id=&amp;quot;questions_table&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;% if $disp_flag != 1 %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;td align=left width=300&amp;gt;Questions:&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;%  if @questionnaire.type != 'QuizQuestionnaire' %&amp;gt;&amp;lt;td align=left&amp;gt;weight&amp;lt;/td&amp;gt;&amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;% for @question in @questionnaire.questions %&amp;gt;&lt;br /&gt;
      &amp;lt;% i=1 %&amp;gt;&lt;br /&gt;
         &amp;lt;%= @question.edit(i) %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/table&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Refactoring &amp;lt;tt&amp;gt;complete&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
Logic is written in multiple_choice_checkbox model for multiple choice checkbox question type. Similarly, same process is followed for remaining question types. To begin a quiz, &amp;lt;tt&amp;gt;complete&amp;lt;/tt&amp;gt; is called from the model.&lt;br /&gt;
     @question = self&lt;br /&gt;
     html = &amp;quot;&amp;quot;&lt;br /&gt;
     html += label_tag(&amp;quot;#{question.id}&amp;quot;, question.txt) +&amp;quot;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;
     quiz_question_choices = QuizQuestionChoice.where(question_id: @question.id)&lt;br /&gt;
     quiz_question_choices.each do |choice|&lt;br /&gt;
       if answer==&amp;quot;view&amp;quot;&lt;br /&gt;
         html += check_box_tag (&amp;quot;#{question.id}[]&amp;quot;, &amp;quot;#{choice.txt}&amp;quot;, choice.iscorrect)&lt;br /&gt;
         html += label_tag(&amp;quot;#{choice.txt}&amp;quot;, choice.txt) + &amp;quot;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;
       end&lt;br /&gt;
       if answer==&amp;quot;take&amp;quot;&lt;br /&gt;
         html += check_box_tag (&amp;quot;#{question.id}[]&amp;quot;, &amp;quot;#{choice.txt}&amp;quot;)&lt;br /&gt;
         html += label_tag(&amp;quot;#{choice.txt}&amp;quot;, choice.txt) + &amp;quot;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;
       end&lt;br /&gt;
       html.html_safe&lt;br /&gt;
     end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
== Refactoring &amp;lt;tt&amp;gt;view_completed_question&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
The logic for viewing completed question and their answers is written in &amp;lt;tt&amp;gt;app/views/student_quizzes/finished_quiz.html.erb&amp;lt;/tt&amp;gt; using a redundant if-elsif structure as shown below. &lt;br /&gt;
 &amp;lt;% if question_type.eql? 'MultipleChoiceRadio' %&amp;gt;&lt;br /&gt;
    &amp;lt;% QuizQuestionChoice.where(question_id: question.id).each do |answer|  %&amp;gt;&lt;br /&gt;
      &amp;lt;% if(answer.iscorrect) %&amp;gt;&lt;br /&gt;
        &amp;lt;b&amp;gt;&amp;lt;%= p answer.txt  %&amp;gt;&amp;lt;/b&amp;gt; -- Correct &amp;lt;br&amp;gt;&lt;br /&gt;
      &amp;lt;%else%&amp;gt;&lt;br /&gt;
        &amp;lt;%= p answer.txt  %&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;br&amp;gt;&lt;br /&gt;
    &amp;lt;%user_answer=Answer.where(response_id: @response.id, question_id:  question.id).first%&amp;gt;&lt;br /&gt;
    Your answer is: &amp;lt;b&amp;gt;&amp;lt;%= user_answer.comments  %&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
    &amp;lt;%if user_answer.answer==1%&amp;gt;&lt;br /&gt;
      &amp;lt;img src=&amp;quot;/assets/Check-icon.png&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;%else%&amp;gt;&lt;br /&gt;
      &amp;lt;img src=&amp;quot;/assets/delete_icon.png&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;%end%&amp;gt;&lt;br /&gt;
    &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
    &amp;lt;% elsif question_type.eql? 'MultipleChoiceCheckbox' %&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;% elsif(question_type == 'TrueFalse') %&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
The &amp;lt;tt&amp;gt;app/views/student_quizzes/finished_quiz.html.erb&amp;lt;/tt&amp;gt; was refactored by removing the logic from the view and making it clean. We used a single construct which determines question type and answer type by calling view_completed_question method declared in quiz class as shown below.&lt;br /&gt;
 &amp;lt;%user_answer=Answer.where(response_id: @response.id, question_id:  question.id)%&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Question &amp;lt;%= i %&amp;gt;: &amp;lt;/b&amp;gt;&amp;lt;%= label_tag &amp;quot;#{question.id}&amp;quot;, question.txt %&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;%= question.view_completed_question(i,user_answer) %&amp;gt;&lt;br /&gt;
 &amp;lt;% i += 1 %&amp;gt;&lt;br /&gt;
Similarly, logic was written in models for each of the question types. Following code snippet shows &amp;lt;tt&amp;gt;view_completed_question&amp;lt;/tt&amp;gt; for true/false question type.&lt;br /&gt;
def view_completed_question(count, answer)&lt;br /&gt;
     @question = self&lt;br /&gt;
     html=&amp;quot;&amp;quot;&lt;br /&gt;
     html+= &amp;quot;Correct Answer is: &amp;lt;b&amp;gt;&amp;quot;&lt;br /&gt;
     html+= QuizQuestionChoice.where(question_id: @question.id,iscorrect: 1).first.txt&lt;br /&gt;
     html+= &amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&amp;quot;&lt;br /&gt;
     html+= &amp;quot;Your answer is: &amp;lt;b&amp;gt;&amp;quot;&lt;br /&gt;
     html+= answer.first.coments + &amp;quot;&amp;lt;/b&amp;gt;&amp;quot;&lt;br /&gt;
     if(answer.first.answer == 1)&lt;br /&gt;
       html+= &amp;quot;&amp;lt;img src=/assets/Check-icon.png/&amp;gt;&amp;quot;&lt;br /&gt;
     else&lt;br /&gt;
       html+= &amp;quot;&amp;lt;img src=/assets/delete_icon.png/&amp;gt;&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
     html+= &amp;quot;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
'''Remove irrelevant comments from the student_quizzes_controller'''&lt;br /&gt;
The &amp;lt;tt&amp;gt;student_quizzes_controller&amp;lt;/tt&amp;gt; has a few comments which are irrelevant and make the method bulky. These could be safely removed from the code.&lt;br /&gt;
&lt;br /&gt;
== Unit Testing ==&lt;br /&gt;
We added unit tests in &amp;lt;tt&amp;gt;spec/models/quiz_question_spec.rb&amp;lt;/tt&amp;gt; which check the generated HTML for each of the refactored methods. by We used &amp;lt;tt&amp;gt;context&amp;lt;/tt&amp;gt; blocks to incorporate tests for each type of question. Here is an example of the tests for &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;view_question_text&amp;quot; do&lt;br /&gt;
    context &amp;quot;when the question is a multiple-choice radio&amp;quot; do&lt;br /&gt;
      it &amp;quot;contains the text of the question&amp;quot; do&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;In which city is NCSU located?&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;contains each of the choices&amp;quot; do&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;Raleigh&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;Atlanta&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;Charlotte&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;North Carolina&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;bolds the correct answer&amp;quot; do&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;&amp;lt;b&amp;gt;Raleigh&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;does not bold incorrect answers&amp;quot; do&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;Atlanta&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;Charlotte&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;North Carolina&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context &amp;quot;when the question is a multiple-choice checkbox&amp;quot; do&lt;br /&gt;
      it &amp;quot;contains the text of the question&amp;quot; do&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Which of the following are colors?&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;contains each of the choices&amp;quot; do&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Paint&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Blue&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Car&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Red&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;bolds the correct answers&amp;quot; do&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;&amp;lt;b&amp;gt;Blue&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;&amp;lt;b&amp;gt;Red&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;does not bold incorrect answers&amp;quot; do&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;Paint&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;Car&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context &amp;quot;when the question is true/false&amp;quot; do&lt;br /&gt;
      it &amp;quot;contains the text of the question&amp;quot; do&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).to include(&amp;quot;2+2=4&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;contains each of the choices&amp;quot; do&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).to include(&amp;quot;True&amp;quot;)&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).to include(&amp;quot;False&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;bolds the correct answer&amp;quot; do&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).to include(&amp;quot;&amp;lt;b&amp;gt;True&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;does not bold the incorrect answer&amp;quot; do&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;False&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_different_question_types_from_quiz_feature&amp;diff=101282</id>
		<title>CSC/ECE 517 Spring 2016/Refactor different question types from quiz feature</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_different_question_types_from_quiz_feature&amp;diff=101282"/>
		<updated>2016-03-24T02:33:44Z</updated>

		<summary type="html">&lt;p&gt;Dasoni: /* Remove irrelevant comments from the student_quizzes_controller */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1602 OSS assignment for Spring 2016, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
====Background====&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. Expertiza has a quizzing feature which allow student authors to create quiz questions and test the peer reviewers. The idea behind this is, if a reviewer can answer the quiz questions which were created by the author correctly, we assume that the reviewer has read the artifact carefully enough and thereby we trust the peer-review.&lt;br /&gt;
&lt;br /&gt;
====Current Implementation and Problems====&lt;br /&gt;
* Following three different types of questions are supported in quizzing feature of Expertiza&lt;br /&gt;
# Multiple Choice Radio&lt;br /&gt;
# Multiple Choice Checkbox&lt;br /&gt;
# True/False&lt;br /&gt;
* The current implementation of Quizzing feature is not consistent with the current questions and questionnaires. Since Quiz questionnaire is one sub type of questionnaire, so it should follow the design of other type of questionnaires. But, the current implementation is inconsistent with other questionnaires.&lt;br /&gt;
* In order to create a quiz, the existing code is written in the views which has a series of if-then structures to implement the functionality of each different question type. This kind of implementation makes the code slower and violates the principles of MVC architecture.&lt;br /&gt;
* Current HTML code doesn't looks like source code.&lt;br /&gt;
* Code is repeated for different question types.&lt;br /&gt;
* Proper Ruby naming conventions are not followed&lt;br /&gt;
====Changes Implemented====&lt;br /&gt;
* All logic moved to model. Four separate methods - &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;complete&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;view_completed_question&amp;lt;/tt&amp;gt; in order to generate the same HTML for each of the question types. We used polymorphism by declaring all these methods in &amp;lt;tt&amp;gt;QuizQuestion&amp;lt;/tt&amp;gt; which inherits from &amp;lt;tt&amp;gt;Question&amp;lt;/tt&amp;gt; and has sub-types &amp;lt;tt&amp;gt;MultipleChoiceRadio&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;MultipleChoiceCheckbox&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;TrueFalse&amp;lt;/tt&amp;gt;. &lt;br /&gt;
* When questionnaire author creates a quiz, &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt; is called. To call this on UI, you can login as a student, click 'create quiz' / 'edit quiz' on 'Your Works' page. The &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt; method is now called from &amp;lt;tt&amp;gt;/view/questionnaires/_quiz_question.html.erb&amp;lt;/tt&amp;gt;&lt;br /&gt;
* When questions are viewed by the author or the instructor, &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt; method is called. To call this on UI, you can either login as a student, click 'view quiz' on 'Your works' page or login as an instructor, find an assignment with quizzing feature and click the icon 'view quiz questions'. The 'view_question_text' calls &amp;lt;tt&amp;gt;view/questionnaires/view.html.erb&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* When the quiz takers tries to take the quiz, &amp;lt;tt&amp;gt;complete&amp;lt;/tt&amp;gt; is called. To call this on UI, you can login as a quiz taker, request a quiz to take on “Take quizzes” page, then click “begin”. This method is now called on &amp;lt;tt&amp;gt;view/student_quizzes/take_quiz&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* When the quiz taker finished taking a quiz and wants to view the quiz result again, &amp;lt;tt&amp;gt;view_completed_question&amp;lt;/tt&amp;gt; is called. To call this on UI, you can login as a quiz taker, find a finished quiz and click “view”. This method is called on &amp;lt;tt&amp;gt;view/student_quizzes/finished_quiz&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* Using polymorphism and DRY principles, code repetition has been virtually eliminated.&lt;br /&gt;
&lt;br /&gt;
== Refactoring &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt; method is called when the author of the quiz or the instructor views the quiz. The method is responsible for generating the HTML to display the question along with each of its choices. The correct choice(s) should be bolded. Prior to refactoring, this functionality was located in &amp;lt;tt&amp;gt;app/views/student_quizzes/review_questions.html.erb&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%questions = questionnaire.questions%&amp;gt;&lt;br /&gt;
      &amp;lt;% questions.each do |question| %&amp;gt;&lt;br /&gt;
        &amp;lt;b&amp;gt; &amp;lt;%= question.txt %&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
        &amp;lt;% question_type = question.get_formatted_question_type%&amp;gt;&lt;br /&gt;
        Question Type: &amp;lt;%= question_type %&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;% if question_type == 'True/False' %&amp;gt;&lt;br /&gt;
          Correct Answer: &amp;lt;%= (QuizQuestionChoice.where(question_id: question.id, iscorrect:1).first.txt) %&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
        &amp;lt;% elsif question_type == 'Multiple Choice - Radio' %&amp;gt;&lt;br /&gt;
          &amp;lt;% correct_answer = '' %&amp;gt;&lt;br /&gt;
          Answer Options:&amp;lt;br&amp;gt;&lt;br /&gt;
          &amp;lt;% QuizQuestionChoice.where(question_id: question.id).each do |choice| %&amp;gt;&lt;br /&gt;
            &amp;lt;% if choice.iscorrect == true  %&amp;gt;&lt;br /&gt;
              &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;B&amp;gt;&amp;lt;%= choice.txt %&amp;gt;&amp;lt;/B&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
              &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;%= choice.txt %&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
        &amp;lt;% elsif question_type == 'Multiple Choice - Checked' %&amp;gt;&lt;br /&gt;
          Answer Options:&amp;lt;br&amp;gt;&lt;br /&gt;
          &amp;lt;% QuizQuestionChoice.where(question_id: question.id).each do |choice| %&amp;gt;&lt;br /&gt;
            &amp;lt;% if choice.iscorrect == true  %&amp;gt;&lt;br /&gt;
              &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;B&amp;gt;&amp;lt;%= choice.txt %&amp;gt;&amp;lt;/B&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;%else%&amp;gt;&lt;br /&gt;
              &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;%= choice.txt %&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&amp;lt;hr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This logic has been moved to &amp;lt;tt&amp;gt;app/models/quiz_question.rb&amp;lt;/tt&amp;gt;, so now the view simply needs to call the method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%questions = questionnaire.questions%&amp;gt;&lt;br /&gt;
      &amp;lt;%questions.each do |question| %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%if question.is_a? Question%&amp;gt;&lt;br /&gt;
          &amp;lt;%=question.view_question_text.html_safe%&amp;gt;&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
      &amp;lt;% end %&amp;gt;&amp;lt;hr&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unit tests were added to &amp;lt;tt&amp;gt;spec/models/quiz_question_spec.rb&amp;lt;/tt&amp;gt; covering all three types of questions to ensure that the correct HTML is generated.&lt;br /&gt;
&lt;br /&gt;
== Refactoring &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;edit&amp;lt;/tt&amp;gt; method is called when the author creates or edits a quiz. It makes every element of the quiz editable. Prior to refactoring, the HTML was in &amp;lt;tt&amp;gt;app/views/questionnaires/_quiz_questionnaire.html.erb&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @questionnaire.type == 'QuizQuestionnaire' %&amp;gt;        &lt;br /&gt;
  &amp;lt;!--handle a questionnaire differently if it is a quiz--&amp;gt;&lt;br /&gt;
    &amp;lt;table id=&amp;quot;questions_table&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;% if $disp_flag != 1 %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;td align=left width=300&amp;gt;Questions:&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;%  if @questionnaire.type != 'QuizQuestionnaire' %&amp;gt;&amp;lt;td align=left&amp;gt;weight&amp;lt;/td&amp;gt;&amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;% for @question in @questionnaire.questions %&amp;gt;&lt;br /&gt;
          &amp;lt;% questionnum=@question.id %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;% if $disp_flag != 1 %&amp;gt;&lt;br /&gt;
            &amp;lt;td &amp;gt; &amp;lt;%= text_area &amp;quot;question[]&amp;quot;, 'txt', :cols=&amp;gt;100 %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;%  @quiz_question_choices = QuizQuestionChoice.where(question_id: @question.id) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;% i=1 %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;% for @quiz_question_choice in @quiz_question_choices %&amp;gt;&lt;br /&gt;
          &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;td&amp;gt;&lt;br /&gt;
            &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
              &amp;lt;% if @question.type==&amp;quot;MultipleChoiceCheckbox&amp;quot; %&amp;gt;&lt;br /&gt;
                  &amp;lt;%= hidden_field_tag(&amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceCheckbox][#{i}][iscorrect]&amp;quot;,'0') %&amp;gt;&lt;br /&gt;
                  &amp;lt;%= check_box_tag(&amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceCheckbox][#{i}][iscorrect]&amp;quot;,'1', @quiz_question_choice.iscorrect) %&amp;gt;&lt;br /&gt;
                  &amp;amp;nbsp;&amp;lt;%= text_field_tag &amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceCheckbox][#{i}][txt]&amp;quot;, @quiz_question_choice.txt, :size=&amp;gt;40 %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;%if @question.type==&amp;quot;MultipleChoiceRadio&amp;quot; %&amp;gt;&lt;br /&gt;
                &amp;lt;%= radio_button_tag(&amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceRadio][correctindex]&amp;quot;, &amp;quot;#{i}&amp;quot;, @quiz_question_choice.iscorrect)%&amp;gt;&lt;br /&gt;
                &amp;amp;nbsp;&amp;lt;%= text_field_tag &amp;quot;quiz_question_choices[#{questionnum}][MultipleChoiceRadio][#{i}][txt]&amp;quot;, @quiz_question_choice.txt, :size=&amp;gt;40 %&amp;gt;&lt;br /&gt;
              &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              &amp;lt;%if @question.type==&amp;quot;TrueFalse&amp;quot; %&amp;gt;&lt;br /&gt;
                &amp;lt;% if @quiz_question_choice.txt==&amp;quot;True&amp;quot;%&amp;gt;&lt;br /&gt;
                  &amp;lt;%= radio_button_tag(&amp;quot;quiz_question_choices[#{questionnum}][TrueFalse][1][iscorrect]&amp;quot;, 'True', @quiz_question_choice.iscorrect) %&amp;gt;   True&lt;br /&gt;
                &amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
                &amp;lt;% if @quiz_question_choice.txt==&amp;quot;False&amp;quot;%&amp;gt;&lt;br /&gt;
                    &amp;lt;%= radio_button_tag(&amp;quot;quiz_question_choices[#{questionnum}][TrueFalse][1][iscorrect]&amp;quot;, 'False', @quiz_question_choice.iscorrect) %&amp;gt;   False&lt;br /&gt;
                &amp;lt;%end%&amp;gt;&lt;br /&gt;
              &amp;lt;% end %&amp;gt;&lt;br /&gt;
          &amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;/tr&amp;gt;&lt;br /&gt;
          &amp;lt;% i+=1 %&amp;gt;&lt;br /&gt;
        &amp;lt;%end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/table&amp;gt; &lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After refactoring, the same file looked like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @questionnaire.type == 'QuizQuestionnaire' %&amp;gt;&lt;br /&gt;
  &amp;lt;!--handle a questionnaire differently if it is a quiz--&amp;gt;&lt;br /&gt;
    &amp;lt;table id=&amp;quot;questions_table&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;% if $disp_flag != 1 %&amp;gt;&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
          &amp;lt;td align=left width=300&amp;gt;Questions:&amp;lt;/td&amp;gt;&lt;br /&gt;
          &amp;lt;%  if @questionnaire.type != 'QuizQuestionnaire' %&amp;gt;&amp;lt;td align=left&amp;gt;weight&amp;lt;/td&amp;gt;&amp;lt;%end%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;% for @question in @questionnaire.questions %&amp;gt;&lt;br /&gt;
      &amp;lt;% i=1 %&amp;gt;&lt;br /&gt;
         &amp;lt;%= @question.edit(i) %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/table&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Refactoring &amp;lt;tt&amp;gt;complete&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
Logic is written in multiple_choice_checkbox model for multiple choice checkbox question type. Similarly, same process is followed for remaining question types. To begin a quiz, &amp;lt;tt&amp;gt;complete&amp;lt;/tt&amp;gt; is called from the model.&lt;br /&gt;
     @question = self&lt;br /&gt;
     html = &amp;quot;&amp;quot;&lt;br /&gt;
     html += label_tag(&amp;quot;#{question.id}&amp;quot;, question.txt) +&amp;quot;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;
     quiz_question_choices = QuizQuestionChoice.where(question_id: @question.id)&lt;br /&gt;
     quiz_question_choices.each do |choice|&lt;br /&gt;
       if answer==&amp;quot;view&amp;quot;&lt;br /&gt;
         html += check_box_tag (&amp;quot;#{question.id}[]&amp;quot;, &amp;quot;#{choice.txt}&amp;quot;, choice.iscorrect)&lt;br /&gt;
         html += label_tag(&amp;quot;#{choice.txt}&amp;quot;, choice.txt) + &amp;quot;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;
       end&lt;br /&gt;
       if answer==&amp;quot;take&amp;quot;&lt;br /&gt;
         html += check_box_tag (&amp;quot;#{question.id}[]&amp;quot;, &amp;quot;#{choice.txt}&amp;quot;)&lt;br /&gt;
         html += label_tag(&amp;quot;#{choice.txt}&amp;quot;, choice.txt) + &amp;quot;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;
       end&lt;br /&gt;
       html.html_safe&lt;br /&gt;
     end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
== Refactoring &amp;lt;tt&amp;gt;view_completed_question&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
The logic for viewing completed question and their answers is written in &amp;lt;tt&amp;gt;app/views/student_quizzes/finished_quiz.html.erb&amp;lt;/tt&amp;gt; using a redundant if-elsif structure as shown below. &lt;br /&gt;
 &amp;lt;% if question_type.eql? 'MultipleChoiceRadio' %&amp;gt;&lt;br /&gt;
    &amp;lt;% QuizQuestionChoice.where(question_id: question.id).each do |answer|  %&amp;gt;&lt;br /&gt;
      &amp;lt;% if(answer.iscorrect) %&amp;gt;&lt;br /&gt;
        &amp;lt;b&amp;gt;&amp;lt;%= p answer.txt  %&amp;gt;&amp;lt;/b&amp;gt; -- Correct &amp;lt;br&amp;gt;&lt;br /&gt;
      &amp;lt;%else%&amp;gt;&lt;br /&gt;
        &amp;lt;%= p answer.txt  %&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;br&amp;gt;&lt;br /&gt;
    &amp;lt;%user_answer=Answer.where(response_id: @response.id, question_id:  question.id).first%&amp;gt;&lt;br /&gt;
    Your answer is: &amp;lt;b&amp;gt;&amp;lt;%= user_answer.comments  %&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
    &amp;lt;%if user_answer.answer==1%&amp;gt;&lt;br /&gt;
      &amp;lt;img src=&amp;quot;/assets/Check-icon.png&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;%else%&amp;gt;&lt;br /&gt;
      &amp;lt;img src=&amp;quot;/assets/delete_icon.png&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;%end%&amp;gt;&lt;br /&gt;
    &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
    &amp;lt;% elsif question_type.eql? 'MultipleChoiceCheckbox' %&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;% elsif(question_type == 'TrueFalse') %&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
The &amp;lt;tt&amp;gt;app/views/student_quizzes/finished_quiz.html.erb&amp;lt;/tt&amp;gt; was refactored by removing the logic from the view and making it clean. We used a single construct which determines question type and answer type by calling view_completed_question method declared in quiz class as shown below.&lt;br /&gt;
 &amp;lt;%user_answer=Answer.where(response_id: @response.id, question_id:  question.id)%&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Question &amp;lt;%= i %&amp;gt;: &amp;lt;/b&amp;gt;&amp;lt;%= label_tag &amp;quot;#{question.id}&amp;quot;, question.txt %&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;%= question.view_completed_question(i,user_answer) %&amp;gt;&lt;br /&gt;
 &amp;lt;% i += 1 %&amp;gt;&lt;br /&gt;
Similarly, logic was written in models for each of the question types. Following code snippet shows &amp;lt;tt&amp;gt;view_completed_question&amp;lt;/tt&amp;gt; for true/false question type.&lt;br /&gt;
def view_completed_question(count, answer)&lt;br /&gt;
     @question = self&lt;br /&gt;
     html=&amp;quot;&amp;quot;&lt;br /&gt;
     html+= &amp;quot;Correct Answer is: &amp;lt;b&amp;gt;&amp;quot;&lt;br /&gt;
     html+= QuizQuestionChoice.where(question_id: @question.id,iscorrect: 1).first.txt&lt;br /&gt;
     html+= &amp;quot;&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&amp;quot;&lt;br /&gt;
     html+= &amp;quot;Your answer is: &amp;lt;b&amp;gt;&amp;quot;&lt;br /&gt;
     html+= answer.first.coments + &amp;quot;&amp;lt;/b&amp;gt;&amp;quot;&lt;br /&gt;
     if(answer.first.answer == 1)&lt;br /&gt;
       html+= &amp;quot;&amp;lt;img src=/assets/Check-icon.png/&amp;gt;&amp;quot;&lt;br /&gt;
     else&lt;br /&gt;
       html+= &amp;quot;&amp;lt;img src=/assets/delete_icon.png/&amp;gt;&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
     html+= &amp;quot;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
'''Remove irrelevant comments from the &amp;lt;tt&amp;gt;student_quizzes_controller'''&lt;br /&gt;
The &amp;lt;tt&amp;gt;student_quizzes_controller&amp;lt;/tt&amp;gt; has a few comments which are irrelevant and make the method bulky. These could be safely removed from the code.&lt;br /&gt;
&lt;br /&gt;
== Unit Testing ==&lt;br /&gt;
We added unit tests in &amp;lt;tt&amp;gt;spec/models/quiz_question_spec.rb&amp;lt;/tt&amp;gt; which check the generated HTML for each of the refactored methods. by We used &amp;lt;tt&amp;gt;context&amp;lt;/tt&amp;gt; blocks to incorporate tests for each type of question. Here is an example of the tests for &amp;lt;tt&amp;gt;view_question_text&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe &amp;quot;view_question_text&amp;quot; do&lt;br /&gt;
    context &amp;quot;when the question is a multiple-choice radio&amp;quot; do&lt;br /&gt;
      it &amp;quot;contains the text of the question&amp;quot; do&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;In which city is NCSU located?&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;contains each of the choices&amp;quot; do&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;Raleigh&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;Atlanta&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;Charlotte&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;North Carolina&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;bolds the correct answer&amp;quot; do&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).to include(&amp;quot;&amp;lt;b&amp;gt;Raleigh&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;does not bold incorrect answers&amp;quot; do&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;Atlanta&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;Charlotte&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
        expect(@radio_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;North Carolina&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context &amp;quot;when the question is a multiple-choice checkbox&amp;quot; do&lt;br /&gt;
      it &amp;quot;contains the text of the question&amp;quot; do&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Which of the following are colors?&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;contains each of the choices&amp;quot; do&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Paint&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Blue&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Car&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;Red&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;bolds the correct answers&amp;quot; do&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;&amp;lt;b&amp;gt;Blue&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).to include(&amp;quot;&amp;lt;b&amp;gt;Red&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;does not bold incorrect answers&amp;quot; do&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;Paint&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
        expect(@checkbox_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;Car&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context &amp;quot;when the question is true/false&amp;quot; do&lt;br /&gt;
      it &amp;quot;contains the text of the question&amp;quot; do&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).to include(&amp;quot;2+2=4&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;contains each of the choices&amp;quot; do&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).to include(&amp;quot;True&amp;quot;)&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).to include(&amp;quot;False&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;bolds the correct answer&amp;quot; do&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).to include(&amp;quot;&amp;lt;b&amp;gt;True&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      it &amp;quot;does not bold the incorrect answer&amp;quot; do&lt;br /&gt;
        expect(@true_false_question.view_question_text.html_safe).not_to include(&amp;quot;&amp;lt;b&amp;gt;False&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dasoni</name></author>
	</entry>
</feed>