<?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=Dde</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=Dde"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Dde"/>
	<updated>2026-05-06T06:52:48Z</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_2019_-_Project_E1928._Allow_reviewers_to_bid_on_what_to_review&amp;diff=124883</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1928. Allow reviewers to bid on what to review</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1928._Allow_reviewers_to_bid_on_what_to_review&amp;diff=124883"/>
		<updated>2019-05-06T22:45:22Z</updated>

		<summary type="html">&lt;p&gt;Dde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation. It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
== Similarity to previous implementation ==&lt;br /&gt;
A similar review bidding feature was implemented in the previous semester, by making use of the '''Top Trading Cycles''' (TTC) algorithm. &amp;lt;br&amp;gt;&lt;br /&gt;
Link: [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review] &amp;lt;br&amp;gt;&lt;br /&gt;
However, there were a few issues with that implementation, notably:&lt;br /&gt;
*The lack of color-coding feature.&lt;br /&gt;
Solution: We implmented the color coding feature in our bidding list and the selection list. Following is the screenshot for that implementation. &lt;br /&gt;
* Ordering was done by team IDs, which is not a reasonable ordering.&lt;br /&gt;
* The content of some newly-added file are very similar with existing ones.&lt;br /&gt;
* The UI could have been cleaner.&lt;br /&gt;
Solution: Some of their existing code was not DRY and they had some smelly code in their implementation. We have tried to remove most of these inconsistencies in the code. &lt;br /&gt;
* There is only one list while topic bidding interface has two lists, one for the the available list of topics and the other list for topics that are selected for the bidding. &lt;br /&gt;
Solution: We have implemented the two lists as seen below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;div style=&amp;quot;display:inline-block&amp;quot; &amp;gt;&lt;br /&gt;
    &amp;lt;!--Topics table--&amp;gt;&lt;br /&gt;
    &amp;lt;table style=&amp;quot;width: 48%; float: left&amp;quot; class=&amp;quot;general&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; 'table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
      &amp;lt;% i=1 %&amp;gt;&lt;br /&gt;
      &amp;lt;tbody id=&amp;quot;topics&amp;quot; data-update-url=&amp;lt;%= &amp;quot;/student_review/set_priority?participant_id=#{participant.id}&amp;quot; %&amp;gt; class=&amp;quot;connectedSortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;sort-disabled&amp;quot;&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;% for bid in @bids %&amp;gt;&lt;br /&gt;
        &amp;lt;%= get_intelligent_review_row(bid) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render :partial =&amp;gt; 'table_line', :locals =&amp;gt; {:i=&amp;gt;i, :bid=&amp;gt;bid} %&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;% i=i+1 %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tbody&amp;gt;&lt;br /&gt;
    &amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--Selections table--&amp;gt;&lt;br /&gt;
    &amp;lt;table style=&amp;quot;width: 48%; display:block&amp;quot; class=&amp;quot;general&amp;quot; align=&amp;quot;right&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;% i=1 %&amp;gt;&lt;br /&gt;
      &amp;lt;tr&amp;gt;&amp;lt;%= render :partial =&amp;gt; 'table_header' %&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;tbody id=&amp;quot;selections&amp;quot; data-update-url=&amp;lt;%= &amp;quot;/student_review/set_priority?participant_id=#{@participant.id}&amp;quot; %&amp;gt; class=&amp;quot;connectedSortable&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;tr class=&amp;quot;sort-disabled&amp;quot;&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
      &amp;lt;% for topic in @selected_topics %&amp;gt;&lt;br /&gt;
        &amp;lt;tr style= &amp;quot;background-color:&amp;lt;%= get_topic_bg_color_by_review(topic, @max_team_size) %&amp;gt;&amp;quot; id=&amp;quot;topic_&amp;lt;%= topic.id %&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;%= render :partial =&amp;gt; 'table_line', :locals =&amp;gt; {:i=&amp;gt;i, :topic=&amp;gt;topic} %&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
        &amp;lt;% i=i+1 %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;/tbody&amp;gt;&lt;br /&gt;
    &amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
