<?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=Xshao2</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=Xshao2"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Xshao2"/>
	<updated>2026-07-21T22:27:20Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92105</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92105"/>
		<updated>2014-11-12T23:04:19Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Exampls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 3: Make slight changes to existing methods/codes ===&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
Existing methods have no enough parameters we want, or they are not returning out results we want.&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Make small changes to them to fit the new methods we write without interfering the previous methods.&lt;br /&gt;
&lt;br /&gt;
==== Exampls ====&lt;br /&gt;
The slight changes of functions are small, trivial and less important to readers to understand what we have done. So only examples are shown to convey the ideas, and all the detailed modification can be found at our [https://github.com/shaoxq1205/expertiza Github] (on branch production). &amp;lt;ref&amp;gt;https://github.com/shaoxq1205/expertiza&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here's the example:&lt;br /&gt;
We need to add a round_number for the questionnaire() method in order to make it return different values (actually from different rows of the assignment_questionnaire table) because there're more than 1 rounds now and each round may have different values.&lt;br /&gt;
previous method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type)&lt;br /&gt;
    questionnaire = assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
current method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type, round_number)&lt;br /&gt;
    if round_number.nil?&lt;br /&gt;
      questionnaire=assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    else&lt;br /&gt;
      ass_ques=assignment.assignment_questionnaires.find_by_used_in_round(round_number)&lt;br /&gt;
      # make sure the assignment_questionnaire record is not empty&lt;br /&gt;
      if !ass_ques.nil?&lt;br /&gt;
      temp_num=ass_ques.questionnaire_id&lt;br /&gt;
      questionnaire = assignment.questionnaires.find_by_id(temp_num)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
=== Design ===&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
=== Codes ===&lt;br /&gt;
In app/features/instructor/Vary_Rubrics_by_Round_Test.feature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Scenario1: Instructor can set the review rubric varies by round&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I check &amp;quot;Review rubric varies by round?&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,30&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,20&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,22&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      And I use Review Round1 named &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
      And I use Review Round2&amp;quot;named &amp;quot;rubric1&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario2: Student should see the review rubric for 1st round&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
Scenario3: Instructor then change the due date of Round 2, so that the student would see a different review rubric&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,22&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,23&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario4: Student should see the review rubric for 2st round, which is different from the 1st one&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;rubric1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In app/features/step_definitions/review_rubric_varies_by_round.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
And /^I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;$/ do&lt;br /&gt;
  visit('/assignment/edit/18')&lt;br /&gt;
