CSC/ECE 517 Fall 2018/E1841 Issues Related to Rubrics: Difference between revisions
Line 46: | Line 46: | ||
</pre> | </pre> | ||
======''' | ======'''tree_display_controller.rb File'''====== | ||
In this file , | Path to file: /app/controllers/tree_display_controller.rb | ||
In this file, multiple functions were updated viz. '''goto_controller()''' and ''' list()''' and goto_{rubric_name}, where rubric_name is one of the following: [questionnaires, review_rubrics, metareview_rubrics, teammatereview_rubrics, author_feedbacks, global_survey, surveys, course_surveys, bookmarkrating_rubrics, courses, assignments] | |||
The goto_controller function now takes in a new parameter names "last_open_tab", which indicates which tab ought to be selected after a refresh (due to list action). This value is stored in a session variable. | |||
The goto_{rubric_name} functions pass in the value for last_open_tab corresponding to the tab to which they belong. | |||
The list action was updated to store an instance variable that will be accessible in list.html.erb. | |||
<br> | <br> | ||
======'''goto_controller():'''====== | ======'''goto_controller():'''====== | ||
<li> The modification in goto_controller enables the function to keep a track of which tab was last opened by adding a new parameter viz. '''last_open_tab''' and setting its values to the integer value corresponding to the position of the tab on the web page . example , if the Questionnaires tab is opened then a value of 3 will be assigned to the last_opened_tab parameter as the position of the Questionnaires tab is 3 on the web page.This Function also handles the direction of the control from Questionnaires tab to the Review Rubrics Tab when Review Rubrics tab is being clicked. | <li> The modification in goto_controller enables the function to keep a track of which tab was last opened by adding a new parameter viz. '''last_open_tab''' and setting its values to the integer value corresponding to the position of the tab on the web page . example , if the Questionnaires tab is opened then a value of 3 will be assigned to the last_opened_tab parameter as the position of the Questionnaires tab is 3 on the web page.This Function also handles the direction of the control from Questionnaires tab to the Review Rubrics Tab when Review Rubrics tab is being clicked. |
Revision as of 05:07, 6 November 2018
E1553 : Issues Related to Rubrics
Introdution
Expertiza is an Peer Review Web Application System. It allows multiple students to participate in various assignments posted by the Instructor and provides a platform to all the students to conduct a peer review on the work done by their peers. Expertiza is an opensource project written in Ruby on Rails and React.js. We as a team have targeted some specific issues related to this project and Have tried Our best to fix them.
Problem Statement
What it Does
In Expertiza, instructors (also admin, super admin and TAs) can create rubrics (they are called questionnaires in DB, there are different types like review rubric, teammate review rubric, etc. Each rubric may have one or many criteria (called questions in DB). For each criterion, it may have 0 to many suggestions.
Fixes Required
Current Functionality
Solutions
Issue 1
When one tries to select "Manage > Questionnaires > Review rubrics" , it just takes back to the Questionnaires Main page rather than displaying the Review rubrics page.
Solution Description
tree_display.jsx File
Path to file: /app/assets/javascripts/tree_display.jsx A new React lifecycle function was added to the ContentTableRow class, viz. componentDidMount: function() . The function determines which sub-menu item was clicked in the Manage Instructor Content- Questionnaire menu and expands the corresponding rubric by updating the state of the table row.
componentDidMount: function() { selectedMenuItem = document.getElementById("tree_display").getAttribute("data-menu-item"); rubricArray = ["Review", "Metareview", "Author Feedback", "Teammate Review", "Course Survey", "Assignment Survey", "Global Survey"]; selectedMenuItemIndex = rubricArray.indexOf(selectedMenuItem); if(selectedMenuItemIndex !== -1 && rubricArray[selectedMenuItemIndex] === this.props.name) { this.setState({ expanded: true }, function() { this.props.rowClicked(this.props.id, true,this.props.newParams) }) } },
tree_display_controller.rb File
Path to file: /app/controllers/tree_display_controller.rb In this file, multiple functions were updated viz. goto_controller() and list() and goto_{rubric_name}, where rubric_name is one of the following: [questionnaires, review_rubrics, metareview_rubrics, teammatereview_rubrics, author_feedbacks, global_survey, surveys, course_surveys, bookmarkrating_rubrics, courses, assignments]
The goto_controller function now takes in a new parameter names "last_open_tab", which indicates which tab ought to be selected after a refresh (due to list action). This value is stored in a session variable. The goto_{rubric_name} functions pass in the value for last_open_tab corresponding to the tab to which they belong.
The list action was updated to store an instance variable that will be accessible in list.html.erb.
goto_controller():
#Adding of the parameter def goto_controller(name_parameter, last_open_tab) node_object = TreeFolder.find_by(name: name_parameter) session[:root] = FolderNode.find_by(node_object_id: node_object.id).id session[:last_open_tab] = last_open_tab unless last_open_tab.nil? redirect_to controller: 'tree_display', action: 'list', current_controller: name_parameter end #Setting of the Parameter def goto_questionnaires goto_controller('Questionnaires', '3') end
list():
def list @current_controller = params[:current_controller] redirect_to controller: :content_pages, action: :view if current_user.nil? redirect_to controller: :student_task, action: :list if current_user.try(:student?) end
= List.html.erb file
This file has been modified so that the tree_display.jsx file is able to access the sub-tab which is recently been clicked so that the function within display.jsx is able to expand the sub-tab.
#list.html.erb <h1>Manage content</h1> <%= link_to 'Manage Notifications', notifications_url %> <div id="tree_display" params="#{@reactjsParams}" data-menu-item= '<%= "#{@current_controller}" %>'></div>
Solution Screenshots