[[File:sri4.JPG]]&lt;br /&gt;
[[File:sri5.JPG]]&lt;br /&gt;
&lt;br /&gt;
* There was no &amp;quot;add link to submission&amp;quot; in the bidding list.&lt;br /&gt;
Solution: After much deliberation, this feature is not required.&lt;br /&gt;
* This implementation altered too many lines of existing Expertiza code.&lt;br /&gt;
Solution: The project required us to implement review_bids and student_review models, controllers and view for student_review. We also applied migrations to the existing database to incorporate this functionality.&lt;br /&gt;
* Many irrelevant tests were included.&lt;br /&gt;
Solution: We have not included any of the team's irrelevant tests.&lt;br /&gt;
&lt;br /&gt;
While we would not be writing this implementation from scratch, we would instead be using their [https://github.com/expertiza/expertiza/pull/1322 Pull Request] and remove the possible defects that they had.&lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
Students currently are able to &amp;quot;bid&amp;quot; for topics that they want to do as an assignment. We plan to implement the same bidding feature for reviewing others' work, which is currently assigned on a &amp;quot;first-come-first-serve&amp;quot; basis. &lt;br /&gt;
&lt;br /&gt;
The current first-come-first-serve approach to assigning reviews to students is not efficient since sometimes the same project is requested to be reviewed by multiple students, while other projects are not in demand. By letting the students bid on topics they're interested in, the reviews are assigned more efficiently based on user interest.&lt;br /&gt;
&lt;br /&gt;
In this project we will make use of the Top Trading Cycles algorithm on Expertiza, to implement the review-bidding feature.&lt;br /&gt;
&lt;br /&gt;
== Current Implementation of the bidding ==&lt;br /&gt;
Before talking about the functionality of review mapping, it's necessary to describe some of the related models and controllers in Expertiza and how they are organized to fully implement the functionality. It should be noted here that this is an implementation of the bidding feature for assignment topics.&lt;br /&gt;
&lt;br /&gt;
===Models===&lt;br /&gt;
&lt;br /&gt;
[[File:Current_design_review_bidding.jpg]]&lt;br /&gt;
&lt;br /&gt;
1. When an assignment is released, an instance of Assignment is created and corresponding topic instances of SignUpTopics are also imported, indicating that different topics are available for students to choose from within this assignment.&lt;br /&gt;
&lt;br /&gt;
2. Students are assigned as instances of AssignmentParticipant to this assignment and form up their teams (Model Team).&lt;br /&gt;
&lt;br /&gt;
3. Each team registers for several topics and becomes a candidate instance of SignUpTeam. After topics bidding, some of the candidate teams become an official signed-up team of a particular topic.&lt;br /&gt;
&lt;br /&gt;
4. After assignment submission, participants choose their preferred topics and response mappings between assignment (reviewed object), assignment team (reviewee) and assignment participant (reviewer) are created.&lt;br /&gt;
&lt;br /&gt;
5. After the mapping, participants can submit their response and the afterwards is out of discussion range of this document.&lt;br /&gt;
&lt;br /&gt;
===Use Case Diagram===&lt;br /&gt;
[[File:Review_use_case.PNG‎]]&lt;br /&gt;
===Workflow===&lt;br /&gt;
&lt;br /&gt;
Currently, Expertiza employs FIFO strategy on review assignment.  In the ReviewMappingController, the method &amp;quot;add_reviewer&amp;quot; is invoked when students try to request a peer review. When it's done, a new mapping is created, that is why review assignment is in FIFO style.&lt;br /&gt;
&lt;br /&gt;
To understand the basic workflow of bidding on topics, we can look at the LotteryController:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firstly, teams have different preferences towards available topics. For example, let's say there are three topics within an assignment, namely A, B and C and there are 4 teams W, X, Y, Z. Let's assume each teams preferred order of topics is as follows:&lt;br /&gt;
&lt;br /&gt;
W: B, A, C  |  X:  B, C  |   Y:  C, A, B | Z:  A, B, C&lt;br /&gt;
&lt;br /&gt;
This data structure is passed to the back-end service http://peerlogic.csc.ncsu.edu/intelligent_assignment/merge_teams by method &amp;quot;run_intelligent_assignment&amp;quot; of LotteryController.  The peerlogic service runs top_trading_cycles algorithm to let the teams have a fair bidding over the topics.&lt;br /&gt;
&lt;br /&gt;
Now, consider a similar bidding approach to peer review assignment. Why is it workable? The following diagram illustrates the similarity of the two bidding model. &lt;br /&gt;
[[File:Contrast_topic_review_bidding.jpg]]&lt;br /&gt;
&lt;br /&gt;
As for topics bidding, a few available slots of a particular topic are open for teams contending. In the left part of the diagram, there are 4 slots so only 4 teams can successfully contend for it. Slot is described as &amp;quot;max_choosers&amp;quot; of a sign_up topic in Expertiza. Consequently, there will be 4 different responses after the submission, and this time it is the participants that contend for the responses. &lt;br /&gt;
&lt;br /&gt;
Some discrepancies need additional attention.&lt;br /&gt;
&lt;br /&gt;
1. Slots can be left unoccupied if no team is willing to respond. However, every response needs to have at least some reviewers. &lt;br /&gt;
&lt;br /&gt;
2. The size of bidding data is different, since the number of teams are usually 1/2, 1/3 or 1/4 of the participants. &lt;br /&gt;
&lt;br /&gt;
3. The policy of bidding may be slightly different. Participants are not allowed to review a response submitted by themselves.  However, the topic bidding doesn't have this constraint.&lt;br /&gt;
&lt;br /&gt;
== Top Trading Cycles Mechanism ==&lt;br /&gt;
&lt;br /&gt;
In the paper School Choice: A Mechanism Design Approach, author Atila Abdulkadiroglu, and Tayfun Sonmez have described Top Trading Cycles Mechanism. The intuition of the mechanism is students who have the highest priorities are allowed to trade the schools. Students who are assigned to schools are removed and other students who have the highest priority will compete for schools. The mechanism is as follows:&lt;br /&gt;
&lt;br /&gt;
Step1: Each school has a counter (No. of seats/ capacity). Each student has a priority list. Each school points to the student who has the highest priority to the school. A cycle is formed which is an ordered&lt;br /&gt;
list (s1, i1, s2, ...., sk,ik). Every student in the cycle points to the school he/she is admitted and removed from the list. The counter of school is reduced by one and when it becomes zero it is removed from the list.&lt;br /&gt;
&lt;br /&gt;
Step k: Remaining students point to their favorite school among the remaining schools and each remaining school points to the student with the highest priority among the remaining students. There is at least one student. Every student in the cycle points to the school he/she is admitted and removed from the list. The counter of school is reduced by one and when it becomes zero it is removed from the list.&lt;br /&gt;
&lt;br /&gt;
The algorithm terminates when all students are assigned a seat.&lt;br /&gt;
&lt;br /&gt;
1.  Top Trading Cycles algorithm: [https://www.jstor.org/stable/pdf/3132114.pdf?casa_token=Bp8Syf8Q0yYAAAAA:f7zDJdWurp5cYlHtSHaUxRbDc1o4sL0Qx8UTnk7C5eeXPhgyiTOaWqgftX-nNJ48s6SGyPBzH3_U3Yv6Pfapo1OJaj-estvNyRl60LNQi5QgGW3LmAW8pQ]&lt;br /&gt;
&lt;br /&gt;
== Bidding policy (Stable marriage problem) ==&lt;br /&gt;
As part of this assignment, we have to analyse the implementation of the stable marriage problem which is a stable sorting algorithm. The following summary of how the algorithm works, is taken from the &amp;quot;College Admissions and the Stability of Marriage (1962)&amp;quot; by D. Gale and L. S. Shapley. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A certain community consists of n men and n women. Each person ranks those of the opposite sex in accordance with his or her preferences for a marriage partner. We&lt;br /&gt;
seek a satisfactory way of marrying off all members of the community. Imitating our earlier deﬁnition, we call a set of marriages unstable (and here the suitability of the&lt;br /&gt;
term is quite clear) if under it there are a man and a woman who are not married to each other but prefer each other to their actual mates.&lt;br /&gt;
&lt;br /&gt;
'''Deﬁnition:''' An assignment of couples will be called unstable if there are two men α and β who are married to women A and B, respectively, although β prefers A to B and A prefers β to α.&lt;br /&gt;
&lt;br /&gt;
So, we can ask the question: For any pattern of preferences is it possible to ﬁnd a stable set of marriages?&lt;br /&gt;
&lt;br /&gt;
Before giving the answer let us look at some examples.&lt;br /&gt;
&lt;br /&gt;
Example 1. The following is the “ranking matrix” of three men, α, β, and γ , and three women, A, B, and C.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Man\Woman !! A !! B !! C&lt;br /&gt;
|-&lt;br /&gt;
| α || 1,3      || 2,2     || 3,1&lt;br /&gt;
|-&lt;br /&gt;
| β || 3,1      || 1,3     || 2,2&lt;br /&gt;
|-&lt;br /&gt;
| γ || 2,2      || 3,1     || 1,3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ﬁrst number of each pair in the matrix gives the ranking of women by the men, the second number is the ranking of the men by the women. Thus, α ranks A ﬁrst, B second, C third, while A ranks β ﬁrst, γ second, and α third, etc.&lt;br /&gt;
&lt;br /&gt;
There are six possible sets of marriages; of these, three are stable. One of these is realized by giving each man his ﬁrst choice, thus α marries A, β marries B, and γ marries C. Note that although each woman gets her last choice, the arrangement is nevertheless stable. Alternatively one may let the women have their ﬁrst choices and marry α to C, β to A, and γ to B. The third stable arrangement is to give everyone his or her second choice and have α marry B, β marry C, and γ marry A. The reader will easily verify that all other arrangements are unstable.&lt;br /&gt;
&lt;br /&gt;
Based on this approach, in the existing implementation of Expertiza, we have match_new_teams_to_topics method in the lottery_controller that performs this stable sorting algorithm for teams that have bid for an assignment. Our objective would be to implement a similar strategy, but we would use students instead of teams since there are no &amp;quot;team reviews&amp;quot;. Every student selects their own assignment to review.&lt;br /&gt;
&lt;br /&gt;
== Design strategy ==&lt;br /&gt;
Almost all of the functionality for our project has already been implemented in the review portion of the Expertiza system - where the teams are allowed to bid on topics they want to work for their project. We plan to reuse the code to keep the implementation DRY but we need to add some additional features to make it work for the review bidding functionality. '''Delegation''' is a way to make composition as powerful for reuse as inheritance. The Delegation pattern will help us reduce the coupling of methods to their original class as we have components that seem to behave identically, but we realize that this situation can change in the future.&lt;br /&gt;
&lt;br /&gt;
[[File:Untitled_Diagram.png]]&lt;br /&gt;
&lt;br /&gt;
====Controller====&lt;br /&gt;
Because of this, we plan to approach this project by first using delegation pattern to add biding capability to the [https://github.com/expertiza/expertiza/blob/master/app/controllers/review_mapping_controller.rb review mapping controller] for choosing topics. Apart from this, a new controller,[https://github.com/expertiza/expertiza/pull/1322/files#diff-e064188effa2297543b98ac353bba4e3 review bids controller] is implemented to handle interactions similar to the one done in [https://github.com/expertiza/expertiza/blob/master/app/controllers/lottery_controller.rb lottery controller]. It handles the following implementations. &lt;br /&gt;
&lt;br /&gt;
1. Trigger the bidding by sending a request to PeerLogic backend with proper parameters retrieved from ReviewBid records. &lt;br /&gt;
&lt;br /&gt;
2. Process the response from PeerLogic and transform it into records of ReviewResponseMap.&lt;br /&gt;
&lt;br /&gt;
====View====&lt;br /&gt;
The bidding interface for reviews is followed from [https://github.com/expertiza/expertiza/pull/778/commits similar] implementation for topic bidding. We need to modify the ''code'' to implement the heat-map showing us the demand density for each project to be reviewed, the list of all available topics to review and the list of topics selected already. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Color Coding Scheme:''' &amp;lt;br&amp;gt;&lt;br /&gt;
The color coding scheme would range from Red for the most in-demand topics to green for the least contested topics. &amp;lt;br&amp;gt;&lt;br /&gt;
The top 10% of in-demand topics will be coded in Red, the next 30% of the topics will be in orange, the next 30% in yellow and the last 30% in the green. We are using percentages instead of hard-coding the color coding scheme so that it works dynamically with changing number of students. &amp;lt;br&amp;gt;&lt;br /&gt;
After we allow the student users to bid for their topic of interest we need to provide access to instructors to start the bidding algorithm.&lt;br /&gt;
&lt;br /&gt;
====Model====&lt;br /&gt;
To maintain the original functionality of Expertiza as well as to add review bidding, a new model to handle bidding data called ReviewBid is created. ReviewBid contains bidding assignment information, its biddable topics as well as the  participants' preference. ReviewBid is served as the input of the bidding algorithm. We decided to let participants bid on assignment teams rather than topics for simplicity.&lt;br /&gt;
&lt;br /&gt;
Here is the definition of ReviewBid:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id &lt;br /&gt;
|int(11)  &lt;br /&gt;
|unique identifier for the record&lt;br /&gt;
|- &lt;br /&gt;
!team_id   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|the work of team to be bid on&lt;br /&gt;
|- &lt;br /&gt;
!participant_id   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|participant id&lt;br /&gt;
|- &lt;br /&gt;
!priority   &lt;br /&gt;
|text&lt;br /&gt;
|participant's preference towards the team&lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|timestamp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|timestamp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Allow Instructor to set review strategy to '''bidding''': &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:sri1.JPG]] &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the review strategy to  '''bidding''', participants are assigned a default bidding list, ordered by topic's name.&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Default_bidding_list.png]]&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Participants can drag the items up or down to alter the priority.&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Altered_bidding_list.png]]&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instructors can start bidding by clicking the following icon.&amp;lt;br&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
[[File:sri3.JPG]]&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the bidding is done, participants can login and see what they are assigned with.&amp;lt;br&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
[[File:Bidding_result.png]]&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Automated tests are to be written for model ReviewBid, controller ReviewBidController. We also plan to write basic tests to check the correctness of Gale Shapley algorithm.&lt;br /&gt;
&lt;br /&gt;
UI Tests:&lt;br /&gt;
&lt;br /&gt;
In addition to automated tests we will also perform manual testing of the newly added features which include the following:&lt;br /&gt;
&lt;br /&gt;
1. The student should be able to bid the reviews when Professor enables bid option for students on that particular assignment.&lt;br /&gt;
&lt;br /&gt;
2. The reviews prioritized by the student should show colors i.e. green, orange and red indicating how likely he is going to get the review that he bid.&lt;br /&gt;
&lt;br /&gt;
3. At maximum, a student should be able to four assignments.&lt;br /&gt;
&lt;br /&gt;
== Pointers for future teams working on this project ==&lt;br /&gt;
1. The selections table in two column view does not retain the data &lt;br /&gt;
After we drag and drop the projects in the second table ‘selections’, the data does not persist or get saved in the DB. So when we refresh the page the selections table is empty again. &lt;br /&gt;
Code: topic_list code&lt;br /&gt;
&lt;br /&gt;
2. Color-coding&lt;br /&gt;
The color coding implementation should be tested. &lt;br /&gt;
As the selections table is not getting saved, the color-coding feature could not be tested though it is implemented in the below file. &lt;br /&gt;
Code: def bg_color_coding_review&lt;br /&gt;
&lt;br /&gt;
3. The Gale Shaply implementation needs to be checked. &lt;br /&gt;
After making sure the data gets saved in the DB from selection table, we need to make sure that it is passed to the implemented Gale shaply algorithm in the required format and gives the required output. &lt;br /&gt;
Code: def gale_shaply&lt;br /&gt;
&lt;br /&gt;
4. The Gale Shapley button icon needs to be changed. &lt;br /&gt;
Right now, we are reusing the info.png which is the icon for intelligent topic assignment. We should find a better suited name for the file and also find an appropriate image for it.&lt;br /&gt;
&lt;br /&gt;
5. DRY the code as it is vastly similar to the intelligent assignment implementation.&lt;br /&gt;
&lt;br /&gt;
6. Testing &lt;br /&gt;
We need to write proper tests to verify our Gale shaply algorithm and the UI.  Some possible Rspec tests that we can add are: &lt;br /&gt;
If a person gives a topic as his first preference and no one else has that topic as their first preference, the aforementioned person should get that topic to review after the Gale shaply algorithm is run. &lt;br /&gt;
The topic that a participant is assigned cannot be reviewed by the same participant. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
 &lt;br /&gt;
# College Admissions and the Stability of Marriage (1962), D. Gale and L. S. Shapley [https://www-jstor-org.prox.lib.ncsu.edu/stable/2312726?Search=yes&amp;amp;resultItemClick=true&amp;amp;searchText=College&amp;amp;searchText=Admissions&amp;amp;searchText=and&amp;amp;searchText=the&amp;amp;searchText=Stability&amp;amp;searchText=of&amp;amp;searchText=Marriage&amp;amp;searchUri=%2Faction%2FdoBasicSearch%3Fgroup%3Dnone%26amp%3Bfc%3Doff%26amp%3BQuery%3DCollege%2BAdmissions%2Band%2Bthe%2BStability%2Bof%2BMarriage%26amp%3Bwc%3Don%26amp%3Bacc%3Don&amp;amp;ab_segments=0%2Fdefault-2%2Fcontrol&amp;amp;refreqid=search%3A6c17f9ae92b22bc404fc3b7641ac908a&amp;amp;seq=1#metadata_info_tab_contents ]&lt;br /&gt;
# CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review]&lt;br /&gt;
# Pull Request #1322 (E1856. Allow reviewers to bid on what to review) [https://github.com/expertiza/expertiza/pull/1322 ]&lt;br /&gt;
# Top Trading Cycles Algorithm[https://www.jstor.org/stable/pdf/3132114.pdf?casa_token=Bp8Syf8Q0yYAAAAA:f7zDJdWurp5cYlHtSHaUxRbDc1o4sL0Qx8UTnk7C5eeXPhgyiTOaWqgftX-nNJ48s6SGyPBzH3_U3Yv6Pfapo1OJaj-estvNyRl60LNQi5QgGW3LmAW8pQ]&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1928._Allow_reviewers_to_bid_on_what_to_review&amp;diff=124629</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1928. Allow reviewers to bid on what to review</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1928._Allow_reviewers_to_bid_on_what_to_review&amp;diff=124629"/>
		<updated>2019-04-27T01:55:05Z</updated>

		<summary type="html">&lt;p&gt;Dde: /* Similarity to previous implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation. It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
== Similarity to previous implementation ==&lt;br /&gt;
A similar review bidding feature was implemented in the previous semester, by making use of the '''Top Trading Cycles'''(TTC) algorithm. &amp;lt;br&amp;gt;&lt;br /&gt;
Link: [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review] &amp;lt;br&amp;gt;&lt;br /&gt;
However, there were a few issues with that implementation, notably:&lt;br /&gt;
*The lack of color-coding feature.&lt;br /&gt;
Solution: We implmented the color coding feature in our bidding list and the selection list. Following is the screenshot for that implementation. &lt;br /&gt;
* Ordering was done by team IDs, which is not a reasonable ordering.&lt;br /&gt;
* The content of some newly-added file are very similar with existing ones.&lt;br /&gt;
* The UI could have been cleaner.&lt;br /&gt;
Solution: Some of their existing code was not DRY and they had some smelly code in their implementation. We have tried to remove most of these inconsistencies in the code. &lt;br /&gt;
* There is only one list while topic bidding interface has two lists, one for the the available list of topics and the other list for topics that are selected for the bidding. &lt;br /&gt;
Solution: We have implemented the two lists as seen below:&lt;br /&gt;
[[File:Dde1.png]]&lt;br /&gt;
[[File:Dde2.png]]&lt;br /&gt;
&lt;br /&gt;
* There was no &amp;quot;add link to submission&amp;quot; in the bidding list.&lt;br /&gt;
Solution: After much deliberation, this feature is not required.&lt;br /&gt;
* This implementation altered too many lines of existing Expertiza code.&lt;br /&gt;
Solution: The project required us to implement review_bids and student_review models, controllers and view for student_review. We also applied migrations to the existing database to incorporate this functionality.&lt;br /&gt;
* Many irrelevant tests were included.&lt;br /&gt;
&lt;br /&gt;
While we would not be writing this implementation from scratch, we would instead be using their [https://github.com/expertiza/expertiza/pull/1322 Pull Request] and remove the possible defects that they had.&lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
Students currently are able to &amp;quot;bid&amp;quot; for topics that they want to do as an assignment. We plan to implement the same bidding feature for reviewing others' work, which is currently assigned on a &amp;quot;first-come-first-serve&amp;quot; basis. &lt;br /&gt;
&lt;br /&gt;
The current first-come-first-serve approach to assigning reviews to students is not efficient since sometimes the same project is requested to be reviewed by multiple students, while other projects are not in demand. By letting the students bid on topics they're interested in, the reviews are assigned more efficiently based on user interest.&lt;br /&gt;
&lt;br /&gt;
In this project we will make use of the Top Trading Cycles algorithm on Expertiza, to implement the review-bidding feature.&lt;br /&gt;
&lt;br /&gt;
== Current Implementation of the bidding ==&lt;br /&gt;
Before talking about the functionality of review mapping, it's necessary to describe some of the related models and controllers in Expertiza and how they are organized to fully implement the functionality. It should be noted here that this is an implementation of the bidding feature for assignment topics.&lt;br /&gt;
&lt;br /&gt;
===Models===&lt;br /&gt;
&lt;br /&gt;
[[File:Current_design_review_bidding.jpg]]&lt;br /&gt;
&lt;br /&gt;
1. When an assignment is released, an instance of Assignment is created and corresponding topic instances of SignUpTopics are also imported, indicating that different topics are available for students to choose from within this assignment.&lt;br /&gt;
&lt;br /&gt;
2. Students are assigned as instances of AssignmentParticipant to this assignment and form up their teams(Model Team).&lt;br /&gt;
&lt;br /&gt;
3. Each team registers for several topics and becomes a candidate instance of SignUpTeam. After topics bidding, some of the candidate teams become an official signed-up team of a particular topic.&lt;br /&gt;
&lt;br /&gt;
4. After assignment submission, participants choose their preferred topics and response mappings between assignment(reviewed object), assignment team(reviewee) and assignment participant(reviewer) are created.&lt;br /&gt;
&lt;br /&gt;
5. After the mapping, participants can submit their response and the afterwards is out of discussion range of this document.&lt;br /&gt;
&lt;br /&gt;
===Use Case Diagram===&lt;br /&gt;
[[File:Review_use_case.PNG‎]]&lt;br /&gt;
===Workflow===&lt;br /&gt;
&lt;br /&gt;
Currently, Expertiza employs FIFO strategy on review assignment.  In the ReviewMappingController, the method &amp;quot;add_reviewer&amp;quot; is invoked when students try to request a peer review. When it's done, a new mapping is created, that is why review assignment is in FIFO style.&lt;br /&gt;
&lt;br /&gt;
To understand the basic workflow of bidding on topics, we can look at the LotteryController:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firstly, teams have different preferences towards available topics. For example, let's say there are three topics within an assignment, namely A, B and C and there are 4 teams W, X, Y, Z. Let's assume each teams preferred order of topics is as follows:&lt;br /&gt;
&lt;br /&gt;
W: B, A, C  |  X:  B, C  |   Y:  C, A, B | Z:  A, B, C&lt;br /&gt;
&lt;br /&gt;
This data structure is passed to the back-end service http://peerlogic.csc.ncsu.edu/intelligent_assignment/merge_teams by method &amp;quot;run_intelligent_assignment&amp;quot; of LotteryController.  The peerlogic service runs top_trading_cycles algorithm to let the teams have a fair bidding over the topics.&lt;br /&gt;
&lt;br /&gt;
Now, consider a similar bidding approach to peer review assignment. Why is it workable? The following diagram illustrates the similarity of the two bidding model. &lt;br /&gt;
[[File:Contrast_topic_review_bidding.jpg]]&lt;br /&gt;
&lt;br /&gt;
As for topics bidding, a few available slots of a particular topic are open for teams contending. In the left part of the diagram, there are 4 slots so only 4 teams can successfully contend for it. Slot is described as &amp;quot;max_choosers&amp;quot; of a sign_up topic in Expertiza. Consequently, there will be 4 different responses after the submission, and this time it is the participants that contend for the responses. &lt;br /&gt;
&lt;br /&gt;
Some discrepancies need additional attention.&lt;br /&gt;
&lt;br /&gt;
1. Slots can be left unoccupied if no team is willing to respond. However, every response needs to have at least some reviewers. &lt;br /&gt;
&lt;br /&gt;
2. The size of bidding data is different, since the number of teams are usually 1/2, 1/3 or 1/4 of the participants. &lt;br /&gt;
&lt;br /&gt;
3. The policy of bidding may be slightly different. Participants are not allowed to review a response submitted by themselves.  However, the topic bidding doesn't have this constraint.&lt;br /&gt;
&lt;br /&gt;
== Top Trading Cycles Mechanism ==&lt;br /&gt;
&lt;br /&gt;
In the paper School Choice: A Mechanism Design Approach, author Atila Abdulkadiroglu, and Tayfun Sonmez have described Top Trading Cycles Mechanism. The intuition of the mechanism is students who have the highest priorities are allowed to trade the schools. Students who are assigned to schools are removed and other students who have the highest priority will compete for schools. The mechanism is as follows:&lt;br /&gt;
&lt;br /&gt;
Step1: Each school has a counter (No. of seats/ capacity). Each student has a priority list. Each school points to the student who has the highest priority to the school. A cycle is formed which is an ordered&lt;br /&gt;
list (s1, i1, s2, ...., sk,ik). Every student in the cycle points to the school he/she is admitted and removed from the list. The counter of school is reduced by one and when it becomes zero it is removed from the list.&lt;br /&gt;
&lt;br /&gt;
Step k: Remaining students point to their favorite school among the remaining schools and each remaining school points to the student with the highest priority among the remaining students. There is at least one student. Every student in the cycle points to the school he/she is admitted and removed from the list. The counter of school is reduced by one and when it becomes zero it is removed from the list.&lt;br /&gt;
&lt;br /&gt;
The algorithm terminates when all students are assigned a seat.&lt;br /&gt;
&lt;br /&gt;
1.  Top Trading Cycles algorithm: [https://www.jstor.org/stable/pdf/3132114.pdf?casa_token=Bp8Syf8Q0yYAAAAA:f7zDJdWurp5cYlHtSHaUxRbDc1o4sL0Qx8UTnk7C5eeXPhgyiTOaWqgftX-nNJ48s6SGyPBzH3_U3Yv6Pfapo1OJaj-estvNyRl60LNQi5QgGW3LmAW8pQ]&lt;br /&gt;
&lt;br /&gt;
== Bidding policy (Stable marriage problem) ==&lt;br /&gt;
As part of this assignment, we have to analyse the implementation of the stable marriage problem which is a stable sorting algorithm. The following summary of how the algorithm works, is taken from the &amp;quot;College Admissions and the Stability of Marriage (1962)&amp;quot; by D. Gale and L. S. Shapley. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A certain community consists of n men and n women. Each person ranks those of the opposite sex in accordance with his or her preferences for a marriage partner. We&lt;br /&gt;
seek a satisfactory way of marrying off all members of the community. Imitating our earlier deﬁnition, we call a set of marriages unstable (and here the suitability of the&lt;br /&gt;
term is quite clear) if under it there are a man and a woman who are not married to each other but prefer each other to their actual mates.&lt;br /&gt;
&lt;br /&gt;
'''Deﬁnition:''' An assignment of couples will be called unstable if there are two men α and β who are married to women A and B, respectively, although β prefers A to B and A prefers β to α.&lt;br /&gt;
&lt;br /&gt;
So, we can ask the question: For any pattern of preferences is it possible to ﬁnd a stable set of marriages?&lt;br /&gt;
&lt;br /&gt;
Before giving the answer let us look at some examples.&lt;br /&gt;
&lt;br /&gt;
Example 1. The following is the “ranking matrix” of three men, α, β, and γ , and three women, A, B, and C.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Man\Woman !! A !! B !! C&lt;br /&gt;
|-&lt;br /&gt;
| α || 1,3      || 2,2     || 3,1&lt;br /&gt;
|-&lt;br /&gt;
| β || 3,1      || 1,3     || 2,2&lt;br /&gt;
|-&lt;br /&gt;
| γ || 2,2      || 3,1     || 1,3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ﬁrst number of each pair in the matrix gives the ranking of women by the men, the second number is the ranking of the men by the women. Thus, α ranks A ﬁrst, B second, C third, while A ranks β ﬁrst, γ second, and α third, etc.&lt;br /&gt;
&lt;br /&gt;
There are six possible sets of marriages; of these, three are stable. One of these is realized by giving each man his ﬁrst choice, thus α marries A, β marries B, and γ marries C. Note that although each woman gets her last choice, the arrangement is nevertheless stable. Alternatively one may let the women have their ﬁrst choices and marry α to C, β to A, and γ to B. The third stable arrangement is to give everyone his or her second choice and have α marry B, β marry C, and γ marry A. The reader will easily verify that all other arrangements are unstable.&lt;br /&gt;
&lt;br /&gt;
Based on this approach, in the existing implementation of Expertiza, we have match_new_teams_to_topics method in the lottery_controller that performs this stable sorting algorithm for teams that have bid for an assignment. Our objective would be to implement a similar strategy, but we would use students instead of teams since there are no &amp;quot;team reviews&amp;quot;. Every student selects their own assignment to review.&lt;br /&gt;
&lt;br /&gt;
== Design strategy ==&lt;br /&gt;
Almost all of the functionality for our project has already been implemented in the review portion of the Expertiza system - where the teams are allowed to bid on topics they want to work for their project. We plan to reuse the code to keep the implementation DRY but we need to add some additional features to make it work for the review bidding functionality. '''Delegation''' is a way to make composition as powerful for reuse as inheritance. The Delegation pattern will help us reduce the coupling of methods to their original class as we have components that seem to behave identically, but we realize that this situation can change in the future.&lt;br /&gt;
&lt;br /&gt;
[[File:Untitled_Diagram.png]]&lt;br /&gt;
&lt;br /&gt;
====Controller====&lt;br /&gt;
Because of this, we plan to approach this project by first using delegation pattern to add biding capability to the [https://github.com/expertiza/expertiza/blob/master/app/controllers/review_mapping_controller.rb review mapping controller] for choosing topics. Apart from this, a new controller,[https://github.com/expertiza/expertiza/pull/1322/files#diff-e064188effa2297543b98ac353bba4e3 review bids controller] is implemented to handle interactions similar to the one done in [https://github.com/expertiza/expertiza/blob/master/app/controllers/lottery_controller.rb lottery controller]. It handles the following implementations. &lt;br /&gt;
&lt;br /&gt;
1. Trigger the bidding by sending a request to PeerLogic backend with proper parameters retrieved from ReviewBid records. &lt;br /&gt;
&lt;br /&gt;
2. Process the response from PeerLogic and transform it into records of ReviewResponseMap.&lt;br /&gt;
&lt;br /&gt;
====View====&lt;br /&gt;
The bidding interface for reviews is followed from [https://github.com/expertiza/expertiza/pull/778/commits similar] implementation for topic bidding. We need to modify the ''code'' to implement the heat-map showing us the demand density for each project to be reviewed, the list of all available topics to review and the list of topics selected already. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Color Coding Scheme:''' &amp;lt;br&amp;gt;&lt;br /&gt;
The color coding scheme would range from Red for the most in-demand topics to green for the least contested topics. &amp;lt;br&amp;gt;&lt;br /&gt;
The top 10% of in-demand topics will be coded in Red, the next 30% of the topics will be in orange, the next 30% in yellow and the last 30% in the green. We are using percentages instead of hard-coding the color coding scheme so that it works dynamically with changing number of students. &amp;lt;br&amp;gt;&lt;br /&gt;
After we allow the student users to bid for their topic of interest we need to provide access to instructors to start the bidding algorithm.&lt;br /&gt;
&lt;br /&gt;
====Model====&lt;br /&gt;
To maintain the original functionality of Expertiza as well as to add review bidding, a new model to handle bidding data called ReviewBid is created. ReviewBid contains bidding assignment information, its biddable topics as well as the  participants' preference. ReviewBid is served as the input of the bidding algorithm. We decided to let participants bid on assignment teams rather than topics for simplicity.&lt;br /&gt;
&lt;br /&gt;
Here is the definition of ReviewBid:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id &lt;br /&gt;
|int(11)  &lt;br /&gt;
|unique identifier for the record&lt;br /&gt;
|- &lt;br /&gt;
!team_id   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|the work of team to be bid on&lt;br /&gt;
|- &lt;br /&gt;
!participant_id   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|participant id&lt;br /&gt;
|- &lt;br /&gt;
!priority   &lt;br /&gt;
|text&lt;br /&gt;
|participant's preference towards the team&lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|timestamp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|timestamp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Allow Instructor to set review strategy to '''bidding''': &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Review_strategy.png]] &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the review strategy to  '''bidding''', participants are assigned a default bidding list, ordered by topic's name.&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Default_bidding_list.png]]&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Participants can drag the items up or down to alter the priority.&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Altered_bidding_list.png]]&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instructors can start bidding by clicking the following icon.&amp;lt;br&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
[[File:Bidding_icon.png]]&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the bidding is done, participants can login and see what they are assigned with.&amp;lt;br&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
[[File:Bidding_result.png]]&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Automated tests are to be written for model ReviewBid, controller ReviewBidController. We also plan to write basic tests to check the correctness of Gale Shapley algorithm.&lt;br /&gt;
&lt;br /&gt;
UI Tests:&lt;br /&gt;
&lt;br /&gt;
In addition to automated tests we will also perform manual testing of the newly added features which include the following:&lt;br /&gt;
&lt;br /&gt;
1. The student should be able to bid the reviews when Professor enables bid option for students on that particular assignment.&lt;br /&gt;
&lt;br /&gt;
2. The reviews prioritized by the student should show colors i.e. green, orange and red indicating how likely he is going to get the review that he bid.&lt;br /&gt;
&lt;br /&gt;
3. At maximum, a student should be able to four assignments.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
 &lt;br /&gt;
# College Admissions and the Stability of Marriage (1962), D. Gale and L. S. Shapley [https://www-jstor-org.prox.lib.ncsu.edu/stable/2312726?Search=yes&amp;amp;resultItemClick=true&amp;amp;searchText=College&amp;amp;searchText=Admissions&amp;amp;searchText=and&amp;amp;searchText=the&amp;amp;searchText=Stability&amp;amp;searchText=of&amp;amp;searchText=Marriage&amp;amp;searchUri=%2Faction%2FdoBasicSearch%3Fgroup%3Dnone%26amp%3Bfc%3Doff%26amp%3BQuery%3DCollege%2BAdmissions%2Band%2Bthe%2BStability%2Bof%2BMarriage%26amp%3Bwc%3Don%26amp%3Bacc%3Don&amp;amp;ab_segments=0%2Fdefault-2%2Fcontrol&amp;amp;refreqid=search%3A6c17f9ae92b22bc404fc3b7641ac908a&amp;amp;seq=1#metadata_info_tab_contents ]&lt;br /&gt;
# CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review]&lt;br /&gt;
# Pull Request #1322 (E1856. Allow reviewers to bid on what to review) [https://github.com/expertiza/expertiza/pull/1322 ]&lt;br /&gt;
# Top Trading Cycles Algorithm[https://www.jstor.org/stable/pdf/3132114.pdf?casa_token=Bp8Syf8Q0yYAAAAA:f7zDJdWurp5cYlHtSHaUxRbDc1o4sL0Qx8UTnk7C5eeXPhgyiTOaWqgftX-nNJ48s6SGyPBzH3_U3Yv6Pfapo1OJaj-estvNyRl60LNQi5QgGW3LmAW8pQ]&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Dde1.png&amp;diff=124628</id>
		<title>File:Dde1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Dde1.png&amp;diff=124628"/>
		<updated>2019-04-27T01:52:17Z</updated>

		<summary type="html">&lt;p&gt;Dde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Dde2.png&amp;diff=124626</id>
		<title>File:Dde2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Dde2.png&amp;diff=124626"/>
		<updated>2019-04-27T01:51:56Z</updated>

		<summary type="html">&lt;p&gt;Dde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1928._Allow_reviewers_to_bid_on_what_to_review&amp;diff=123867</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1928. Allow reviewers to bid on what to review</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1928._Allow_reviewers_to_bid_on_what_to_review&amp;diff=123867"/>
		<updated>2019-04-12T20:34:12Z</updated>

		<summary type="html">&lt;p&gt;Dde: /* View */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation. It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
== Similarity to previous implementation ==&lt;br /&gt;
A similar review bidding feature was implemented in the previous semester, by making use of the '''Top Trading Cycles'''(TTC) algorithm. &amp;lt;br&amp;gt;&lt;br /&gt;
Link: [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review] &amp;lt;br&amp;gt;&lt;br /&gt;
However, there were a few issues with that implementation, notably:&lt;br /&gt;
# The lack of color-coding feature.&lt;br /&gt;
# Ordering was done by team IDs, which is not a reasonable ordering.&lt;br /&gt;
# The content of some newly-added file are very similar with existing ones.&lt;br /&gt;
# The UI could have been cleaner.&lt;br /&gt;
# There is only one list while topic bidding interface has two lists, one for the the available list of topics and the other list for topics that are selected for the bidding. &lt;br /&gt;
# There was no &amp;quot;add link to submission&amp;quot; in the bidding list.&lt;br /&gt;
# This implementation altered too many lines of existing Expertiza code.&lt;br /&gt;
# Many irrelevant tests were included.&lt;br /&gt;
&lt;br /&gt;
While we would not be writing this implementation from scratch, we would instead be using their [https://github.com/expertiza/expertiza/pull/1322 Pull Request] and remove the possible defects that they had.&lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
Students currently are able to &amp;quot;bid&amp;quot; for topics that they want to do as an assignment. We plan to implement the same bidding feature for reviewing others' work, which is currently assigned on a &amp;quot;first-come-first-serve&amp;quot; basis. &lt;br /&gt;
&lt;br /&gt;
The current first-come-first-serve approach to assigning reviews to students is not efficient since sometimes the same project is requested to be reviewed by multiple students, while other projects are not in demand. By letting the students bid on topics they're interested in, the reviews are assigned more efficiently based on user interest.&lt;br /&gt;
&lt;br /&gt;
In this project we will make use of the Top Trading Cycles algorithm on Expertiza, to implement the review-bidding feature.&lt;br /&gt;
&lt;br /&gt;
== Current Implementation of the bidding ==&lt;br /&gt;
Before talking about the functionality of review mapping, it's necessary to describe some of the related models and controllers in Expertiza and how they are organized to fully implement the functionality. It should be noted here that this is an implementation of the bidding feature for assignment topics.&lt;br /&gt;
&lt;br /&gt;
===Models===&lt;br /&gt;
&lt;br /&gt;
[[File:Current_design_review_bidding.jpg]]&lt;br /&gt;
&lt;br /&gt;
1. When an assignment is released, an instance of Assignment is created and corresponding topic instances of SignUpTopics are also imported, indicating that different topics are available for students to choose from within this assignment.&lt;br /&gt;
&lt;br /&gt;
2. Students are assigned as instances of AssignmentParticipant to this assignment and form up their teams(Model Team).&lt;br /&gt;
&lt;br /&gt;
3. Each team registers for several topics and becomes a candidate instance of SignUpTeam. After topics bidding, some of the candidate teams become an official signed-up team of a particular topic.&lt;br /&gt;
&lt;br /&gt;
4. After assignment submission, participants choose their preferred topics and response mappings between assignment(reviewed object), assignment team(reviewee) and assignment participant(reviewer) are created.&lt;br /&gt;
&lt;br /&gt;
5. After the mapping, participants can submit their response and the afterwards is out of discussion range of this document.&lt;br /&gt;
&lt;br /&gt;
===Use Case Diagram===&lt;br /&gt;
[[File:Review_use_case.PNG‎]]&lt;br /&gt;
===Workflow===&lt;br /&gt;
&lt;br /&gt;
Currently, Expertiza employs FIFO strategy on review assignment.  In the ReviewMappingController, the method &amp;quot;add_reviewer&amp;quot; is invoked when students try to request a peer review. When it's done, a new mapping is created, that is why review assignment is in FIFO style.&lt;br /&gt;
&lt;br /&gt;
To understand the basic workflow of bidding on topics, we can look at the LotteryController:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firstly, teams have different preferences towards available topics. For example, let's say there are three topics within an assignment, namely A, B and C and there are 4 teams W, X, Y, Z. Let's assume each teams preferred order of topics is as follows:&lt;br /&gt;
&lt;br /&gt;
W: B, A, C  |  X:  B, C  |   Y:  C, A, B | Z:  A, B, C&lt;br /&gt;
&lt;br /&gt;
This data structure is passed to the back-end service http://peerlogic.csc.ncsu.edu/intelligent_assignment/merge_teams by method &amp;quot;run_intelligent_assignment&amp;quot; of LotteryController.  The peerlogic service runs top_trading_cycles algorithm to let the teams have a fair bidding over the topics.&lt;br /&gt;
&lt;br /&gt;
Now, consider a similar bidding approach to peer review assignment. Why is it workable? The following diagram illustrates the similarity of the two bidding model. &lt;br /&gt;
[[File:Contrast_topic_review_bidding.jpg]]&lt;br /&gt;
&lt;br /&gt;
As for topics bidding, a few available slots of a particular topic are open for teams contending. In the left part of the diagram, there are 4 slots so only 4 teams can successfully contend for it. Slot is described as &amp;quot;max_choosers&amp;quot; of a sign_up topic in Expertiza. Consequently, there will be 4 different responses after the submission, and this time it is the participants that contend for the responses. &lt;br /&gt;
&lt;br /&gt;
Some discrepancies need additional attention.&lt;br /&gt;
&lt;br /&gt;
1. Slots can be left unoccupied if no team is willing to respond. However, every response needs to have at least some reviewers. &lt;br /&gt;
&lt;br /&gt;
2. The size of bidding data is different, since the number of teams are usually 1/2, 1/3 or 1/4 of the participants. &lt;br /&gt;
&lt;br /&gt;
3. The policy of bidding may be slightly different. Participants are not allowed to review a response submitted by themselves.  However, the topic bidding doesn't have this constraint.&lt;br /&gt;
&lt;br /&gt;
== Top Trading Cycles Mechanism ==&lt;br /&gt;
&lt;br /&gt;
In the paper School Choice: A Mechanism Design Approach, author Atila Abdulkadiroglu, and Tayfun Sonmez have described Top Trading Cycles Mechanism. The intuition of the mechanism is students who have the highest priorities are allowed to trade the schools. Students who are assigned to schools are removed and other students who have the highest priority will compete for schools. The mechanism is as follows:&lt;br /&gt;
&lt;br /&gt;
Step1: Each school has a counter (No. of seats/ capacity). Each student has a priority list. Each school points to the student who has the highest priority to the school. A cycle is formed which is an ordered&lt;br /&gt;
list (s1, i1, s2, ...., sk,ik). Every student in the cycle points to the school he/she is admitted and removed from the list. The counter of school is reduced by one and when it becomes zero it is removed from the list.&lt;br /&gt;
&lt;br /&gt;
Step k: Remaining students point to their favorite school among the remaining schools and each remaining school points to the student with the highest priority among the remaining students. There is at least one student. Every student in the cycle points to the school he/she is admitted and removed from the list. The counter of school is reduced by one and when it becomes zero it is removed from the list.&lt;br /&gt;
&lt;br /&gt;
The algorithm terminates when all students are assigned a seat.&lt;br /&gt;
&lt;br /&gt;
1.  Top Trading Cycles algorithm: [https://www.jstor.org/stable/pdf/3132114.pdf?casa_token=Bp8Syf8Q0yYAAAAA:f7zDJdWurp5cYlHtSHaUxRbDc1o4sL0Qx8UTnk7C5eeXPhgyiTOaWqgftX-nNJ48s6SGyPBzH3_U3Yv6Pfapo1OJaj-estvNyRl60LNQi5QgGW3LmAW8pQ]&lt;br /&gt;
&lt;br /&gt;
== Bidding policy (Stable marriage problem) ==&lt;br /&gt;
As part of this assignment, we have to analyse the implementation of the stable marriage problem which is a stable sorting algorithm. The following summary of how the algorithm works, is taken from the &amp;quot;College Admissions and the Stability of Marriage (1962)&amp;quot; by D. Gale and L. S. Shapley. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A certain community consists of n men and n women. Each person ranks those of the opposite sex in accordance with his or her preferences for a marriage partner. We&lt;br /&gt;
seek a satisfactory way of marrying off all members of the community. Imitating our earlier deﬁnition, we call a set of marriages unstable (and here the suitability of the&lt;br /&gt;
term is quite clear) if under it there are a man and a woman who are not married to each other but prefer each other to their actual mates.&lt;br /&gt;
&lt;br /&gt;
'''Deﬁnition:''' An assignment of couples will be called unstable if there are two men α and β who are married to women A and B, respectively, although β prefers A to B and A prefers β to α.&lt;br /&gt;
&lt;br /&gt;
So, we can ask the question: For any pattern of preferences is it possible to ﬁnd a stable set of marriages?&lt;br /&gt;
&lt;br /&gt;
Before giving the answer let us look at some examples.&lt;br /&gt;
&lt;br /&gt;
Example 1. The following is the “ranking matrix” of three men, α, β, and γ , and three women, A, B, and C.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Man\Woman !! A !! B !! C&lt;br /&gt;
|-&lt;br /&gt;
| α || 1,3      || 2,2     || 3,1&lt;br /&gt;
|-&lt;br /&gt;
| β || 3,1      || 1,3     || 2,2&lt;br /&gt;
|-&lt;br /&gt;
| γ || 2,2      || 3,1     || 1,3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ﬁrst number of each pair in the matrix gives the ranking of women by the men, the second number is the ranking of the men by the women. Thus, α ranks A ﬁrst, B second, C third, while A ranks β ﬁrst, γ second, and α third, etc.&lt;br /&gt;
&lt;br /&gt;
There are six possible sets of marriages; of these, three are stable. One of these is realized by giving each man his ﬁrst choice, thus α marries A, β marries B, and γ marries C. Note that although each woman gets her last choice, the arrangement is nevertheless stable. Alternatively one may let the women have their ﬁrst choices and marry α to C, β to A, and γ to B. The third stable arrangement is to give everyone his or her second choice and have α marry B, β marry C, and γ marry A. The reader will easily verify that all other arrangements are unstable.&lt;br /&gt;
&lt;br /&gt;
Based on this approach, in the existing implementation of Expertiza, we have match_new_teams_to_topics method in the lottery_controller that performs this stable sorting algorithm for teams that have bid for an assignment. Our objective would be to implement a similar strategy, but we would use students instead of teams since there are no &amp;quot;team reviews&amp;quot;. Every student selects their own assignment to review.&lt;br /&gt;
&lt;br /&gt;
== Design strategy ==&lt;br /&gt;
Almost all of the functionality for our project has already been implemented in the review portion of the Expertiza system - where the teams are allowed to bid on topics they want to work for their project. We plan to reuse the code to keep the implementation DRY but we need to add some additional features to make it work for the review bidding functionality. '''Delegation''' is a way to make composition as powerful for reuse as inheritance. The Delegation pattern will help us reduce the coupling of methods to their original class as we have components that seem to behave identically, but we realize that this situation can change in the future.&lt;br /&gt;
&lt;br /&gt;
[[File:Untitled_Diagram.png]]&lt;br /&gt;
&lt;br /&gt;
====Controller====&lt;br /&gt;
Because of this, we plan to approach this project by first using delegation pattern to add biding capability to the [https://github.com/expertiza/expertiza/blob/master/app/controllers/review_mapping_controller.rb review mapping controller] for choosing topics. Apart from this, a new controller,[https://github.com/expertiza/expertiza/pull/1322/files#diff-e064188effa2297543b98ac353bba4e3 review bids controller] is implemented to handle interactions similar to the one done in [https://github.com/expertiza/expertiza/blob/master/app/controllers/lottery_controller.rb lottery controller]. It handles the following implementations. &lt;br /&gt;
&lt;br /&gt;
1. Trigger the bidding by sending a request to PeerLogic backend with proper parameters retrieved from ReviewBid records. &lt;br /&gt;
&lt;br /&gt;
2. Process the response from PeerLogic and transform it into records of ReviewResponseMap.&lt;br /&gt;
&lt;br /&gt;
====View====&lt;br /&gt;
The bidding interface for reviews is followed from [https://github.com/expertiza/expertiza/pull/778/commits similar] implementation for topic bidding. We need to modify the ''code'' to implement the heat-map showing us the demand density for each project to be reviewed, the list of all available topics to review and the list of topics selected already. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Color Coding Scheme:''' &amp;lt;br&amp;gt;&lt;br /&gt;
The color coding scheme would range from Red for the most in-demand topics to green for the least contested topics. &amp;lt;br&amp;gt;&lt;br /&gt;
The top 10% of in-demand topics will be coded in Red, the next 30% of the topics will be in orange, the next 30% in yellow and the last 30% in the green. We are using percentages instead of hard-coding the color coding scheme so that it works dynamically with changing number of students. &amp;lt;br&amp;gt;&lt;br /&gt;
After we allow the student users to bid for their topic of interest we need to provide access to instructors to start the bidding algorithm.&lt;br /&gt;
&lt;br /&gt;
====Model====&lt;br /&gt;
To maintain the original functionality of Expertiza as well as to add review bidding, a new model to handle bidding data called ReviewBid is created. ReviewBid contains bidding assignment information, its biddable topics as well as the  participants' preference. ReviewBid is served as the input of the bidding algorithm. We decided to let participants bid on assignment teams rather than topics for simplicity.&lt;br /&gt;
&lt;br /&gt;
Here is the definition of ReviewBid:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id &lt;br /&gt;
|int(11)  &lt;br /&gt;
|unique identifier for the record&lt;br /&gt;
|- &lt;br /&gt;
!team_id   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|the work of team to be bid on&lt;br /&gt;
|- &lt;br /&gt;
!participant_id   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|participant id&lt;br /&gt;
|- &lt;br /&gt;
!priority   &lt;br /&gt;
|text&lt;br /&gt;
|participant's preference towards the team&lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|timestamp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|timestamp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Allow Instructor to set review strategy to '''bidding''': &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Review_strategy.png]] &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After setting the review strategy to  '''bidding''', participants are assigned a default bidding list, ordered by topic's name.&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Default_bidding_list.png]]&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Participants can drag the items up or down to alter the priority.&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Altered_bidding_list.png]]&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instructors can start bidding by clicking the following icon.&amp;lt;br&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
[[File:Bidding_icon.png]]&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the bidding is done, participants can login and see what they are assigned with.&amp;lt;br&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
[[File:Bidding_result.png]]&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
 &lt;br /&gt;
# College Admissions and the Stability of Marriage (1962), D. Gale and L. S. Shapley [https://www-jstor-org.prox.lib.ncsu.edu/stable/2312726?Search=yes&amp;amp;resultItemClick=true&amp;amp;searchText=College&amp;amp;searchText=Admissions&amp;amp;searchText=and&amp;amp;searchText=the&amp;amp;searchText=Stability&amp;amp;searchText=of&amp;amp;searchText=Marriage&amp;amp;searchUri=%2Faction%2FdoBasicSearch%3Fgroup%3Dnone%26amp%3Bfc%3Doff%26amp%3BQuery%3DCollege%2BAdmissions%2Band%2Bthe%2BStability%2Bof%2BMarriage%26amp%3Bwc%3Don%26amp%3Bacc%3Don&amp;amp;ab_segments=0%2Fdefault-2%2Fcontrol&amp;amp;refreqid=search%3A6c17f9ae92b22bc404fc3b7641ac908a&amp;amp;seq=1#metadata_info_tab_contents ]&lt;br /&gt;
# CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review]&lt;br /&gt;
# Pull Request #1322 (E1856. Allow reviewers to bid on what to review) [https://github.com/expertiza/expertiza/pull/1322 ]&lt;br /&gt;
# Top Trading Cycles Algorithm[https://www.jstor.org/stable/pdf/3132114.pdf?casa_token=Bp8Syf8Q0yYAAAAA:f7zDJdWurp5cYlHtSHaUxRbDc1o4sL0Qx8UTnk7C5eeXPhgyiTOaWqgftX-nNJ48s6SGyPBzH3_U3Yv6Pfapo1OJaj-estvNyRl60LNQi5QgGW3LmAW8pQ]&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1928._Allow_reviewers_to_bid_on_what_to_review&amp;diff=123325</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1928. Allow reviewers to bid on what to review</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1928._Allow_reviewers_to_bid_on_what_to_review&amp;diff=123325"/>
		<updated>2019-04-06T17:36:59Z</updated>

		<summary type="html">&lt;p&gt;Dde: /* Design strategy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation. It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
== Similarity to previous implementation ==&lt;br /&gt;
A similar implementation was provided in the last semester was by a team who had implemented the TTC and the required review bidding functionality. &amp;lt;br&amp;gt;&lt;br /&gt;
Link: [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review] &amp;lt;br&amp;gt;&lt;br /&gt;
However, their implementation had a few problems, notably:&lt;br /&gt;
# The color-coding feature was not implemented.&lt;br /&gt;
# The implementation entailed ordering by IDs of teams who did the topics (not a reasonable ordering).&lt;br /&gt;
# The content of some newly-added file are very similar with existing ones.&lt;br /&gt;
# The UI was not clean, it appeared to be disarrayed.&lt;br /&gt;
# There is only one list while topic bidding interface has two lists, one for the the available list of topics and the other list for topics that are selected for the bidding. &lt;br /&gt;
# There was no &amp;quot;add link to submission&amp;quot; in the bidding list.&lt;br /&gt;
# This implementation altered too many lines of existing Expertiza code.&lt;br /&gt;
# Many irrelevant tests were included.&lt;br /&gt;
&lt;br /&gt;
While we would not be writing this implementation from scratch, we would instead be using their [https://github.com/expertiza/expertiza/pull/1322 Pull Request] and remove the possible defects that they had.&lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
Students currently are able to “bid” for the projects that they want to do as an assignment. On the other hand, for reviewing others’ work, the policy that’s currently in use is  “first-come-first-serve”. We would try to implement the Top Trading Cycles algorithm that assigns review topics to students in a priority. &lt;br /&gt;
&lt;br /&gt;
The bidding policy for project topics that students want to work on is already implemented. Students can currently bid on project topics for their team assignment. This reduces the conflicts in assigning topics to each team. But to contradict the desired implementation, we will make use of student user instead of teams, since a single student bids on a multiple topics.&lt;br /&gt;
&lt;br /&gt;
There’s also reviewing work for each assignment. Currently, the policy to assign the project to the reviewer is “first-come-first-serve”. Student who chooses to review a project, will get the same project based on priority.&lt;br /&gt;
&lt;br /&gt;
However, this policy creates an issue — while reviewing a student's work, sometimes the same project is requested to be reviewed by many students, while some other projects are not in demand. A similar bidding policy for assigning projects to reviewers can help students who want to review a project the most to be most likely to receive that project. The completion of this project will allow students to also bid on what projects they are interested in reviewing.&lt;br /&gt;
&lt;br /&gt;
The project includes implementation of the top trading cycles algorithm on Expertiza.&lt;br /&gt;
&lt;br /&gt;
== Current Implementation of the bidding ==&lt;br /&gt;
Regarding to the functionality of review mapping, it's necessary to describe some of the related models and controllers in expertiza and how they are organized to fully implement the functionality. It should be noted here that this is an implementation of the bidding for assignment topics.&lt;br /&gt;
&lt;br /&gt;
===Models===&lt;br /&gt;
&lt;br /&gt;
[[File:Current_design_review_bidding.jpg]]&lt;br /&gt;
&lt;br /&gt;
1. When an assignment is released, an instance of Assignment is created and corresponding topic instances of SignUpTopics are also imported, indicating that different topics are available for students to choose from within this assignment.&lt;br /&gt;
&lt;br /&gt;
2. Students are assigned as instances of AssignmentParticipant to this assignment and form up their teams(Model Team).&lt;br /&gt;
&lt;br /&gt;
3. Each team registers for several topics and becomes a candidate instance of SignUpTeam. After topics bidding, some of the candidate teams become an official signed-up team of a particular topic.&lt;br /&gt;
&lt;br /&gt;
4. After assignment submission, participants choose their preferred topics and response mappings between assignment(reviewed object), assignment team(reviewee) and assignment participant(reviewer) are created.&lt;br /&gt;
&lt;br /&gt;
5. After the mapping, participants can submit their response and the afterwards is out of discussion range of this document.&lt;br /&gt;
&lt;br /&gt;
===Workflow===&lt;br /&gt;
&lt;br /&gt;
For now, expertiza employs FIFO strategy on review assignment.  In the ReviewMappingController, method &amp;quot;add_reviewer&amp;quot; is invoked when students are trying to request a peer review. When it is done, a new mapping is created, that is why review assignment is in FIFO style.&lt;br /&gt;
&lt;br /&gt;
If reviewers are allowed to bid on what to review, the procedure of topics bidding implemented by LotteryController is a good reference. Here is the basic workflow of topics bidding:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First of all, teams have different preference towards the topics. For example, there are three topics within an assignment, namely A, B and C. Therefore 4 teams W, X, Y, Z. Teams would have their own preference towards different topics:&lt;br /&gt;
&lt;br /&gt;
W: B, A, C  |  X:  B, C  |   Y:  C, A, B | Z:  A, B, C&lt;br /&gt;
&lt;br /&gt;
This data structure is passed to backend service http://peerlogic.csc.ncsu.edu/intelligent_assignment/merge_teams by method &amp;quot;run_intelligent_assignment&amp;quot; of LotteryController.  The peerlogic service runs top_trading_cycles algorithm to have a fair bidding over the topics and teams.&lt;br /&gt;
&lt;br /&gt;
A similar bid can take place on peer review assignment. Why is it workable? The following diagram illustrates the similarity of the two bidding model. &lt;br /&gt;
[[File:Contrast_topic_review_bidding.jpg]]&lt;br /&gt;
&lt;br /&gt;
As for topics bidding, a few available slots of a particular topic are open for teams contending. In the left part of the diagram, there are 4 slots so only 4 teams can successfully contend for it. Slot is described as &amp;quot;max_choosers&amp;quot; of a sign_up topic in Expertiza. Consequently, there will be 4 different responses after the submission, and this time it is the participants that contend for the responses. &lt;br /&gt;
&lt;br /&gt;
Some discrepancies need additional attention.&lt;br /&gt;
&lt;br /&gt;
1. Slots can be left unoccupied if no team is willing to response. However, every response needs to have at least some reviewers. &lt;br /&gt;
&lt;br /&gt;
2. The size of bidding data is different, since the number of teams are usually 1/2, 1/3 or 1/4 of the participants. &lt;br /&gt;
&lt;br /&gt;
3. The policy of bidding may be slightly different. Participants are not allowed to review a response submitted by themselves.  However, the topic bidding doesn't have this constraint.&lt;br /&gt;
&lt;br /&gt;
== Top Trading Cycles Mechanism ==&lt;br /&gt;
&lt;br /&gt;
In the paper School Choice: A Mechanism Design Approach, author Atila Abdulkadiroglu, and Tayfun Sonmez have described Top Trading Cycles Mechanism. The intuition of the mechanism is students who have the highest priorities are allowed to trade the schools. Students who are assigned to schools are removed and other students who have the highest priority will compete for schools. The mechanism is as follows:&lt;br /&gt;
&lt;br /&gt;
step1: Each school has a counter (no of seats/ capacity). Each student has a priority list. Each school points to the student who has the highest priority to the school. A cycle is formed which is an ordered&lt;br /&gt;
list (s1, i1, s2, ...., sk,ik). Every student in the cycle points to the school he/she is admitted and removed from the list. The counter of school is reduced by one and when it becomes zero it is removed from the list.&lt;br /&gt;
&lt;br /&gt;
step k: Remaining students point to their favorite school among the remaining schools and each remaining school points to the student with the highest priority among the remaining students. There is at least one student. Every student in the cycle points to the school he/she is admitted and removed from the list. The counter of school is reduced by one and when it becomes zero it is removed from the list.&lt;br /&gt;
&lt;br /&gt;
The algorithm terminates when all students are assigned a seat.&lt;br /&gt;
&lt;br /&gt;
1.  Top Trading Cycles algorithm: [https://www.jstor.org/stable/pdf/3132114.pdf?casa_token=Bp8Syf8Q0yYAAAAA:f7zDJdWurp5cYlHtSHaUxRbDc1o4sL0Qx8UTnk7C5eeXPhgyiTOaWqgftX-nNJ48s6SGyPBzH3_U3Yv6Pfapo1OJaj-estvNyRl60LNQi5QgGW3LmAW8pQ]&lt;br /&gt;
&lt;br /&gt;
== Bidding policy (Stable marriage problem) ==&lt;br /&gt;
As part of this assignment, we have to analyse the implementation of the stable marriage problem which is a stable sorting algorithm. The explanation for this algorithm is as follows which as been taken from &amp;quot;College Admissions and the Stability of Marriage (1962)&amp;quot; by D. Gale and L. S. Shapley. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A certain community consists of n men and n women. Each person ranks those of the opposite sex in accordance with his or her preferences for a marriage partner. We&lt;br /&gt;
seek a satisfactory way of marrying off all members of the community. Imitating our earlier deﬁnition, we call a set of marriages unstable (and here the suitability of the&lt;br /&gt;
term is quite clear) if under it there are a man and a woman who are not married to each other but prefer each other to their actual mates.&lt;br /&gt;
&lt;br /&gt;
'''Deﬁnition:''' An assignment of couples will be called unstable if there are two men α and β who are married to women A and B, respectively, although β prefers A to B and A prefers β to α.&lt;br /&gt;
&lt;br /&gt;
So, we can ask the question: For any pattern of preferences is it possible to ﬁnd a stable set of marriages?&lt;br /&gt;
&lt;br /&gt;
Before giving the answer let us look at some examples.&lt;br /&gt;
&lt;br /&gt;
Example 1. The following is the “ranking matrix” of three men, α, β, and γ , and three women, A, B, and C.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Man\Woman !! A !! B !! C&lt;br /&gt;
|-&lt;br /&gt;
| α || 1,3      || 2,2     || 3,1&lt;br /&gt;
|-&lt;br /&gt;
| β || 3,1      || 1,3     || 2,2&lt;br /&gt;
|-&lt;br /&gt;
| γ || 2,2      || 3,1     || 1,3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ﬁrst number of each pair in the matrix gives the ranking of women by the men, the second number is the ranking of the men by the women. Thus, α ranks A ﬁrst, B second, C third, while A ranks β ﬁrst, γ second, and α third, etc.&lt;br /&gt;
&lt;br /&gt;
There are six possible sets of marriages; of these, three are stable. One of these is realized by giving each man his ﬁrst choice, thus α marries A, β marries B, and γ marries C. Note that although each woman gets her last choice, the arrangement is nevertheless stable. Alternatively one may let the women have their ﬁrst choices and marry α to C, β to A, and γ to B. The third stable arrangement is to give everyone his or her second choice and have α marry B, β marry C, and γ marry A. The reader will easily verify that all other arrangements are unstable.&lt;br /&gt;
&lt;br /&gt;
In the existing implementation, we have match_new_teams_to_topics method in lottery_controller that performs this stable sorting algorithm for teams that have bid for an assignment. Our objective would be to implement a similar strategy, but we would use students instead of teams since there are no &amp;quot;team reviews&amp;quot;. Every student selects their own assignment to review&lt;br /&gt;
&lt;br /&gt;
== Design strategy ==&lt;br /&gt;
Almost all of the functionality for our project has already been implemented in the review portion of the Expertiza system - where the teams are allowed to bid on topics they want to work for their project. We plan to reuse the code to keep the implementation DRY but we need to add some additional features to make it work for review bidding functionality. '''Delegation''' is a way to make composition as powerful for reuse as an inheritance. Delegation pattern will help us to reduce the coupling of methods to their original class as we have components that seem to behave identically, but we realize that this situation can change in the future.&lt;br /&gt;
&lt;br /&gt;
[[File:Untitled_Diagram.png]]&lt;br /&gt;
&lt;br /&gt;
====Controller====&lt;br /&gt;
Because of this, we plan to approach this project by first using delegation pattern to add biding capability to the [https://github.com/expertiza/expertiza/blob/master/app/controllers/review_mapping_controller.rb review mapping controller] for choosing topics. Apart from this, a new controller,[https://github.com/expertiza/expertiza/pull/1322/files#diff-e064188effa2297543b98ac353bba4e3 review bids controller] is implemented to handle interactions similar to the one done in [https://github.com/expertiza/expertiza/blob/master/app/controllers/lottery_controller.rb lottery controller]. It handles the following implementations. &lt;br /&gt;
&lt;br /&gt;
1. Trigger the bidding by sending a request to PeerLogic backend with proper parameters retrieved from ReviewBid records. &lt;br /&gt;
&lt;br /&gt;
2. Process the response from PeerLogic and transform it into records of ReviewResponseMap.&lt;br /&gt;
&lt;br /&gt;
====View====&lt;br /&gt;
The bidding interface for reviews is followed from [https://github.com/expertiza/expertiza/pull/778/commits similar] implementation for topic bidding. We need to modify the ''code'' to implement the heat-map showing us demand density for each project to be reviewed and list of all available topics to review and selected topics. After we allow the student users to bid for their topic of interest we need to provide access to instructors to start the bidding algorithm. &lt;br /&gt;
&lt;br /&gt;
====Model====&lt;br /&gt;
To maintain the original functionality of Expertiza as well as to add review bidding, a new model to handle the data of the bidding called ReviewBid is created. ReviewBid contains the information of bidding assignment and its biddable topics as well as the  participants' preference. ReviewBid is served as the input of the bidding algorithm. We decided to let participant to bid on assignment teams rather than topics for simplicity.&lt;br /&gt;
&lt;br /&gt;
Here is the definition of ReviewBid:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id &lt;br /&gt;
|int(11)  &lt;br /&gt;
|unique identifier for the record&lt;br /&gt;
|- &lt;br /&gt;
!team_id   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|the work of team to be bid on&lt;br /&gt;
|- &lt;br /&gt;
!participant_id   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|participant id&lt;br /&gt;
|- &lt;br /&gt;
!priority   &lt;br /&gt;
|text&lt;br /&gt;
|participant's preference towards the team&lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|timestamp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|timestamp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Allow Instructor to set review strategy to be bidding:&lt;br /&gt;
[[File:Review_strategy.png]]&lt;br /&gt;
&lt;br /&gt;
After setting the review strategy to be bidding, participants are assigned with a default bidding list, ordered by topic's name.&lt;br /&gt;
[[File:Default_bidding_list.png]]&lt;br /&gt;
&lt;br /&gt;
Participants can drag the items up and own to alter the priority.&lt;br /&gt;
[[File:Altered_bidding_list.png]]&lt;br /&gt;
&lt;br /&gt;
Instructors can start bidding by clicking the following icon. &lt;br /&gt;
[[File:Bidding_icon.png]]&lt;br /&gt;
&lt;br /&gt;
After the bidding is done, participants can login and see what they are assigned with. &lt;br /&gt;
[[File:Bidding_result.png]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
 &lt;br /&gt;
# [https://www-jstor-org.prox.lib.ncsu.edu/stable/2312726?Search=yes&amp;amp;resultItemClick=true&amp;amp;searchText=College&amp;amp;searchText=Admissions&amp;amp;searchText=and&amp;amp;searchText=the&amp;amp;searchText=Stability&amp;amp;searchText=of&amp;amp;searchText=Marriage&amp;amp;searchUri=%2Faction%2FdoBasicSearch%3Fgroup%3Dnone%26amp%3Bfc%3Doff%26amp%3BQuery%3DCollege%2BAdmissions%2Band%2Bthe%2BStability%2Bof%2BMarriage%26amp%3Bwc%3Don%26amp%3Bacc%3Don&amp;amp;ab_segments=0%2Fdefault-2%2Fcontrol&amp;amp;refreqid=search%3A6c17f9ae92b22bc404fc3b7641ac908a&amp;amp;seq=1#metadata_info_tab_contents College Admissions and the Stability of Marriage (1962), D. Gale and L. S. Shapley]&lt;br /&gt;
# [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review]&lt;br /&gt;
# [https://github.com/expertiza/expertiza/pull/1322 Pull Request #1322 (E1856. Allow reviewers to bid on what to review)]&lt;br /&gt;
# Top Trading Cycles Algorithm[https://www.jstor.org/stable/pdf/3132114.pdf?casa_token=Bp8Syf8Q0yYAAAAA:f7zDJdWurp5cYlHtSHaUxRbDc1o4sL0Qx8UTnk7C5eeXPhgyiTOaWqgftX-nNJ48s6SGyPBzH3_U3Yv6Pfapo1OJaj-estvNyRl60LNQi5QgGW3LmAW8pQ]&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Untitled_Diagram.png&amp;diff=123324</id>
		<title>File:Untitled Diagram.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Untitled_Diagram.png&amp;diff=123324"/>
		<updated>2019-04-06T17:36:06Z</updated>

		<summary type="html">&lt;p&gt;Dde: uploaded a new version of &amp;amp;quot;File:Untitled Diagram.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1928._Allow_reviewers_to_bid_on_what_to_review&amp;diff=123316</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1928. Allow reviewers to bid on what to review</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1928._Allow_reviewers_to_bid_on_what_to_review&amp;diff=123316"/>
		<updated>2019-04-06T16:08:58Z</updated>

		<summary type="html">&lt;p&gt;Dde: /* Model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation. It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
== Similarity to previous implementation ==&lt;br /&gt;
A similar implementation was provided in the last semester was by a team who had implemented the TTC and the required review bidding functionality. &amp;lt;br&amp;gt;&lt;br /&gt;
Link: [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review] &amp;lt;br&amp;gt;&lt;br /&gt;
However, their implementation had a few problems, notably:&lt;br /&gt;
# The color-coding feature was not implemented.&lt;br /&gt;
# The implementation entailed ordering by IDs of teams who did the topics (not a reasonable ordering).&lt;br /&gt;
# The content of some newly-added file are very similar with existing ones.&lt;br /&gt;
# The UI was not clean, it appeared to be disarrayed.&lt;br /&gt;
# There is only one list while topic bidding interface has two lists, one for the the available list of topics and the other list for topics that are selected for the bidding. &lt;br /&gt;
# There was no &amp;quot;add link to submission&amp;quot; in the bidding list.&lt;br /&gt;
# This implementation altered too many lines of existing Expertiza code.&lt;br /&gt;
# Many irrelevant tests were included.&lt;br /&gt;
&lt;br /&gt;
While we would not be writing this implementation from scratch, we would instead be using their [https://github.com/expertiza/expertiza/pull/1322 Pull Request] and remove the possible defects that they had.&lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
Students currently are able to “bid” for the projects that they want to do as an assignment. On the other hand, for reviewing others’ work, the policy that’s currently in use is  “first-come-first-serve”. We would try to implement the Top Trading Cycles algorithm that assigns review topics to students in a priority. &lt;br /&gt;
&lt;br /&gt;
The bidding policy for project topics that students want to work on is already implemented. Students can currently bid on project topics for their team assignment. This reduces the conflicts in assigning topics to each team. But to contradict the desired implementation, we will make use of student user instead of teams, since a single student bids on a multiple topics.&lt;br /&gt;
&lt;br /&gt;
There’s also reviewing work for each assignment. Currently, the policy to assign the project to the reviewer is “first-come-first-serve”. Student who chooses to review a project, will get the same project based on priority.&lt;br /&gt;
&lt;br /&gt;
However, this policy creates an issue — while reviewing a student's work, sometimes the same project is requested to be reviewed by many students, while some other projects are not in demand. A similar bidding policy for assigning projects to reviewers can help students who want to review a project the most to be most likely to receive that project. The completion of this project will allow students to also bid on what projects they are interested in reviewing.&lt;br /&gt;
&lt;br /&gt;
The project includes implementation of the top trading cycles algorithm on Expertiza.&lt;br /&gt;
&lt;br /&gt;
== Current Implementation of the bidding ==&lt;br /&gt;
Regarding to the functionality of review mapping, it's necessary to describe some of the related models and controllers in expertiza and how they are organized to fully implement the functionality. It should be noted here that this is an implementation of the bidding for assignment topics.&lt;br /&gt;
&lt;br /&gt;
===Models===&lt;br /&gt;
&lt;br /&gt;
[[File:Current_design_review_bidding.jpg]]&lt;br /&gt;
&lt;br /&gt;
1. When an assignment is released, an instance of Assignment is created and corresponding topic instances of SignUpTopics are also imported, indicating that different topics are available for students to choose from within this assignment.&lt;br /&gt;
&lt;br /&gt;
2. Students are assigned as instances of AssignmentParticipant to this assignment and form up their teams(Model Team).&lt;br /&gt;
&lt;br /&gt;
3. Each team registers for several topics and becomes a candidate instance of SignUpTeam. After topics bidding, some of the candidate teams become an official signed-up team of a particular topic.&lt;br /&gt;
&lt;br /&gt;
4. After assignment submission, participants choose their preferred topics and response mappings between assignment(reviewed object), assignment team(reviewee) and assignment participant(reviewer) are created.&lt;br /&gt;
&lt;br /&gt;
5. After the mapping, participants can submit their response and the afterwards is out of discussion range of this document.&lt;br /&gt;
&lt;br /&gt;
===Workflow===&lt;br /&gt;
&lt;br /&gt;
For now, expertiza employs FIFO strategy on review assignment.  In the ReviewMappingController, method &amp;quot;add_reviewer&amp;quot; is invoked when students are trying to request a peer review. When it is done, a new mapping is created, that is why review assignment is in FIFO style.&lt;br /&gt;
&lt;br /&gt;
If reviewers are allowed to bid on what to review, the procedure of topics bidding implemented by LotteryController is a good reference. Here is the basic workflow of topics bidding:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First of all, teams have different preference towards the topics. For example, there are three topics within an assignment, namely A, B and C. Therefore 4 teams W, X, Y, Z. Teams would have their own preference towards different topics:&lt;br /&gt;
&lt;br /&gt;
W: B, A, C  |  X:  B, C  |   Y:  C, A, B | Z:  A, B, C&lt;br /&gt;
&lt;br /&gt;
This data structure is passed to backend service http://peerlogic.csc.ncsu.edu/intelligent_assignment/merge_teams by method &amp;quot;run_intelligent_assignment&amp;quot; of LotteryController.  The peerlogic service runs top_trading_cycles algorithm to have a fair bidding over the topics and teams.&lt;br /&gt;
&lt;br /&gt;
A similar bid can take place on peer review assignment. Why is it workable? The following diagram illustrates the similarity of the two bidding model. &lt;br /&gt;
[[File:Contrast_topic_review_bidding.jpg]]&lt;br /&gt;
&lt;br /&gt;
As for topics bidding, a few available slots of a particular topic are open for teams contending. In the left part of the diagram, there are 4 slots so only 4 teams can successfully contend for it. Slot is described as &amp;quot;max_choosers&amp;quot; of a sign_up topic in Expertiza. Consequently, there will be 4 different responses after the submission, and this time it is the participants that contend for the responses. &lt;br /&gt;
&lt;br /&gt;
Some discrepancies need additional attention.&lt;br /&gt;
&lt;br /&gt;
1. Slots can be left unoccupied if no team is willing to response. However, every response needs to have at least some reviewers. &lt;br /&gt;
&lt;br /&gt;
2. The size of bidding data is different, since the number of teams are usually 1/2, 1/3 or 1/4 of the participants. &lt;br /&gt;
&lt;br /&gt;
3. The policy of bidding may be slightly different. Participants are not allowed to review a response submitted by themselves.  However, the topic bidding doesn't have this constraint.&lt;br /&gt;
&lt;br /&gt;
== Top Trading Cycles Mechanism ==&lt;br /&gt;
1.  Top Trading Cycles algorithm: [https://www.jstor.org/stable/pdf/3132114.pdf?casa_token=Bp8Syf8Q0yYAAAAA:f7zDJdWurp5cYlHtSHaUxRbDc1o4sL0Qx8UTnk7C5eeXPhgyiTOaWqgftX-nNJ48s6SGyPBzH3_U3Yv6Pfapo1OJaj-estvNyRl60LNQi5QgGW3LmAW8pQ]&lt;br /&gt;
&lt;br /&gt;
== Bidding policy (Stable marriage problem) ==&lt;br /&gt;
As part of this assignment, we have to analyse the implementation of the stable marriage problem which is a stable sorting algorithm. The explanation for this algorithm is as follows which as been taken from &amp;quot;College Admissions and the Stability of Marriage (1962)&amp;quot; by D. Gale and L. S. Shapley. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A certain community consists of n men and n women. Each person ranks those of the opposite sex in accordance with his or her preferences for a marriage partner. We&lt;br /&gt;
seek a satisfactory way of marrying off all members of the community. Imitating our earlier deﬁnition, we call a set of marriages unstable (and here the suitability of the&lt;br /&gt;
term is quite clear) if under it there are a man and a woman who are not married to each other but prefer each other to their actual mates.&lt;br /&gt;
&lt;br /&gt;
'''Deﬁnition:''' An assignment of couples will be called unstable if there are two men α and β who are married to women A and B, respectively, although β prefers A to B and A prefers β to α.&lt;br /&gt;
&lt;br /&gt;
So, we can ask the question: For any pattern of preferences is it possible to ﬁnd a stable set of marriages?&lt;br /&gt;
&lt;br /&gt;
Before giving the answer let us look at some examples.&lt;br /&gt;
&lt;br /&gt;
Example 1. The following is the “ranking matrix” of three men, α, β, and γ , and three women, A, B, and C.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Man\Woman !! A !! B !! C&lt;br /&gt;
|-&lt;br /&gt;
| α || 1,3      || 2,2     || 3,1&lt;br /&gt;
|-&lt;br /&gt;
| β || 3,1      || 1,3     || 2,2&lt;br /&gt;
|-&lt;br /&gt;
| γ || 2,2      || 3,1     || 1,3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ﬁrst number of each pair in the matrix gives the ranking of women by the men, the second number is the ranking of the men by the women. Thus, α ranks A ﬁrst, B second, C third, while A ranks β ﬁrst, γ second, and α third, etc.&lt;br /&gt;
&lt;br /&gt;
There are six possible sets of marriages; of these, three are stable. One of these is realized by giving each man his ﬁrst choice, thus α marries A, β marries B, and γ marries C. Note that although each woman gets her last choice, the arrangement is nevertheless stable. Alternatively one may let the women have their ﬁrst choices and marry α to C, β to A, and γ to B. The third stable arrangement is to give everyone his or her second choice and have α marry B, β marry C, and γ marry A. The reader will easily verify that all other arrangements are unstable.&lt;br /&gt;
&lt;br /&gt;
In the existing implementation, we have match_new_teams_to_topics method in lottery_controller that performs this stable sorting algorithm for teams that have bid for an assignment. Our objective would be to implement a similar strategy, but we would use students instead of teams since there are no &amp;quot;team reviews&amp;quot;. Every student selects their own assignment to review&lt;br /&gt;
&lt;br /&gt;
== Design strategy ==&lt;br /&gt;
Almost all of the functionality for our project has already been implemented in the review portion of the Expertiza system - where the teams are allowed to bid on topics they want to work for their project. We plan to reuse the code to keep the implementation DRY but we need to add some additional features to make it work for review bidding functionality. '''Delegation''' is a way to make composition as powerful for reuse as an inheritance. Delegation pattern will help us to reduce the coupling of methods to their original class as we have components that seem to behave identically, but we realize that this situation can change in the future.&lt;br /&gt;
&lt;br /&gt;
====Controller====&lt;br /&gt;
Because of this, we plan to approach this project by first using delegation pattern to add biding capability to the [https://github.com/expertiza/expertiza/blob/master/app/controllers/review_mapping_controller.rb review mapping controller] for choosing topics. Apart from this, a new controller,[https://github.com/expertiza/expertiza/pull/1322/files#diff-e064188effa2297543b98ac353bba4e3 review bids controller] is implemented to handle interactions similar to the one done in [https://github.com/expertiza/expertiza/blob/master/app/controllers/lottery_controller.rb lottery controller]. It handles the following implementations. &lt;br /&gt;
&lt;br /&gt;
1. Trigger the bidding by sending a request to PeerLogic backend with proper parameters retrieved from ReviewBid records. &lt;br /&gt;
&lt;br /&gt;
2. Process the response from PeerLogic and transform it into records of ReviewResponseMap.&lt;br /&gt;
&lt;br /&gt;
====View====&lt;br /&gt;
The bidding interface for reviews is followed from [https://github.com/expertiza/expertiza/pull/778/commits similar] implementation for topic bidding. We need to modify the ''code'' to implement the heat-map showing us demand density for each project to be reviewed and list of all available topics to review and selected topics. After we allow the student users to bid for their topic of interest we need to provide access to instructors to start the bidding algorithm. &lt;br /&gt;
&lt;br /&gt;
====Model====&lt;br /&gt;
To maintain the original functionality of Expertiza as well as to add review bidding, a new model to handle the data of the bidding called ReviewBid is created. ReviewBid contains the information of bidding assignment and its biddable topics as well as the  participants' preference. ReviewBid is served as the input of the bidding algorithm. We decided to let participant to bid on assignment teams rather than topics for simplicity.&lt;br /&gt;
&lt;br /&gt;
Here is the definition of ReviewBid:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id &lt;br /&gt;
|int(11)  &lt;br /&gt;
|unique identifier for the record&lt;br /&gt;
|- &lt;br /&gt;
!team_id   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|the work of team to be bid on&lt;br /&gt;
|- &lt;br /&gt;
!participant_id   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|participant id&lt;br /&gt;
|- &lt;br /&gt;
!priority   &lt;br /&gt;
|text&lt;br /&gt;
|participant's preference towards the team&lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|timestamp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|timestamp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
 &lt;br /&gt;
# [https://www-jstor-org.prox.lib.ncsu.edu/stable/2312726?Search=yes&amp;amp;resultItemClick=true&amp;amp;searchText=College&amp;amp;searchText=Admissions&amp;amp;searchText=and&amp;amp;searchText=the&amp;amp;searchText=Stability&amp;amp;searchText=of&amp;amp;searchText=Marriage&amp;amp;searchUri=%2Faction%2FdoBasicSearch%3Fgroup%3Dnone%26amp%3Bfc%3Doff%26amp%3BQuery%3DCollege%2BAdmissions%2Band%2Bthe%2BStability%2Bof%2BMarriage%26amp%3Bwc%3Don%26amp%3Bacc%3Don&amp;amp;ab_segments=0%2Fdefault-2%2Fcontrol&amp;amp;refreqid=search%3A6c17f9ae92b22bc404fc3b7641ac908a&amp;amp;seq=1#metadata_info_tab_contents College Admissions and the Stability of Marriage (1962), D. Gale and L. S. Shapley]&lt;br /&gt;
# [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review]&lt;br /&gt;
# [https://github.com/expertiza/expertiza/pull/1322 Pull Request #1322 (E1856. Allow reviewers to bid on what to review)]&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1928._Allow_reviewers_to_bid_on_what_to_review&amp;diff=123312</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1928. Allow reviewers to bid on what to review</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1928._Allow_reviewers_to_bid_on_what_to_review&amp;diff=123312"/>
		<updated>2019-04-06T16:01:34Z</updated>

		<summary type="html">&lt;p&gt;Dde: /* Design strategy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation. It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
== Similarity to previous implementation ==&lt;br /&gt;
A similar implementation was provided in the last semester was by a team who had implemented the TTC and the required review bidding functionality. &amp;lt;br&amp;gt;&lt;br /&gt;
Link: [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review] &amp;lt;br&amp;gt;&lt;br /&gt;
However, their implementation had a few problems, notably:&lt;br /&gt;
# The color-coding feature was not implemented.&lt;br /&gt;
# The implementation entailed ordering by IDs of teams who did the topics (not a reasonable ordering).&lt;br /&gt;
# The content of some newly-added file are very similar with existing ones.&lt;br /&gt;
# The UI was not clean, it appeared to be disarrayed.&lt;br /&gt;
# There is only one list while topic bidding interface has two lists, one for the the available list of topics and the other list for topics that are selected for the bidding. &lt;br /&gt;
# There was no &amp;quot;add link to submission&amp;quot; in the bidding list.&lt;br /&gt;
# This implementation altered too many lines of existing Expertiza code.&lt;br /&gt;
# Many irrelevant tests were included.&lt;br /&gt;
&lt;br /&gt;
While we would not be writing this implementation from scratch, we would instead be using their [https://github.com/expertiza/expertiza/pull/1322 Pull Request] and remove the possible defects that they had.&lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
Students currently are able to “bid” for the projects that they want to do as an assignment. On the other hand, for reviewing others’ work, the policy that’s currently in use is  “first-come-first-serve”. We would try to implement the Top Trading Cycles algorithm that assigns review topics to students in a priority. &lt;br /&gt;
&lt;br /&gt;
The bidding policy for project topics that students want to work on is already implemented. Students can currently bid on project topics for their team assignment. This reduces the conflicts in assigning topics to each team. But to contradict the desired implementation, we will make use of student user instead of teams, since a single student bids on a multiple topics.&lt;br /&gt;
&lt;br /&gt;
There’s also reviewing work for each assignment. Currently, the policy to assign the project to the reviewer is “first-come-first-serve”. Student who chooses to review a project, will get the same project based on priority.&lt;br /&gt;
&lt;br /&gt;
However, this policy creates an issue — while reviewing a student's work, sometimes the same project is requested to be reviewed by many students, while some other projects are not in demand. A similar bidding policy for assigning projects to reviewers can help students who want to review a project the most to be most likely to receive that project. The completion of this project will allow students to also bid on what projects they are interested in reviewing.&lt;br /&gt;
&lt;br /&gt;
The project includes implementation of the top trading cycles algorithm on Expertiza.&lt;br /&gt;
&lt;br /&gt;
== Current Implementation of the bidding ==&lt;br /&gt;
Regarding to the functionality of review mapping, it's necessary to describe some of the related models and controllers in expertiza and how they are organized to fully implement the functionality. It should be noted here that this is an implementation of the bidding for assignment topics.&lt;br /&gt;
&lt;br /&gt;
===Models===&lt;br /&gt;
&lt;br /&gt;
[[File:Current_design_review_bidding.jpg]]&lt;br /&gt;
&lt;br /&gt;
1. When an assignment is released, an instance of Assignment is created and corresponding topic instances of SignUpTopics are also imported, indicating that different topics are available for students to choose from within this assignment.&lt;br /&gt;
&lt;br /&gt;
2. Students are assigned as instances of AssignmentParticipant to this assignment and form up their teams(Model Team).&lt;br /&gt;
&lt;br /&gt;
3. Each team registers for several topics and becomes a candidate instance of SignUpTeam. After topics bidding, some of the candidate teams become an official signed-up team of a particular topic.&lt;br /&gt;
&lt;br /&gt;
4. After assignment submission, participants choose their preferred topics and response mappings between assignment(reviewed object), assignment team(reviewee) and assignment participant(reviewer) are created.&lt;br /&gt;
&lt;br /&gt;
5. After the mapping, participants can submit their response and the afterwards is out of discussion range of this document.&lt;br /&gt;
&lt;br /&gt;
===Workflow===&lt;br /&gt;
&lt;br /&gt;
For now, expertiza employs FIFO strategy on review assignment.  In the ReviewMappingController, method &amp;quot;add_reviewer&amp;quot; is invoked when students are trying to request a peer review. When it is done, a new mapping is created, that is why review assignment is in FIFO style.&lt;br /&gt;
&lt;br /&gt;
If reviewers are allowed to bid on what to review, the procedure of topics bidding implemented by LotteryController is a good reference. Here is the basic workflow of topics bidding:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First of all, teams have different preference towards the topics. For example, there are three topics within an assignment, namely A, B and C. Therefore 4 teams W, X, Y, Z. Teams would have their own preference towards different topics:&lt;br /&gt;
&lt;br /&gt;
W: B, A, C  |  X:  B, C  |   Y:  C, A, B | Z:  A, B, C&lt;br /&gt;
&lt;br /&gt;
This data structure is passed to backend service http://peerlogic.csc.ncsu.edu/intelligent_assignment/merge_teams by method &amp;quot;run_intelligent_assignment&amp;quot; of LotteryController.  The peerlogic service runs top_trading_cycles algorithm to have a fair bidding over the topics and teams.&lt;br /&gt;
&lt;br /&gt;
A similar bid can take place on peer review assignment. Why is it workable? The following diagram illustrates the similarity of the two bidding model. &lt;br /&gt;
[[File:Contrast_topic_review_bidding.jpg]]&lt;br /&gt;
&lt;br /&gt;
As for topics bidding, a few available slots of a particular topic are open for teams contending. In the left part of the diagram, there are 4 slots so only 4 teams can successfully contend for it. Slot is described as &amp;quot;max_choosers&amp;quot; of a sign_up topic in Expertiza. Consequently, there will be 4 different responses after the submission, and this time it is the participants that contend for the responses. &lt;br /&gt;
&lt;br /&gt;
Some discrepancies need additional attention.&lt;br /&gt;
&lt;br /&gt;
1. Slots can be left unoccupied if no team is willing to response. However, every response needs to have at least some reviewers. &lt;br /&gt;
&lt;br /&gt;
2. The size of bidding data is different, since the number of teams are usually 1/2, 1/3 or 1/4 of the participants. &lt;br /&gt;
&lt;br /&gt;
3. The policy of bidding may be slightly different. Participants are not allowed to review a response submitted by themselves.  However, the topic bidding doesn't have this constraint.&lt;br /&gt;
&lt;br /&gt;
== Bidding policy (Stable marriage problem) ==&lt;br /&gt;
As part of this assignment, we have to analyse the implementation of the stable marriage problem which is a stable sorting algorithm. The explanation for this algorithm is as follows which as been taken from &amp;quot;College Admissions and the Stability of Marriage (1962)&amp;quot; by D. Gale and L. S. Shapley. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A certain community consists of n men and n women. Each person ranks those of the opposite sex in accordance with his or her preferences for a marriage partner. We&lt;br /&gt;
seek a satisfactory way of marrying off all members of the community. Imitating our earlier deﬁnition, we call a set of marriages unstable (and here the suitability of the&lt;br /&gt;
term is quite clear) if under it there are a man and a woman who are not married to each other but prefer each other to their actual mates.&lt;br /&gt;
&lt;br /&gt;
'''Deﬁnition:''' An assignment of couples will be called unstable if there are two men α and β who are married to women A and B, respectively, although β prefers A to B and A prefers β to α.&lt;br /&gt;
&lt;br /&gt;
So, we can ask the question: For any pattern of preferences is it possible to ﬁnd a stable set of marriages?&lt;br /&gt;
&lt;br /&gt;
Before giving the answer let us look at some examples.&lt;br /&gt;
&lt;br /&gt;
Example 1. The following is the “ranking matrix” of three men, α, β, and γ , and three women, A, B, and C.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Man\Woman !! A !! B !! C&lt;br /&gt;
|-&lt;br /&gt;
| α || 1,3      || 2,2     || 3,1&lt;br /&gt;
|-&lt;br /&gt;
| β || 3,1      || 1,3     || 2,2&lt;br /&gt;
|-&lt;br /&gt;
| γ || 2,2      || 3,1     || 1,3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ﬁrst number of each pair in the matrix gives the ranking of women by the men, the second number is the ranking of the men by the women. Thus, α ranks A ﬁrst, B second, C third, while A ranks β ﬁrst, γ second, and α third, etc.&lt;br /&gt;
&lt;br /&gt;
There are six possible sets of marriages; of these, three are stable. One of these is realized by giving each man his ﬁrst choice, thus α marries A, β marries B, and γ marries C. Note that although each woman gets her last choice, the arrangement is nevertheless stable. Alternatively one may let the women have their ﬁrst choices and marry α to C, β to A, and γ to B. The third stable arrangement is to give everyone his or her second choice and have α marry B, β marry C, and γ marry A. The reader will easily verify that all other arrangements are unstable.&lt;br /&gt;
&lt;br /&gt;
In the existing implementation, we have match_new_teams_to_topics method in lottery_controller that performs this stable sorting algorithm for teams that have bid for an assignment. Our objective would be to implement a similar strategy, but we would use students instead of teams since there are no &amp;quot;team reviews&amp;quot;. Every student selects their own assignment to review&lt;br /&gt;
&lt;br /&gt;
== Design strategy ==&lt;br /&gt;
Almost all of the functionality for our project has already been implemented in the review portion of the Expertiza system - where the teams are allowed to bid on topics they want to work for their project. We plan to reuse the code to keep the implementation DRY but we need to add some additional features to make it work for review bidding functionality. '''Delegation''' is a way to make composition as powerful for reuse as an inheritance. Delegation pattern will help us to reduce the coupling of methods to their original class as we have components that seem to behave identically, but we realize that this situation can change in the future.&lt;br /&gt;
&lt;br /&gt;
====Controller====&lt;br /&gt;
Because of this, we plan to approach this project by first using delegation pattern to add biding capability to the [https://github.com/expertiza/expertiza/blob/master/app/controllers/review_mapping_controller.rb review mapping controller] for choosing topics. Apart from this, a new controller,[https://github.com/expertiza/expertiza/pull/1322/files#diff-e064188effa2297543b98ac353bba4e3 review bids controller] is implemented to handle interactions similar to the one done in [https://github.com/expertiza/expertiza/blob/master/app/controllers/lottery_controller.rb lottery controller]. It handles the following implementations. &lt;br /&gt;
&lt;br /&gt;
1. Trigger the bidding by sending a request to PeerLogic backend with proper parameters retrieved from ReviewBid records. &lt;br /&gt;
&lt;br /&gt;
2. Process the response from PeerLogic and transform it into records of ReviewResponseMap.&lt;br /&gt;
&lt;br /&gt;
====View====&lt;br /&gt;
The bidding interface for reviews is followed from [https://github.com/expertiza/expertiza/pull/778/commits similar] implementation for topic bidding. We need to modify the ''code'' to implement the heat-map showing us demand density for each project to be reviewed and list of all available topics to review and selected topics. After we allow the student users to bid for their topic of interest we need to provide access to instructors to start the bidding algorithm. &lt;br /&gt;
&lt;br /&gt;
====Model====&lt;br /&gt;
To maintain the original functionality of Expertiza as well as to add review bidding, we decide to add a new model to handle the data of the bidding. Let's call it ReviewBid. ReviewBid contains the information of bidding assignment and its biddable topics as well as the  participants' preference. ReviewBid is served as the input of the bidding algorithm. We decided to let participant to bid on assignment teams rather than topics for simplicity.&lt;br /&gt;
&lt;br /&gt;
Here is the definition of ReviewBid:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
!Field Name !!Type !!Description &lt;br /&gt;
|-&lt;br /&gt;
!id &lt;br /&gt;
|int(11)  &lt;br /&gt;
|unique identifier for the record&lt;br /&gt;
|- &lt;br /&gt;
!team_id   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|the work of team to be bid on&lt;br /&gt;
|- &lt;br /&gt;
!participant_id   &lt;br /&gt;
|int(11)  &lt;br /&gt;
|participant id&lt;br /&gt;
|- &lt;br /&gt;
!priority   &lt;br /&gt;
|text&lt;br /&gt;
|participant's preference towards the team&lt;br /&gt;
|-&lt;br /&gt;
!created_at&lt;br /&gt;
|timestamp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!updated_at&lt;br /&gt;
|timestamp&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
 &lt;br /&gt;
# [https://www-jstor-org.prox.lib.ncsu.edu/stable/2312726?Search=yes&amp;amp;resultItemClick=true&amp;amp;searchText=College&amp;amp;searchText=Admissions&amp;amp;searchText=and&amp;amp;searchText=the&amp;amp;searchText=Stability&amp;amp;searchText=of&amp;amp;searchText=Marriage&amp;amp;searchUri=%2Faction%2FdoBasicSearch%3Fgroup%3Dnone%26amp%3Bfc%3Doff%26amp%3BQuery%3DCollege%2BAdmissions%2Band%2Bthe%2BStability%2Bof%2BMarriage%26amp%3Bwc%3Don%26amp%3Bacc%3Don&amp;amp;ab_segments=0%2Fdefault-2%2Fcontrol&amp;amp;refreqid=search%3A6c17f9ae92b22bc404fc3b7641ac908a&amp;amp;seq=1#metadata_info_tab_contents College Admissions and the Stability of Marriage (1962), D. Gale and L. S. Shapley]&lt;br /&gt;
# [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review]&lt;br /&gt;
# [https://github.com/expertiza/expertiza/pull/1322 Pull Request #1322 (E1856. Allow reviewers to bid on what to review)]&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1928._Allow_reviewers_to_bid_on_what_to_review&amp;diff=123190</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1928. Allow reviewers to bid on what to review</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1928._Allow_reviewers_to_bid_on_what_to_review&amp;diff=123190"/>
		<updated>2019-04-05T14:03:40Z</updated>

		<summary type="html">&lt;p&gt;Dde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
It is a web server.&lt;br /&gt;
== Top Trading Cycles Algorithm==&lt;br /&gt;
&lt;br /&gt;
== Design strategy ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1912_Export_Tags&amp;diff=122936</id>
		<title>E1912 Export Tags</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1912_Export_Tags&amp;diff=122936"/>
		<updated>2019-04-02T00:06:41Z</updated>

		<summary type="html">&lt;p&gt;Dde: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
Expertiza is an Open Source Web Application Software managed by National Science Foundation. Expertiza is used by many courses including CSC 517 for assignment management. It has functionalities such as peer reviews, teammate reviews and tagging reviews in which students can provide feedback on other's work which helps peer in better developing the project. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
The Expertiza team currently had to manually fire queries in the database in order to get the tag submissions made by an individual user(student) on each review for a particular assignment. In this way, the team got the data from the entire class, which was then used to feed the Machine Learning algorithms. But many times it used to happen that students made random tags and the ML algorithm was not able to make good predictions out of it, hence in order to solve this issue a new idea was proposed as to select on the students which did not create outliers in the predictions and hence, therefore, it is a good proposal.&lt;br /&gt;
&lt;br /&gt;
===Tasks Identified===&lt;br /&gt;
In order to perform this task following files were identified where the code hasbeen added.&lt;br /&gt;
* In _answer_tagging_report.html.erb view, a button is added for exporting the student's tagged values&lt;br /&gt;
* A checkbox for each row has been added in order to select students whose tags are to be exported(By default all will be selected).&lt;br /&gt;
* A method is written in export_file_controller.rb controller named export_tags that exports the CSV file.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The workflow diagram of our implementation is shown here: &lt;br /&gt;
&lt;br /&gt;
[[File:E1912flow.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We have added a default select all checkbox under ''Report tags done by each user'' which enables student selection for exporting tags in the CSV file. We have added a column for the checkbox and a button named '''Export''' which on click generates the CSV file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Eb1912Export.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below is the snippet of the same view ''_answer_tagging_report.html.erb ''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag(export_tags, method: 'put',:id =&amp;gt; 'tst') do %&amp;gt;&lt;br /&gt;
      &amp;lt;div id=&amp;quot;tab-summary&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;h4  align=&amp;quot;center&amp;quot;&amp;gt;Summary for each user&amp;lt;/h4&amp;gt;&lt;br /&gt;
        &amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;thead&amp;gt;&lt;br /&gt;
          &amp;lt;tr&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;Username&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;Percentage of tags done&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;# tags done&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;# tags not done&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;# possible tags to do&amp;lt;img src='/assets/info.png' title='Number of answers that fulfil the prerequisite setup for each&lt;br /&gt;
 tags (Answer of certain question types and has a length of greater than the threshold).'/&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th&amp;gt;Tags export&amp;lt;/th&amp;gt;&lt;br /&gt;
          &amp;lt;/tr&amp;gt;&lt;br /&gt;
          &amp;lt;/thead&amp;gt;&lt;br /&gt;
          &amp;lt;% @user_tagging_report.each do |key, val| %&amp;gt;&lt;br /&gt;
              &amp;lt;tr&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.user.name(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.user.fullname(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.percentage.to_s %&amp;gt;%&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.no_tagged.to_s %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.no_not_tagged.to_s %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.no_tagable %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= check_box_tag 'names[]', val.user.name(session[:ip]), true %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
              &amp;lt;/tr&amp;gt;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;/table&amp;gt;&lt;br /&gt;
      &amp;lt;/div&amp;gt;&lt;br /&gt;
     &amp;lt;%= submit_tag &amp;quot;Export&amp;quot;,:value =&amp;gt; 'Export' ,:form =&amp;gt; 'tst',method: 'put' %&amp;gt;&lt;br /&gt;
   &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Screen Record==&lt;br /&gt;
# [https://drive.google.com/open?id=1B65_N3bWwPlSyiXMhXzXypKvKLN09g0r Here] is the link to a screen recording on how to access the functionality and export the CSV file.&lt;br /&gt;
&lt;br /&gt;
==Code and Snapshots==&lt;br /&gt;
&lt;br /&gt;
We have written a method inside the ''export_file_controller.rb''. Once this method is called it queries on the ''name'' array passed from the view and exports the CSV file with the required data.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def export_tags&lt;br /&gt;
    @user_ids = User.where(&amp;quot;name IN (?)&amp;quot;, params[:names])&lt;br /&gt;
    @students = AnswerTag.select('answers.*, answer_tags.*').joins(:answer).where(&amp;quot;answer_tags.answer_id = answers.id and answer_tags.user_id IN (?)&amp;quot;, @user_ids.pluck(:id))&lt;br /&gt;
    attributes = %w[user_id tag_prompt_deployment_id comments value]&lt;br /&gt;
&lt;br /&gt;
    csv_data = CSV.generate(col_sep: &amp;quot;,&amp;quot;) do |csv|&lt;br /&gt;
      csv &amp;lt;&amp;lt; attributes&lt;br /&gt;
      @students.each do |item|&lt;br /&gt;
        csv &amp;lt;&amp;lt; item.attributes.values_at(*attributes)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    filename = &amp;quot;Tags&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    send_data csv_data,&lt;br /&gt;
              type: 'text/csv; charset=iso-8859-1; header=present',&lt;br /&gt;
              disposition: &amp;quot;attachment; filename=#{filename}.csv&amp;quot;&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file has '''user_id, tag_prompt_deployment_id, comments and value'''. We can see that some comments are repeated it is because every review that is received has at least 1 tag for it. Hence we see the repetition. The value column has -1, 0 and 1 as No, not answered and Yes meaning respectively.&lt;br /&gt;
&lt;br /&gt;
[[File:Eb1912csv.png]]&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
The functionality for our project was to implement exporting of tagged comments from the Expertiza system. For this, we will approach the project by using the delegation pattern to add exporting capabilities to the export file controller for exporting tags.&lt;br /&gt;
&lt;br /&gt;
==Teammates==&lt;br /&gt;
Mentor - Harsh Agrawal&lt;br /&gt;
&lt;br /&gt;
* Aishwarya Subramanian (asubram7)&lt;br /&gt;
* Dyuti De (dde)&lt;br /&gt;
* Ankit Mody (amody)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# [https://github.com/expertiza/expertiza Github Repository for Expertiza]&lt;br /&gt;
# [http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables Expertiza Documentation on Database Tables]&lt;br /&gt;
# [https://guides.rubyonrails.org/api_app.html Rails Guide Documentation]&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E1912flow.png&amp;diff=122935</id>
		<title>File:E1912flow.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E1912flow.png&amp;diff=122935"/>
		<updated>2019-04-02T00:06:07Z</updated>

		<summary type="html">&lt;p&gt;Dde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1912_Export_Tags&amp;diff=122934</id>
		<title>E1912 Export Tags</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1912_Export_Tags&amp;diff=122934"/>
		<updated>2019-04-02T00:02:22Z</updated>

		<summary type="html">&lt;p&gt;Dde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
Expertiza is an Open Source Web Application Software managed by National Science Foundation. Expertiza is used by many courses including CSC 517 for assignment management. It has functionalities such as peer reviews, teammate reviews and tagging reviews in which students can provide feedback on other's work which helps peer in better developing the project. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
The Expertiza team currently had to manually fire queries in the database in order to get the tag submissions made by an individual user(student) on each review for a particular assignment. In this way, the team got the data from the entire class, which was then used to feed the Machine Learning algorithms. But many times it used to happen that students made random tags and the ML algorithm was not able to make good predictions out of it, hence in order to solve this issue a new idea was proposed as to select on the students which did not create outliers in the predictions and hence, therefore, it is a good proposal.&lt;br /&gt;
&lt;br /&gt;
===Tasks Identified===&lt;br /&gt;
In order to perform this task following files were identified where the code hasbeen added.&lt;br /&gt;
* In _answer_tagging_report.html.erb view, a button is added for exporting the student's tagged values&lt;br /&gt;
* A checkbox for each row has been added in order to select students whose tags are to be exported(By default all will be selected).&lt;br /&gt;
* A method is written in export_file_controller.rb controller named export_tags that exports the CSV file.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The workflow diagram of our implementation is shown here: &lt;br /&gt;
&lt;br /&gt;
[[File:E1912flowdia.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We have added a default select all checkbox under ''Report tags done by each user'' which enables student selection for exporting tags in the CSV file. We have added a column for the checkbox and a button named '''Export''' which on click generates the CSV file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Eb1912Export.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below is the snippet of the same view ''_answer_tagging_report.html.erb ''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;%= form_tag(export_tags, method: 'put',:id =&amp;gt; 'tst') do %&amp;gt;&lt;br /&gt;
      &amp;lt;div id=&amp;quot;tab-summary&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;h4  align=&amp;quot;center&amp;quot;&amp;gt;Summary for each user&amp;lt;/h4&amp;gt;&lt;br /&gt;
        &amp;lt;table class=&amp;quot;table table-striped sortable&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;thead&amp;gt;&lt;br /&gt;
          &amp;lt;tr&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;Username&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;Percentage of tags done&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;# tags done&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;# tags not done&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th class=&amp;quot;sorter-true&amp;quot;&amp;gt;# possible tags to do&amp;lt;img src='/assets/info.png' title='Number of answers that fulfil the prerequisite setup for each&lt;br /&gt;
 tags (Answer of certain question types and has a length of greater than the threshold).'/&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
            &amp;lt;th&amp;gt;Tags export&amp;lt;/th&amp;gt;&lt;br /&gt;
          &amp;lt;/tr&amp;gt;&lt;br /&gt;
          &amp;lt;/thead&amp;gt;&lt;br /&gt;
          &amp;lt;% @user_tagging_report.each do |key, val| %&amp;gt;&lt;br /&gt;
              &amp;lt;tr&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.user.name(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.user.fullname(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.percentage.to_s %&amp;gt;%&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.no_tagged.to_s %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.no_not_tagged.to_s %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= val.no_tagable %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
                &amp;lt;td&amp;gt;&amp;lt;%= check_box_tag 'names[]', val.user.name(session[:ip]), true %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
              &amp;lt;/tr&amp;gt;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;/table&amp;gt;&lt;br /&gt;
      &amp;lt;/div&amp;gt;&lt;br /&gt;
     &amp;lt;%= submit_tag &amp;quot;Export&amp;quot;,:value =&amp;gt; 'Export' ,:form =&amp;gt; 'tst',method: 'put' %&amp;gt;&lt;br /&gt;
   &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Screen Record==&lt;br /&gt;
# [https://drive.google.com/open?id=1B65_N3bWwPlSyiXMhXzXypKvKLN09g0r Here] is the link to a screen recording on how to access the functionality and export the CSV file.&lt;br /&gt;
&lt;br /&gt;
==Code and Snapshots==&lt;br /&gt;
&lt;br /&gt;
We have written a method inside the ''export_file_controller.rb''. Once this method is called it queries on the ''name'' array passed from the view and exports the CSV file with the required data.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def export_tags&lt;br /&gt;
    @user_ids = User.where(&amp;quot;name IN (?)&amp;quot;, params[:names])&lt;br /&gt;
    @students = AnswerTag.select('answers.*, answer_tags.*').joins(:answer).where(&amp;quot;answer_tags.answer_id = answers.id and answer_tags.user_id IN (?)&amp;quot;, @user_ids.pluck(:id))&lt;br /&gt;
    attributes = %w[user_id tag_prompt_deployment_id comments value]&lt;br /&gt;
&lt;br /&gt;
    csv_data = CSV.generate(col_sep: &amp;quot;,&amp;quot;) do |csv|&lt;br /&gt;
      csv &amp;lt;&amp;lt; attributes&lt;br /&gt;
      @students.each do |item|&lt;br /&gt;
        csv &amp;lt;&amp;lt; item.attributes.values_at(*attributes)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    filename = &amp;quot;Tags&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    send_data csv_data,&lt;br /&gt;
              type: 'text/csv; charset=iso-8859-1; header=present',&lt;br /&gt;
              disposition: &amp;quot;attachment; filename=#{filename}.csv&amp;quot;&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file has '''user_id, tag_prompt_deployment_id, comments and value'''. We can see that some comments are repeated it is because every review that is received has at least 1 tag for it. Hence we see the repetition. The value column has -1, 0 and 1 as No, not answered and Yes meaning respectively.&lt;br /&gt;
&lt;br /&gt;
[[File:Eb1912csv.png]]&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
The functionality for our project was to implement exporting of tagged comments from the Expertiza system. For this, we will approach the project by using the delegation pattern to add exporting capabilities to the export file controller for exporting tags.&lt;br /&gt;
&lt;br /&gt;
==Teammates==&lt;br /&gt;
Mentor - Harsh Agrawal&lt;br /&gt;
&lt;br /&gt;
* Aishwarya Subramanian (asubram7)&lt;br /&gt;
* Dyuti De (dde)&lt;br /&gt;
* Ankit Mody (amody)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# [https://github.com/expertiza/expertiza Github Repository for Expertiza]&lt;br /&gt;
# [http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables Expertiza Documentation on Database Tables]&lt;br /&gt;
# [https://guides.rubyonrails.org/api_app.html Rails Guide Documentation]&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E1912flowdia.png&amp;diff=122933</id>
		<title>File:E1912flowdia.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E1912flowdia.png&amp;diff=122933"/>
		<updated>2019-04-01T23:58:11Z</updated>

		<summary type="html">&lt;p&gt;Dde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1912_Export_Tags&amp;diff=122813</id>
		<title>E1912 Export Tags</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1912_Export_Tags&amp;diff=122813"/>
		<updated>2019-04-01T18:10:19Z</updated>

		<summary type="html">&lt;p&gt;Dde: /* Future work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
Expertiza is an Open Source Web Application Software managed by National Science Foundation. Expertiza is used by many courses including CSC 517 for assignment management. It has functionalities such as peer reviews, teammate reviews and tagging reviews in which students can provide feedback on other's work which helps peer in better developing the project. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
The Expertiza team currently had to manually fire queries in the database in order to get the tag submissions made by an individual user(student) on each review for a particular assignment. In this way, the team got the data from the entire class, which was then used to feed the Machine Learning algorithms. But many times it used to happen that students made random tags and the ML algorithm was not able to make good predictions out of it, hence in order to solve this issue a new idea was proposed as to select on the students which did not create outliers in the predictions and hence, therefore, it is a good proposal.&lt;br /&gt;
&lt;br /&gt;
===Tasks Identified===&lt;br /&gt;
In order to perform this task following files were identified where the code hasbeen added.&lt;br /&gt;
* In _answer_tagging_report.html.erb view, a button is added for exporting the student's tagged values&lt;br /&gt;
* A checkbox for each row has been added in order to select students whose tags are to be exported(By default all will be selected).&lt;br /&gt;
* A method is written in export_file_controller.rb controller named export_tags that exports the CSV file.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
We have added a default select all checkbox under ''Report tags done by each user'' which enables student selection for exporting tags in the CSV file. We have added a column for the checkbox and a button named '''Export''' which on click generates the CSV file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Eb1912Export.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below is the snippet of same view ''_answer_tagging_report.html.erb ''.&lt;br /&gt;
&lt;br /&gt;
[[File:E1912Code2.png]]&lt;br /&gt;
&lt;br /&gt;
==Definition, Demo code and snapshots==&lt;br /&gt;
&lt;br /&gt;
We have written a method inside the ''export_file_controller.rb''. Once this method is called it queries on the ''name'' array passed from the view and exports the CSV file with the required data.&lt;br /&gt;
&lt;br /&gt;
[[File:Eb1912Code3.png]]&lt;br /&gt;
&lt;br /&gt;
The output file has '''user_id, tag_prompt_deployment_id, comments and value'''. We can see that some comments are repeated it is because every review that is received has at least 1 tag for it. Hence we see the repetition. The value column has -1, 0 and 1 as No, not answered and Yes meaning respectively.&lt;br /&gt;
&lt;br /&gt;
[[File:Eb1912csv.png]]&lt;br /&gt;
&lt;br /&gt;
==Teammates==&lt;br /&gt;
Mentor - Harsh Agrawal&lt;br /&gt;
&lt;br /&gt;
* Aishwarya Subramanian (asubram7)&lt;br /&gt;
* Dyuti De (dde)&lt;br /&gt;
* Ankit Mody (amody)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# [https://github.com/expertiza/expertiza Github Repository for Expertiza]&lt;br /&gt;
# [http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables Expertiza Documentation on Database Tables]&lt;br /&gt;
# [https://guides.rubyonrails.org/api_app.html Rails Guide Documentation]&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1912_Export_Tags&amp;diff=122806</id>
		<title>E1912 Export Tags</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1912_Export_Tags&amp;diff=122806"/>
		<updated>2019-04-01T17:39:46Z</updated>

		<summary type="html">&lt;p&gt;Dde: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
Expertiza is an Open Source Web Application Software managed by National Science Foundation. Expertiza is used by many courses including CSC 517 for assignment management. It has functionalities such as peer reviews, teammate reviews and tagging reviews in which students can provide feedback on other's work which helps peer in better developing the project. &lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
The Expertiza team currently had to manually fire queries in the database in order to get the tag submissions made by an individual user(student) on each review for a particular assignment. In this way, the team got the data from the entire class, which was then used to feed the Machine Learning algorithms. But many times it used to happen that students made random tags and the ML algorithm was not able to make good predictions out of it, hence in order to solve this issue a new idea was proposed as to select on the students which did not create outliers in the predictions and hence, therefore, it is a good proposal.&lt;br /&gt;
&lt;br /&gt;
===Tasks Identified===&lt;br /&gt;
In order to perform this task following files were identified where the code hasbeen added.&lt;br /&gt;
* In _answer_tagging_report.html.erb view, a button is added for exporting the student's tagged values&lt;br /&gt;
* A checkbox for each row has been added in order to select students whose tags are to be exported(By default all will be selected).&lt;br /&gt;
* A method is written in export_file_controller.rb controller named export_tags that exports the CSV file.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
We have added a default select all checkbox under ''Report tags done by each user'' which enables student selection for exporting tags in the CSV file. We have added a column for the checkbox and a button named '''Export''' which on click generates the CSV file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Eb1912Export.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below is the snippet of same view ''_answer_tagging_report.html.erb ''.&lt;br /&gt;
&lt;br /&gt;
[[File:E1912Code2.png]]&lt;br /&gt;
&lt;br /&gt;
==Definition, Demo code and snapshots==&lt;br /&gt;
&lt;br /&gt;
We have written a method inside the ''export_file_controller.rb''. Once this method is called it queries on the ''name'' array passed from the view and exports the CSV file with the required data.&lt;br /&gt;
&lt;br /&gt;
[[File:Eb1912Code3.png]]&lt;br /&gt;
&lt;br /&gt;
The output file has '''user_id, tag_prompt_deployment_id, comments and value'''. We can see that some comments are repeated it is because every review that is received has at least 1 tag for it. Hence we see the repetition. The value column has -1, 0 and 1 as No, not answered and Yes meaning respectively.&lt;br /&gt;
&lt;br /&gt;
[[File:Eb1912csv.png]]&lt;br /&gt;
&lt;br /&gt;
==Teammates==&lt;br /&gt;
Mentor - Harsh Agrawal&lt;br /&gt;
&lt;br /&gt;
* Aishwarya Subramanian (asubram7)&lt;br /&gt;
* Dyuti De (dde)&lt;br /&gt;
* Ankit Mody (amody)&lt;br /&gt;
&lt;br /&gt;
==Future work==&lt;br /&gt;
The task accomplished is of added a checkbox in the view so that students can be selected as required. The following are a few which were identified as part of this project.&lt;br /&gt;
* Adding a javascript function in view so that it stores the username of every student which is selected in an array.&lt;br /&gt;
* Defining a query which will extract the data based on the usernames of students from USERS, ANSWERS and ANSWER_TAGS.&lt;br /&gt;
* Writing a method in report_formart_helper.rb that exports the csv file.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
# [https://github.com/expertiza/expertiza Github Repository for Expertiza]&lt;br /&gt;
# [http://wiki.expertiza.ncsu.edu/index.php/Documentation_on_Database_Tables Expertiza Documentation on Database Tables]&lt;br /&gt;
# [https://guides.rubyonrails.org/api_app.html Rails Guide Documentation]&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Eb1912Export.png&amp;diff=122792</id>
		<title>File:Eb1912Export.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Eb1912Export.png&amp;diff=122792"/>
		<updated>2019-04-01T17:06:33Z</updated>

		<summary type="html">&lt;p&gt;Dde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Eb1912csv.png&amp;diff=122791</id>
		<title>File:Eb1912csv.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Eb1912csv.png&amp;diff=122791"/>
		<updated>2019-04-01T17:05:56Z</updated>

		<summary type="html">&lt;p&gt;Dde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Eb1912Code3.png&amp;diff=122789</id>
		<title>File:Eb1912Code3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Eb1912Code3.png&amp;diff=122789"/>
		<updated>2019-04-01T17:05:21Z</updated>

		<summary type="html">&lt;p&gt;Dde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E1912Code2.png&amp;diff=122788</id>
		<title>File:E1912Code2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E1912Code2.png&amp;diff=122788"/>
		<updated>2019-04-01T17:01:20Z</updated>

		<summary type="html">&lt;p&gt;Dde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1912_Export_Tags&amp;diff=122050</id>
		<title>E1912 Export Tags</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1912_Export_Tags&amp;diff=122050"/>
		<updated>2019-03-25T06:54:01Z</updated>

		<summary type="html">&lt;p&gt;Dde: Created page with &amp;quot;==Introduction== ===About Expertiza=== Expertiza is an Open Source Web Application Software managed by National Science Foundation. Expertiza is used by many courses including CS...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
Expertiza is an Open Source Web Application Software managed by National Science Foundation. Expertiza is used by many courses including CSC 517 for assignment management. It has functionalities such as peer reviews, teammate reviews and tagging reviews in which students can provide feedback on other's work which helps peer in better developing the project. &lt;br /&gt;
&lt;br /&gt;
===Motivation - (drawback and solution)===&lt;br /&gt;
The Expertiza team currently had to manually fire queries in database in order to get the tag submissions made by an individual user(student) on each review for a particular assignment. In this way the team got the data from the entire class, which was then used to feed the Machine Learning algorithms. But many times it used to happen that students made random tags and the ML algorithm was not able to make good predictions out of it, hence in order to solve this issue a new idea was proposed as to select on the students which did not create outliers in the predictions and hence therefore it is a good proposal.&lt;br /&gt;
&lt;br /&gt;
===Tasks Identified===&lt;br /&gt;
In order to perform this task changes following tasks were identified.&lt;br /&gt;
* In answer_tagging_report.html.erb view, a button will be added for export&lt;br /&gt;
* A checkbox for each row will be added in order to select students whose tags are to be exported.&lt;br /&gt;
* A method should be added in report_formart_helper.rb helper that would export the csv file. &lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
Currently, we have added a default select all checkbox which enables in generating the csv of all students under the assignment. &lt;br /&gt;
[[File:Eb1912cb.png]]&lt;br /&gt;
&lt;br /&gt;
In the section of Report tags done by all user, we have added a column for the check box. Below is the snippet of same.&lt;br /&gt;
&lt;br /&gt;
[[File:Eb1912code1.png]]&lt;br /&gt;
&lt;br /&gt;
==Definition, Demo code and snapshots==&lt;br /&gt;
&lt;br /&gt;
==Teammates==&lt;br /&gt;
&lt;br /&gt;
==Future work==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Eb1912code1.png&amp;diff=122049</id>
		<title>File:Eb1912code1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Eb1912code1.png&amp;diff=122049"/>
		<updated>2019-03-25T06:48:47Z</updated>

		<summary type="html">&lt;p&gt;Dde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Eb1912cb.png&amp;diff=122048</id>
		<title>File:Eb1912cb.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Eb1912cb.png&amp;diff=122048"/>
		<updated>2019-03-25T06:42:00Z</updated>

		<summary type="html">&lt;p&gt;Dde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Checkbox.png&amp;diff=122047</id>
		<title>File:Checkbox.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Checkbox.png&amp;diff=122047"/>
		<updated>2019-03-25T06:34:24Z</updated>

		<summary type="html">&lt;p&gt;Dde: uploaded a new version of &amp;amp;quot;File:Checkbox.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dde</name></author>
	</entry>
</feed>