mod_forum/local/grades/grader

This module will tie together all of the different calls the gradable module will make.

Source:
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Members

(static, constant) launch

Source:

Launch the grader interface with the specified parameters.

(static, constant) view

Source:

Show the grade for a specific user.

Methods

(async, inner) displayGradingError(root, user, err)

Source:

Display a grading error, typically from a failed save.

Parameters:
Name Type Description
root HTMLElement

The container for the grader

user Object

The user who was errored

err Object

The details of the error

(inner) displayUserPicker(root, html)

Source:

Helper function that replaces the user picker placeholder with what we get back from the user picker class.

Parameters:
Name Type Description
root HTMLElement
html String

(inner) fetchContentFromRender(html, js) → {array}

Source:

To be removed, this is now done as a part of Templates.renderForPromise()

Parameters:
Name Type Description
html String
js String
Returns:

An array containing the HTML, and JS.

Type
array

(inner) getSaveUserGradeFunction(root, setGradeForUser) → {function}

Source:

Get the function used to save a user grade.

Parameters:
Name Type Description
root HTMLElement

The container for the grader

setGradeForUser function

The function that will be called.

Returns:
Type
function

(inner) getUpdateUserContentFunction(root, getContentForUser, getGradeForUser, saveGradeForUser) → {function}

Source:

Here we build the function that is passed to the user picker that'll handle updating the user content area of the grading interface.

Parameters:
Name Type Description
root HTMLElement
getContentForUser function
getGradeForUser function
saveGradeForUser function
Returns:
Type
function

(inner) hideSearchResultContainer(bodyContainer, userPickerContainer, searchResultsContainer)

Source:

Hide the search results container and show the user picker and body content.

Parameters:
Name Type Description
bodyContainer HTMLElement

The container element for the body content

userPickerContainer HTMLElement

The container element for the user picker

searchResultsContainer HTMLElement

The container element for the search results

(inner) hideUserSearchInput(toggleSearchButton, searchContainer, searchInput)

Source:

Toggles the visibility of the user search.

Parameters:
Name Type Description
toggleSearchButton HTMLElement

The button that toggles the search

searchContainer HTMLElement

The container element for the user search

searchInput HTMLElement

The input element for searching

(inner) registerEventListeners(graderLayout, userPicker, saveGradeFunction, userList)

Source:

Add click handlers to the buttons in the header of the grading interface.

Parameters:
Name Type Description
graderLayout HTMLElement
userPicker Object
saveGradeFunction function
userList Array

List of users for the grader.

(async, inner) renderSearchResults(searchResultsContainer, users)

Source:

Render the list of users in the search results area.

Parameters:
Name Type Description
searchResultsContainer HTMLElement

The container element for search results

users Array

The list of users to display

(inner) searchForUsers(userList, searchTerm) → {Array}

Source:

Find the list of users who's names include the given search term.

Parameters:
Name Type Description
userList Array

List of users for the grader

searchTerm String

The search term to match

Returns:
Type
Array

(inner) setContentContainerMargin(graderContainer, rightMargin)

Source:

Adjusts the right margin of the content container.

Parameters:
Name Type Description
graderContainer HTMLElement

The container for the grader app.

rightMargin Number

The right margin value.

(inner) showSearchResultContainer(bodyContainer, userPickerContainer, searchResultsContainer)

Source:

Show the search results container and hide the user picker and body content.

Parameters:
Name Type Description
bodyContainer HTMLElement

The container element for the body content

userPickerContainer HTMLElement

The container element for the user picker

searchResultsContainer HTMLElement

The container element for the search results

(inner) showUserSearchInput(toggleSearchButton, searchContainer, searchInput)

Source:

Toggles the visibility of the user search.

Parameters:
Name Type Description
toggleSearchButton HTMLElement

The button that toggles the search

searchContainer HTMLElement

The container element for the user search

searchInput HTMLElement

The input element for searching