end&lt;br /&gt;
And /^I fill in &amp;quot;([^&amp;quot;]*)&amp;quot; for &amp;quot;([^&amp;quot;]*)&amp;quot; $/ do |due_date, deadline|&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{due_date}\&amp;quot; for \&amp;quot;due_date\&amp;quot;&amp;quot;&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{deadline}\&amp;quot; for \&amp;quot;deadline\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;update_wiki&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;update_wiki\&amp;quot; from \&amp;quot;questionnaires[review1]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;rubric1&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;rubric1\&amp;quot; from \&amp;quot;questionnaires[review2]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Final Layout ==&lt;br /&gt;
Here are the screen shots of the final layouts.&lt;br /&gt;
=== Rubrics Tab ===&lt;br /&gt;
[[File:Unchecked.png]]&lt;br /&gt;
[[File:Checked.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, a Review rubric varies by round checkbox will make a difference, which makes sense.&lt;br /&gt;
=== Due Dates Tab ===&lt;br /&gt;
[[File:Due_unchecked.jpg]]&lt;br /&gt;
[[File:Due_checked.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, a Change name and description url checkbox will make a difference, which makes sense.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92104</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92104"/>
		<updated>2014-11-12T23:03:15Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Exampls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 3: Make slight changes to existing methods/codes ===&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
Existing methods have no enough parameters we want, or they are not returning out results we want.&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Make small changes to them to fit the new methods we write without interfering the previous methods.&lt;br /&gt;
&lt;br /&gt;
==== Exampls ====&lt;br /&gt;
The slight changes of functions are small, trivial and less important to readers to understand what we have done. So only examples are shown to convey the ideas, and all the detailed modification can be found at our[[Github https://github.com/shaoxq1205/expertiza]] (on branch production). &amp;lt;ref&amp;gt;https://github.com/shaoxq1205/expertiza&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here's the example:&lt;br /&gt;
We need to add a round_number for the questionnaire() method in order to make it return different values (actually from different rows of the assignment_questionnaire table) because there're more than 1 rounds now and each round may have different values.&lt;br /&gt;
previous method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type)&lt;br /&gt;
    questionnaire = assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
current method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type, round_number)&lt;br /&gt;
    if round_number.nil?&lt;br /&gt;
      questionnaire=assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    else&lt;br /&gt;
      ass_ques=assignment.assignment_questionnaires.find_by_used_in_round(round_number)&lt;br /&gt;
      # make sure the assignment_questionnaire record is not empty&lt;br /&gt;
      if !ass_ques.nil?&lt;br /&gt;
      temp_num=ass_ques.questionnaire_id&lt;br /&gt;
      questionnaire = assignment.questionnaires.find_by_id(temp_num)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
=== Design ===&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
=== Codes ===&lt;br /&gt;
In app/features/instructor/Vary_Rubrics_by_Round_Test.feature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Scenario1: Instructor can set the review rubric varies by round&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I check &amp;quot;Review rubric varies by round?&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,30&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,20&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,22&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      And I use Review Round1 named &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
      And I use Review Round2&amp;quot;named &amp;quot;rubric1&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario2: Student should see the review rubric for 1st round&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
Scenario3: Instructor then change the due date of Round 2, so that the student would see a different review rubric&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,22&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,23&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario4: Student should see the review rubric for 2st round, which is different from the 1st one&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;rubric1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In app/features/step_definitions/review_rubric_varies_by_round.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
And /^I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;$/ do&lt;br /&gt;
  visit('/assignment/edit/18')&lt;br /&gt;
end&lt;br /&gt;
And /^I fill in &amp;quot;([^&amp;quot;]*)&amp;quot; for &amp;quot;([^&amp;quot;]*)&amp;quot; $/ do |due_date, deadline|&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{due_date}\&amp;quot; for \&amp;quot;due_date\&amp;quot;&amp;quot;&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{deadline}\&amp;quot; for \&amp;quot;deadline\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;update_wiki&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;update_wiki\&amp;quot; from \&amp;quot;questionnaires[review1]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;rubric1&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;rubric1\&amp;quot; from \&amp;quot;questionnaires[review2]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Final Layout ==&lt;br /&gt;
Here are the screen shots of the final layouts.&lt;br /&gt;
=== Rubrics Tab ===&lt;br /&gt;
[[File:Unchecked.png]]&lt;br /&gt;
[[File:Checked.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, a Review rubric varies by round checkbox will make a difference, which makes sense.&lt;br /&gt;
=== Due Dates Tab ===&lt;br /&gt;
[[File:Due_unchecked.jpg]]&lt;br /&gt;
[[File:Due_checked.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, a Change name and description url checkbox will make a difference, which makes sense.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92103</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92103"/>
		<updated>2014-11-12T23:02:56Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Exampls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 3: Make slight changes to existing methods/codes ===&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
Existing methods have no enough parameters we want, or they are not returning out results we want.&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Make small changes to them to fit the new methods we write without interfering the previous methods.&lt;br /&gt;
&lt;br /&gt;
==== Exampls ====&lt;br /&gt;
The slight changes of functions are small, trivial and less important to readers to understand what we have done. So only examples are shown to convey the ideas, and all the detailed modification can be found at our[Github https://github.com/shaoxq1205/expertiza] (on branch production). &amp;lt;ref&amp;gt;https://github.com/shaoxq1205/expertiza&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here's the example:&lt;br /&gt;
We need to add a round_number for the questionnaire() method in order to make it return different values (actually from different rows of the assignment_questionnaire table) because there're more than 1 rounds now and each round may have different values.&lt;br /&gt;
previous method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type)&lt;br /&gt;
    questionnaire = assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
current method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type, round_number)&lt;br /&gt;
    if round_number.nil?&lt;br /&gt;
      questionnaire=assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    else&lt;br /&gt;
      ass_ques=assignment.assignment_questionnaires.find_by_used_in_round(round_number)&lt;br /&gt;
      # make sure the assignment_questionnaire record is not empty&lt;br /&gt;
      if !ass_ques.nil?&lt;br /&gt;
      temp_num=ass_ques.questionnaire_id&lt;br /&gt;
      questionnaire = assignment.questionnaires.find_by_id(temp_num)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
=== Design ===&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
=== Codes ===&lt;br /&gt;
In app/features/instructor/Vary_Rubrics_by_Round_Test.feature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Scenario1: Instructor can set the review rubric varies by round&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I check &amp;quot;Review rubric varies by round?&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,30&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,20&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,22&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      And I use Review Round1 named &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
      And I use Review Round2&amp;quot;named &amp;quot;rubric1&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario2: Student should see the review rubric for 1st round&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
Scenario3: Instructor then change the due date of Round 2, so that the student would see a different review rubric&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,22&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,23&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario4: Student should see the review rubric for 2st round, which is different from the 1st one&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;rubric1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In app/features/step_definitions/review_rubric_varies_by_round.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
And /^I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;$/ do&lt;br /&gt;
  visit('/assignment/edit/18')&lt;br /&gt;
end&lt;br /&gt;
And /^I fill in &amp;quot;([^&amp;quot;]*)&amp;quot; for &amp;quot;([^&amp;quot;]*)&amp;quot; $/ do |due_date, deadline|&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{due_date}\&amp;quot; for \&amp;quot;due_date\&amp;quot;&amp;quot;&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{deadline}\&amp;quot; for \&amp;quot;deadline\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;update_wiki&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;update_wiki\&amp;quot; from \&amp;quot;questionnaires[review1]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;rubric1&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;rubric1\&amp;quot; from \&amp;quot;questionnaires[review2]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Final Layout ==&lt;br /&gt;
Here are the screen shots of the final layouts.&lt;br /&gt;
=== Rubrics Tab ===&lt;br /&gt;
[[File:Unchecked.png]]&lt;br /&gt;
[[File:Checked.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, a Review rubric varies by round checkbox will make a difference, which makes sense.&lt;br /&gt;
=== Due Dates Tab ===&lt;br /&gt;
[[File:Due_unchecked.jpg]]&lt;br /&gt;
[[File:Due_checked.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, a Change name and description url checkbox will make a difference, which makes sense.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92102</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92102"/>
		<updated>2014-11-12T23:02:31Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Exampls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 3: Make slight changes to existing methods/codes ===&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
Existing methods have no enough parameters we want, or they are not returning out results we want.&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Make small changes to them to fit the new methods we write without interfering the previous methods.&lt;br /&gt;
&lt;br /&gt;
==== Exampls ====&lt;br /&gt;
The slight changes of functions are small, trivial and less important to readers to understand what we have done. So only examples are shown to convey the ideas, and all the detailed modification can be found at our Github [[https://github.com/shaoxq1205/expertiza]] (on branch production). &amp;lt;ref&amp;gt;https://github.com/shaoxq1205/expertiza&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here's the example:&lt;br /&gt;
We need to add a round_number for the questionnaire() method in order to make it return different values (actually from different rows of the assignment_questionnaire table) because there're more than 1 rounds now and each round may have different values.&lt;br /&gt;
previous method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type)&lt;br /&gt;
    questionnaire = assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
current method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type, round_number)&lt;br /&gt;
    if round_number.nil?&lt;br /&gt;
      questionnaire=assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    else&lt;br /&gt;
      ass_ques=assignment.assignment_questionnaires.find_by_used_in_round(round_number)&lt;br /&gt;
      # make sure the assignment_questionnaire record is not empty&lt;br /&gt;
      if !ass_ques.nil?&lt;br /&gt;
      temp_num=ass_ques.questionnaire_id&lt;br /&gt;
      questionnaire = assignment.questionnaires.find_by_id(temp_num)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
=== Design ===&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
=== Codes ===&lt;br /&gt;
In app/features/instructor/Vary_Rubrics_by_Round_Test.feature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Scenario1: Instructor can set the review rubric varies by round&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I check &amp;quot;Review rubric varies by round?&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,30&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,20&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,22&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      And I use Review Round1 named &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
      And I use Review Round2&amp;quot;named &amp;quot;rubric1&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario2: Student should see the review rubric for 1st round&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
Scenario3: Instructor then change the due date of Round 2, so that the student would see a different review rubric&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,22&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,23&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario4: Student should see the review rubric for 2st round, which is different from the 1st one&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;rubric1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In app/features/step_definitions/review_rubric_varies_by_round.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
And /^I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;$/ do&lt;br /&gt;
  visit('/assignment/edit/18')&lt;br /&gt;
end&lt;br /&gt;
And /^I fill in &amp;quot;([^&amp;quot;]*)&amp;quot; for &amp;quot;([^&amp;quot;]*)&amp;quot; $/ do |due_date, deadline|&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{due_date}\&amp;quot; for \&amp;quot;due_date\&amp;quot;&amp;quot;&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{deadline}\&amp;quot; for \&amp;quot;deadline\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;update_wiki&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;update_wiki\&amp;quot; from \&amp;quot;questionnaires[review1]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;rubric1&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;rubric1\&amp;quot; from \&amp;quot;questionnaires[review2]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Final Layout ==&lt;br /&gt;
Here are the screen shots of the final layouts.&lt;br /&gt;
=== Rubrics Tab ===&lt;br /&gt;
[[File:Unchecked.png]]&lt;br /&gt;
[[File:Checked.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, a Review rubric varies by round checkbox will make a difference, which makes sense.&lt;br /&gt;
=== Due Dates Tab ===&lt;br /&gt;
[[File:Due_unchecked.jpg]]&lt;br /&gt;
[[File:Due_checked.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, a Change name and description url checkbox will make a difference, which makes sense.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92101</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92101"/>
		<updated>2014-11-12T23:01:11Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Exampls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 3: Make slight changes to existing methods/codes ===&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
Existing methods have no enough parameters we want, or they are not returning out results we want.&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Make small changes to them to fit the new methods we write without interfering the previous methods.&lt;br /&gt;
&lt;br /&gt;
==== Exampls ====&lt;br /&gt;
The slight changes of functions are small, trivial and less important to readers to understand what we have done. So only examples are shown to convey the ideas, and all the detailed modification can be found at our Github (on branch production). &amp;lt;ref&amp;gt;https://github.com/shaoxq1205/expertiza&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here's the example:&lt;br /&gt;
We need to add a round_number for the questionnaire() method in order to make it return different values (actually from different rows of the assignment_questionnaire table) because there're more than 1 rounds now and each round may have different values.&lt;br /&gt;
previous method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type)&lt;br /&gt;
    questionnaire = assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
current method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type, round_number)&lt;br /&gt;
    if round_number.nil?&lt;br /&gt;
      questionnaire=assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    else&lt;br /&gt;
      ass_ques=assignment.assignment_questionnaires.find_by_used_in_round(round_number)&lt;br /&gt;
      # make sure the assignment_questionnaire record is not empty&lt;br /&gt;
      if !ass_ques.nil?&lt;br /&gt;
      temp_num=ass_ques.questionnaire_id&lt;br /&gt;
      questionnaire = assignment.questionnaires.find_by_id(temp_num)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
=== Design ===&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
=== Codes ===&lt;br /&gt;
In app/features/instructor/Vary_Rubrics_by_Round_Test.feature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Scenario1: Instructor can set the review rubric varies by round&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I check &amp;quot;Review rubric varies by round?&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,30&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,20&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,22&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      And I use Review Round1 named &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
      And I use Review Round2&amp;quot;named &amp;quot;rubric1&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario2: Student should see the review rubric for 1st round&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
Scenario3: Instructor then change the due date of Round 2, so that the student would see a different review rubric&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,22&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,23&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario4: Student should see the review rubric for 2st round, which is different from the 1st one&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;rubric1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In app/features/step_definitions/review_rubric_varies_by_round.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
And /^I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;$/ do&lt;br /&gt;
  visit('/assignment/edit/18')&lt;br /&gt;
end&lt;br /&gt;
And /^I fill in &amp;quot;([^&amp;quot;]*)&amp;quot; for &amp;quot;([^&amp;quot;]*)&amp;quot; $/ do |due_date, deadline|&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{due_date}\&amp;quot; for \&amp;quot;due_date\&amp;quot;&amp;quot;&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{deadline}\&amp;quot; for \&amp;quot;deadline\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;update_wiki&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;update_wiki\&amp;quot; from \&amp;quot;questionnaires[review1]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;rubric1&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;rubric1\&amp;quot; from \&amp;quot;questionnaires[review2]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Final Layout ==&lt;br /&gt;
Here are the screen shots of the final layouts.&lt;br /&gt;
=== Rubrics Tab ===&lt;br /&gt;
[[File:Unchecked.png]]&lt;br /&gt;
[[File:Checked.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, a Review rubric varies by round checkbox will make a difference, which makes sense.&lt;br /&gt;
=== Due Dates Tab ===&lt;br /&gt;
[[File:Due_unchecked.jpg]]&lt;br /&gt;
[[File:Due_checked.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, a Change name and description url checkbox will make a difference, which makes sense.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92100</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92100"/>
		<updated>2014-11-12T23:00:36Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Exampls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 3: Make slight changes to existing methods/codes ===&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
Existing methods have no enough parameters we want, or they are not returning out results we want.&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Make small changes to them to fit the new methods we write without interfering the previous methods.&lt;br /&gt;
&lt;br /&gt;
==== Exampls ====&lt;br /&gt;
The slight changes of functions are small, trivial and less important to readers to understand what we have done. So only examples are shown to convey the ideas, and all the detailed modification can be found at our Github (on branch production). &amp;lt;ref&amp;gt;https:github.com/shaoxq1205/expertiza&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here's the example:&lt;br /&gt;
We need to add a round_number for the questionnaire() method in order to make it return different values (actually from different rows of the assignment_questionnaire table) because there're more than 1 rounds now and each round may have different values.&lt;br /&gt;
previous method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type)&lt;br /&gt;
    questionnaire = assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
current method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type, round_number)&lt;br /&gt;
    if round_number.nil?&lt;br /&gt;
      questionnaire=assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    else&lt;br /&gt;
      ass_ques=assignment.assignment_questionnaires.find_by_used_in_round(round_number)&lt;br /&gt;
      # make sure the assignment_questionnaire record is not empty&lt;br /&gt;
      if !ass_ques.nil?&lt;br /&gt;
      temp_num=ass_ques.questionnaire_id&lt;br /&gt;
      questionnaire = assignment.questionnaires.find_by_id(temp_num)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
=== Design ===&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
=== Codes ===&lt;br /&gt;
In app/features/instructor/Vary_Rubrics_by_Round_Test.feature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Scenario1: Instructor can set the review rubric varies by round&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I check &amp;quot;Review rubric varies by round?&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,30&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,20&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,22&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      And I use Review Round1 named &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
      And I use Review Round2&amp;quot;named &amp;quot;rubric1&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario2: Student should see the review rubric for 1st round&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
Scenario3: Instructor then change the due date of Round 2, so that the student would see a different review rubric&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,22&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,23&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario4: Student should see the review rubric for 2st round, which is different from the 1st one&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;rubric1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In app/features/step_definitions/review_rubric_varies_by_round.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
And /^I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;$/ do&lt;br /&gt;
  visit('/assignment/edit/18')&lt;br /&gt;
end&lt;br /&gt;
And /^I fill in &amp;quot;([^&amp;quot;]*)&amp;quot; for &amp;quot;([^&amp;quot;]*)&amp;quot; $/ do |due_date, deadline|&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{due_date}\&amp;quot; for \&amp;quot;due_date\&amp;quot;&amp;quot;&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{deadline}\&amp;quot; for \&amp;quot;deadline\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;update_wiki&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;update_wiki\&amp;quot; from \&amp;quot;questionnaires[review1]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;rubric1&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;rubric1\&amp;quot; from \&amp;quot;questionnaires[review2]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Final Layout ==&lt;br /&gt;
Here are the screen shots of the final layouts.&lt;br /&gt;
=== Rubrics Tab ===&lt;br /&gt;
[[File:Unchecked.png]]&lt;br /&gt;
[[File:Checked.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, a Review rubric varies by round checkbox will make a difference, which makes sense.&lt;br /&gt;
=== Due Dates Tab ===&lt;br /&gt;
[[File:Due_unchecked.jpg]]&lt;br /&gt;
[[File:Due_checked.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, a Change name and description url checkbox will make a difference, which makes sense.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92099</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92099"/>
		<updated>2014-11-12T22:58:14Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Due Dates Tab */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 3: Make slight changes to existing methods/codes ===&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
Existing methods have no enough parameters we want, or they are not returning out results we want.&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Make small changes to them to fit the new methods we write without interfering the previous methods.&lt;br /&gt;
&lt;br /&gt;
==== Exampls ====&lt;br /&gt;
The slight changes of functions are small, trivial and less important to readers to understand what we have done. So only examples are shown to convey the ideas, and all the detailed modification can be found at our Github: https:github.com/shaoxq1205/expertiza (on branch production).&lt;br /&gt;
&lt;br /&gt;
Here's the example:&lt;br /&gt;
We need to add a round_number for the questionnaire() method in order to make it return different values (actually from different rows of the assignment_questionnaire table) because there're more than 1 rounds now and each round may have different values.&lt;br /&gt;
previous method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type)&lt;br /&gt;
    questionnaire = assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
current method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type, round_number)&lt;br /&gt;
    if round_number.nil?&lt;br /&gt;
      questionnaire=assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    else&lt;br /&gt;
      ass_ques=assignment.assignment_questionnaires.find_by_used_in_round(round_number)&lt;br /&gt;
      # make sure the assignment_questionnaire record is not empty&lt;br /&gt;
      if !ass_ques.nil?&lt;br /&gt;
      temp_num=ass_ques.questionnaire_id&lt;br /&gt;
      questionnaire = assignment.questionnaires.find_by_id(temp_num)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
=== Design ===&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
=== Codes ===&lt;br /&gt;
In app/features/instructor/Vary_Rubrics_by_Round_Test.feature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Scenario1: Instructor can set the review rubric varies by round&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I check &amp;quot;Review rubric varies by round?&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,30&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,20&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,22&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      And I use Review Round1 named &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
      And I use Review Round2&amp;quot;named &amp;quot;rubric1&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario2: Student should see the review rubric for 1st round&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
Scenario3: Instructor then change the due date of Round 2, so that the student would see a different review rubric&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,22&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,23&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario4: Student should see the review rubric for 2st round, which is different from the 1st one&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;rubric1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In app/features/step_definitions/review_rubric_varies_by_round.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
And /^I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;$/ do&lt;br /&gt;
  visit('/assignment/edit/18')&lt;br /&gt;
end&lt;br /&gt;
And /^I fill in &amp;quot;([^&amp;quot;]*)&amp;quot; for &amp;quot;([^&amp;quot;]*)&amp;quot; $/ do |due_date, deadline|&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{due_date}\&amp;quot; for \&amp;quot;due_date\&amp;quot;&amp;quot;&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{deadline}\&amp;quot; for \&amp;quot;deadline\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;update_wiki&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;update_wiki\&amp;quot; from \&amp;quot;questionnaires[review1]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;rubric1&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;rubric1\&amp;quot; from \&amp;quot;questionnaires[review2]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Final Layout ==&lt;br /&gt;
Here are the screen shots of the final layouts.&lt;br /&gt;
=== Rubrics Tab ===&lt;br /&gt;
[[File:Unchecked.png]]&lt;br /&gt;
[[File:Checked.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, a Review rubric varies by round checkbox will make a difference, which makes sense.&lt;br /&gt;
=== Due Dates Tab ===&lt;br /&gt;
[[File:Due_unchecked.jpg]]&lt;br /&gt;
[[File:Due_checked.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, a Change name and description url checkbox will make a difference, which makes sense.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92098</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92098"/>
		<updated>2014-11-12T22:57:32Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Final Layout */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 3: Make slight changes to existing methods/codes ===&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
Existing methods have no enough parameters we want, or they are not returning out results we want.&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Make small changes to them to fit the new methods we write without interfering the previous methods.&lt;br /&gt;
&lt;br /&gt;
==== Exampls ====&lt;br /&gt;
The slight changes of functions are small, trivial and less important to readers to understand what we have done. So only examples are shown to convey the ideas, and all the detailed modification can be found at our Github: https:github.com/shaoxq1205/expertiza (on branch production).&lt;br /&gt;
&lt;br /&gt;
Here's the example:&lt;br /&gt;
We need to add a round_number for the questionnaire() method in order to make it return different values (actually from different rows of the assignment_questionnaire table) because there're more than 1 rounds now and each round may have different values.&lt;br /&gt;
previous method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type)&lt;br /&gt;
    questionnaire = assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
current method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type, round_number)&lt;br /&gt;
    if round_number.nil?&lt;br /&gt;
      questionnaire=assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    else&lt;br /&gt;
      ass_ques=assignment.assignment_questionnaires.find_by_used_in_round(round_number)&lt;br /&gt;
      # make sure the assignment_questionnaire record is not empty&lt;br /&gt;
      if !ass_ques.nil?&lt;br /&gt;
      temp_num=ass_ques.questionnaire_id&lt;br /&gt;
      questionnaire = assignment.questionnaires.find_by_id(temp_num)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
=== Design ===&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
=== Codes ===&lt;br /&gt;
In app/features/instructor/Vary_Rubrics_by_Round_Test.feature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Scenario1: Instructor can set the review rubric varies by round&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I check &amp;quot;Review rubric varies by round?&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,30&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,20&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,22&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      And I use Review Round1 named &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
      And I use Review Round2&amp;quot;named &amp;quot;rubric1&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario2: Student should see the review rubric for 1st round&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
Scenario3: Instructor then change the due date of Round 2, so that the student would see a different review rubric&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,22&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,23&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario4: Student should see the review rubric for 2st round, which is different from the 1st one&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;rubric1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In app/features/step_definitions/review_rubric_varies_by_round.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
And /^I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;$/ do&lt;br /&gt;
  visit('/assignment/edit/18')&lt;br /&gt;
end&lt;br /&gt;
And /^I fill in &amp;quot;([^&amp;quot;]*)&amp;quot; for &amp;quot;([^&amp;quot;]*)&amp;quot; $/ do |due_date, deadline|&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{due_date}\&amp;quot; for \&amp;quot;due_date\&amp;quot;&amp;quot;&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{deadline}\&amp;quot; for \&amp;quot;deadline\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;update_wiki&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;update_wiki\&amp;quot; from \&amp;quot;questionnaires[review1]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;rubric1&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;rubric1\&amp;quot; from \&amp;quot;questionnaires[review2]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Final Layout ==&lt;br /&gt;
Here are the screen shots of the final layouts.&lt;br /&gt;
=== Rubrics Tab ===&lt;br /&gt;
[[File:Unchecked.png]]&lt;br /&gt;
[[File:Checked.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, a Review rubric varies by round checkbox will make a difference, which makes sense.&lt;br /&gt;
=== Due Dates Tab ===&lt;br /&gt;
[[File:Due_unchecked.jpg]]&lt;br /&gt;
[[File:Due_checked.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, a Display due_date_names and urls checkbox will make a difference, which makes sense.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92097</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92097"/>
		<updated>2014-11-12T22:56:53Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Due Dates Tab */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 3: Make slight changes to existing methods/codes ===&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
Existing methods have no enough parameters we want, or they are not returning out results we want.&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Make small changes to them to fit the new methods we write without interfering the previous methods.&lt;br /&gt;
&lt;br /&gt;
==== Exampls ====&lt;br /&gt;
The slight changes of functions are small, trivial and less important to readers to understand what we have done. So only examples are shown to convey the ideas, and all the detailed modification can be found at our Github: https:github.com/shaoxq1205/expertiza (on branch production).&lt;br /&gt;
&lt;br /&gt;
Here's the example:&lt;br /&gt;
We need to add a round_number for the questionnaire() method in order to make it return different values (actually from different rows of the assignment_questionnaire table) because there're more than 1 rounds now and each round may have different values.&lt;br /&gt;
previous method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type)&lt;br /&gt;
    questionnaire = assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
current method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type, round_number)&lt;br /&gt;
    if round_number.nil?&lt;br /&gt;
      questionnaire=assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    else&lt;br /&gt;
      ass_ques=assignment.assignment_questionnaires.find_by_used_in_round(round_number)&lt;br /&gt;
      # make sure the assignment_questionnaire record is not empty&lt;br /&gt;
      if !ass_ques.nil?&lt;br /&gt;
      temp_num=ass_ques.questionnaire_id&lt;br /&gt;
      questionnaire = assignment.questionnaires.find_by_id(temp_num)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
=== Design ===&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
=== Codes ===&lt;br /&gt;
In app/features/instructor/Vary_Rubrics_by_Round_Test.feature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Scenario1: Instructor can set the review rubric varies by round&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I check &amp;quot;Review rubric varies by round?&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,30&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,20&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,22&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      And I use Review Round1 named &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
      And I use Review Round2&amp;quot;named &amp;quot;rubric1&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario2: Student should see the review rubric for 1st round&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
Scenario3: Instructor then change the due date of Round 2, so that the student would see a different review rubric&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,22&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,23&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario4: Student should see the review rubric for 2st round, which is different from the 1st one&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;rubric1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In app/features/step_definitions/review_rubric_varies_by_round.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
And /^I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;$/ do&lt;br /&gt;
  visit('/assignment/edit/18')&lt;br /&gt;
end&lt;br /&gt;
And /^I fill in &amp;quot;([^&amp;quot;]*)&amp;quot; for &amp;quot;([^&amp;quot;]*)&amp;quot; $/ do |due_date, deadline|&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{due_date}\&amp;quot; for \&amp;quot;due_date\&amp;quot;&amp;quot;&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{deadline}\&amp;quot; for \&amp;quot;deadline\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;update_wiki&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;update_wiki\&amp;quot; from \&amp;quot;questionnaires[review1]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;rubric1&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;rubric1\&amp;quot; from \&amp;quot;questionnaires[review2]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Final Layout ==&lt;br /&gt;
Here are the screen shots of the final layouts.&lt;br /&gt;
=== Rubrics Tab ===&lt;br /&gt;
[[File:Checked.png]]&lt;br /&gt;
[[File:Unchecked.png]]&lt;br /&gt;
As you can see, a Review rubric varies by round checkbox will make a difference, which makes sense.&lt;br /&gt;
=== Due Dates Tab ===&lt;br /&gt;
[[File:Due_checked.png]]&lt;br /&gt;
[[File:Due_unchecked.jpg]]&lt;br /&gt;
As you can see, a Display due_date_names and urls checkbox will make a difference, which makes sense.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92096</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92096"/>
		<updated>2014-11-12T22:56:04Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Final Layout */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 3: Make slight changes to existing methods/codes ===&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
Existing methods have no enough parameters we want, or they are not returning out results we want.&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Make small changes to them to fit the new methods we write without interfering the previous methods.&lt;br /&gt;
&lt;br /&gt;
==== Exampls ====&lt;br /&gt;
The slight changes of functions are small, trivial and less important to readers to understand what we have done. So only examples are shown to convey the ideas, and all the detailed modification can be found at our Github: https:github.com/shaoxq1205/expertiza (on branch production).&lt;br /&gt;
&lt;br /&gt;
Here's the example:&lt;br /&gt;
We need to add a round_number for the questionnaire() method in order to make it return different values (actually from different rows of the assignment_questionnaire table) because there're more than 1 rounds now and each round may have different values.&lt;br /&gt;
previous method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type)&lt;br /&gt;
    questionnaire = assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
current method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type, round_number)&lt;br /&gt;
    if round_number.nil?&lt;br /&gt;
      questionnaire=assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    else&lt;br /&gt;
      ass_ques=assignment.assignment_questionnaires.find_by_used_in_round(round_number)&lt;br /&gt;
      # make sure the assignment_questionnaire record is not empty&lt;br /&gt;
      if !ass_ques.nil?&lt;br /&gt;
      temp_num=ass_ques.questionnaire_id&lt;br /&gt;
      questionnaire = assignment.questionnaires.find_by_id(temp_num)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
=== Design ===&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
=== Codes ===&lt;br /&gt;
In app/features/instructor/Vary_Rubrics_by_Round_Test.feature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Scenario1: Instructor can set the review rubric varies by round&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I check &amp;quot;Review rubric varies by round?&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,30&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,20&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,22&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      And I use Review Round1 named &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
      And I use Review Round2&amp;quot;named &amp;quot;rubric1&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario2: Student should see the review rubric for 1st round&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
Scenario3: Instructor then change the due date of Round 2, so that the student would see a different review rubric&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,22&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,23&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario4: Student should see the review rubric for 2st round, which is different from the 1st one&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;rubric1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In app/features/step_definitions/review_rubric_varies_by_round.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
And /^I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;$/ do&lt;br /&gt;
  visit('/assignment/edit/18')&lt;br /&gt;
end&lt;br /&gt;
And /^I fill in &amp;quot;([^&amp;quot;]*)&amp;quot; for &amp;quot;([^&amp;quot;]*)&amp;quot; $/ do |due_date, deadline|&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{due_date}\&amp;quot; for \&amp;quot;due_date\&amp;quot;&amp;quot;&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{deadline}\&amp;quot; for \&amp;quot;deadline\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;update_wiki&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;update_wiki\&amp;quot; from \&amp;quot;questionnaires[review1]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;rubric1&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;rubric1\&amp;quot; from \&amp;quot;questionnaires[review2]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Final Layout ==&lt;br /&gt;
Here are the screen shots of the final layouts.&lt;br /&gt;
=== Rubrics Tab ===&lt;br /&gt;
[[File:Checked.png]]&lt;br /&gt;
[[File:Unchecked.png]]&lt;br /&gt;
As you can see, a Review rubric varies by round checkbox will make a difference, which makes sense.&lt;br /&gt;
=== Due Dates Tab ===&lt;br /&gt;
[[File:Due_checked.png]]&lt;br /&gt;
[[File:Due_unchecked.png]]&lt;br /&gt;
As you can see, a Display due_date_names and urls checkbox will make a difference, which makes sense.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Unchecked.png&amp;diff=92095</id>
		<title>File:Unchecked.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Unchecked.png&amp;diff=92095"/>
		<updated>2014-11-12T22:55:00Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Due_unchecked.jpg&amp;diff=92094</id>
		<title>File:Due unchecked.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Due_unchecked.jpg&amp;diff=92094"/>
		<updated>2014-11-12T22:54:50Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Due_checked.png&amp;diff=92093</id>
		<title>File:Due checked.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Due_checked.png&amp;diff=92093"/>
		<updated>2014-11-12T22:54:39Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Checked.png&amp;diff=92092</id>
		<title>File:Checked.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Checked.png&amp;diff=92092"/>
		<updated>2014-11-12T22:54:20Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92091</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92091"/>
		<updated>2014-11-12T22:50:59Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Cucumber Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 3: Make slight changes to existing methods/codes ===&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
Existing methods have no enough parameters we want, or they are not returning out results we want.&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Make small changes to them to fit the new methods we write without interfering the previous methods.&lt;br /&gt;
&lt;br /&gt;
==== Exampls ====&lt;br /&gt;
The slight changes of functions are small, trivial and less important to readers to understand what we have done. So only examples are shown to convey the ideas, and all the detailed modification can be found at our Github: https:github.com/shaoxq1205/expertiza (on branch production).&lt;br /&gt;
&lt;br /&gt;
Here's the example:&lt;br /&gt;
We need to add a round_number for the questionnaire() method in order to make it return different values (actually from different rows of the assignment_questionnaire table) because there're more than 1 rounds now and each round may have different values.&lt;br /&gt;
previous method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type)&lt;br /&gt;
    questionnaire = assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
current method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type, round_number)&lt;br /&gt;
    if round_number.nil?&lt;br /&gt;
      questionnaire=assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    else&lt;br /&gt;
      ass_ques=assignment.assignment_questionnaires.find_by_used_in_round(round_number)&lt;br /&gt;
      # make sure the assignment_questionnaire record is not empty&lt;br /&gt;
      if !ass_ques.nil?&lt;br /&gt;
      temp_num=ass_ques.questionnaire_id&lt;br /&gt;
      questionnaire = assignment.questionnaires.find_by_id(temp_num)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
=== Design ===&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
=== Codes ===&lt;br /&gt;
In app/features/instructor/Vary_Rubrics_by_Round_Test.feature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Scenario1: Instructor can set the review rubric varies by round&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I check &amp;quot;Review rubric varies by round?&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,30&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,20&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,22&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      And I use Review Round1 named &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
      And I use Review Round2&amp;quot;named &amp;quot;rubric1&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario2: Student should see the review rubric for 1st round&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
Scenario3: Instructor then change the due date of Round 2, so that the student would see a different review rubric&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,22&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,23&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario4: Student should see the review rubric for 2st round, which is different from the 1st one&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;rubric1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In app/features/step_definitions/review_rubric_varies_by_round.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
And /^I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;$/ do&lt;br /&gt;
  visit('/assignment/edit/18')&lt;br /&gt;
end&lt;br /&gt;
And /^I fill in &amp;quot;([^&amp;quot;]*)&amp;quot; for &amp;quot;([^&amp;quot;]*)&amp;quot; $/ do |due_date, deadline|&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{due_date}\&amp;quot; for \&amp;quot;due_date\&amp;quot;&amp;quot;&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{deadline}\&amp;quot; for \&amp;quot;deadline\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;update_wiki&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;update_wiki\&amp;quot; from \&amp;quot;questionnaires[review1]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;rubric1&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;rubric1\&amp;quot; from \&amp;quot;questionnaires[review2]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Final Layout ==&lt;br /&gt;
Here are the screen shots of the final layouts.&lt;br /&gt;
=== Rubrics Tab ===&lt;br /&gt;
As you can see, a Review rubric varies by round checkbox will make a difference, which makes sense.&lt;br /&gt;
=== Due Dates Tab ===&lt;br /&gt;
As you can see, a Display due_date_names and urls checkbox will make a difference, which makes sense.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92090</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92090"/>
		<updated>2014-11-12T22:46:58Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Cucumber Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 3: Make slight changes to existing methods/codes ===&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
Existing methods have no enough parameters we want, or they are not returning out results we want.&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Make small changes to them to fit the new methods we write without interfering the previous methods.&lt;br /&gt;
&lt;br /&gt;
==== Exampls ====&lt;br /&gt;
The slight changes of functions are small, trivial and less important to readers to understand what we have done. So only examples are shown to convey the ideas, and all the detailed modification can be found at our Github: https:github.com/shaoxq1205/expertiza (on branch production).&lt;br /&gt;
&lt;br /&gt;
Here's the example:&lt;br /&gt;
We need to add a round_number for the questionnaire() method in order to make it return different values (actually from different rows of the assignment_questionnaire table) because there're more than 1 rounds now and each round may have different values.&lt;br /&gt;
previous method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type)&lt;br /&gt;
    questionnaire = assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
current method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type, round_number)&lt;br /&gt;
    if round_number.nil?&lt;br /&gt;
      questionnaire=assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    else&lt;br /&gt;
      ass_ques=assignment.assignment_questionnaires.find_by_used_in_round(round_number)&lt;br /&gt;
      # make sure the assignment_questionnaire record is not empty&lt;br /&gt;
      if !ass_ques.nil?&lt;br /&gt;
      temp_num=ass_ques.questionnaire_id&lt;br /&gt;
      questionnaire = assignment.questionnaires.find_by_id(temp_num)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
=== Design ===&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
=== Codes ===&lt;br /&gt;
In app/features/instructor/Vary_Rubrics_by_Round_Test.feature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Scenario1: Instructor can set the review rubric varies by round&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I check &amp;quot;Review rubric varies by round?&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,30&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,20&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,22&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      And I use Review Round1 named &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
      And I use Review Round2&amp;quot;named &amp;quot;rubric1&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario2: Student should see the review rubric for 1st round&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;update_wiki&amp;quot;&lt;br /&gt;
Scenario3: Instructor then change the due date of Round 2, so that the student would see a different review rubric&lt;br /&gt;
      Given an instructor named &amp;quot;user6&amp;quot;&lt;br /&gt;
      And I am logged in as &amp;quot;user6&amp;quot; &lt;br /&gt;
      @instructor&lt;br /&gt;
      @manage_assignments&lt;br /&gt;
      When I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
      And I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,10&amp;quot; for &amp;quot;Round1 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,10,22&amp;quot; for &amp;quot;Round1 Review&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,11,10&amp;quot; for &amp;quot;Round2 Submission&amp;quot;&lt;br /&gt;
      And I fill in &amp;quot;2014,12,23&amp;quot; for &amp;quot;Round2:Review&amp;quot;&lt;br /&gt;
      Then I press &amp;quot;Save&amp;quot;&lt;br /&gt;
@wip&lt;br /&gt;
Scenario4: Student should see the review rubric for 2st round, which is different from the 1st one&lt;br /&gt;
  Given I am logged in as a user13&lt;br /&gt;
  And I move to the &amp;quot;Assignments&amp;quot; page&lt;br /&gt;
  And I click the &amp;quot;Week 4 wiki&amp;quot; link&lt;br /&gt;
  When I click the &amp;quot;Others' work&amp;quot; link&lt;br /&gt;
  Then I should see &amp;quot;rubric1&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In app/features/step_definitions/review_rubric_varies_by_round.rb:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
And /^I click the &amp;quot;edit&amp;quot; link for &amp;quot;Week 4 wiki&amp;quot;$/ do&lt;br /&gt;
  visit('/assignment/edit/18')&lt;br /&gt;
end&lt;br /&gt;
And /^I fill in &amp;quot;([^&amp;quot;]*)&amp;quot; for &amp;quot;([^&amp;quot;]*)&amp;quot; $/ do |due_date, deadline|&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{due_date}\&amp;quot; for \&amp;quot;due_date\&amp;quot;&amp;quot;&lt;br /&gt;
  step &amp;quot;I fill in \&amp;quot;#{deadline}\&amp;quot; for \&amp;quot;deadline\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;update_wiki&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;update_wiki\&amp;quot; from \&amp;quot;questionnaires[review1]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
And /^I use Review Round1 named &amp;quot;rubric1&amp;quot; $/ do&lt;br /&gt;
  step &amp;quot;I select \&amp;quot;rubric1\&amp;quot; from \&amp;quot;questionnaires[review2]\&amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92089</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92089"/>
		<updated>2014-11-12T22:42:48Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Case 3: Make slight changes to existing functions/codes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 3: Make slight changes to existing methods/codes ===&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
Existing methods have no enough parameters we want, or they are not returning out results we want.&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Make small changes to them to fit the new methods we write without interfering the previous methods.&lt;br /&gt;
&lt;br /&gt;
==== Exampls ====&lt;br /&gt;
The slight changes of functions are small, trivial and less important to readers to understand what we have done. So only examples are shown to convey the ideas, and all the detailed modification can be found at our Github: https:github.com/shaoxq1205/expertiza (on branch production).&lt;br /&gt;
&lt;br /&gt;
Here's the example:&lt;br /&gt;
We need to add a round_number for the questionnaire() method in order to make it return different values (actually from different rows of the assignment_questionnaire table) because there're more than 1 rounds now and each round may have different values.&lt;br /&gt;
previous method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type)&lt;br /&gt;
    questionnaire = assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
current method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type, round_number)&lt;br /&gt;
    if round_number.nil?&lt;br /&gt;
      questionnaire=assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    else&lt;br /&gt;
      ass_ques=assignment.assignment_questionnaires.find_by_used_in_round(round_number)&lt;br /&gt;
      # make sure the assignment_questionnaire record is not empty&lt;br /&gt;
      if !ass_ques.nil?&lt;br /&gt;
      temp_num=ass_ques.questionnaire_id&lt;br /&gt;
      questionnaire = assignment.questionnaires.find_by_id(temp_num)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92088</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92088"/>
		<updated>2014-11-12T22:42:30Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 3: Make slight changes to existing functions/codes ===&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
Existing methods have no enough parameters we want, or they are not returning out results we want.&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Make small changes to them to fit the new methods we write without interfering the previous methods.&lt;br /&gt;
&lt;br /&gt;
==== Exampls ====&lt;br /&gt;
The slight changes of functions are small, trivial and less important to readers to understand what we have done. So only examples are shown to convey the ideas, and all the detailed modification can be found at our Github: https:github.com/shaoxq1205/expertiza (on branch production).&lt;br /&gt;
&lt;br /&gt;
Here's the example:&lt;br /&gt;
We need to add a round_number for the questionnaire() method in order to make it return different values (actually from different rows of the assignment_questionnaire table) because there're more than 1 rounds now and each round may have different values.&lt;br /&gt;
previous method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type)&lt;br /&gt;
    questionnaire = assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
current method of questionnaire():&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def questionnaire(assignment, type, round_number)&lt;br /&gt;
    if round_number.nil?&lt;br /&gt;
      questionnaire=assignment.questionnaires.find_by_type(type)&lt;br /&gt;
    else&lt;br /&gt;
      ass_ques=assignment.assignment_questionnaires.find_by_used_in_round(round_number)&lt;br /&gt;
      # make sure the assignment_questionnaire record is not empty&lt;br /&gt;
      if !ass_ques.nil?&lt;br /&gt;
      temp_num=ass_ques.questionnaire_id&lt;br /&gt;
      questionnaire = assignment.questionnaires.find_by_id(temp_num)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    if questionnaire.nil?&lt;br /&gt;
      questionnaire = Object.const_get(type).new&lt;br /&gt;
      questionnaire&lt;br /&gt;
    else&lt;br /&gt;
      questionnaire&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92087</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92087"/>
		<updated>2014-11-12T22:28:27Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92086</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92086"/>
		<updated>2014-11-12T22:28:12Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Code Modifications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
==== Codes ====&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92085</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92085"/>
		<updated>2014-11-12T22:27:23Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92084</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92084"/>
		<updated>2014-11-12T22:26:26Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92083</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92083"/>
		<updated>2014-11-12T22:24:52Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
 &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92082</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92082"/>
		<updated>2014-11-12T22:24:12Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Code Modifications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end corresponding changes should be made in the end of _due_dates.html.erb, after which the webpage will display corresponding contents (hide or display name and url columns according to whether they are empty):&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;table class='exp' id='due_dates_table' style='padding:10px;min-width: 990px;overflow: hidden;'&amp;gt;&lt;br /&gt;
  &amp;lt;tr id='due_date_heading'&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
          &amp;lt;% for i in 1..@assignment.rounds_of_reviews %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'submission', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'submission', i-1).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'review', &amp;lt;%=i%&amp;gt;, &amp;lt;%= due_date(@assignment, 'review', i-1).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
          addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty %&amp;gt;,'metareview', 0, &amp;lt;%= due_date(@assignment, 'metareview').to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
          //after webpage refreshes, hide or display name and url according to whether names and urls are empty in DB&lt;br /&gt;
          var due_date_name_column=document.getElementById(&amp;quot;due_date_name_column&amp;quot;);&lt;br /&gt;
          var due_date_url_column=document.getElementById(&amp;quot;due_date_url_column&amp;quot;);&lt;br /&gt;
          &amp;lt;% if @due_date_nameurl_notempty ==&amp;quot;null&amp;quot; %&amp;gt;&lt;br /&gt;
          due_date_name_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          due_date_url_column.style.visibility=&amp;quot;hidden&amp;quot;;&lt;br /&gt;
          &amp;lt;% end %&amp;gt;&lt;br /&gt;
      }());&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92081</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92081"/>
		<updated>2014-11-12T22:20:06Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox. Here are the main changes in _due_dates.html.erb:&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92080</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92080"/>
		<updated>2014-11-12T22:18:50Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox.&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92079</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92079"/>
		<updated>2014-11-12T22:18:32Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92078</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92078"/>
		<updated>2014-11-12T22:18:10Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92077</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92077"/>
		<updated>2014-11-12T22:17:39Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92076</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92076"/>
		<updated>2014-11-12T22:15:49Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
&amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
&amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92075</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92075"/>
		<updated>2014-11-12T22:15:27Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;!--Add a change name or url checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
&amp;lt;input name=&amp;quot;changenameurl&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;%= check_box_tag('changenameurl', 'true', @due_date_nameurl_notempty_checkbox,:onclick=&amp;gt;&amp;quot;handleChangenameurl(this.checked,due_date_name_column,due_date_url_column)&amp;quot; ) %&amp;gt;&lt;br /&gt;
&amp;lt;%= label_tag('changenameurl', 'Change name and description url?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92074</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92074"/>
		<updated>2014-11-12T22:14:36Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column) {&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92073</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92073"/>
		<updated>2014-11-12T22:13:48Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column){&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92072</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92072"/>
		<updated>2014-11-12T22:13:15Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox.&lt;br /&gt;
&lt;br /&gt;
function handleChangenameurl(checkvalue,due_date_name_column,due_date_url_column){&lt;br /&gt;
        var state = checkvalue;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (!document.getElementById) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //hide name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(null,'submission',i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(null,'review', i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(null,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
            due_date_url_column.style.display=&amp;quot;none&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //display name and url colomns&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                removeDueDateTableElement('submission', i);&lt;br /&gt;
                removeDueDateTableElement('review', i);&lt;br /&gt;
            }&lt;br /&gt;
            removeDueDateTableElement('metareview', 0);&lt;br /&gt;
            for (i =1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                addDueDateTableElement(1,'submission', i, &amp;lt;%= due_date(@assignment, 'submission', 0).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;); // or use questionnaire_options(@assignment, nil).to_json&lt;br /&gt;
                addDueDateTableElement(1,'review',i, &amp;lt;%= due_date(@assignment, 'review', 0).to_json %&amp;gt;, &amp;lt;%= questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).to_json %&amp;gt;,&amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            }&lt;br /&gt;
            addDueDateTableElement(1,'metareview',0,&amp;lt;%= due_date(@assignment,'metareview', 0).to_json%&amp;gt;);&lt;br /&gt;
            due_date_name_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
            due_date_url_column.removeAttribute(&amp;quot;style&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92071</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92071"/>
		<updated>2014-11-12T22:12:18Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox.&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92070</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92070"/>
		<updated>2014-11-12T22:11:53Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox.&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92069</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92069"/>
		<updated>2014-11-12T22:11:25Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox.&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92068</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92068"/>
		<updated>2014-11-12T22:10:56Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to check if the name and url are NULL in database to make a decision in the initial display (or after webpage refreshes). If there are contents in the DB, which means someone has typed in some texts, it will display the two columns; on the contrary, it won't display to make the table simpler.:&lt;br /&gt;
&lt;br /&gt;
def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @due_date_nameurl_notempty = &amp;quot;null&amp;quot;&lt;br /&gt;
    @due_date_nameurl_notempty_checkbox = false&lt;br /&gt;
    ...&lt;br /&gt;
    # Add by Xiaoqiang Shao, check if name and url in database is empty before webpage displays&lt;br /&gt;
    @due_date_all.each do |dd|&lt;br /&gt;
      if(!(dd.deadline_name.nil?))&lt;br /&gt;
      if(dd.deadline_name.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
      if(!(dd.description_url.nil?))&lt;br /&gt;
      if(dd.description_url.length&amp;gt;=1)&lt;br /&gt;
        @due_date_nameurl_notempty = 1&lt;br /&gt;
        @due_date_nameurl_notempty_checkbox = true&lt;br /&gt;
      end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
And at any time, users can hide/show the two columns by checking the checkbox.&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92067</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92067"/>
		<updated>2014-11-12T22:06:38Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
In the _rubrics.html.erb, we added a javascript function to handle the click action:&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92066</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92066"/>
		<updated>2014-11-12T22:05:28Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92065</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92065"/>
		<updated>2014-11-12T22:05:16Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92064</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92064"/>
		<updated>2014-11-12T22:05:04Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* After Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    @reviewvarycheck = nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @reviewvarycheck = 1&lt;br /&gt;
        @q_id = aq.questionnaire_id&lt;br /&gt;
        @qn = Questionnaire.find(@q_id)&lt;br /&gt;
&lt;br /&gt;
        if(@qn.display_type.eql?&amp;quot;Review&amp;quot;)&lt;br /&gt;
          @review_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Metareview&amp;quot;)&lt;br /&gt;
          @metareview_check=1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Author Feedback&amp;quot;)&lt;br /&gt;
          @author_check = 1&lt;br /&gt;
        elsif(@qn.display_type.eql?&amp;quot;Teammate Review&amp;quot;)&lt;br /&gt;
          @teammate_check = 1&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92063</id>
		<title>CSC/ECE 517 Fall 2014/OSS E1450 cxm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_E1450_cxm&amp;diff=92063"/>
		<updated>2014-11-12T20:50:56Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1450: UI change for assignment view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What it does: &amp;lt;/b&amp;gt;Change UI of Expertiza to support varying rubric feature (allow instructors to specify different review rubrics for different review rounds)&lt;br /&gt;
&lt;br /&gt;
== Background Information==&lt;br /&gt;
&lt;br /&gt;
=== What is Expertiza? ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). The Expertiza project is supported by the National Science Foundation&amp;lt;ref&amp;gt;https://github.com/expertiza/expertiza&amp;lt;/ref&amp;gt;. The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages&amp;lt;ref&amp;gt;http://wikis.lib.ncsu.edu/index.php/Expertiza&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== JavaScript ===&lt;br /&gt;
&lt;br /&gt;
JavaScript is a dynamic programming language of the Web browsers. Despite some naming, syntactic, and standard library similarities, JavaScript and Java are otherwise unrelated and have very different [http://en.wikipedia.org/wiki/Semantics_(computer_science) semantics]. The syntax of JavaScript is actually derived from [http://en.wikipedia.org/wiki/C_(programming_language) C], while the semantics and design are influenced by [http://en.wikipedia.org/wiki/Self_(programming_language) Self] and [http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme] programming languages&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/JavaScript&amp;lt;/ref&amp;gt;. This mix of features makes it a multi-paradigm language, supporting [http://en.wikipedia.org/wiki/Object-oriented_programming object-oriented], [http://en.wikipedia.org/wiki/Imperative_programming imperative], and [http://en.wikipedia.org/wiki/Functional_programming functional] programming styles.&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&amp;lt;b&amp;gt;Classes involved:&amp;lt;/b&amp;gt;controllers/assignment_controller.rb (488 lines)&amp;lt;br&amp;gt; views/assignment/edit.html.erb (55 lines) in production branch (not in master branch)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What needs to be done:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This project requires JavaScript knowledge. &lt;br /&gt;
&lt;br /&gt;
*A checkbox “Review rubrics vary by round” should be added to the “Rubric” tab in the view of creating/editing assignment. No corresponding field in “assignments” table is necessary. We can tell if this checkbox should be checked by checking “assignments_questionnaires” table by current assignment_id. If there is no record with a non-null value in  “used_in_round” field, this assignment is not using this feature and the checkbox should not be checked. (if one assignment has 2 rounds but they are using the same set of rubrics, for each type of rubric there should be only one entry with “used_in_round” field null)R&lt;br /&gt;
&lt;br /&gt;
* There should be a editable “deadline name” for each due date on “due date” panel if this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in deadline_name field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* Another “description URL” text box should be editable when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in description_url field in due_dates table)&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;deadline_name&amp;quot; and &amp;quot;description URL&amp;quot; could be hidden when you change the status of the checkbox in Due_Date tab&lt;br /&gt;
&lt;br /&gt;
* A drop-down box which help instructor to select review rubric should be added for a review round when this type of review is specified to be “varying by rounds” in the “rubrics” tab  (the input should be recorded in assignments_questionnaires table)&lt;br /&gt;
&lt;br /&gt;
* There are no tests for the code.  Create appropriate functional and integration tests.&lt;br /&gt;
&lt;br /&gt;
== Environment Setup==&lt;br /&gt;
&lt;br /&gt;
Since we are developing on the Production branch, in stead of the Rails4 branch, the environment for us would be  different from the majority of the class. Here is the list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ruby:&amp;lt;/b&amp;gt; 1.8.7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rails:&amp;lt;/b&amp;gt; 2.3.15&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Java:&amp;lt;/b&amp;gt; 1.6&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Openjdk:&amp;lt;/b&amp;gt; 6.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Database:&amp;lt;/b&amp;gt; expertiza_scrubbed_2014_03_14.sql&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== Case 1: Add Checkbox on &amp;quot;Rubric&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No checkbox for &amp;quot;Varying Rubric by Round&amp;quot; on the general tab for Instructors.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
In the views / assignment / edit / _rubric.html.erb, we added a checkbox, which can read the value of used_in_round_flag. In Rubrics Tab, add a Review rubric varies by round checkbox, when checked, it displays corresponding number of rounds of Review round 1 to Review round n; when unchecked, it displays as usual.&lt;br /&gt;
At the same time, it will store new data in the table into database, in assignment_questionnaires table, it will add 1,2,3...n to used_in_round column if the review rubric varies by round; if not, it will store NULL.&lt;br /&gt;
Everytime webpage refreshes, the checkbox is checked or not according to the value of used_in_round column in the assignment_questionnaires table.&lt;br /&gt;
&lt;br /&gt;
In the assignment_controller.rb, we added a method to load the value from database to used_in_round_flag:&lt;br /&gt;
&lt;br /&gt;
 def edit&lt;br /&gt;
    @assignment = Assignment.find(params[:id])&lt;br /&gt;
    @assignment_questionnaires = AssignmentQuestionnaire.find_all_by_assignment_id(params[:id])&lt;br /&gt;
    @used_in_round_flag= nil&lt;br /&gt;
    @assignment_questionnaires.each do  |aq|&lt;br /&gt;
      if(!(aq.used_in_round.nil?))&lt;br /&gt;
        @used_in_round_flag= 1&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 function handleCheckReviewVary(checkvalue) {&lt;br /&gt;
        var state = checkvalue.checked;&lt;br /&gt;
        var round_count = &amp;lt;%= @assignment.rounds_of_reviews%&amp;gt;;&lt;br /&gt;
        if (state == true &amp;amp;&amp;amp; round_count &amp;gt;1){&lt;br /&gt;
            //Make it display by rounds&lt;br /&gt;
            var element_id;&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
                for (i = 1; i &amp;lt;= round_count; i++) {&lt;br /&gt;
                    addQuestionnaireTableRow('ReviewQuestionnaire', i, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;  'ReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, 'ReviewQuestionnaire',nil).&amp;lt;br&amp;gt;to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
                }&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment,&amp;lt;br&amp;gt; 'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            &amp;lt;%@avoidrepeatsign=1%&amp;gt;;&lt;br /&gt;
        }&lt;br /&gt;
        if (state == false &amp;amp;&amp;amp; round_count&amp;gt;1){&lt;br /&gt;
            //Make it display as usual&lt;br /&gt;
            var element_id;&lt;br /&gt;
            for (i=1;i&amp;lt;=round_count+1;i++) {&lt;br /&gt;
                element_id = 'questionnaire_table_' + 'ReviewQuestionnaire';&lt;br /&gt;
                jQuery('#' + element_id).remove();&lt;br /&gt;
            }&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'MetareviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'AuthorFeedbackQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            element_id = 'questionnaire_table_' + 'TeammateReviewQuestionnaire';&lt;br /&gt;
            jQuery('#' + element_id).remove();&lt;br /&gt;
            //And display original ones&lt;br /&gt;
            addQuestionnaireTableRow('ReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment,&amp;lt;br&amp;gt; 'ReviewQuestionnaire',1).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'ReviewQuestionnaire', 1).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, 'ReviewQuestionnaire')&amp;lt;br&amp;gt;.to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('MetareviewQuestionnaire', null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'MetareviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('AuthorFeedbackQuestionnaire', null,&amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'AuthorFeedbackQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
            addQuestionnaireTableRow('TeammateReviewQuestionnaire',null, &amp;lt;%= questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= assignment_questionnaire(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire',nil).to_json %&amp;gt;, &amp;lt;%= questionnaire_options(@assignment, &amp;lt;br&amp;gt;'TeammateReviewQuestionnaire').to_json %&amp;gt;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
 &amp;lt;!--//Add a review varies by round checkbox. By: Xiaoqiang Shao--&amp;gt;&lt;br /&gt;
 &amp;lt;input name=&amp;quot;assignment_questionnaire[used_in_round]&amp;quot; type=&amp;quot;hidden&amp;quot; value=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;%= check_box_tag('assignment_questionnaire[used_in_round]', 'true', &amp;lt;br&amp;gt; @reviewvarycheck,:onclick=&amp;gt;&amp;quot;handleCheckReviewVary(this)&amp;quot; ) %&amp;gt;&lt;br /&gt;
 &amp;lt;%= label_tag('assignment_questionnaire[used_in_round]', 'Review rubric varies by round?') %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Case 2: Add &amp;quot;Deadline_name&amp;quot; and  &amp;quot;Description_url&amp;quot; on &amp;quot;Due_date&amp;quot; Tab===&lt;br /&gt;
&lt;br /&gt;
==== Current Scenario ====&lt;br /&gt;
&lt;br /&gt;
No test_box for &amp;quot;deadline_name&amp;quot; and &amp;quot;description_url&amp;quot; on due_date tab.&lt;br /&gt;
&lt;br /&gt;
==== After Changes ====&lt;br /&gt;
&lt;br /&gt;
* Add Due Date Name and Description_url to the table, users can fill in blanks and store them in DB&lt;br /&gt;
* Rewrite set button function calling, everytime the button is pressed, it calls submit_form() and update in assignment_controller, then change the @assignment.rounds_of_review value in order to make changes in the DB instantly, which will help Rubrics tab display correctly&lt;br /&gt;
* Add a Change name and description url checkbox. If checked, the Due Date Name and Descripton_url will whow up; if unchecked, the two columns will hide.&lt;br /&gt;
* Everytime when webpage refreshes, the checkbox value will be set according to whether there’s value that is not empty in the deadline_name or description_url columns in due_dates table in DB.&lt;br /&gt;
&lt;br /&gt;
== Cucumber Tests ==&lt;br /&gt;
&lt;br /&gt;
A few cucumber tests are added to perform the functional and integrated test for our project, such as:&lt;br /&gt;
&lt;br /&gt;
Scenario 1: An instructor can set the &amp;quot;Review Rubric Varies by Round&amp;quot; for an assignment, and set due dates for all of submissions and reviews, as well as different rubrics would be used&lt;br /&gt;
&lt;br /&gt;
Scenario 2: A student should see the review rubric for 1st round in the other's work link&lt;br /&gt;
&lt;br /&gt;
Scenario 3: The instructor change the due date to start the 2nd round of review&lt;br /&gt;
&lt;br /&gt;
Scenario 4: A student should see the review rubric for 2nd round in the other's work link&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_19_mx&amp;diff=88725</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 19 mx</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_19_mx&amp;diff=88725"/>
		<updated>2014-09-26T03:44:06Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Run in Cucumber */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Watir'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= Introduction=&lt;br /&gt;
Watir('''W'''eb '''A'''pplication '''T'''est '''i'''n '''R'''uby), pronounced as 'water', is an automated test toolkit which uses the Ruby scripting language for automated tests to be developed and run against a web browser. &amp;lt;ref&amp;gt;http://www.httpwatch.com/rubywatir/&amp;lt;/ref&amp;gt;It allows users to write tests that are easy to read and maintain, also simple and flexible. Watir was first developed by Bret Pettichord and Paul Rogers. It drives [http://en.wikipedia.org/wiki/Internet_Explorer Internet Explorer], [http://en.wikipedia.org/wiki/FirefoxMozilla Firefox|Firefox], [http://en.wikipedia.org/wiki/Chrome Google Chrome|Chrome], [http://en.wikipedia.org/wiki/Opera Opera (web browser)|Opera] and [http://en.wikipedia.org/wiki/Safari Safari (web browser)|Safari], and is available as a [http://en.wikipedia.org/wiki/RubyGems RubyGems] gem, &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Watir&amp;lt;/ref&amp;gt; which is a free, open source Ruby library that  can test web applications written in any language&amp;lt;ref&amp;gt;https://rubygems.org/gems/watir-classic&amp;lt;/ref&amp;gt; and drive a web browser the same way an end user would. It clicks links, fills in forms, presses buttons. Watir can also check results, such as whether expected text appears on the page or not, or whether a control is enabled. &amp;lt;ref&amp;gt;http://watir.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watir project consists of several smaller projects, including watir-classic, watir-webdriver and watirspec.&lt;br /&gt;
&lt;br /&gt;
== Watir-classic ==&lt;br /&gt;
Watir-classic is a Watir driver for automating only Internet Explorer on Windows.&amp;lt;ref&amp;gt;https://github.com/watir/watir-classic&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watir-classic is able to work on Internet Explorer 8, 9 and 10&amp;lt;ref&amp;gt;http://rubydoc.info/gems/watir-classic/3.7.0/frames&amp;lt;/ref&amp;gt;, and is supported by Ruby 1.8.7, 1.9.3 and 2.0.0.&lt;br /&gt;
&lt;br /&gt;
== Watir-webdriver==&lt;br /&gt;
Watie-webdriver is an implementation built on WebDriver's Ruby bindings. It supports not only the Internet Explorer, but also namely Firefox, Chrome and Safari,&amp;lt;ref&amp;gt;https://github.com/watir/watir-webdriver&amp;lt;/ref&amp;gt;which is a main difference compared with watir-classic.&lt;br /&gt;
&lt;br /&gt;
== Watirspec ==&lt;br /&gt;
Watirspec combines best features of Watir [http://en.wikipedia.org/wiki/RSpec RSpec] and Ruby for browser-based functional testing.&amp;lt;ref&amp;gt;https://rubygems.org/gems/watirspec&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Just like RubySpec is for Ruby, Watirspec is the executable specification of the Watir API.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Web Application Testing ==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Web_testing Web testing] is a software testing that focuses on web applications. Complete testing of a web-based system before going live can help address issues before the system is revealed to the public. Issues such as the basic functionality of the site, the security of the web application, its accessibility to handicapped users and fully able users, as well as readiness for expected traffic and number of users and the ability to survive a massive spike in user traffic, both of which are related to load testing.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_testing&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Web Testing Checklist:'''&amp;lt;ref&amp;gt;http://www.softwaretestinghelp.com/web-application-testing/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Functionality Testing： Test for all the links in web pages, database connection, forms used in the web pages for submitting or getting information from user, as well as Cookie testing.&lt;br /&gt;
&lt;br /&gt;
*Usability Testing:  Test for navigation, contents and other user information for user help.&lt;br /&gt;
&lt;br /&gt;
*Interface Testing: Test for main interfaces, such as Web server, application server interface and Database server interface. Check whether all the interactions between these servers are executed properly or not. &lt;br /&gt;
&lt;br /&gt;
*Compatibility Testing: Test for the compatibility of your web site, which is a very critical testing aspect, including Browser compatibility, Operating system compatibility, Mobile browsing and Printing options compatibility. &lt;br /&gt;
&lt;br /&gt;
*Performance Testing: Test for web application performance, which should include both Web Load Testing and Web Stress Testing.&lt;br /&gt;
&lt;br /&gt;
== Ruby ==&lt;br /&gt;
Ruby is a dynamic, designed and developed in the mid-1990s by Yukihiro &amp;quot;Matz&amp;quot; Matsumoto in Japan, is a reflective, object-oriented, general-purpose programming language. Like other programming languages, Ruby gives you the power to connect to databases, read data files and spreadsheets, export XML, and structure your code as reusable libraries. Unlike other programming languages, Ruby is concise and often a joy to read.&lt;br /&gt;
&lt;br /&gt;
According to its authors, Ruby was influenced by [http://en.wikipedia.org/wiki/Perl Perl], [http://en.wikipedia.org/wiki/Smalltalk Smalltalk], [http://en.wikipedia.org/wiki/Eiffel Eiffel], [http://en.wikipedia.org/wiki/Ada Ada], and [http://en.wikipedia.org/wiki/Lisp Lisp]. It supports multiple programming paradigms, including functional, object-oriented, and imperative. It also has a dynamic type system and automatic memory management.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Ruby_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Several Features：'''&amp;lt;ref&amp;gt;http://www.starkdigital.net/ruby-programming&amp;lt;/ref&amp;gt;&lt;br /&gt;
*Thoroughly object-oriented with inheritance, mixins and metaclasses&lt;br /&gt;
*Dynamic typing and duck typing&lt;br /&gt;
*Large standard library, including modules for [http://en.wikipedia.org/wiki/YAML YAML], [http://en.wikipedia.org/wiki/JSON JSON], [http://en.wikipedia.org/wiki/XML XML], [http://en.wikipedia.org/wiki/CGI CGI], [http://en.wikipedia.org/wiki/OpenSSL OpenSSL], [http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP], [http://en.wikipedia.org/wiki/File_Transfer_Protocol FTP], [http://en.wikipedia.org/wiki/RSS RSS], [http://en.wikipedia.org/wiki/Curse_(disambiguation) curses], [http://en.wikipedia.org/wiki/Zlib zlib], and [http://en.wikipedia.org/wiki/Tk_(software) Tk] &lt;br /&gt;
*Dynamic reflection and alteration of objects to facilitate [http://en.wikipedia.org/wiki/Metaprogramming metaprogramming]&lt;br /&gt;
[http://www.starkdigital.net/ruby-programming See More Features.]&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
== Install Ruby on Linux ==&lt;br /&gt;
Use your relevant package manager to update or install Ruby with the following at a terminal window:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install ruby  # for Ubuntu / Debian users&lt;br /&gt;
 sudo yum install ruby      # for Red Hat / Fedora users&lt;br /&gt;
== Update RubyGems on Linux ==&lt;br /&gt;
Make sure you have the latest rubygems version 1.3.7 or above installed. Use your relevant package manager to install the latest version with the following at a terminal window:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install rubygems # for Ubuntu / Debian users&lt;br /&gt;
 sudo yum install rubygems  # for Red Hat / Fedora users&lt;br /&gt;
&lt;br /&gt;
== Install a HTML Inspector ==&lt;br /&gt;
To use Watir effectively, you’ll need to be able to browse through the structure of your application’s HTML pages. These tools help you do that.&lt;br /&gt;
&lt;br /&gt;
*On Firefox, use Firebug&lt;br /&gt;
*On Internet Explorer, use the IE Developer Toolbar&lt;br /&gt;
&lt;br /&gt;
== Installing or Updating RubyGems ==&lt;br /&gt;
While updating RubyGems, or installing any of the gems, you can use the following additional flags:&lt;br /&gt;
&lt;br /&gt;
 --no-rdoc --no-ri&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 gem update --system --no-rdoc --no-ri&lt;br /&gt;
 gem install watir --no-rdoc --no-ri&lt;br /&gt;
&lt;br /&gt;
= Make It Run =&lt;br /&gt;
After everything required installed, we can run the watir tests in several ways. Below three ways are listed, and each of them is designed to work on the live Watir demo form: http://bit.ly/watir-example.&lt;br /&gt;
&lt;br /&gt;
== Run in .rb ==&lt;br /&gt;
First of all, let's see how to conduct the test in ruby on rails. The example was based on the example listed on a google form, it demonstrated watir's functionality such as entering text into a text field, clicking a button like a user does, checking to see if a page contains text and so on. Below is the step-by-step command to finish the test in .rb file, which means you can simply save these commands in a .rb file and run it with ruby.&lt;br /&gt;
&lt;br /&gt;
''Example 1: &amp;lt;ref&amp;gt;http://watir.com/examples/&amp;lt;/ref&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
*Require Ruby Watir gem first via the -rubygems command line option, or by using the RUBYOPT environment variable. You can also require it manually in your script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rubygems'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Including Watir gem to drive Internet Explorer on Windows&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'watir'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Including Watir-WebDriver gem to drive Firefox/Chrome on Windows/Mac/Linux&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'watir-webdriver'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Starting a new browser &amp;amp; and going to our site&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser = Watir::Browser.new&lt;br /&gt;
browser.goto 'http://bit.ly/watir-example'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting a text field&lt;br /&gt;
&lt;br /&gt;
[[File:Text-field.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.text_field(:name =&amp;gt; 'entry.0.single').set 'Watir'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting a multi-line text box&lt;br /&gt;
&lt;br /&gt;
[[File:text-box1.png|text-box1.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.text_field(:name =&amp;gt; 'entry.1.single').set &amp;quot;I come here from Australia. \n The weather is great here.&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting and clearing a radio button&lt;br /&gt;
&lt;br /&gt;
[[File:3.radio-buttons1.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.radio(:value =&amp;gt; 'Watir').set&lt;br /&gt;
browser.radio(:value =&amp;gt; 'Watir').clear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting and clearing check boxes&lt;br /&gt;
&lt;br /&gt;
[[File:4.checkboxes.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Ruby').set&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Python').set&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Python').clear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Clearing, getting and selecting selection list values&lt;br /&gt;
&lt;br /&gt;
[[File:5.selection-list.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.select_list(:name =&amp;gt; 'entry.6.single').clear&lt;br /&gt;
puts browser.select_list(:name =&amp;gt; 'entry.6.single').options&lt;br /&gt;
browser.select_list(:name =&amp;gt; 'entry.6.single').select 'Chrome'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Clicking a button&lt;br /&gt;
&lt;br /&gt;
[[File:6.button.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.button(:name =&amp;gt; 'submit').click&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Checking for text in a page&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
puts browser.text.include? 'Your response has been recorded.'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Checking the title of a page&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
puts browser.title == 'Thanks!'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Run in Rspec ==&lt;br /&gt;
RSpec is a Behaviour-Driven Development tool for Ruby programmers. BDD is an approach to software development that combines Test-Driven Development, Domain Driven Design, and Acceptance Test-Driven Planning. RSpec helps you do the TDD part of that equation, focusing on the documentation and design aspects of TDD. The following code demonstrates using Watir and a basic RSpec example.[http://rspec.info/ More Info.]&lt;br /&gt;
&lt;br /&gt;
''Example 2: &amp;lt;ref&amp;gt;http://watir.com/frameworks/&amp;lt;/ref&amp;gt; ''&lt;br /&gt;
&lt;br /&gt;
1. Install&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install rspec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Example&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec test_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will execute the following rspec example:&lt;br /&gt;
&lt;br /&gt;
'''test_spec.rb'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require &amp;quot;rubygems&amp;quot;&lt;br /&gt;
require &amp;quot;rspec&amp;quot;&lt;br /&gt;
require &amp;quot;watir-webdriver&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
describe &amp;quot;google.com&amp;quot; do&lt;br /&gt;
  let(:browser) { @browser ||= Watir::Browser.new :firefox } &lt;br /&gt;
  before { browser.goto &amp;quot;http://google.com&amp;quot; } &lt;br /&gt;
  after { browser.close }&lt;br /&gt;
 &lt;br /&gt;
  it &amp;quot;should search for watir&amp;quot; do&lt;br /&gt;
    browser.text_field(:name =&amp;gt; &amp;quot;q&amp;quot;).set &amp;quot;watir&amp;quot;&lt;br /&gt;
    browser.button.click &lt;br /&gt;
    browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).wait_until_present&lt;br /&gt;
    browser.title.should == &amp;quot;watir - Google Search&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Run in Cucumber ==&lt;br /&gt;
Cucumber lets software development teams describe how software should behave in plain text. The text is written in a business-readable domain-specific language and serves as documentation, automated tests and development-aid – all rolled into one format.[http://cukes.info/ More Info.]&lt;br /&gt;
&lt;br /&gt;
''Example 3: &amp;lt;ref&amp;gt;http://watir.com/frameworks/&amp;lt;/ref&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
1. Install&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install cucumber&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cucumber features&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will execute the following cucumber feature:&lt;br /&gt;
'''features/example.feature'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Feature: Search In order to use Google users must be able to search for content &lt;br /&gt;
Scenario: Search for a term&lt;br /&gt;
Given I have entered &amp;quot;watir&amp;quot; into the query&lt;br /&gt;
When I click &amp;quot;search&amp;quot;&lt;br /&gt;
Then I should see some results&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''features/step_definitions/example_steps.rb'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require &amp;quot;watir-webdriver&amp;quot;&lt;br /&gt;
require &amp;quot;rspec/expectations&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
Given /^I have entered &amp;quot;([^&amp;quot;]*)&amp;quot; into the query$/ do |term|&lt;br /&gt;
  @browser ||= Watir::Browser.new :firefox&lt;br /&gt;
  @browser.goto &amp;quot;google.com&amp;quot;&lt;br /&gt;
  @browser.text_field(:name =&amp;gt; &amp;quot;q&amp;quot;).set term&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
When /^I click &amp;quot;([^&amp;quot;]*)&amp;quot;$/ do |button_name|&lt;br /&gt;
  @browser.button.click&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
Then /^I should see some results$/ do&lt;br /&gt;
  @browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).wait_until_present&lt;br /&gt;
  @browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).should exist &lt;br /&gt;
  @browser.close&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Comparison with Other Tools =&lt;br /&gt;
&lt;br /&gt;
There are some other framworks will do similar work as watir does, for example, [http://en.wikipedia.org/wiki/Cucumber_(software) Cucmber], [http://en.wikipedia.org/wiki/Capybara Capybara] and RSpec[http://en.wikipedia.org/wiki/RSpec RSpec]. But in comparison, they have different features and are usually used in conjecture.&lt;br /&gt;
&lt;br /&gt;
In software engineering, behavior-driven development (abbreviated BDD) is a software development process based on test-driven development (TDD). &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Behavior-driven_development&amp;lt;/ref&amp;gt; It's very important in software testing. The relationship between Watir and Cucmmber is usually designing a framework to test cucumber scenarios using Watir tool. [http://qastrategies.blogspot.com/2012/06/bdd-framework-to-test-web-application.html See Example]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The detailed characteristics and relationships are:&lt;br /&gt;
&lt;br /&gt;
*Watir&amp;lt;br&amp;gt;&lt;br /&gt;
Put simply, Watir is a browser driver. Lightweight and simple to use, Watir excels at automating modern browsers. Built in Ruby, it does not have an IDE of it's own, but it works well with other testing frameworks and solutions in the Ruby ecosystem. &lt;br /&gt;
&lt;br /&gt;
*Cucumber&amp;lt;br&amp;gt;&lt;br /&gt;
Cucumber lets software development teams describe how software should behave in plain english, it is designed to allow you to execute automated integration tests. It is a tool for implementing Behavior Driven Development.It can work nicely in conjecture with Capybara and RSpec.&lt;br /&gt;
&lt;br /&gt;
*Capybara&amp;lt;br&amp;gt;&lt;br /&gt;
Capybara is a library written in the Ruby programming language which makes it easy to simulate how a user interacts with your application. It can talk with many different drivers which execute tests through the same clean and simple interface, including Selenium, Webkit or pure Ruby drivers.&amp;lt;ref&amp;gt;http://jnicklas.github.io/capybara/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*RSpec&amp;lt;br&amp;gt;&lt;br /&gt;
RSpec helps you do the TDD(Test-Driven Development) part of the whole development (combines Test-Driven Development, Domain Driven Design, and Acceptance Test-Driven Planning), focusing on the documentation and design aspects of TDD. A combination of RSpec and Watir makes really readable test scripts.&amp;lt;ref&amp;gt;http://www.ibmwcs.com/2010/08/testing-with-rspec-cucumber-selenium.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:''Here's an video tutorial from Youtube introducing how to test with Ruby Cucumber RSpec Capybara Watir WebDriver Testing.[https://www.youtube.com/watch?v=jPH5Eiz32N0 More Info]''&lt;br /&gt;
&lt;br /&gt;
= Pros and Cons =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* No external server needed to run a test.  Just run &amp;quot;ruby test.rb&amp;quot; and it goes, this simplifies any scripts used to execute the tests through continuous integration servers like [http://en.wikipedia.org/wiki/Hudson_%28software%29 Hudson] or [http://en.wikipedia.org/wiki/Bamboo_%28software%29 Bamboo] or whatever.&amp;lt;ref&amp;gt;http://www.quora.com/What-are-the-pros-and-cons-of-different-front-end-web-testing-frameworks-such-as-Selenium-or-Watir&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Rich API, which is pretty easy and once the users get the basics they can just guess how to write the code without needed alot of documentation.&lt;br /&gt;
&lt;br /&gt;
* Tests can often be run through alternative tools, such as watir-webdriver, [http://watirmelon.com/2009/08/31/celerity-first-impressions/ celerity] and more, which are all more-or-less support the watir API.  This means that if the users write their framework carefully, they would not be locked into watir.&lt;br /&gt;
&lt;br /&gt;
* Watir-webdriver does work in both ruby and [http://en.wikipedia.org/wiki/JRuby jruby].&lt;br /&gt;
&lt;br /&gt;
* Don't have much issue dealing with [http://en.wikipedia.org/wiki/Ajax_%28programming%29 AJAX], watir autumatically knows when the page finished loading.&lt;br /&gt;
&lt;br /&gt;
* Typically runs faster than a comparable selenium test.&lt;br /&gt;
&lt;br /&gt;
* Better support for headless browsers, like Celerity.&lt;br /&gt;
&lt;br /&gt;
* Multi browser (&amp;amp; OS) support&lt;br /&gt;
&lt;br /&gt;
*Provides an &amp;quot;attach&amp;quot; method which lets users programmatic access both the original domain window and the linked domain window from the same test.&amp;lt;ref&amp;gt;http://onestopqa.blogspot.com/2012/09/pros-cons-of-watir-selenium-or-sahi.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Each browser's implementation is a little bit different, and the driver for each browser is written independently.  This means inconsistent test results between browsers, which could be an issue sometime.&lt;br /&gt;
&lt;br /&gt;
* API is ruby only, users have to learn Ruby first.&lt;br /&gt;
&lt;br /&gt;
* Doesn't seem to be as widely used as selenium, a lil bit harder to find pretty good engineers.&lt;br /&gt;
&lt;br /&gt;
* The task of porting Watir to a new browser isn’t an easy one, and the task of keeping every port of Watir in sync, with the same API, is difficult. &amp;lt;ref&amp;gt;http://watirmelon.com/2010/04/10/watir-selenium-webdriver/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Further Reading =&lt;br /&gt;
1. An virtual experience on Watir, see how watir works in your eyes. https://www.youtube.com/watch?v=FxQXQGpImAo&lt;br /&gt;
&lt;br /&gt;
2. Get started with watir in one minute. https://testwisely.com/testwise/docs/tutorials/watir&lt;br /&gt;
&lt;br /&gt;
3. Tutorial on Ruby Cucumber RSpec Capybara Watir WebDriver Testing, know how they work here: https://www.youtube.com/watch?v=jPH5Eiz32N0&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_19_mx&amp;diff=88724</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 19 mx</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_19_mx&amp;diff=88724"/>
		<updated>2014-09-26T03:43:56Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Run in Rspec */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Watir'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= Introduction=&lt;br /&gt;
Watir('''W'''eb '''A'''pplication '''T'''est '''i'''n '''R'''uby), pronounced as 'water', is an automated test toolkit which uses the Ruby scripting language for automated tests to be developed and run against a web browser. &amp;lt;ref&amp;gt;http://www.httpwatch.com/rubywatir/&amp;lt;/ref&amp;gt;It allows users to write tests that are easy to read and maintain, also simple and flexible. Watir was first developed by Bret Pettichord and Paul Rogers. It drives [http://en.wikipedia.org/wiki/Internet_Explorer Internet Explorer], [http://en.wikipedia.org/wiki/FirefoxMozilla Firefox|Firefox], [http://en.wikipedia.org/wiki/Chrome Google Chrome|Chrome], [http://en.wikipedia.org/wiki/Opera Opera (web browser)|Opera] and [http://en.wikipedia.org/wiki/Safari Safari (web browser)|Safari], and is available as a [http://en.wikipedia.org/wiki/RubyGems RubyGems] gem, &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Watir&amp;lt;/ref&amp;gt; which is a free, open source Ruby library that  can test web applications written in any language&amp;lt;ref&amp;gt;https://rubygems.org/gems/watir-classic&amp;lt;/ref&amp;gt; and drive a web browser the same way an end user would. It clicks links, fills in forms, presses buttons. Watir can also check results, such as whether expected text appears on the page or not, or whether a control is enabled. &amp;lt;ref&amp;gt;http://watir.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watir project consists of several smaller projects, including watir-classic, watir-webdriver and watirspec.&lt;br /&gt;
&lt;br /&gt;
== Watir-classic ==&lt;br /&gt;
Watir-classic is a Watir driver for automating only Internet Explorer on Windows.&amp;lt;ref&amp;gt;https://github.com/watir/watir-classic&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watir-classic is able to work on Internet Explorer 8, 9 and 10&amp;lt;ref&amp;gt;http://rubydoc.info/gems/watir-classic/3.7.0/frames&amp;lt;/ref&amp;gt;, and is supported by Ruby 1.8.7, 1.9.3 and 2.0.0.&lt;br /&gt;
&lt;br /&gt;
== Watir-webdriver==&lt;br /&gt;
Watie-webdriver is an implementation built on WebDriver's Ruby bindings. It supports not only the Internet Explorer, but also namely Firefox, Chrome and Safari,&amp;lt;ref&amp;gt;https://github.com/watir/watir-webdriver&amp;lt;/ref&amp;gt;which is a main difference compared with watir-classic.&lt;br /&gt;
&lt;br /&gt;
== Watirspec ==&lt;br /&gt;
Watirspec combines best features of Watir [http://en.wikipedia.org/wiki/RSpec RSpec] and Ruby for browser-based functional testing.&amp;lt;ref&amp;gt;https://rubygems.org/gems/watirspec&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Just like RubySpec is for Ruby, Watirspec is the executable specification of the Watir API.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Web Application Testing ==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Web_testing Web testing] is a software testing that focuses on web applications. Complete testing of a web-based system before going live can help address issues before the system is revealed to the public. Issues such as the basic functionality of the site, the security of the web application, its accessibility to handicapped users and fully able users, as well as readiness for expected traffic and number of users and the ability to survive a massive spike in user traffic, both of which are related to load testing.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_testing&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Web Testing Checklist:'''&amp;lt;ref&amp;gt;http://www.softwaretestinghelp.com/web-application-testing/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Functionality Testing： Test for all the links in web pages, database connection, forms used in the web pages for submitting or getting information from user, as well as Cookie testing.&lt;br /&gt;
&lt;br /&gt;
*Usability Testing:  Test for navigation, contents and other user information for user help.&lt;br /&gt;
&lt;br /&gt;
*Interface Testing: Test for main interfaces, such as Web server, application server interface and Database server interface. Check whether all the interactions between these servers are executed properly or not. &lt;br /&gt;
&lt;br /&gt;
*Compatibility Testing: Test for the compatibility of your web site, which is a very critical testing aspect, including Browser compatibility, Operating system compatibility, Mobile browsing and Printing options compatibility. &lt;br /&gt;
&lt;br /&gt;
*Performance Testing: Test for web application performance, which should include both Web Load Testing and Web Stress Testing.&lt;br /&gt;
&lt;br /&gt;
== Ruby ==&lt;br /&gt;
Ruby is a dynamic, designed and developed in the mid-1990s by Yukihiro &amp;quot;Matz&amp;quot; Matsumoto in Japan, is a reflective, object-oriented, general-purpose programming language. Like other programming languages, Ruby gives you the power to connect to databases, read data files and spreadsheets, export XML, and structure your code as reusable libraries. Unlike other programming languages, Ruby is concise and often a joy to read.&lt;br /&gt;
&lt;br /&gt;
According to its authors, Ruby was influenced by [http://en.wikipedia.org/wiki/Perl Perl], [http://en.wikipedia.org/wiki/Smalltalk Smalltalk], [http://en.wikipedia.org/wiki/Eiffel Eiffel], [http://en.wikipedia.org/wiki/Ada Ada], and [http://en.wikipedia.org/wiki/Lisp Lisp]. It supports multiple programming paradigms, including functional, object-oriented, and imperative. It also has a dynamic type system and automatic memory management.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Ruby_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Several Features：'''&amp;lt;ref&amp;gt;http://www.starkdigital.net/ruby-programming&amp;lt;/ref&amp;gt;&lt;br /&gt;
*Thoroughly object-oriented with inheritance, mixins and metaclasses&lt;br /&gt;
*Dynamic typing and duck typing&lt;br /&gt;
*Large standard library, including modules for [http://en.wikipedia.org/wiki/YAML YAML], [http://en.wikipedia.org/wiki/JSON JSON], [http://en.wikipedia.org/wiki/XML XML], [http://en.wikipedia.org/wiki/CGI CGI], [http://en.wikipedia.org/wiki/OpenSSL OpenSSL], [http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP], [http://en.wikipedia.org/wiki/File_Transfer_Protocol FTP], [http://en.wikipedia.org/wiki/RSS RSS], [http://en.wikipedia.org/wiki/Curse_(disambiguation) curses], [http://en.wikipedia.org/wiki/Zlib zlib], and [http://en.wikipedia.org/wiki/Tk_(software) Tk] &lt;br /&gt;
*Dynamic reflection and alteration of objects to facilitate [http://en.wikipedia.org/wiki/Metaprogramming metaprogramming]&lt;br /&gt;
[http://www.starkdigital.net/ruby-programming See More Features.]&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
== Install Ruby on Linux ==&lt;br /&gt;
Use your relevant package manager to update or install Ruby with the following at a terminal window:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install ruby  # for Ubuntu / Debian users&lt;br /&gt;
 sudo yum install ruby      # for Red Hat / Fedora users&lt;br /&gt;
== Update RubyGems on Linux ==&lt;br /&gt;
Make sure you have the latest rubygems version 1.3.7 or above installed. Use your relevant package manager to install the latest version with the following at a terminal window:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install rubygems # for Ubuntu / Debian users&lt;br /&gt;
 sudo yum install rubygems  # for Red Hat / Fedora users&lt;br /&gt;
&lt;br /&gt;
== Install a HTML Inspector ==&lt;br /&gt;
To use Watir effectively, you’ll need to be able to browse through the structure of your application’s HTML pages. These tools help you do that.&lt;br /&gt;
&lt;br /&gt;
*On Firefox, use Firebug&lt;br /&gt;
*On Internet Explorer, use the IE Developer Toolbar&lt;br /&gt;
&lt;br /&gt;
== Installing or Updating RubyGems ==&lt;br /&gt;
While updating RubyGems, or installing any of the gems, you can use the following additional flags:&lt;br /&gt;
&lt;br /&gt;
 --no-rdoc --no-ri&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 gem update --system --no-rdoc --no-ri&lt;br /&gt;
 gem install watir --no-rdoc --no-ri&lt;br /&gt;
&lt;br /&gt;
= Make It Run =&lt;br /&gt;
After everything required installed, we can run the watir tests in several ways. Below three ways are listed, and each of them is designed to work on the live Watir demo form: http://bit.ly/watir-example.&lt;br /&gt;
&lt;br /&gt;
== Run in .rb ==&lt;br /&gt;
First of all, let's see how to conduct the test in ruby on rails. The example was based on the example listed on a google form, it demonstrated watir's functionality such as entering text into a text field, clicking a button like a user does, checking to see if a page contains text and so on. Below is the step-by-step command to finish the test in .rb file, which means you can simply save these commands in a .rb file and run it with ruby.&lt;br /&gt;
&lt;br /&gt;
''Example 1: &amp;lt;ref&amp;gt;http://watir.com/examples/&amp;lt;/ref&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
*Require Ruby Watir gem first via the -rubygems command line option, or by using the RUBYOPT environment variable. You can also require it manually in your script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rubygems'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Including Watir gem to drive Internet Explorer on Windows&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'watir'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Including Watir-WebDriver gem to drive Firefox/Chrome on Windows/Mac/Linux&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'watir-webdriver'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Starting a new browser &amp;amp; and going to our site&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser = Watir::Browser.new&lt;br /&gt;
browser.goto 'http://bit.ly/watir-example'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting a text field&lt;br /&gt;
&lt;br /&gt;
[[File:Text-field.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.text_field(:name =&amp;gt; 'entry.0.single').set 'Watir'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting a multi-line text box&lt;br /&gt;
&lt;br /&gt;
[[File:text-box1.png|text-box1.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.text_field(:name =&amp;gt; 'entry.1.single').set &amp;quot;I come here from Australia. \n The weather is great here.&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting and clearing a radio button&lt;br /&gt;
&lt;br /&gt;
[[File:3.radio-buttons1.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.radio(:value =&amp;gt; 'Watir').set&lt;br /&gt;
browser.radio(:value =&amp;gt; 'Watir').clear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting and clearing check boxes&lt;br /&gt;
&lt;br /&gt;
[[File:4.checkboxes.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Ruby').set&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Python').set&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Python').clear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Clearing, getting and selecting selection list values&lt;br /&gt;
&lt;br /&gt;
[[File:5.selection-list.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.select_list(:name =&amp;gt; 'entry.6.single').clear&lt;br /&gt;
puts browser.select_list(:name =&amp;gt; 'entry.6.single').options&lt;br /&gt;
browser.select_list(:name =&amp;gt; 'entry.6.single').select 'Chrome'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Clicking a button&lt;br /&gt;
&lt;br /&gt;
[[File:6.button.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.button(:name =&amp;gt; 'submit').click&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Checking for text in a page&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
puts browser.text.include? 'Your response has been recorded.'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Checking the title of a page&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
puts browser.title == 'Thanks!'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Run in Rspec ==&lt;br /&gt;
RSpec is a Behaviour-Driven Development tool for Ruby programmers. BDD is an approach to software development that combines Test-Driven Development, Domain Driven Design, and Acceptance Test-Driven Planning. RSpec helps you do the TDD part of that equation, focusing on the documentation and design aspects of TDD. The following code demonstrates using Watir and a basic RSpec example.[http://rspec.info/ More Info.]&lt;br /&gt;
&lt;br /&gt;
''Example 2: &amp;lt;ref&amp;gt;http://watir.com/frameworks/&amp;lt;/ref&amp;gt; ''&lt;br /&gt;
&lt;br /&gt;
1. Install&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install rspec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Example&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec test_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will execute the following rspec example:&lt;br /&gt;
&lt;br /&gt;
'''test_spec.rb'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require &amp;quot;rubygems&amp;quot;&lt;br /&gt;
require &amp;quot;rspec&amp;quot;&lt;br /&gt;
require &amp;quot;watir-webdriver&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
describe &amp;quot;google.com&amp;quot; do&lt;br /&gt;
  let(:browser) { @browser ||= Watir::Browser.new :firefox } &lt;br /&gt;
  before { browser.goto &amp;quot;http://google.com&amp;quot; } &lt;br /&gt;
  after { browser.close }&lt;br /&gt;
 &lt;br /&gt;
  it &amp;quot;should search for watir&amp;quot; do&lt;br /&gt;
    browser.text_field(:name =&amp;gt; &amp;quot;q&amp;quot;).set &amp;quot;watir&amp;quot;&lt;br /&gt;
    browser.button.click &lt;br /&gt;
    browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).wait_until_present&lt;br /&gt;
    browser.title.should == &amp;quot;watir - Google Search&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Run in Cucumber ==&lt;br /&gt;
Cucumber lets software development teams describe how software should behave in plain text. The text is written in a business-readable domain-specific language and serves as documentation, automated tests and development-aid – all rolled into one format.[http://cukes.info/ More Info.]&lt;br /&gt;
&lt;br /&gt;
Example 3: &amp;lt;ref&amp;gt;http://watir.com/frameworks/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Install&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install cucumber&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cucumber features&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will execute the following cucumber feature:&lt;br /&gt;
'''features/example.feature'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Feature: Search In order to use Google users must be able to search for content &lt;br /&gt;
Scenario: Search for a term&lt;br /&gt;
Given I have entered &amp;quot;watir&amp;quot; into the query&lt;br /&gt;
When I click &amp;quot;search&amp;quot;&lt;br /&gt;
Then I should see some results&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''features/step_definitions/example_steps.rb'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require &amp;quot;watir-webdriver&amp;quot;&lt;br /&gt;
require &amp;quot;rspec/expectations&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
Given /^I have entered &amp;quot;([^&amp;quot;]*)&amp;quot; into the query$/ do |term|&lt;br /&gt;
  @browser ||= Watir::Browser.new :firefox&lt;br /&gt;
  @browser.goto &amp;quot;google.com&amp;quot;&lt;br /&gt;
  @browser.text_field(:name =&amp;gt; &amp;quot;q&amp;quot;).set term&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
When /^I click &amp;quot;([^&amp;quot;]*)&amp;quot;$/ do |button_name|&lt;br /&gt;
  @browser.button.click&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
Then /^I should see some results$/ do&lt;br /&gt;
  @browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).wait_until_present&lt;br /&gt;
  @browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).should exist &lt;br /&gt;
  @browser.close&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Comparison with Other Tools =&lt;br /&gt;
&lt;br /&gt;
There are some other framworks will do similar work as watir does, for example, [http://en.wikipedia.org/wiki/Cucumber_(software) Cucmber], [http://en.wikipedia.org/wiki/Capybara Capybara] and RSpec[http://en.wikipedia.org/wiki/RSpec RSpec]. But in comparison, they have different features and are usually used in conjecture.&lt;br /&gt;
&lt;br /&gt;
In software engineering, behavior-driven development (abbreviated BDD) is a software development process based on test-driven development (TDD). &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Behavior-driven_development&amp;lt;/ref&amp;gt; It's very important in software testing. The relationship between Watir and Cucmmber is usually designing a framework to test cucumber scenarios using Watir tool. [http://qastrategies.blogspot.com/2012/06/bdd-framework-to-test-web-application.html See Example]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The detailed characteristics and relationships are:&lt;br /&gt;
&lt;br /&gt;
*Watir&amp;lt;br&amp;gt;&lt;br /&gt;
Put simply, Watir is a browser driver. Lightweight and simple to use, Watir excels at automating modern browsers. Built in Ruby, it does not have an IDE of it's own, but it works well with other testing frameworks and solutions in the Ruby ecosystem. &lt;br /&gt;
&lt;br /&gt;
*Cucumber&amp;lt;br&amp;gt;&lt;br /&gt;
Cucumber lets software development teams describe how software should behave in plain english, it is designed to allow you to execute automated integration tests. It is a tool for implementing Behavior Driven Development.It can work nicely in conjecture with Capybara and RSpec.&lt;br /&gt;
&lt;br /&gt;
*Capybara&amp;lt;br&amp;gt;&lt;br /&gt;
Capybara is a library written in the Ruby programming language which makes it easy to simulate how a user interacts with your application. It can talk with many different drivers which execute tests through the same clean and simple interface, including Selenium, Webkit or pure Ruby drivers.&amp;lt;ref&amp;gt;http://jnicklas.github.io/capybara/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*RSpec&amp;lt;br&amp;gt;&lt;br /&gt;
RSpec helps you do the TDD(Test-Driven Development) part of the whole development (combines Test-Driven Development, Domain Driven Design, and Acceptance Test-Driven Planning), focusing on the documentation and design aspects of TDD. A combination of RSpec and Watir makes really readable test scripts.&amp;lt;ref&amp;gt;http://www.ibmwcs.com/2010/08/testing-with-rspec-cucumber-selenium.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:''Here's an video tutorial from Youtube introducing how to test with Ruby Cucumber RSpec Capybara Watir WebDriver Testing.[https://www.youtube.com/watch?v=jPH5Eiz32N0 More Info]''&lt;br /&gt;
&lt;br /&gt;
= Pros and Cons =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* No external server needed to run a test.  Just run &amp;quot;ruby test.rb&amp;quot; and it goes, this simplifies any scripts used to execute the tests through continuous integration servers like [http://en.wikipedia.org/wiki/Hudson_%28software%29 Hudson] or [http://en.wikipedia.org/wiki/Bamboo_%28software%29 Bamboo] or whatever.&amp;lt;ref&amp;gt;http://www.quora.com/What-are-the-pros-and-cons-of-different-front-end-web-testing-frameworks-such-as-Selenium-or-Watir&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Rich API, which is pretty easy and once the users get the basics they can just guess how to write the code without needed alot of documentation.&lt;br /&gt;
&lt;br /&gt;
* Tests can often be run through alternative tools, such as watir-webdriver, [http://watirmelon.com/2009/08/31/celerity-first-impressions/ celerity] and more, which are all more-or-less support the watir API.  This means that if the users write their framework carefully, they would not be locked into watir.&lt;br /&gt;
&lt;br /&gt;
* Watir-webdriver does work in both ruby and [http://en.wikipedia.org/wiki/JRuby jruby].&lt;br /&gt;
&lt;br /&gt;
* Don't have much issue dealing with [http://en.wikipedia.org/wiki/Ajax_%28programming%29 AJAX], watir autumatically knows when the page finished loading.&lt;br /&gt;
&lt;br /&gt;
* Typically runs faster than a comparable selenium test.&lt;br /&gt;
&lt;br /&gt;
* Better support for headless browsers, like Celerity.&lt;br /&gt;
&lt;br /&gt;
* Multi browser (&amp;amp; OS) support&lt;br /&gt;
&lt;br /&gt;
*Provides an &amp;quot;attach&amp;quot; method which lets users programmatic access both the original domain window and the linked domain window from the same test.&amp;lt;ref&amp;gt;http://onestopqa.blogspot.com/2012/09/pros-cons-of-watir-selenium-or-sahi.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Each browser's implementation is a little bit different, and the driver for each browser is written independently.  This means inconsistent test results between browsers, which could be an issue sometime.&lt;br /&gt;
&lt;br /&gt;
* API is ruby only, users have to learn Ruby first.&lt;br /&gt;
&lt;br /&gt;
* Doesn't seem to be as widely used as selenium, a lil bit harder to find pretty good engineers.&lt;br /&gt;
&lt;br /&gt;
* The task of porting Watir to a new browser isn’t an easy one, and the task of keeping every port of Watir in sync, with the same API, is difficult. &amp;lt;ref&amp;gt;http://watirmelon.com/2010/04/10/watir-selenium-webdriver/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Further Reading =&lt;br /&gt;
1. An virtual experience on Watir, see how watir works in your eyes. https://www.youtube.com/watch?v=FxQXQGpImAo&lt;br /&gt;
&lt;br /&gt;
2. Get started with watir in one minute. https://testwisely.com/testwise/docs/tutorials/watir&lt;br /&gt;
&lt;br /&gt;
3. Tutorial on Ruby Cucumber RSpec Capybara Watir WebDriver Testing, know how they work here: https://www.youtube.com/watch?v=jPH5Eiz32N0&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_19_mx&amp;diff=88723</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 19 mx</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_19_mx&amp;diff=88723"/>
		<updated>2014-09-26T03:43:41Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Run in .rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Watir'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= Introduction=&lt;br /&gt;
Watir('''W'''eb '''A'''pplication '''T'''est '''i'''n '''R'''uby), pronounced as 'water', is an automated test toolkit which uses the Ruby scripting language for automated tests to be developed and run against a web browser. &amp;lt;ref&amp;gt;http://www.httpwatch.com/rubywatir/&amp;lt;/ref&amp;gt;It allows users to write tests that are easy to read and maintain, also simple and flexible. Watir was first developed by Bret Pettichord and Paul Rogers. It drives [http://en.wikipedia.org/wiki/Internet_Explorer Internet Explorer], [http://en.wikipedia.org/wiki/FirefoxMozilla Firefox|Firefox], [http://en.wikipedia.org/wiki/Chrome Google Chrome|Chrome], [http://en.wikipedia.org/wiki/Opera Opera (web browser)|Opera] and [http://en.wikipedia.org/wiki/Safari Safari (web browser)|Safari], and is available as a [http://en.wikipedia.org/wiki/RubyGems RubyGems] gem, &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Watir&amp;lt;/ref&amp;gt; which is a free, open source Ruby library that  can test web applications written in any language&amp;lt;ref&amp;gt;https://rubygems.org/gems/watir-classic&amp;lt;/ref&amp;gt; and drive a web browser the same way an end user would. It clicks links, fills in forms, presses buttons. Watir can also check results, such as whether expected text appears on the page or not, or whether a control is enabled. &amp;lt;ref&amp;gt;http://watir.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watir project consists of several smaller projects, including watir-classic, watir-webdriver and watirspec.&lt;br /&gt;
&lt;br /&gt;
== Watir-classic ==&lt;br /&gt;
Watir-classic is a Watir driver for automating only Internet Explorer on Windows.&amp;lt;ref&amp;gt;https://github.com/watir/watir-classic&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watir-classic is able to work on Internet Explorer 8, 9 and 10&amp;lt;ref&amp;gt;http://rubydoc.info/gems/watir-classic/3.7.0/frames&amp;lt;/ref&amp;gt;, and is supported by Ruby 1.8.7, 1.9.3 and 2.0.0.&lt;br /&gt;
&lt;br /&gt;
== Watir-webdriver==&lt;br /&gt;
Watie-webdriver is an implementation built on WebDriver's Ruby bindings. It supports not only the Internet Explorer, but also namely Firefox, Chrome and Safari,&amp;lt;ref&amp;gt;https://github.com/watir/watir-webdriver&amp;lt;/ref&amp;gt;which is a main difference compared with watir-classic.&lt;br /&gt;
&lt;br /&gt;
== Watirspec ==&lt;br /&gt;
Watirspec combines best features of Watir [http://en.wikipedia.org/wiki/RSpec RSpec] and Ruby for browser-based functional testing.&amp;lt;ref&amp;gt;https://rubygems.org/gems/watirspec&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Just like RubySpec is for Ruby, Watirspec is the executable specification of the Watir API.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Web Application Testing ==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Web_testing Web testing] is a software testing that focuses on web applications. Complete testing of a web-based system before going live can help address issues before the system is revealed to the public. Issues such as the basic functionality of the site, the security of the web application, its accessibility to handicapped users and fully able users, as well as readiness for expected traffic and number of users and the ability to survive a massive spike in user traffic, both of which are related to load testing.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_testing&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Web Testing Checklist:'''&amp;lt;ref&amp;gt;http://www.softwaretestinghelp.com/web-application-testing/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Functionality Testing： Test for all the links in web pages, database connection, forms used in the web pages for submitting or getting information from user, as well as Cookie testing.&lt;br /&gt;
&lt;br /&gt;
*Usability Testing:  Test for navigation, contents and other user information for user help.&lt;br /&gt;
&lt;br /&gt;
*Interface Testing: Test for main interfaces, such as Web server, application server interface and Database server interface. Check whether all the interactions between these servers are executed properly or not. &lt;br /&gt;
&lt;br /&gt;
*Compatibility Testing: Test for the compatibility of your web site, which is a very critical testing aspect, including Browser compatibility, Operating system compatibility, Mobile browsing and Printing options compatibility. &lt;br /&gt;
&lt;br /&gt;
*Performance Testing: Test for web application performance, which should include both Web Load Testing and Web Stress Testing.&lt;br /&gt;
&lt;br /&gt;
== Ruby ==&lt;br /&gt;
Ruby is a dynamic, designed and developed in the mid-1990s by Yukihiro &amp;quot;Matz&amp;quot; Matsumoto in Japan, is a reflective, object-oriented, general-purpose programming language. Like other programming languages, Ruby gives you the power to connect to databases, read data files and spreadsheets, export XML, and structure your code as reusable libraries. Unlike other programming languages, Ruby is concise and often a joy to read.&lt;br /&gt;
&lt;br /&gt;
According to its authors, Ruby was influenced by [http://en.wikipedia.org/wiki/Perl Perl], [http://en.wikipedia.org/wiki/Smalltalk Smalltalk], [http://en.wikipedia.org/wiki/Eiffel Eiffel], [http://en.wikipedia.org/wiki/Ada Ada], and [http://en.wikipedia.org/wiki/Lisp Lisp]. It supports multiple programming paradigms, including functional, object-oriented, and imperative. It also has a dynamic type system and automatic memory management.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Ruby_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Several Features：'''&amp;lt;ref&amp;gt;http://www.starkdigital.net/ruby-programming&amp;lt;/ref&amp;gt;&lt;br /&gt;
*Thoroughly object-oriented with inheritance, mixins and metaclasses&lt;br /&gt;
*Dynamic typing and duck typing&lt;br /&gt;
*Large standard library, including modules for [http://en.wikipedia.org/wiki/YAML YAML], [http://en.wikipedia.org/wiki/JSON JSON], [http://en.wikipedia.org/wiki/XML XML], [http://en.wikipedia.org/wiki/CGI CGI], [http://en.wikipedia.org/wiki/OpenSSL OpenSSL], [http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP], [http://en.wikipedia.org/wiki/File_Transfer_Protocol FTP], [http://en.wikipedia.org/wiki/RSS RSS], [http://en.wikipedia.org/wiki/Curse_(disambiguation) curses], [http://en.wikipedia.org/wiki/Zlib zlib], and [http://en.wikipedia.org/wiki/Tk_(software) Tk] &lt;br /&gt;
*Dynamic reflection and alteration of objects to facilitate [http://en.wikipedia.org/wiki/Metaprogramming metaprogramming]&lt;br /&gt;
[http://www.starkdigital.net/ruby-programming See More Features.]&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
== Install Ruby on Linux ==&lt;br /&gt;
Use your relevant package manager to update or install Ruby with the following at a terminal window:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install ruby  # for Ubuntu / Debian users&lt;br /&gt;
 sudo yum install ruby      # for Red Hat / Fedora users&lt;br /&gt;
== Update RubyGems on Linux ==&lt;br /&gt;
Make sure you have the latest rubygems version 1.3.7 or above installed. Use your relevant package manager to install the latest version with the following at a terminal window:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install rubygems # for Ubuntu / Debian users&lt;br /&gt;
 sudo yum install rubygems  # for Red Hat / Fedora users&lt;br /&gt;
&lt;br /&gt;
== Install a HTML Inspector ==&lt;br /&gt;
To use Watir effectively, you’ll need to be able to browse through the structure of your application’s HTML pages. These tools help you do that.&lt;br /&gt;
&lt;br /&gt;
*On Firefox, use Firebug&lt;br /&gt;
*On Internet Explorer, use the IE Developer Toolbar&lt;br /&gt;
&lt;br /&gt;
== Installing or Updating RubyGems ==&lt;br /&gt;
While updating RubyGems, or installing any of the gems, you can use the following additional flags:&lt;br /&gt;
&lt;br /&gt;
 --no-rdoc --no-ri&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 gem update --system --no-rdoc --no-ri&lt;br /&gt;
 gem install watir --no-rdoc --no-ri&lt;br /&gt;
&lt;br /&gt;
= Make It Run =&lt;br /&gt;
After everything required installed, we can run the watir tests in several ways. Below three ways are listed, and each of them is designed to work on the live Watir demo form: http://bit.ly/watir-example.&lt;br /&gt;
&lt;br /&gt;
== Run in .rb ==&lt;br /&gt;
First of all, let's see how to conduct the test in ruby on rails. The example was based on the example listed on a google form, it demonstrated watir's functionality such as entering text into a text field, clicking a button like a user does, checking to see if a page contains text and so on. Below is the step-by-step command to finish the test in .rb file, which means you can simply save these commands in a .rb file and run it with ruby.&lt;br /&gt;
&lt;br /&gt;
''Example 1: &amp;lt;ref&amp;gt;http://watir.com/examples/&amp;lt;/ref&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
*Require Ruby Watir gem first via the -rubygems command line option, or by using the RUBYOPT environment variable. You can also require it manually in your script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rubygems'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Including Watir gem to drive Internet Explorer on Windows&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'watir'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Including Watir-WebDriver gem to drive Firefox/Chrome on Windows/Mac/Linux&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'watir-webdriver'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Starting a new browser &amp;amp; and going to our site&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser = Watir::Browser.new&lt;br /&gt;
browser.goto 'http://bit.ly/watir-example'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting a text field&lt;br /&gt;
&lt;br /&gt;
[[File:Text-field.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.text_field(:name =&amp;gt; 'entry.0.single').set 'Watir'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting a multi-line text box&lt;br /&gt;
&lt;br /&gt;
[[File:text-box1.png|text-box1.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.text_field(:name =&amp;gt; 'entry.1.single').set &amp;quot;I come here from Australia. \n The weather is great here.&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting and clearing a radio button&lt;br /&gt;
&lt;br /&gt;
[[File:3.radio-buttons1.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.radio(:value =&amp;gt; 'Watir').set&lt;br /&gt;
browser.radio(:value =&amp;gt; 'Watir').clear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting and clearing check boxes&lt;br /&gt;
&lt;br /&gt;
[[File:4.checkboxes.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Ruby').set&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Python').set&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Python').clear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Clearing, getting and selecting selection list values&lt;br /&gt;
&lt;br /&gt;
[[File:5.selection-list.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.select_list(:name =&amp;gt; 'entry.6.single').clear&lt;br /&gt;
puts browser.select_list(:name =&amp;gt; 'entry.6.single').options&lt;br /&gt;
browser.select_list(:name =&amp;gt; 'entry.6.single').select 'Chrome'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Clicking a button&lt;br /&gt;
&lt;br /&gt;
[[File:6.button.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.button(:name =&amp;gt; 'submit').click&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Checking for text in a page&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
puts browser.text.include? 'Your response has been recorded.'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Checking the title of a page&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
puts browser.title == 'Thanks!'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Run in Rspec ==&lt;br /&gt;
RSpec is a Behaviour-Driven Development tool for Ruby programmers. BDD is an approach to software development that combines Test-Driven Development, Domain Driven Design, and Acceptance Test-Driven Planning. RSpec helps you do the TDD part of that equation, focusing on the documentation and design aspects of TDD. The following code demonstrates using Watir and a basic RSpec example.[http://rspec.info/ More Info.]&lt;br /&gt;
&lt;br /&gt;
Example 2: &amp;lt;ref&amp;gt;http://watir.com/frameworks/&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
1. Install&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install rspec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Example&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec test_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will execute the following rspec example:&lt;br /&gt;
&lt;br /&gt;
'''test_spec.rb'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require &amp;quot;rubygems&amp;quot;&lt;br /&gt;
require &amp;quot;rspec&amp;quot;&lt;br /&gt;
require &amp;quot;watir-webdriver&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
describe &amp;quot;google.com&amp;quot; do&lt;br /&gt;
  let(:browser) { @browser ||= Watir::Browser.new :firefox } &lt;br /&gt;
  before { browser.goto &amp;quot;http://google.com&amp;quot; } &lt;br /&gt;
  after { browser.close }&lt;br /&gt;
 &lt;br /&gt;
  it &amp;quot;should search for watir&amp;quot; do&lt;br /&gt;
    browser.text_field(:name =&amp;gt; &amp;quot;q&amp;quot;).set &amp;quot;watir&amp;quot;&lt;br /&gt;
    browser.button.click &lt;br /&gt;
    browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).wait_until_present&lt;br /&gt;
    browser.title.should == &amp;quot;watir - Google Search&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Run in Cucumber ==&lt;br /&gt;
Cucumber lets software development teams describe how software should behave in plain text. The text is written in a business-readable domain-specific language and serves as documentation, automated tests and development-aid – all rolled into one format.[http://cukes.info/ More Info.]&lt;br /&gt;
&lt;br /&gt;
Example 3: &amp;lt;ref&amp;gt;http://watir.com/frameworks/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Install&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install cucumber&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cucumber features&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will execute the following cucumber feature:&lt;br /&gt;
'''features/example.feature'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Feature: Search In order to use Google users must be able to search for content &lt;br /&gt;
Scenario: Search for a term&lt;br /&gt;
Given I have entered &amp;quot;watir&amp;quot; into the query&lt;br /&gt;
When I click &amp;quot;search&amp;quot;&lt;br /&gt;
Then I should see some results&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''features/step_definitions/example_steps.rb'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require &amp;quot;watir-webdriver&amp;quot;&lt;br /&gt;
require &amp;quot;rspec/expectations&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
Given /^I have entered &amp;quot;([^&amp;quot;]*)&amp;quot; into the query$/ do |term|&lt;br /&gt;
  @browser ||= Watir::Browser.new :firefox&lt;br /&gt;
  @browser.goto &amp;quot;google.com&amp;quot;&lt;br /&gt;
  @browser.text_field(:name =&amp;gt; &amp;quot;q&amp;quot;).set term&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
When /^I click &amp;quot;([^&amp;quot;]*)&amp;quot;$/ do |button_name|&lt;br /&gt;
  @browser.button.click&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
Then /^I should see some results$/ do&lt;br /&gt;
  @browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).wait_until_present&lt;br /&gt;
  @browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).should exist &lt;br /&gt;
  @browser.close&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Comparison with Other Tools =&lt;br /&gt;
&lt;br /&gt;
There are some other framworks will do similar work as watir does, for example, [http://en.wikipedia.org/wiki/Cucumber_(software) Cucmber], [http://en.wikipedia.org/wiki/Capybara Capybara] and RSpec[http://en.wikipedia.org/wiki/RSpec RSpec]. But in comparison, they have different features and are usually used in conjecture.&lt;br /&gt;
&lt;br /&gt;
In software engineering, behavior-driven development (abbreviated BDD) is a software development process based on test-driven development (TDD). &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Behavior-driven_development&amp;lt;/ref&amp;gt; It's very important in software testing. The relationship between Watir and Cucmmber is usually designing a framework to test cucumber scenarios using Watir tool. [http://qastrategies.blogspot.com/2012/06/bdd-framework-to-test-web-application.html See Example]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The detailed characteristics and relationships are:&lt;br /&gt;
&lt;br /&gt;
*Watir&amp;lt;br&amp;gt;&lt;br /&gt;
Put simply, Watir is a browser driver. Lightweight and simple to use, Watir excels at automating modern browsers. Built in Ruby, it does not have an IDE of it's own, but it works well with other testing frameworks and solutions in the Ruby ecosystem. &lt;br /&gt;
&lt;br /&gt;
*Cucumber&amp;lt;br&amp;gt;&lt;br /&gt;
Cucumber lets software development teams describe how software should behave in plain english, it is designed to allow you to execute automated integration tests. It is a tool for implementing Behavior Driven Development.It can work nicely in conjecture with Capybara and RSpec.&lt;br /&gt;
&lt;br /&gt;
*Capybara&amp;lt;br&amp;gt;&lt;br /&gt;
Capybara is a library written in the Ruby programming language which makes it easy to simulate how a user interacts with your application. It can talk with many different drivers which execute tests through the same clean and simple interface, including Selenium, Webkit or pure Ruby drivers.&amp;lt;ref&amp;gt;http://jnicklas.github.io/capybara/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*RSpec&amp;lt;br&amp;gt;&lt;br /&gt;
RSpec helps you do the TDD(Test-Driven Development) part of the whole development (combines Test-Driven Development, Domain Driven Design, and Acceptance Test-Driven Planning), focusing on the documentation and design aspects of TDD. A combination of RSpec and Watir makes really readable test scripts.&amp;lt;ref&amp;gt;http://www.ibmwcs.com/2010/08/testing-with-rspec-cucumber-selenium.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:''Here's an video tutorial from Youtube introducing how to test with Ruby Cucumber RSpec Capybara Watir WebDriver Testing.[https://www.youtube.com/watch?v=jPH5Eiz32N0 More Info]''&lt;br /&gt;
&lt;br /&gt;
= Pros and Cons =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* No external server needed to run a test.  Just run &amp;quot;ruby test.rb&amp;quot; and it goes, this simplifies any scripts used to execute the tests through continuous integration servers like [http://en.wikipedia.org/wiki/Hudson_%28software%29 Hudson] or [http://en.wikipedia.org/wiki/Bamboo_%28software%29 Bamboo] or whatever.&amp;lt;ref&amp;gt;http://www.quora.com/What-are-the-pros-and-cons-of-different-front-end-web-testing-frameworks-such-as-Selenium-or-Watir&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Rich API, which is pretty easy and once the users get the basics they can just guess how to write the code without needed alot of documentation.&lt;br /&gt;
&lt;br /&gt;
* Tests can often be run through alternative tools, such as watir-webdriver, [http://watirmelon.com/2009/08/31/celerity-first-impressions/ celerity] and more, which are all more-or-less support the watir API.  This means that if the users write their framework carefully, they would not be locked into watir.&lt;br /&gt;
&lt;br /&gt;
* Watir-webdriver does work in both ruby and [http://en.wikipedia.org/wiki/JRuby jruby].&lt;br /&gt;
&lt;br /&gt;
* Don't have much issue dealing with [http://en.wikipedia.org/wiki/Ajax_%28programming%29 AJAX], watir autumatically knows when the page finished loading.&lt;br /&gt;
&lt;br /&gt;
* Typically runs faster than a comparable selenium test.&lt;br /&gt;
&lt;br /&gt;
* Better support for headless browsers, like Celerity.&lt;br /&gt;
&lt;br /&gt;
* Multi browser (&amp;amp; OS) support&lt;br /&gt;
&lt;br /&gt;
*Provides an &amp;quot;attach&amp;quot; method which lets users programmatic access both the original domain window and the linked domain window from the same test.&amp;lt;ref&amp;gt;http://onestopqa.blogspot.com/2012/09/pros-cons-of-watir-selenium-or-sahi.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Each browser's implementation is a little bit different, and the driver for each browser is written independently.  This means inconsistent test results between browsers, which could be an issue sometime.&lt;br /&gt;
&lt;br /&gt;
* API is ruby only, users have to learn Ruby first.&lt;br /&gt;
&lt;br /&gt;
* Doesn't seem to be as widely used as selenium, a lil bit harder to find pretty good engineers.&lt;br /&gt;
&lt;br /&gt;
* The task of porting Watir to a new browser isn’t an easy one, and the task of keeping every port of Watir in sync, with the same API, is difficult. &amp;lt;ref&amp;gt;http://watirmelon.com/2010/04/10/watir-selenium-webdriver/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Further Reading =&lt;br /&gt;
1. An virtual experience on Watir, see how watir works in your eyes. https://www.youtube.com/watch?v=FxQXQGpImAo&lt;br /&gt;
&lt;br /&gt;
2. Get started with watir in one minute. https://testwisely.com/testwise/docs/tutorials/watir&lt;br /&gt;
&lt;br /&gt;
3. Tutorial on Ruby Cucumber RSpec Capybara Watir WebDriver Testing, know how they work here: https://www.youtube.com/watch?v=jPH5Eiz32N0&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_19_mx&amp;diff=88720</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 19 mx</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_19_mx&amp;diff=88720"/>
		<updated>2014-09-26T03:41:41Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Comparison with Other Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Watir'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= Introduction=&lt;br /&gt;
Watir('''W'''eb '''A'''pplication '''T'''est '''i'''n '''R'''uby), pronounced as 'water', is an automated test toolkit which uses the Ruby scripting language for automated tests to be developed and run against a web browser. &amp;lt;ref&amp;gt;http://www.httpwatch.com/rubywatir/&amp;lt;/ref&amp;gt;It allows users to write tests that are easy to read and maintain, also simple and flexible. Watir was first developed by Bret Pettichord and Paul Rogers. It drives [http://en.wikipedia.org/wiki/Internet_Explorer Internet Explorer], [http://en.wikipedia.org/wiki/FirefoxMozilla Firefox|Firefox], [http://en.wikipedia.org/wiki/Chrome Google Chrome|Chrome], [http://en.wikipedia.org/wiki/Opera Opera (web browser)|Opera] and [http://en.wikipedia.org/wiki/Safari Safari (web browser)|Safari], and is available as a [http://en.wikipedia.org/wiki/RubyGems RubyGems] gem, &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Watir&amp;lt;/ref&amp;gt; which is a free, open source Ruby library that  can test web applications written in any language&amp;lt;ref&amp;gt;https://rubygems.org/gems/watir-classic&amp;lt;/ref&amp;gt; and drive a web browser the same way an end user would. It clicks links, fills in forms, presses buttons. Watir can also check results, such as whether expected text appears on the page or not, or whether a control is enabled. &amp;lt;ref&amp;gt;http://watir.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watir project consists of several smaller projects, including watir-classic, watir-webdriver and watirspec.&lt;br /&gt;
&lt;br /&gt;
== Watir-classic ==&lt;br /&gt;
Watir-classic is a Watir driver for automating only Internet Explorer on Windows.&amp;lt;ref&amp;gt;https://github.com/watir/watir-classic&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watir-classic is able to work on Internet Explorer 8, 9 and 10&amp;lt;ref&amp;gt;http://rubydoc.info/gems/watir-classic/3.7.0/frames&amp;lt;/ref&amp;gt;, and is supported by Ruby 1.8.7, 1.9.3 and 2.0.0.&lt;br /&gt;
&lt;br /&gt;
== Watir-webdriver==&lt;br /&gt;
Watie-webdriver is an implementation built on WebDriver's Ruby bindings. It supports not only the Internet Explorer, but also namely Firefox, Chrome and Safari,&amp;lt;ref&amp;gt;https://github.com/watir/watir-webdriver&amp;lt;/ref&amp;gt;which is a main difference compared with watir-classic.&lt;br /&gt;
&lt;br /&gt;
== Watirspec ==&lt;br /&gt;
Watirspec combines best features of Watir [http://en.wikipedia.org/wiki/RSpec RSpec] and Ruby for browser-based functional testing.&amp;lt;ref&amp;gt;https://rubygems.org/gems/watirspec&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Just like RubySpec is for Ruby, Watirspec is the executable specification of the Watir API.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Web Application Testing ==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Web_testing Web testing] is a software testing that focuses on web applications. Complete testing of a web-based system before going live can help address issues before the system is revealed to the public. Issues such as the basic functionality of the site, the security of the web application, its accessibility to handicapped users and fully able users, as well as readiness for expected traffic and number of users and the ability to survive a massive spike in user traffic, both of which are related to load testing.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_testing&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Web Testing Checklist:'''&amp;lt;ref&amp;gt;http://www.softwaretestinghelp.com/web-application-testing/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Functionality Testing： Test for all the links in web pages, database connection, forms used in the web pages for submitting or getting information from user, as well as Cookie testing.&lt;br /&gt;
&lt;br /&gt;
*Usability Testing:  Test for navigation, contents and other user information for user help.&lt;br /&gt;
&lt;br /&gt;
*Interface Testing: Test for main interfaces, such as Web server, application server interface and Database server interface. Check whether all the interactions between these servers are executed properly or not. &lt;br /&gt;
&lt;br /&gt;
*Compatibility Testing: Test for the compatibility of your web site, which is a very critical testing aspect, including Browser compatibility, Operating system compatibility, Mobile browsing and Printing options compatibility. &lt;br /&gt;
&lt;br /&gt;
*Performance Testing: Test for web application performance, which should include both Web Load Testing and Web Stress Testing.&lt;br /&gt;
&lt;br /&gt;
== Ruby ==&lt;br /&gt;
Ruby is a dynamic, designed and developed in the mid-1990s by Yukihiro &amp;quot;Matz&amp;quot; Matsumoto in Japan, is a reflective, object-oriented, general-purpose programming language. Like other programming languages, Ruby gives you the power to connect to databases, read data files and spreadsheets, export XML, and structure your code as reusable libraries. Unlike other programming languages, Ruby is concise and often a joy to read.&lt;br /&gt;
&lt;br /&gt;
According to its authors, Ruby was influenced by [http://en.wikipedia.org/wiki/Perl Perl], [http://en.wikipedia.org/wiki/Smalltalk Smalltalk], [http://en.wikipedia.org/wiki/Eiffel Eiffel], [http://en.wikipedia.org/wiki/Ada Ada], and [http://en.wikipedia.org/wiki/Lisp Lisp]. It supports multiple programming paradigms, including functional, object-oriented, and imperative. It also has a dynamic type system and automatic memory management.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Ruby_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Several Features：'''&amp;lt;ref&amp;gt;http://www.starkdigital.net/ruby-programming&amp;lt;/ref&amp;gt;&lt;br /&gt;
*Thoroughly object-oriented with inheritance, mixins and metaclasses&lt;br /&gt;
*Dynamic typing and duck typing&lt;br /&gt;
*Large standard library, including modules for [http://en.wikipedia.org/wiki/YAML YAML], [http://en.wikipedia.org/wiki/JSON JSON], [http://en.wikipedia.org/wiki/XML XML], [http://en.wikipedia.org/wiki/CGI CGI], [http://en.wikipedia.org/wiki/OpenSSL OpenSSL], [http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP], [http://en.wikipedia.org/wiki/File_Transfer_Protocol FTP], [http://en.wikipedia.org/wiki/RSS RSS], [http://en.wikipedia.org/wiki/Curse_(disambiguation) curses], [http://en.wikipedia.org/wiki/Zlib zlib], and [http://en.wikipedia.org/wiki/Tk_(software) Tk] &lt;br /&gt;
*Dynamic reflection and alteration of objects to facilitate [http://en.wikipedia.org/wiki/Metaprogramming metaprogramming]&lt;br /&gt;
[http://www.starkdigital.net/ruby-programming See More Features.]&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
== Install Ruby on Linux ==&lt;br /&gt;
Use your relevant package manager to update or install Ruby with the following at a terminal window:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install ruby  # for Ubuntu / Debian users&lt;br /&gt;
 sudo yum install ruby      # for Red Hat / Fedora users&lt;br /&gt;
== Update RubyGems on Linux ==&lt;br /&gt;
Make sure you have the latest rubygems version 1.3.7 or above installed. Use your relevant package manager to install the latest version with the following at a terminal window:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install rubygems # for Ubuntu / Debian users&lt;br /&gt;
 sudo yum install rubygems  # for Red Hat / Fedora users&lt;br /&gt;
&lt;br /&gt;
== Install a HTML Inspector ==&lt;br /&gt;
To use Watir effectively, you’ll need to be able to browse through the structure of your application’s HTML pages. These tools help you do that.&lt;br /&gt;
&lt;br /&gt;
*On Firefox, use Firebug&lt;br /&gt;
*On Internet Explorer, use the IE Developer Toolbar&lt;br /&gt;
&lt;br /&gt;
== Installing or Updating RubyGems ==&lt;br /&gt;
While updating RubyGems, or installing any of the gems, you can use the following additional flags:&lt;br /&gt;
&lt;br /&gt;
 --no-rdoc --no-ri&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 gem update --system --no-rdoc --no-ri&lt;br /&gt;
 gem install watir --no-rdoc --no-ri&lt;br /&gt;
&lt;br /&gt;
= Make It Run =&lt;br /&gt;
After everything required installed, we can run the watir tests in several ways. Below three ways are listed, and each of them is designed to work on the live Watir demo form: http://bit.ly/watir-example.&lt;br /&gt;
&lt;br /&gt;
== Run in .rb ==&lt;br /&gt;
First of all, let's see how to conduct the test in ruby on rails. The example was based on the example listed on a google form, it demonstrated watir's functionality such as entering text into a text field, clicking a button like a user does, checking to see if a page contains text and so on. Below is the step-by-step command to finish the test in .rb file, which means you can simply save these commands in a .rb file and run it with ruby.&lt;br /&gt;
&lt;br /&gt;
Example 1: &amp;lt;ref&amp;gt;http://watir.com/examples/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Require Ruby Watir gem first via the -rubygems command line option, or by using the RUBYOPT environment variable. You can also require it manually in your script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rubygems'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Including Watir gem to drive Internet Explorer on Windows&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'watir'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Including Watir-WebDriver gem to drive Firefox/Chrome on Windows/Mac/Linux&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'watir-webdriver'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Starting a new browser &amp;amp; and going to our site&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser = Watir::Browser.new&lt;br /&gt;
browser.goto 'http://bit.ly/watir-example'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting a text field&lt;br /&gt;
&lt;br /&gt;
[[File:Text-field.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.text_field(:name =&amp;gt; 'entry.0.single').set 'Watir'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting a multi-line text box&lt;br /&gt;
&lt;br /&gt;
[[File:text-box1.png|text-box1.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.text_field(:name =&amp;gt; 'entry.1.single').set &amp;quot;I come here from Australia. \n The weather is great here.&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting and clearing a radio button&lt;br /&gt;
&lt;br /&gt;
[[File:3.radio-buttons1.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.radio(:value =&amp;gt; 'Watir').set&lt;br /&gt;
browser.radio(:value =&amp;gt; 'Watir').clear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting and clearing check boxes&lt;br /&gt;
&lt;br /&gt;
[[File:4.checkboxes.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Ruby').set&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Python').set&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Python').clear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Clearing, getting and selecting selection list values&lt;br /&gt;
&lt;br /&gt;
[[File:5.selection-list.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.select_list(:name =&amp;gt; 'entry.6.single').clear&lt;br /&gt;
puts browser.select_list(:name =&amp;gt; 'entry.6.single').options&lt;br /&gt;
browser.select_list(:name =&amp;gt; 'entry.6.single').select 'Chrome'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Clicking a button&lt;br /&gt;
&lt;br /&gt;
[[File:6.button.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.button(:name =&amp;gt; 'submit').click&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Checking for text in a page&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
puts browser.text.include? 'Your response has been recorded.'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Checking the title of a page&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
puts browser.title == 'Thanks!'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Run in Rspec ==&lt;br /&gt;
RSpec is a Behaviour-Driven Development tool for Ruby programmers. BDD is an approach to software development that combines Test-Driven Development, Domain Driven Design, and Acceptance Test-Driven Planning. RSpec helps you do the TDD part of that equation, focusing on the documentation and design aspects of TDD. The following code demonstrates using Watir and a basic RSpec example.[http://rspec.info/ More Info.]&lt;br /&gt;
&lt;br /&gt;
Example 2: &amp;lt;ref&amp;gt;http://watir.com/frameworks/&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
1. Install&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install rspec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Example&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec test_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will execute the following rspec example:&lt;br /&gt;
&lt;br /&gt;
'''test_spec.rb'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require &amp;quot;rubygems&amp;quot;&lt;br /&gt;
require &amp;quot;rspec&amp;quot;&lt;br /&gt;
require &amp;quot;watir-webdriver&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
describe &amp;quot;google.com&amp;quot; do&lt;br /&gt;
  let(:browser) { @browser ||= Watir::Browser.new :firefox } &lt;br /&gt;
  before { browser.goto &amp;quot;http://google.com&amp;quot; } &lt;br /&gt;
  after { browser.close }&lt;br /&gt;
 &lt;br /&gt;
  it &amp;quot;should search for watir&amp;quot; do&lt;br /&gt;
    browser.text_field(:name =&amp;gt; &amp;quot;q&amp;quot;).set &amp;quot;watir&amp;quot;&lt;br /&gt;
    browser.button.click &lt;br /&gt;
    browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).wait_until_present&lt;br /&gt;
    browser.title.should == &amp;quot;watir - Google Search&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Run in Cucumber ==&lt;br /&gt;
Cucumber lets software development teams describe how software should behave in plain text. The text is written in a business-readable domain-specific language and serves as documentation, automated tests and development-aid – all rolled into one format.[http://cukes.info/ More Info.]&lt;br /&gt;
&lt;br /&gt;
Example 3: &amp;lt;ref&amp;gt;http://watir.com/frameworks/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Install&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install cucumber&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cucumber features&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will execute the following cucumber feature:&lt;br /&gt;
'''features/example.feature'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Feature: Search In order to use Google users must be able to search for content &lt;br /&gt;
Scenario: Search for a term&lt;br /&gt;
Given I have entered &amp;quot;watir&amp;quot; into the query&lt;br /&gt;
When I click &amp;quot;search&amp;quot;&lt;br /&gt;
Then I should see some results&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''features/step_definitions/example_steps.rb'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require &amp;quot;watir-webdriver&amp;quot;&lt;br /&gt;
require &amp;quot;rspec/expectations&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
Given /^I have entered &amp;quot;([^&amp;quot;]*)&amp;quot; into the query$/ do |term|&lt;br /&gt;
  @browser ||= Watir::Browser.new :firefox&lt;br /&gt;
  @browser.goto &amp;quot;google.com&amp;quot;&lt;br /&gt;
  @browser.text_field(:name =&amp;gt; &amp;quot;q&amp;quot;).set term&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
When /^I click &amp;quot;([^&amp;quot;]*)&amp;quot;$/ do |button_name|&lt;br /&gt;
  @browser.button.click&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
Then /^I should see some results$/ do&lt;br /&gt;
  @browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).wait_until_present&lt;br /&gt;
  @browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).should exist &lt;br /&gt;
  @browser.close&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Comparison with Other Tools =&lt;br /&gt;
&lt;br /&gt;
There are some other framworks will do similar work as watir does, for example, [http://en.wikipedia.org/wiki/Cucumber_(software) Cucmber], [http://en.wikipedia.org/wiki/Capybara Capybara] and RSpec[http://en.wikipedia.org/wiki/RSpec RSpec]. But in comparison, they have different features and are usually used in conjecture.&lt;br /&gt;
&lt;br /&gt;
In software engineering, behavior-driven development (abbreviated BDD) is a software development process based on test-driven development (TDD). &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Behavior-driven_development&amp;lt;/ref&amp;gt; It's very important in software testing. The relationship between Watir and Cucmmber is usually designing a framework to test cucumber scenarios using Watir tool. [http://qastrategies.blogspot.com/2012/06/bdd-framework-to-test-web-application.html See Example]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The detailed characteristics and relationships are:&lt;br /&gt;
&lt;br /&gt;
*Watir&amp;lt;br&amp;gt;&lt;br /&gt;
Put simply, Watir is a browser driver. Lightweight and simple to use, Watir excels at automating modern browsers. Built in Ruby, it does not have an IDE of it's own, but it works well with other testing frameworks and solutions in the Ruby ecosystem. &lt;br /&gt;
&lt;br /&gt;
*Cucumber&amp;lt;br&amp;gt;&lt;br /&gt;
Cucumber lets software development teams describe how software should behave in plain english, it is designed to allow you to execute automated integration tests. It is a tool for implementing Behavior Driven Development.It can work nicely in conjecture with Capybara and RSpec.&lt;br /&gt;
&lt;br /&gt;
*Capybara&amp;lt;br&amp;gt;&lt;br /&gt;
Capybara is a library written in the Ruby programming language which makes it easy to simulate how a user interacts with your application. It can talk with many different drivers which execute tests through the same clean and simple interface, including Selenium, Webkit or pure Ruby drivers.&amp;lt;ref&amp;gt;http://jnicklas.github.io/capybara/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*RSpec&amp;lt;br&amp;gt;&lt;br /&gt;
RSpec helps you do the TDD(Test-Driven Development) part of the whole development (combines Test-Driven Development, Domain Driven Design, and Acceptance Test-Driven Planning), focusing on the documentation and design aspects of TDD. A combination of RSpec and Watir makes really readable test scripts.&amp;lt;ref&amp;gt;http://www.ibmwcs.com/2010/08/testing-with-rspec-cucumber-selenium.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:''Here's an video tutorial from Youtube introducing how to test with Ruby Cucumber RSpec Capybara Watir WebDriver Testing.[https://www.youtube.com/watch?v=jPH5Eiz32N0 More Info]''&lt;br /&gt;
&lt;br /&gt;
= Pros and Cons =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* No external server needed to run a test.  Just run &amp;quot;ruby test.rb&amp;quot; and it goes, this simplifies any scripts used to execute the tests through continuous integration servers like [http://en.wikipedia.org/wiki/Hudson_%28software%29 Hudson] or [http://en.wikipedia.org/wiki/Bamboo_%28software%29 Bamboo] or whatever.&amp;lt;ref&amp;gt;http://www.quora.com/What-are-the-pros-and-cons-of-different-front-end-web-testing-frameworks-such-as-Selenium-or-Watir&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Rich API, which is pretty easy and once the users get the basics they can just guess how to write the code without needed alot of documentation.&lt;br /&gt;
&lt;br /&gt;
* Tests can often be run through alternative tools, such as watir-webdriver, [http://watirmelon.com/2009/08/31/celerity-first-impressions/ celerity] and more, which are all more-or-less support the watir API.  This means that if the users write their framework carefully, they would not be locked into watir.&lt;br /&gt;
&lt;br /&gt;
* Watir-webdriver does work in both ruby and [http://en.wikipedia.org/wiki/JRuby jruby].&lt;br /&gt;
&lt;br /&gt;
* Don't have much issue dealing with [http://en.wikipedia.org/wiki/Ajax_%28programming%29 AJAX], watir autumatically knows when the page finished loading.&lt;br /&gt;
&lt;br /&gt;
* Typically runs faster than a comparable selenium test.&lt;br /&gt;
&lt;br /&gt;
* Better support for headless browsers, like Celerity.&lt;br /&gt;
&lt;br /&gt;
* Multi browser (&amp;amp; OS) support&lt;br /&gt;
&lt;br /&gt;
*Provides an &amp;quot;attach&amp;quot; method which lets users programmatic access both the original domain window and the linked domain window from the same test.&amp;lt;ref&amp;gt;http://onestopqa.blogspot.com/2012/09/pros-cons-of-watir-selenium-or-sahi.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Each browser's implementation is a little bit different, and the driver for each browser is written independently.  This means inconsistent test results between browsers, which could be an issue sometime.&lt;br /&gt;
&lt;br /&gt;
* API is ruby only, users have to learn Ruby first.&lt;br /&gt;
&lt;br /&gt;
* Doesn't seem to be as widely used as selenium, a lil bit harder to find pretty good engineers.&lt;br /&gt;
&lt;br /&gt;
* The task of porting Watir to a new browser isn’t an easy one, and the task of keeping every port of Watir in sync, with the same API, is difficult. &amp;lt;ref&amp;gt;http://watirmelon.com/2010/04/10/watir-selenium-webdriver/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Further Reading =&lt;br /&gt;
1. An virtual experience on Watir, see how watir works in your eyes. https://www.youtube.com/watch?v=FxQXQGpImAo&lt;br /&gt;
&lt;br /&gt;
2. Get started with watir in one minute. https://testwisely.com/testwise/docs/tutorials/watir&lt;br /&gt;
&lt;br /&gt;
3. Tutorial on Ruby Cucumber RSpec Capybara Watir WebDriver Testing, know how they work here: https://www.youtube.com/watch?v=jPH5Eiz32N0&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_19_mx&amp;diff=88719</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 19 mx</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_19_mx&amp;diff=88719"/>
		<updated>2014-09-26T03:41:24Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Comparison with Other Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Watir'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= Introduction=&lt;br /&gt;
Watir('''W'''eb '''A'''pplication '''T'''est '''i'''n '''R'''uby), pronounced as 'water', is an automated test toolkit which uses the Ruby scripting language for automated tests to be developed and run against a web browser. &amp;lt;ref&amp;gt;http://www.httpwatch.com/rubywatir/&amp;lt;/ref&amp;gt;It allows users to write tests that are easy to read and maintain, also simple and flexible. Watir was first developed by Bret Pettichord and Paul Rogers. It drives [http://en.wikipedia.org/wiki/Internet_Explorer Internet Explorer], [http://en.wikipedia.org/wiki/FirefoxMozilla Firefox|Firefox], [http://en.wikipedia.org/wiki/Chrome Google Chrome|Chrome], [http://en.wikipedia.org/wiki/Opera Opera (web browser)|Opera] and [http://en.wikipedia.org/wiki/Safari Safari (web browser)|Safari], and is available as a [http://en.wikipedia.org/wiki/RubyGems RubyGems] gem, &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Watir&amp;lt;/ref&amp;gt; which is a free, open source Ruby library that  can test web applications written in any language&amp;lt;ref&amp;gt;https://rubygems.org/gems/watir-classic&amp;lt;/ref&amp;gt; and drive a web browser the same way an end user would. It clicks links, fills in forms, presses buttons. Watir can also check results, such as whether expected text appears on the page or not, or whether a control is enabled. &amp;lt;ref&amp;gt;http://watir.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watir project consists of several smaller projects, including watir-classic, watir-webdriver and watirspec.&lt;br /&gt;
&lt;br /&gt;
== Watir-classic ==&lt;br /&gt;
Watir-classic is a Watir driver for automating only Internet Explorer on Windows.&amp;lt;ref&amp;gt;https://github.com/watir/watir-classic&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watir-classic is able to work on Internet Explorer 8, 9 and 10&amp;lt;ref&amp;gt;http://rubydoc.info/gems/watir-classic/3.7.0/frames&amp;lt;/ref&amp;gt;, and is supported by Ruby 1.8.7, 1.9.3 and 2.0.0.&lt;br /&gt;
&lt;br /&gt;
== Watir-webdriver==&lt;br /&gt;
Watie-webdriver is an implementation built on WebDriver's Ruby bindings. It supports not only the Internet Explorer, but also namely Firefox, Chrome and Safari,&amp;lt;ref&amp;gt;https://github.com/watir/watir-webdriver&amp;lt;/ref&amp;gt;which is a main difference compared with watir-classic.&lt;br /&gt;
&lt;br /&gt;
== Watirspec ==&lt;br /&gt;
Watirspec combines best features of Watir [http://en.wikipedia.org/wiki/RSpec RSpec] and Ruby for browser-based functional testing.&amp;lt;ref&amp;gt;https://rubygems.org/gems/watirspec&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Just like RubySpec is for Ruby, Watirspec is the executable specification of the Watir API.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Web Application Testing ==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Web_testing Web testing] is a software testing that focuses on web applications. Complete testing of a web-based system before going live can help address issues before the system is revealed to the public. Issues such as the basic functionality of the site, the security of the web application, its accessibility to handicapped users and fully able users, as well as readiness for expected traffic and number of users and the ability to survive a massive spike in user traffic, both of which are related to load testing.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_testing&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Web Testing Checklist:'''&amp;lt;ref&amp;gt;http://www.softwaretestinghelp.com/web-application-testing/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Functionality Testing： Test for all the links in web pages, database connection, forms used in the web pages for submitting or getting information from user, as well as Cookie testing.&lt;br /&gt;
&lt;br /&gt;
*Usability Testing:  Test for navigation, contents and other user information for user help.&lt;br /&gt;
&lt;br /&gt;
*Interface Testing: Test for main interfaces, such as Web server, application server interface and Database server interface. Check whether all the interactions between these servers are executed properly or not. &lt;br /&gt;
&lt;br /&gt;
*Compatibility Testing: Test for the compatibility of your web site, which is a very critical testing aspect, including Browser compatibility, Operating system compatibility, Mobile browsing and Printing options compatibility. &lt;br /&gt;
&lt;br /&gt;
*Performance Testing: Test for web application performance, which should include both Web Load Testing and Web Stress Testing.&lt;br /&gt;
&lt;br /&gt;
== Ruby ==&lt;br /&gt;
Ruby is a dynamic, designed and developed in the mid-1990s by Yukihiro &amp;quot;Matz&amp;quot; Matsumoto in Japan, is a reflective, object-oriented, general-purpose programming language. Like other programming languages, Ruby gives you the power to connect to databases, read data files and spreadsheets, export XML, and structure your code as reusable libraries. Unlike other programming languages, Ruby is concise and often a joy to read.&lt;br /&gt;
&lt;br /&gt;
According to its authors, Ruby was influenced by [http://en.wikipedia.org/wiki/Perl Perl], [http://en.wikipedia.org/wiki/Smalltalk Smalltalk], [http://en.wikipedia.org/wiki/Eiffel Eiffel], [http://en.wikipedia.org/wiki/Ada Ada], and [http://en.wikipedia.org/wiki/Lisp Lisp]. It supports multiple programming paradigms, including functional, object-oriented, and imperative. It also has a dynamic type system and automatic memory management.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Ruby_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Several Features：'''&amp;lt;ref&amp;gt;http://www.starkdigital.net/ruby-programming&amp;lt;/ref&amp;gt;&lt;br /&gt;
*Thoroughly object-oriented with inheritance, mixins and metaclasses&lt;br /&gt;
*Dynamic typing and duck typing&lt;br /&gt;
*Large standard library, including modules for [http://en.wikipedia.org/wiki/YAML YAML], [http://en.wikipedia.org/wiki/JSON JSON], [http://en.wikipedia.org/wiki/XML XML], [http://en.wikipedia.org/wiki/CGI CGI], [http://en.wikipedia.org/wiki/OpenSSL OpenSSL], [http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP], [http://en.wikipedia.org/wiki/File_Transfer_Protocol FTP], [http://en.wikipedia.org/wiki/RSS RSS], [http://en.wikipedia.org/wiki/Curse_(disambiguation) curses], [http://en.wikipedia.org/wiki/Zlib zlib], and [http://en.wikipedia.org/wiki/Tk_(software) Tk] &lt;br /&gt;
*Dynamic reflection and alteration of objects to facilitate [http://en.wikipedia.org/wiki/Metaprogramming metaprogramming]&lt;br /&gt;
[http://www.starkdigital.net/ruby-programming See More Features.]&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
== Install Ruby on Linux ==&lt;br /&gt;
Use your relevant package manager to update or install Ruby with the following at a terminal window:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install ruby  # for Ubuntu / Debian users&lt;br /&gt;
 sudo yum install ruby      # for Red Hat / Fedora users&lt;br /&gt;
== Update RubyGems on Linux ==&lt;br /&gt;
Make sure you have the latest rubygems version 1.3.7 or above installed. Use your relevant package manager to install the latest version with the following at a terminal window:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install rubygems # for Ubuntu / Debian users&lt;br /&gt;
 sudo yum install rubygems  # for Red Hat / Fedora users&lt;br /&gt;
&lt;br /&gt;
== Install a HTML Inspector ==&lt;br /&gt;
To use Watir effectively, you’ll need to be able to browse through the structure of your application’s HTML pages. These tools help you do that.&lt;br /&gt;
&lt;br /&gt;
*On Firefox, use Firebug&lt;br /&gt;
*On Internet Explorer, use the IE Developer Toolbar&lt;br /&gt;
&lt;br /&gt;
== Installing or Updating RubyGems ==&lt;br /&gt;
While updating RubyGems, or installing any of the gems, you can use the following additional flags:&lt;br /&gt;
&lt;br /&gt;
 --no-rdoc --no-ri&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 gem update --system --no-rdoc --no-ri&lt;br /&gt;
 gem install watir --no-rdoc --no-ri&lt;br /&gt;
&lt;br /&gt;
= Make It Run =&lt;br /&gt;
After everything required installed, we can run the watir tests in several ways. Below three ways are listed, and each of them is designed to work on the live Watir demo form: http://bit.ly/watir-example.&lt;br /&gt;
&lt;br /&gt;
== Run in .rb ==&lt;br /&gt;
First of all, let's see how to conduct the test in ruby on rails. The example was based on the example listed on a google form, it demonstrated watir's functionality such as entering text into a text field, clicking a button like a user does, checking to see if a page contains text and so on. Below is the step-by-step command to finish the test in .rb file, which means you can simply save these commands in a .rb file and run it with ruby.&lt;br /&gt;
&lt;br /&gt;
Example 1: &amp;lt;ref&amp;gt;http://watir.com/examples/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Require Ruby Watir gem first via the -rubygems command line option, or by using the RUBYOPT environment variable. You can also require it manually in your script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rubygems'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Including Watir gem to drive Internet Explorer on Windows&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'watir'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Including Watir-WebDriver gem to drive Firefox/Chrome on Windows/Mac/Linux&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'watir-webdriver'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Starting a new browser &amp;amp; and going to our site&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser = Watir::Browser.new&lt;br /&gt;
browser.goto 'http://bit.ly/watir-example'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting a text field&lt;br /&gt;
&lt;br /&gt;
[[File:Text-field.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.text_field(:name =&amp;gt; 'entry.0.single').set 'Watir'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting a multi-line text box&lt;br /&gt;
&lt;br /&gt;
[[File:text-box1.png|text-box1.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.text_field(:name =&amp;gt; 'entry.1.single').set &amp;quot;I come here from Australia. \n The weather is great here.&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting and clearing a radio button&lt;br /&gt;
&lt;br /&gt;
[[File:3.radio-buttons1.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.radio(:value =&amp;gt; 'Watir').set&lt;br /&gt;
browser.radio(:value =&amp;gt; 'Watir').clear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting and clearing check boxes&lt;br /&gt;
&lt;br /&gt;
[[File:4.checkboxes.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Ruby').set&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Python').set&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Python').clear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Clearing, getting and selecting selection list values&lt;br /&gt;
&lt;br /&gt;
[[File:5.selection-list.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.select_list(:name =&amp;gt; 'entry.6.single').clear&lt;br /&gt;
puts browser.select_list(:name =&amp;gt; 'entry.6.single').options&lt;br /&gt;
browser.select_list(:name =&amp;gt; 'entry.6.single').select 'Chrome'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Clicking a button&lt;br /&gt;
&lt;br /&gt;
[[File:6.button.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.button(:name =&amp;gt; 'submit').click&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Checking for text in a page&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
puts browser.text.include? 'Your response has been recorded.'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Checking the title of a page&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
puts browser.title == 'Thanks!'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Run in Rspec ==&lt;br /&gt;
RSpec is a Behaviour-Driven Development tool for Ruby programmers. BDD is an approach to software development that combines Test-Driven Development, Domain Driven Design, and Acceptance Test-Driven Planning. RSpec helps you do the TDD part of that equation, focusing on the documentation and design aspects of TDD. The following code demonstrates using Watir and a basic RSpec example.[http://rspec.info/ More Info.]&lt;br /&gt;
&lt;br /&gt;
Example 2: &amp;lt;ref&amp;gt;http://watir.com/frameworks/&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
1. Install&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install rspec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Example&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec test_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will execute the following rspec example:&lt;br /&gt;
&lt;br /&gt;
'''test_spec.rb'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require &amp;quot;rubygems&amp;quot;&lt;br /&gt;
require &amp;quot;rspec&amp;quot;&lt;br /&gt;
require &amp;quot;watir-webdriver&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
describe &amp;quot;google.com&amp;quot; do&lt;br /&gt;
  let(:browser) { @browser ||= Watir::Browser.new :firefox } &lt;br /&gt;
  before { browser.goto &amp;quot;http://google.com&amp;quot; } &lt;br /&gt;
  after { browser.close }&lt;br /&gt;
 &lt;br /&gt;
  it &amp;quot;should search for watir&amp;quot; do&lt;br /&gt;
    browser.text_field(:name =&amp;gt; &amp;quot;q&amp;quot;).set &amp;quot;watir&amp;quot;&lt;br /&gt;
    browser.button.click &lt;br /&gt;
    browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).wait_until_present&lt;br /&gt;
    browser.title.should == &amp;quot;watir - Google Search&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Run in Cucumber ==&lt;br /&gt;
Cucumber lets software development teams describe how software should behave in plain text. The text is written in a business-readable domain-specific language and serves as documentation, automated tests and development-aid – all rolled into one format.[http://cukes.info/ More Info.]&lt;br /&gt;
&lt;br /&gt;
Example 3: &amp;lt;ref&amp;gt;http://watir.com/frameworks/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Install&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install cucumber&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cucumber features&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will execute the following cucumber feature:&lt;br /&gt;
'''features/example.feature'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Feature: Search In order to use Google users must be able to search for content &lt;br /&gt;
Scenario: Search for a term&lt;br /&gt;
Given I have entered &amp;quot;watir&amp;quot; into the query&lt;br /&gt;
When I click &amp;quot;search&amp;quot;&lt;br /&gt;
Then I should see some results&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''features/step_definitions/example_steps.rb'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require &amp;quot;watir-webdriver&amp;quot;&lt;br /&gt;
require &amp;quot;rspec/expectations&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
Given /^I have entered &amp;quot;([^&amp;quot;]*)&amp;quot; into the query$/ do |term|&lt;br /&gt;
  @browser ||= Watir::Browser.new :firefox&lt;br /&gt;
  @browser.goto &amp;quot;google.com&amp;quot;&lt;br /&gt;
  @browser.text_field(:name =&amp;gt; &amp;quot;q&amp;quot;).set term&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
When /^I click &amp;quot;([^&amp;quot;]*)&amp;quot;$/ do |button_name|&lt;br /&gt;
  @browser.button.click&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
Then /^I should see some results$/ do&lt;br /&gt;
  @browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).wait_until_present&lt;br /&gt;
  @browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).should exist &lt;br /&gt;
  @browser.close&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Comparison with Other Tools =&lt;br /&gt;
&lt;br /&gt;
There are some other framworks will do similar work as watir does, for example, [http://en.wikipedia.org/wiki/Cucumber_(software) Cucmber], [http://en.wikipedia.org/wiki/Capybara Capybara] and RSpec[http://en.wikipedia.org/wiki/RSpec RSpec]. But in comparison, they have different features and are usually used in conjecture.&lt;br /&gt;
&lt;br /&gt;
In software engineering, behavior-driven development (abbreviated BDD) is a software development process based on test-driven development (TDD). &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Behavior-driven_development&amp;lt;/ref&amp;gt; It's very important in software testing. The relationship between Watir and Cucmmber is usually designing a framework to test cucumber scenarios using Watir tool. [http://qastrategies.blogspot.com/2012/06/bdd-framework-to-test-web-application.html See Example]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The detailed charateristics and relationships are:&lt;br /&gt;
&lt;br /&gt;
*Watir&amp;lt;br&amp;gt;&lt;br /&gt;
Put simply, Watir is a browser driver. Lightweight and simple to use, Watir excels at automating modern browsers. Built in Ruby, it does not have an IDE of it's own, but it works well with other testing frameworks and solutions in the Ruby ecosystem. &lt;br /&gt;
&lt;br /&gt;
*Cucumber&amp;lt;br&amp;gt;&lt;br /&gt;
Cucumber lets software development teams describe how software should behave in plain english, it is designed to allow you to execute automated integration tests. It is a tool for implementing Behavior Driven Development.It can work nicely in conjecture with Capybara and RSpec.&lt;br /&gt;
&lt;br /&gt;
*Capybara&amp;lt;br&amp;gt;&lt;br /&gt;
Capybara is a library written in the Ruby programming language which makes it easy to simulate how a user interacts with your application. It can talk with many different drivers which execute tests through the same clean and simple interface, including Selenium, Webkit or pure Ruby drivers.&amp;lt;ref&amp;gt;http://jnicklas.github.io/capybara/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*RSpec&amp;lt;br&amp;gt;&lt;br /&gt;
RSpec helps you do the TDD(Test-Driven Development) part of the whole development (combines Test-Driven Development, Domain Driven Design, and Acceptance Test-Driven Planning), focusing on the documentation and design aspects of TDD. A combination of RSpec and Watir makes really readable test scripts.&amp;lt;ref&amp;gt;http://www.ibmwcs.com/2010/08/testing-with-rspec-cucumber-selenium.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:''Here's an video tutorial from Youtube introducing how to test with Ruby Cucumber RSpec Capybara Watir WebDriver Testing.[https://www.youtube.com/watch?v=jPH5Eiz32N0 More Info]''&lt;br /&gt;
&lt;br /&gt;
= Pros and Cons =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* No external server needed to run a test.  Just run &amp;quot;ruby test.rb&amp;quot; and it goes, this simplifies any scripts used to execute the tests through continuous integration servers like [http://en.wikipedia.org/wiki/Hudson_%28software%29 Hudson] or [http://en.wikipedia.org/wiki/Bamboo_%28software%29 Bamboo] or whatever.&amp;lt;ref&amp;gt;http://www.quora.com/What-are-the-pros-and-cons-of-different-front-end-web-testing-frameworks-such-as-Selenium-or-Watir&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Rich API, which is pretty easy and once the users get the basics they can just guess how to write the code without needed alot of documentation.&lt;br /&gt;
&lt;br /&gt;
* Tests can often be run through alternative tools, such as watir-webdriver, [http://watirmelon.com/2009/08/31/celerity-first-impressions/ celerity] and more, which are all more-or-less support the watir API.  This means that if the users write their framework carefully, they would not be locked into watir.&lt;br /&gt;
&lt;br /&gt;
* Watir-webdriver does work in both ruby and [http://en.wikipedia.org/wiki/JRuby jruby].&lt;br /&gt;
&lt;br /&gt;
* Don't have much issue dealing with [http://en.wikipedia.org/wiki/Ajax_%28programming%29 AJAX], watir autumatically knows when the page finished loading.&lt;br /&gt;
&lt;br /&gt;
* Typically runs faster than a comparable selenium test.&lt;br /&gt;
&lt;br /&gt;
* Better support for headless browsers, like Celerity.&lt;br /&gt;
&lt;br /&gt;
* Multi browser (&amp;amp; OS) support&lt;br /&gt;
&lt;br /&gt;
*Provides an &amp;quot;attach&amp;quot; method which lets users programmatic access both the original domain window and the linked domain window from the same test.&amp;lt;ref&amp;gt;http://onestopqa.blogspot.com/2012/09/pros-cons-of-watir-selenium-or-sahi.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Each browser's implementation is a little bit different, and the driver for each browser is written independently.  This means inconsistent test results between browsers, which could be an issue sometime.&lt;br /&gt;
&lt;br /&gt;
* API is ruby only, users have to learn Ruby first.&lt;br /&gt;
&lt;br /&gt;
* Doesn't seem to be as widely used as selenium, a lil bit harder to find pretty good engineers.&lt;br /&gt;
&lt;br /&gt;
* The task of porting Watir to a new browser isn’t an easy one, and the task of keeping every port of Watir in sync, with the same API, is difficult. &amp;lt;ref&amp;gt;http://watirmelon.com/2010/04/10/watir-selenium-webdriver/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Further Reading =&lt;br /&gt;
1. An virtual experience on Watir, see how watir works in your eyes. https://www.youtube.com/watch?v=FxQXQGpImAo&lt;br /&gt;
&lt;br /&gt;
2. Get started with watir in one minute. https://testwisely.com/testwise/docs/tutorials/watir&lt;br /&gt;
&lt;br /&gt;
3. Tutorial on Ruby Cucumber RSpec Capybara Watir WebDriver Testing, know how they work here: https://www.youtube.com/watch?v=jPH5Eiz32N0&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_19_mx&amp;diff=88718</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 19 mx</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_19_mx&amp;diff=88718"/>
		<updated>2014-09-26T03:40:57Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Comparison with Other Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Watir'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= Introduction=&lt;br /&gt;
Watir('''W'''eb '''A'''pplication '''T'''est '''i'''n '''R'''uby), pronounced as 'water', is an automated test toolkit which uses the Ruby scripting language for automated tests to be developed and run against a web browser. &amp;lt;ref&amp;gt;http://www.httpwatch.com/rubywatir/&amp;lt;/ref&amp;gt;It allows users to write tests that are easy to read and maintain, also simple and flexible. Watir was first developed by Bret Pettichord and Paul Rogers. It drives [http://en.wikipedia.org/wiki/Internet_Explorer Internet Explorer], [http://en.wikipedia.org/wiki/FirefoxMozilla Firefox|Firefox], [http://en.wikipedia.org/wiki/Chrome Google Chrome|Chrome], [http://en.wikipedia.org/wiki/Opera Opera (web browser)|Opera] and [http://en.wikipedia.org/wiki/Safari Safari (web browser)|Safari], and is available as a [http://en.wikipedia.org/wiki/RubyGems RubyGems] gem, &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Watir&amp;lt;/ref&amp;gt; which is a free, open source Ruby library that  can test web applications written in any language&amp;lt;ref&amp;gt;https://rubygems.org/gems/watir-classic&amp;lt;/ref&amp;gt; and drive a web browser the same way an end user would. It clicks links, fills in forms, presses buttons. Watir can also check results, such as whether expected text appears on the page or not, or whether a control is enabled. &amp;lt;ref&amp;gt;http://watir.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watir project consists of several smaller projects, including watir-classic, watir-webdriver and watirspec.&lt;br /&gt;
&lt;br /&gt;
== Watir-classic ==&lt;br /&gt;
Watir-classic is a Watir driver for automating only Internet Explorer on Windows.&amp;lt;ref&amp;gt;https://github.com/watir/watir-classic&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watir-classic is able to work on Internet Explorer 8, 9 and 10&amp;lt;ref&amp;gt;http://rubydoc.info/gems/watir-classic/3.7.0/frames&amp;lt;/ref&amp;gt;, and is supported by Ruby 1.8.7, 1.9.3 and 2.0.0.&lt;br /&gt;
&lt;br /&gt;
== Watir-webdriver==&lt;br /&gt;
Watie-webdriver is an implementation built on WebDriver's Ruby bindings. It supports not only the Internet Explorer, but also namely Firefox, Chrome and Safari,&amp;lt;ref&amp;gt;https://github.com/watir/watir-webdriver&amp;lt;/ref&amp;gt;which is a main difference compared with watir-classic.&lt;br /&gt;
&lt;br /&gt;
== Watirspec ==&lt;br /&gt;
Watirspec combines best features of Watir [http://en.wikipedia.org/wiki/RSpec RSpec] and Ruby for browser-based functional testing.&amp;lt;ref&amp;gt;https://rubygems.org/gems/watirspec&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Just like RubySpec is for Ruby, Watirspec is the executable specification of the Watir API.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Web Application Testing ==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Web_testing Web testing] is a software testing that focuses on web applications. Complete testing of a web-based system before going live can help address issues before the system is revealed to the public. Issues such as the basic functionality of the site, the security of the web application, its accessibility to handicapped users and fully able users, as well as readiness for expected traffic and number of users and the ability to survive a massive spike in user traffic, both of which are related to load testing.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_testing&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Web Testing Checklist:'''&amp;lt;ref&amp;gt;http://www.softwaretestinghelp.com/web-application-testing/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Functionality Testing： Test for all the links in web pages, database connection, forms used in the web pages for submitting or getting information from user, as well as Cookie testing.&lt;br /&gt;
&lt;br /&gt;
*Usability Testing:  Test for navigation, contents and other user information for user help.&lt;br /&gt;
&lt;br /&gt;
*Interface Testing: Test for main interfaces, such as Web server, application server interface and Database server interface. Check whether all the interactions between these servers are executed properly or not. &lt;br /&gt;
&lt;br /&gt;
*Compatibility Testing: Test for the compatibility of your web site, which is a very critical testing aspect, including Browser compatibility, Operating system compatibility, Mobile browsing and Printing options compatibility. &lt;br /&gt;
&lt;br /&gt;
*Performance Testing: Test for web application performance, which should include both Web Load Testing and Web Stress Testing.&lt;br /&gt;
&lt;br /&gt;
== Ruby ==&lt;br /&gt;
Ruby is a dynamic, designed and developed in the mid-1990s by Yukihiro &amp;quot;Matz&amp;quot; Matsumoto in Japan, is a reflective, object-oriented, general-purpose programming language. Like other programming languages, Ruby gives you the power to connect to databases, read data files and spreadsheets, export XML, and structure your code as reusable libraries. Unlike other programming languages, Ruby is concise and often a joy to read.&lt;br /&gt;
&lt;br /&gt;
According to its authors, Ruby was influenced by [http://en.wikipedia.org/wiki/Perl Perl], [http://en.wikipedia.org/wiki/Smalltalk Smalltalk], [http://en.wikipedia.org/wiki/Eiffel Eiffel], [http://en.wikipedia.org/wiki/Ada Ada], and [http://en.wikipedia.org/wiki/Lisp Lisp]. It supports multiple programming paradigms, including functional, object-oriented, and imperative. It also has a dynamic type system and automatic memory management.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Ruby_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Several Features：'''&amp;lt;ref&amp;gt;http://www.starkdigital.net/ruby-programming&amp;lt;/ref&amp;gt;&lt;br /&gt;
*Thoroughly object-oriented with inheritance, mixins and metaclasses&lt;br /&gt;
*Dynamic typing and duck typing&lt;br /&gt;
*Large standard library, including modules for [http://en.wikipedia.org/wiki/YAML YAML], [http://en.wikipedia.org/wiki/JSON JSON], [http://en.wikipedia.org/wiki/XML XML], [http://en.wikipedia.org/wiki/CGI CGI], [http://en.wikipedia.org/wiki/OpenSSL OpenSSL], [http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP], [http://en.wikipedia.org/wiki/File_Transfer_Protocol FTP], [http://en.wikipedia.org/wiki/RSS RSS], [http://en.wikipedia.org/wiki/Curse_(disambiguation) curses], [http://en.wikipedia.org/wiki/Zlib zlib], and [http://en.wikipedia.org/wiki/Tk_(software) Tk] &lt;br /&gt;
*Dynamic reflection and alteration of objects to facilitate [http://en.wikipedia.org/wiki/Metaprogramming metaprogramming]&lt;br /&gt;
[http://www.starkdigital.net/ruby-programming See More Features.]&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
== Install Ruby on Linux ==&lt;br /&gt;
Use your relevant package manager to update or install Ruby with the following at a terminal window:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install ruby  # for Ubuntu / Debian users&lt;br /&gt;
 sudo yum install ruby      # for Red Hat / Fedora users&lt;br /&gt;
== Update RubyGems on Linux ==&lt;br /&gt;
Make sure you have the latest rubygems version 1.3.7 or above installed. Use your relevant package manager to install the latest version with the following at a terminal window:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install rubygems # for Ubuntu / Debian users&lt;br /&gt;
 sudo yum install rubygems  # for Red Hat / Fedora users&lt;br /&gt;
&lt;br /&gt;
== Install a HTML Inspector ==&lt;br /&gt;
To use Watir effectively, you’ll need to be able to browse through the structure of your application’s HTML pages. These tools help you do that.&lt;br /&gt;
&lt;br /&gt;
*On Firefox, use Firebug&lt;br /&gt;
*On Internet Explorer, use the IE Developer Toolbar&lt;br /&gt;
&lt;br /&gt;
== Installing or Updating RubyGems ==&lt;br /&gt;
While updating RubyGems, or installing any of the gems, you can use the following additional flags:&lt;br /&gt;
&lt;br /&gt;
 --no-rdoc --no-ri&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 gem update --system --no-rdoc --no-ri&lt;br /&gt;
 gem install watir --no-rdoc --no-ri&lt;br /&gt;
&lt;br /&gt;
= Make It Run =&lt;br /&gt;
After everything required installed, we can run the watir tests in several ways. Below three ways are listed, and each of them is designed to work on the live Watir demo form: http://bit.ly/watir-example.&lt;br /&gt;
&lt;br /&gt;
== Run in .rb ==&lt;br /&gt;
First of all, let's see how to conduct the test in ruby on rails. The example was based on the example listed on a google form, it demonstrated watir's functionality such as entering text into a text field, clicking a button like a user does, checking to see if a page contains text and so on. Below is the step-by-step command to finish the test in .rb file, which means you can simply save these commands in a .rb file and run it with ruby.&lt;br /&gt;
&lt;br /&gt;
Example 1: &amp;lt;ref&amp;gt;http://watir.com/examples/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Require Ruby Watir gem first via the -rubygems command line option, or by using the RUBYOPT environment variable. You can also require it manually in your script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rubygems'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Including Watir gem to drive Internet Explorer on Windows&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'watir'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Including Watir-WebDriver gem to drive Firefox/Chrome on Windows/Mac/Linux&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'watir-webdriver'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Starting a new browser &amp;amp; and going to our site&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser = Watir::Browser.new&lt;br /&gt;
browser.goto 'http://bit.ly/watir-example'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting a text field&lt;br /&gt;
&lt;br /&gt;
[[File:Text-field.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.text_field(:name =&amp;gt; 'entry.0.single').set 'Watir'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting a multi-line text box&lt;br /&gt;
&lt;br /&gt;
[[File:text-box1.png|text-box1.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.text_field(:name =&amp;gt; 'entry.1.single').set &amp;quot;I come here from Australia. \n The weather is great here.&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting and clearing a radio button&lt;br /&gt;
&lt;br /&gt;
[[File:3.radio-buttons1.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.radio(:value =&amp;gt; 'Watir').set&lt;br /&gt;
browser.radio(:value =&amp;gt; 'Watir').clear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting and clearing check boxes&lt;br /&gt;
&lt;br /&gt;
[[File:4.checkboxes.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Ruby').set&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Python').set&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Python').clear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Clearing, getting and selecting selection list values&lt;br /&gt;
&lt;br /&gt;
[[File:5.selection-list.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.select_list(:name =&amp;gt; 'entry.6.single').clear&lt;br /&gt;
puts browser.select_list(:name =&amp;gt; 'entry.6.single').options&lt;br /&gt;
browser.select_list(:name =&amp;gt; 'entry.6.single').select 'Chrome'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Clicking a button&lt;br /&gt;
&lt;br /&gt;
[[File:6.button.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.button(:name =&amp;gt; 'submit').click&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Checking for text in a page&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
puts browser.text.include? 'Your response has been recorded.'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Checking the title of a page&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
puts browser.title == 'Thanks!'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Run in Rspec ==&lt;br /&gt;
RSpec is a Behaviour-Driven Development tool for Ruby programmers. BDD is an approach to software development that combines Test-Driven Development, Domain Driven Design, and Acceptance Test-Driven Planning. RSpec helps you do the TDD part of that equation, focusing on the documentation and design aspects of TDD. The following code demonstrates using Watir and a basic RSpec example.[http://rspec.info/ More Info.]&lt;br /&gt;
&lt;br /&gt;
Example 2: &amp;lt;ref&amp;gt;http://watir.com/frameworks/&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
1. Install&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install rspec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Example&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec test_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will execute the following rspec example:&lt;br /&gt;
&lt;br /&gt;
'''test_spec.rb'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require &amp;quot;rubygems&amp;quot;&lt;br /&gt;
require &amp;quot;rspec&amp;quot;&lt;br /&gt;
require &amp;quot;watir-webdriver&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
describe &amp;quot;google.com&amp;quot; do&lt;br /&gt;
  let(:browser) { @browser ||= Watir::Browser.new :firefox } &lt;br /&gt;
  before { browser.goto &amp;quot;http://google.com&amp;quot; } &lt;br /&gt;
  after { browser.close }&lt;br /&gt;
 &lt;br /&gt;
  it &amp;quot;should search for watir&amp;quot; do&lt;br /&gt;
    browser.text_field(:name =&amp;gt; &amp;quot;q&amp;quot;).set &amp;quot;watir&amp;quot;&lt;br /&gt;
    browser.button.click &lt;br /&gt;
    browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).wait_until_present&lt;br /&gt;
    browser.title.should == &amp;quot;watir - Google Search&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Run in Cucumber ==&lt;br /&gt;
Cucumber lets software development teams describe how software should behave in plain text. The text is written in a business-readable domain-specific language and serves as documentation, automated tests and development-aid – all rolled into one format.[http://cukes.info/ More Info.]&lt;br /&gt;
&lt;br /&gt;
Example 3: &amp;lt;ref&amp;gt;http://watir.com/frameworks/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Install&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install cucumber&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cucumber features&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will execute the following cucumber feature:&lt;br /&gt;
'''features/example.feature'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Feature: Search In order to use Google users must be able to search for content &lt;br /&gt;
Scenario: Search for a term&lt;br /&gt;
Given I have entered &amp;quot;watir&amp;quot; into the query&lt;br /&gt;
When I click &amp;quot;search&amp;quot;&lt;br /&gt;
Then I should see some results&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''features/step_definitions/example_steps.rb'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require &amp;quot;watir-webdriver&amp;quot;&lt;br /&gt;
require &amp;quot;rspec/expectations&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
Given /^I have entered &amp;quot;([^&amp;quot;]*)&amp;quot; into the query$/ do |term|&lt;br /&gt;
  @browser ||= Watir::Browser.new :firefox&lt;br /&gt;
  @browser.goto &amp;quot;google.com&amp;quot;&lt;br /&gt;
  @browser.text_field(:name =&amp;gt; &amp;quot;q&amp;quot;).set term&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
When /^I click &amp;quot;([^&amp;quot;]*)&amp;quot;$/ do |button_name|&lt;br /&gt;
  @browser.button.click&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
Then /^I should see some results$/ do&lt;br /&gt;
  @browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).wait_until_present&lt;br /&gt;
  @browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).should exist &lt;br /&gt;
  @browser.close&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Comparison with Other Tools =&lt;br /&gt;
&lt;br /&gt;
There are some other framworks will do similar work as watir does, for example, [http://en.wikipedia.org/wiki/Cucumber_(software) Cucmber], [http://en.wikipedia.org/wiki/Capybara Capybara] and RSpec[http://en.wikipedia.org/wiki/RSpec RSpec]. But in comparison, they have different features and are usually used in conjecture.&lt;br /&gt;
&lt;br /&gt;
In software engineering, behavior-driven development (abbreviated BDD) is a software development process based on test-driven development (TDD). &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Behavior-driven_development&amp;lt;/ref&amp;gt; It's very important in software testing. The relationship between Watir and Cucmmber is usually designing a framework to test cucumber scenarios using Watir tool. [http://qastrategies.blogspot.com/2012/06/bdd-framework-to-test-web-application.html See Example]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The detailed difference and relationships are:&lt;br /&gt;
&lt;br /&gt;
*Watir&amp;lt;br&amp;gt;&lt;br /&gt;
Put simply, Watir is a browser driver. Lightweight and simple to use, Watir excels at automating modern browsers. Built in Ruby, it does not have an IDE of it's own, but it works well with other testing frameworks and solutions in the Ruby ecosystem. &lt;br /&gt;
&lt;br /&gt;
*Cucumber&amp;lt;br&amp;gt;&lt;br /&gt;
Cucumber lets software development teams describe how software should behave in plain english, it is designed to allow you to execute automated integration tests. It is a tool for implementing Behavior Driven Development.It can work nicely in conjecture with Capybara and RSpec.&lt;br /&gt;
&lt;br /&gt;
*Capybara&amp;lt;br&amp;gt;&lt;br /&gt;
Capybara is a library written in the Ruby programming language which makes it easy to simulate how a user interacts with your application. It can talk with many different drivers which execute tests through the same clean and simple interface, including Selenium, Webkit or pure Ruby drivers.&amp;lt;ref&amp;gt;http://jnicklas.github.io/capybara/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*RSpec&amp;lt;br&amp;gt;&lt;br /&gt;
RSpec helps you do the TDD(Test-Driven Development) part of the whole development (combines Test-Driven Development, Domain Driven Design, and Acceptance Test-Driven Planning), focusing on the documentation and design aspects of TDD. A combination of RSpec and Watir makes really readable test scripts.&amp;lt;ref&amp;gt;http://www.ibmwcs.com/2010/08/testing-with-rspec-cucumber-selenium.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:''Here's an video tutorial from Youtube introducing how to test with Ruby Cucumber RSpec Capybara Watir WebDriver Testing.[https://www.youtube.com/watch?v=jPH5Eiz32N0 More Info]''&lt;br /&gt;
&lt;br /&gt;
= Pros and Cons =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* No external server needed to run a test.  Just run &amp;quot;ruby test.rb&amp;quot; and it goes, this simplifies any scripts used to execute the tests through continuous integration servers like [http://en.wikipedia.org/wiki/Hudson_%28software%29 Hudson] or [http://en.wikipedia.org/wiki/Bamboo_%28software%29 Bamboo] or whatever.&amp;lt;ref&amp;gt;http://www.quora.com/What-are-the-pros-and-cons-of-different-front-end-web-testing-frameworks-such-as-Selenium-or-Watir&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Rich API, which is pretty easy and once the users get the basics they can just guess how to write the code without needed alot of documentation.&lt;br /&gt;
&lt;br /&gt;
* Tests can often be run through alternative tools, such as watir-webdriver, [http://watirmelon.com/2009/08/31/celerity-first-impressions/ celerity] and more, which are all more-or-less support the watir API.  This means that if the users write their framework carefully, they would not be locked into watir.&lt;br /&gt;
&lt;br /&gt;
* Watir-webdriver does work in both ruby and [http://en.wikipedia.org/wiki/JRuby jruby].&lt;br /&gt;
&lt;br /&gt;
* Don't have much issue dealing with [http://en.wikipedia.org/wiki/Ajax_%28programming%29 AJAX], watir autumatically knows when the page finished loading.&lt;br /&gt;
&lt;br /&gt;
* Typically runs faster than a comparable selenium test.&lt;br /&gt;
&lt;br /&gt;
* Better support for headless browsers, like Celerity.&lt;br /&gt;
&lt;br /&gt;
* Multi browser (&amp;amp; OS) support&lt;br /&gt;
&lt;br /&gt;
*Provides an &amp;quot;attach&amp;quot; method which lets users programmatic access both the original domain window and the linked domain window from the same test.&amp;lt;ref&amp;gt;http://onestopqa.blogspot.com/2012/09/pros-cons-of-watir-selenium-or-sahi.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Each browser's implementation is a little bit different, and the driver for each browser is written independently.  This means inconsistent test results between browsers, which could be an issue sometime.&lt;br /&gt;
&lt;br /&gt;
* API is ruby only, users have to learn Ruby first.&lt;br /&gt;
&lt;br /&gt;
* Doesn't seem to be as widely used as selenium, a lil bit harder to find pretty good engineers.&lt;br /&gt;
&lt;br /&gt;
* The task of porting Watir to a new browser isn’t an easy one, and the task of keeping every port of Watir in sync, with the same API, is difficult. &amp;lt;ref&amp;gt;http://watirmelon.com/2010/04/10/watir-selenium-webdriver/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Further Reading =&lt;br /&gt;
1. An virtual experience on Watir, see how watir works in your eyes. https://www.youtube.com/watch?v=FxQXQGpImAo&lt;br /&gt;
&lt;br /&gt;
2. Get started with watir in one minute. https://testwisely.com/testwise/docs/tutorials/watir&lt;br /&gt;
&lt;br /&gt;
3. Tutorial on Ruby Cucumber RSpec Capybara Watir WebDriver Testing, know how they work here: https://www.youtube.com/watch?v=jPH5Eiz32N0&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_19_mx&amp;diff=88716</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 19 mx</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_19_mx&amp;diff=88716"/>
		<updated>2014-09-26T03:40:22Z</updated>

		<summary type="html">&lt;p&gt;Xshao2: /* Comparison with Other Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Watir'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= Introduction=&lt;br /&gt;
Watir('''W'''eb '''A'''pplication '''T'''est '''i'''n '''R'''uby), pronounced as 'water', is an automated test toolkit which uses the Ruby scripting language for automated tests to be developed and run against a web browser. &amp;lt;ref&amp;gt;http://www.httpwatch.com/rubywatir/&amp;lt;/ref&amp;gt;It allows users to write tests that are easy to read and maintain, also simple and flexible. Watir was first developed by Bret Pettichord and Paul Rogers. It drives [http://en.wikipedia.org/wiki/Internet_Explorer Internet Explorer], [http://en.wikipedia.org/wiki/FirefoxMozilla Firefox|Firefox], [http://en.wikipedia.org/wiki/Chrome Google Chrome|Chrome], [http://en.wikipedia.org/wiki/Opera Opera (web browser)|Opera] and [http://en.wikipedia.org/wiki/Safari Safari (web browser)|Safari], and is available as a [http://en.wikipedia.org/wiki/RubyGems RubyGems] gem, &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Watir&amp;lt;/ref&amp;gt; which is a free, open source Ruby library that  can test web applications written in any language&amp;lt;ref&amp;gt;https://rubygems.org/gems/watir-classic&amp;lt;/ref&amp;gt; and drive a web browser the same way an end user would. It clicks links, fills in forms, presses buttons. Watir can also check results, such as whether expected text appears on the page or not, or whether a control is enabled. &amp;lt;ref&amp;gt;http://watir.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watir project consists of several smaller projects, including watir-classic, watir-webdriver and watirspec.&lt;br /&gt;
&lt;br /&gt;
== Watir-classic ==&lt;br /&gt;
Watir-classic is a Watir driver for automating only Internet Explorer on Windows.&amp;lt;ref&amp;gt;https://github.com/watir/watir-classic&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watir-classic is able to work on Internet Explorer 8, 9 and 10&amp;lt;ref&amp;gt;http://rubydoc.info/gems/watir-classic/3.7.0/frames&amp;lt;/ref&amp;gt;, and is supported by Ruby 1.8.7, 1.9.3 and 2.0.0.&lt;br /&gt;
&lt;br /&gt;
== Watir-webdriver==&lt;br /&gt;
Watie-webdriver is an implementation built on WebDriver's Ruby bindings. It supports not only the Internet Explorer, but also namely Firefox, Chrome and Safari,&amp;lt;ref&amp;gt;https://github.com/watir/watir-webdriver&amp;lt;/ref&amp;gt;which is a main difference compared with watir-classic.&lt;br /&gt;
&lt;br /&gt;
== Watirspec ==&lt;br /&gt;
Watirspec combines best features of Watir [http://en.wikipedia.org/wiki/RSpec RSpec] and Ruby for browser-based functional testing.&amp;lt;ref&amp;gt;https://rubygems.org/gems/watirspec&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Just like RubySpec is for Ruby, Watirspec is the executable specification of the Watir API.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Web Application Testing ==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Web_testing Web testing] is a software testing that focuses on web applications. Complete testing of a web-based system before going live can help address issues before the system is revealed to the public. Issues such as the basic functionality of the site, the security of the web application, its accessibility to handicapped users and fully able users, as well as readiness for expected traffic and number of users and the ability to survive a massive spike in user traffic, both of which are related to load testing.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_testing&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Web Testing Checklist:'''&amp;lt;ref&amp;gt;http://www.softwaretestinghelp.com/web-application-testing/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Functionality Testing： Test for all the links in web pages, database connection, forms used in the web pages for submitting or getting information from user, as well as Cookie testing.&lt;br /&gt;
&lt;br /&gt;
*Usability Testing:  Test for navigation, contents and other user information for user help.&lt;br /&gt;
&lt;br /&gt;
*Interface Testing: Test for main interfaces, such as Web server, application server interface and Database server interface. Check whether all the interactions between these servers are executed properly or not. &lt;br /&gt;
&lt;br /&gt;
*Compatibility Testing: Test for the compatibility of your web site, which is a very critical testing aspect, including Browser compatibility, Operating system compatibility, Mobile browsing and Printing options compatibility. &lt;br /&gt;
&lt;br /&gt;
*Performance Testing: Test for web application performance, which should include both Web Load Testing and Web Stress Testing.&lt;br /&gt;
&lt;br /&gt;
== Ruby ==&lt;br /&gt;
Ruby is a dynamic, designed and developed in the mid-1990s by Yukihiro &amp;quot;Matz&amp;quot; Matsumoto in Japan, is a reflective, object-oriented, general-purpose programming language. Like other programming languages, Ruby gives you the power to connect to databases, read data files and spreadsheets, export XML, and structure your code as reusable libraries. Unlike other programming languages, Ruby is concise and often a joy to read.&lt;br /&gt;
&lt;br /&gt;
According to its authors, Ruby was influenced by [http://en.wikipedia.org/wiki/Perl Perl], [http://en.wikipedia.org/wiki/Smalltalk Smalltalk], [http://en.wikipedia.org/wiki/Eiffel Eiffel], [http://en.wikipedia.org/wiki/Ada Ada], and [http://en.wikipedia.org/wiki/Lisp Lisp]. It supports multiple programming paradigms, including functional, object-oriented, and imperative. It also has a dynamic type system and automatic memory management.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Ruby_(programming_language)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Several Features：'''&amp;lt;ref&amp;gt;http://www.starkdigital.net/ruby-programming&amp;lt;/ref&amp;gt;&lt;br /&gt;
*Thoroughly object-oriented with inheritance, mixins and metaclasses&lt;br /&gt;
*Dynamic typing and duck typing&lt;br /&gt;
*Large standard library, including modules for [http://en.wikipedia.org/wiki/YAML YAML], [http://en.wikipedia.org/wiki/JSON JSON], [http://en.wikipedia.org/wiki/XML XML], [http://en.wikipedia.org/wiki/CGI CGI], [http://en.wikipedia.org/wiki/OpenSSL OpenSSL], [http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol HTTP], [http://en.wikipedia.org/wiki/File_Transfer_Protocol FTP], [http://en.wikipedia.org/wiki/RSS RSS], [http://en.wikipedia.org/wiki/Curse_(disambiguation) curses], [http://en.wikipedia.org/wiki/Zlib zlib], and [http://en.wikipedia.org/wiki/Tk_(software) Tk] &lt;br /&gt;
*Dynamic reflection and alteration of objects to facilitate [http://en.wikipedia.org/wiki/Metaprogramming metaprogramming]&lt;br /&gt;
[http://www.starkdigital.net/ruby-programming See More Features.]&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
== Install Ruby on Linux ==&lt;br /&gt;
Use your relevant package manager to update or install Ruby with the following at a terminal window:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install ruby  # for Ubuntu / Debian users&lt;br /&gt;
 sudo yum install ruby      # for Red Hat / Fedora users&lt;br /&gt;
== Update RubyGems on Linux ==&lt;br /&gt;
Make sure you have the latest rubygems version 1.3.7 or above installed. Use your relevant package manager to install the latest version with the following at a terminal window:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install rubygems # for Ubuntu / Debian users&lt;br /&gt;
 sudo yum install rubygems  # for Red Hat / Fedora users&lt;br /&gt;
&lt;br /&gt;
== Install a HTML Inspector ==&lt;br /&gt;
To use Watir effectively, you’ll need to be able to browse through the structure of your application’s HTML pages. These tools help you do that.&lt;br /&gt;
&lt;br /&gt;
*On Firefox, use Firebug&lt;br /&gt;
*On Internet Explorer, use the IE Developer Toolbar&lt;br /&gt;
&lt;br /&gt;
== Installing or Updating RubyGems ==&lt;br /&gt;
While updating RubyGems, or installing any of the gems, you can use the following additional flags:&lt;br /&gt;
&lt;br /&gt;
 --no-rdoc --no-ri&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 gem update --system --no-rdoc --no-ri&lt;br /&gt;
 gem install watir --no-rdoc --no-ri&lt;br /&gt;
&lt;br /&gt;
= Make It Run =&lt;br /&gt;
After everything required installed, we can run the watir tests in several ways. Below three ways are listed, and each of them is designed to work on the live Watir demo form: http://bit.ly/watir-example.&lt;br /&gt;
&lt;br /&gt;
== Run in .rb ==&lt;br /&gt;
First of all, let's see how to conduct the test in ruby on rails. The example was based on the example listed on a google form, it demonstrated watir's functionality such as entering text into a text field, clicking a button like a user does, checking to see if a page contains text and so on. Below is the step-by-step command to finish the test in .rb file, which means you can simply save these commands in a .rb file and run it with ruby.&lt;br /&gt;
&lt;br /&gt;
Example 1: &amp;lt;ref&amp;gt;http://watir.com/examples/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Require Ruby Watir gem first via the -rubygems command line option, or by using the RUBYOPT environment variable. You can also require it manually in your script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rubygems'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Including Watir gem to drive Internet Explorer on Windows&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'watir'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Including Watir-WebDriver gem to drive Firefox/Chrome on Windows/Mac/Linux&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'watir-webdriver'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Starting a new browser &amp;amp; and going to our site&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser = Watir::Browser.new&lt;br /&gt;
browser.goto 'http://bit.ly/watir-example'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting a text field&lt;br /&gt;
&lt;br /&gt;
[[File:Text-field.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.text_field(:name =&amp;gt; 'entry.0.single').set 'Watir'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting a multi-line text box&lt;br /&gt;
&lt;br /&gt;
[[File:text-box1.png|text-box1.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.text_field(:name =&amp;gt; 'entry.1.single').set &amp;quot;I come here from Australia. \n The weather is great here.&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting and clearing a radio button&lt;br /&gt;
&lt;br /&gt;
[[File:3.radio-buttons1.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.radio(:value =&amp;gt; 'Watir').set&lt;br /&gt;
browser.radio(:value =&amp;gt; 'Watir').clear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Setting and clearing check boxes&lt;br /&gt;
&lt;br /&gt;
[[File:4.checkboxes.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Ruby').set&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Python').set&lt;br /&gt;
browser.checkbox(:value =&amp;gt; 'Python').clear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Clearing, getting and selecting selection list values&lt;br /&gt;
&lt;br /&gt;
[[File:5.selection-list.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.select_list(:name =&amp;gt; 'entry.6.single').clear&lt;br /&gt;
puts browser.select_list(:name =&amp;gt; 'entry.6.single').options&lt;br /&gt;
browser.select_list(:name =&amp;gt; 'entry.6.single').select 'Chrome'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Clicking a button&lt;br /&gt;
&lt;br /&gt;
[[File:6.button.png]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
browser.button(:name =&amp;gt; 'submit').click&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Checking for text in a page&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
puts browser.text.include? 'Your response has been recorded.'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Checking the title of a page&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
puts browser.title == 'Thanks!'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Run in Rspec ==&lt;br /&gt;
RSpec is a Behaviour-Driven Development tool for Ruby programmers. BDD is an approach to software development that combines Test-Driven Development, Domain Driven Design, and Acceptance Test-Driven Planning. RSpec helps you do the TDD part of that equation, focusing on the documentation and design aspects of TDD. The following code demonstrates using Watir and a basic RSpec example.[http://rspec.info/ More Info.]&lt;br /&gt;
&lt;br /&gt;
Example 2: &amp;lt;ref&amp;gt;http://watir.com/frameworks/&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
1. Install&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install rspec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Example&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec test_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will execute the following rspec example:&lt;br /&gt;
&lt;br /&gt;
'''test_spec.rb'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require &amp;quot;rubygems&amp;quot;&lt;br /&gt;
require &amp;quot;rspec&amp;quot;&lt;br /&gt;
require &amp;quot;watir-webdriver&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
describe &amp;quot;google.com&amp;quot; do&lt;br /&gt;
  let(:browser) { @browser ||= Watir::Browser.new :firefox } &lt;br /&gt;
  before { browser.goto &amp;quot;http://google.com&amp;quot; } &lt;br /&gt;
  after { browser.close }&lt;br /&gt;
 &lt;br /&gt;
  it &amp;quot;should search for watir&amp;quot; do&lt;br /&gt;
    browser.text_field(:name =&amp;gt; &amp;quot;q&amp;quot;).set &amp;quot;watir&amp;quot;&lt;br /&gt;
    browser.button.click &lt;br /&gt;
    browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).wait_until_present&lt;br /&gt;
    browser.title.should == &amp;quot;watir - Google Search&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Run in Cucumber ==&lt;br /&gt;
Cucumber lets software development teams describe how software should behave in plain text. The text is written in a business-readable domain-specific language and serves as documentation, automated tests and development-aid – all rolled into one format.[http://cukes.info/ More Info.]&lt;br /&gt;
&lt;br /&gt;
Example 3: &amp;lt;ref&amp;gt;http://watir.com/frameworks/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Install&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install cucumber&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cucumber features&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will execute the following cucumber feature:&lt;br /&gt;
'''features/example.feature'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Feature: Search In order to use Google users must be able to search for content &lt;br /&gt;
Scenario: Search for a term&lt;br /&gt;
Given I have entered &amp;quot;watir&amp;quot; into the query&lt;br /&gt;
When I click &amp;quot;search&amp;quot;&lt;br /&gt;
Then I should see some results&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''features/step_definitions/example_steps.rb'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require &amp;quot;watir-webdriver&amp;quot;&lt;br /&gt;
require &amp;quot;rspec/expectations&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
Given /^I have entered &amp;quot;([^&amp;quot;]*)&amp;quot; into the query$/ do |term|&lt;br /&gt;
  @browser ||= Watir::Browser.new :firefox&lt;br /&gt;
  @browser.goto &amp;quot;google.com&amp;quot;&lt;br /&gt;
  @browser.text_field(:name =&amp;gt; &amp;quot;q&amp;quot;).set term&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
When /^I click &amp;quot;([^&amp;quot;]*)&amp;quot;$/ do |button_name|&lt;br /&gt;
  @browser.button.click&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
Then /^I should see some results$/ do&lt;br /&gt;
  @browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).wait_until_present&lt;br /&gt;
  @browser.div(:id =&amp;gt; &amp;quot;resultStats&amp;quot;).should exist &lt;br /&gt;
  @browser.close&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Comparison with Other Tools =&lt;br /&gt;
&lt;br /&gt;
There are some other framworks will do similar work as watir does, for example, [http://en.wikipedia.org/wiki/Cucumber_(software) Cucmber], [http://en.wikipedia.org/wiki/Capybara Capybara] and RSpec[http://en.wikipedia.org/wiki/RSpec RSpec]. But in comparison, they have different features and are usually used in conjecture.&lt;br /&gt;
&lt;br /&gt;
In software engineering, behavior-driven development (abbreviated BDD) is a software development process based on test-driven development (TDD). &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Behavior-driven_development&amp;lt;/ref&amp;gt; It's very important in software testing. The relationship between Watir and Cucmmber is usually designing a framework to test cucumber scenarios using Watir tool. [http://qastrategies.blogspot.com/2012/06/bdd-framework-to-test-web-application.html See Example]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The detailed difference and relationships are:&lt;br /&gt;
&lt;br /&gt;
*Watir&amp;lt;br&amp;gt;&lt;br /&gt;
Put simply, Watir is a browser driver. Lightweight and simple to use, Watir excels at automating modern browsers. Built in Ruby, it does not have an IDE of it's own, but it works well with other testing frameworks and solutions in the Ruby ecosystem. &lt;br /&gt;
&lt;br /&gt;
*Cucumber&amp;lt;br&amp;gt;&lt;br /&gt;
Cucumber lets software development teams describe how software should behave in plain english, it is designed to allow you to execute automated integration tests. It is a tool for implementing Behavior Driven Development.It can work nicely in conjecture with Capybara and RSpec.&lt;br /&gt;
&lt;br /&gt;
*Capybara&amp;lt;br&amp;gt;&lt;br /&gt;
Capybara is a library written in the Ruby programming language which makes it easy to simulate how a user interacts with your application. It can talk with many different drivers which execute tests through the same clean and simple interface, including Selenium, Webkit or pure Ruby drivers.&amp;lt;ref&amp;gt;http://jnicklas.github.io/capybara/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*RSpec&amp;lt;br&amp;gt;&lt;br /&gt;
RSpec helps you do the TDD(Test-Driven Development) part of the whole development (combines Test-Driven Development, Domain Driven Design, and Acceptance Test-Driven Planning), focusing on the documentation and design aspects of TDD. A combination of RSpec and Watir makes really readable test scripts.&amp;lt;ref&amp;gt;http://www.ibmwcs.com/2010/08/testing-with-rspec-cucumber-selenium.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Here's an video tutorial from Youtube introducing how to test with Ruby Cucumber RSpec Capybara Watir WebDriver Testing.[https://www.youtube.com/watch?v=jPH5Eiz32N0 More Info]''&lt;br /&gt;
&lt;br /&gt;
= Pros and Cons =&lt;br /&gt;
== Pros ==&lt;br /&gt;
* No external server needed to run a test.  Just run &amp;quot;ruby test.rb&amp;quot; and it goes, this simplifies any scripts used to execute the tests through continuous integration servers like [http://en.wikipedia.org/wiki/Hudson_%28software%29 Hudson] or [http://en.wikipedia.org/wiki/Bamboo_%28software%29 Bamboo] or whatever.&amp;lt;ref&amp;gt;http://www.quora.com/What-are-the-pros-and-cons-of-different-front-end-web-testing-frameworks-such-as-Selenium-or-Watir&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Rich API, which is pretty easy and once the users get the basics they can just guess how to write the code without needed alot of documentation.&lt;br /&gt;
&lt;br /&gt;
* Tests can often be run through alternative tools, such as watir-webdriver, [http://watirmelon.com/2009/08/31/celerity-first-impressions/ celerity] and more, which are all more-or-less support the watir API.  This means that if the users write their framework carefully, they would not be locked into watir.&lt;br /&gt;
&lt;br /&gt;
* Watir-webdriver does work in both ruby and [http://en.wikipedia.org/wiki/JRuby jruby].&lt;br /&gt;
&lt;br /&gt;
* Don't have much issue dealing with [http://en.wikipedia.org/wiki/Ajax_%28programming%29 AJAX], watir autumatically knows when the page finished loading.&lt;br /&gt;
&lt;br /&gt;
* Typically runs faster than a comparable selenium test.&lt;br /&gt;
&lt;br /&gt;
* Better support for headless browsers, like Celerity.&lt;br /&gt;
&lt;br /&gt;
* Multi browser (&amp;amp; OS) support&lt;br /&gt;
&lt;br /&gt;
*Provides an &amp;quot;attach&amp;quot; method which lets users programmatic access both the original domain window and the linked domain window from the same test.&amp;lt;ref&amp;gt;http://onestopqa.blogspot.com/2012/09/pros-cons-of-watir-selenium-or-sahi.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cons ==&lt;br /&gt;
* Each browser's implementation is a little bit different, and the driver for each browser is written independently.  This means inconsistent test results between browsers, which could be an issue sometime.&lt;br /&gt;
&lt;br /&gt;
* API is ruby only, users have to learn Ruby first.&lt;br /&gt;
&lt;br /&gt;
* Doesn't seem to be as widely used as selenium, a lil bit harder to find pretty good engineers.&lt;br /&gt;
&lt;br /&gt;
* The task of porting Watir to a new browser isn’t an easy one, and the task of keeping every port of Watir in sync, with the same API, is difficult. &amp;lt;ref&amp;gt;http://watirmelon.com/2010/04/10/watir-selenium-webdriver/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Further Reading =&lt;br /&gt;
1. An virtual experience on Watir, see how watir works in your eyes. https://www.youtube.com/watch?v=FxQXQGpImAo&lt;br /&gt;
&lt;br /&gt;
2. Get started with watir in one minute. https://testwisely.com/testwise/docs/tutorials/watir&lt;br /&gt;
&lt;br /&gt;
3. Tutorial on Ruby Cucumber RSpec Capybara Watir WebDriver Testing, know how they work here: https://www.youtube.com/watch?v=jPH5Eiz32N0&lt;/div&gt;</summary>
		<author><name>Xshao2</name></author>
	</entry>
</feed>