MDL-52954 assign: Rebuild the assignment single grade page.

This commit is contained in:
Damyon Wiese 2016-02-01 16:13:46 +08:00
parent 2a3647bae5
commit bb690849c9
86 changed files with 4593 additions and 279 deletions

View file

@ -0,0 +1,16 @@
{{#submissioncount}}
<div>
<a class="btn" href="#" data-region="attempt-chooser" data-submissions="submissions-list-{{uniqid}}">{{#str}}viewadifferentattempt, mod_assign{{/str}}</a>
<div class="hide" id="submissions-list-{{uniqid}}">
<div data-region="submissions-list">
{{#submissions}}
<label class="radio">
<input type="radio" name="select-attemptnumber" value="{{attemptnumber}}"/>
{{attemptsummary}}
<br><em>{{statussummary}}</em>
</label>
{{/submissions}}
</div>
</div>
</div>
{{/submissioncount}}

View file

@ -0,0 +1,46 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_assign/grading_actions
Actions panel at the bottom of the assignment grading UI.
Classes required for JS:
* none
Data attributes required for JS:
* data-region
Context variables required for this template:
* see mod/assign/classes/output/grading_app.php
Example context (json):
This template is initially hidden, and is only displayed after the current user info has been loaded.
}}
<form data-region="grading-actions-form" class="hide">
<label>{{#str}}sendstudentnotifications, mod_assign{{/str}}
<input type="checkbox" name="sendstudentnotifications"
{{#defaultsendnotifications}}checked="checked"{{/defaultsendnotifications}} />
</label>
<button type="submit" class="btn btn-primary" name="savechanges">{{#str}}savechanges{{/str}}</button>
<button type="submit" class="btn" name="resetbutton">{{#str}}reset{{/str}}</button>
</form>
{{#js}}
require(['mod_assign/grading_actions'], function(GradingActions) {
new GradingActions('[data-region="grade-actions"]');
});
{{/js}}

View file

@ -0,0 +1,56 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_assign/grading_app
Actions panel at the bottom of the assignment grading UI.
Classes required for JS:
* Uses some bootstrap classes, but for visual appeal only.
Data attributes required for JS:
* data-region, data-first-userid, data-courseid, data-contextid, data-assignmentid
Context variables required for this template:
* see mod/assign/classes/output/grading_app.php
Example context (json):
This template includes ajax functionality, so it cannot be shown in the template library.
}}
<div data-region="grading-navigation-panel" data-first-userid="{{userid}}" data-courseid="{{courseid}}" data-showuseridentity="{{showuseridentity}}">
{{> mod_assign/grading_navigation }}
</div>
<div data-region="grade-panel" {{^showreview}}class="fullwidth"{{/showreview}}>
<div data-region="grade" data-contextid="{{contextid}}" data-assignmentid="{{assignmentid}}">
{{> mod_assign/grading_panel }}
</div>
</div>
{{#showreview}}
<div data-region="review-panel">
<div data-region="review">
{{> mod_assign/review_panel }}
</div>
</div>
{{/showreview}}
<div data-region="grade-actions-panel">
<div data-region="grade-actions">
{{> mod_assign/grading_actions }}
</div>
</div>
<div data-region="overlay" class="moodle-has-zindex">
{{> mod_assign/grading_save_in_progress }}
</div>

View file

@ -0,0 +1,73 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_assign/grading_navigation
Actions panel at the bottom of the assignment grading UI.
Classes required for JS:
* none
Data attributes required for JS:
* data-region, data-assignmentid, data-groupid
Context variables required for this template:
* see mod/assign/classes/output/grading_app.php
Example context (json):
This template includes ajax functionality, so it cannot be shown in the template library.
}}
<div data-region="grading-navigation" class="row-fluid">
<div data-region="assignment-info" class="span4">
<a href="{{config.wwwroot}}/course/view.php?id={{courseid}}">{{coursename}}</a><br/>
<a href="{{config.wwwroot}}/mod/assign/view.php?id={{cmid}}">{{name}}</a>
{{#caneditsettings}}
<a href="{{config.wwwroot}}/course/modedit.php?update={{cmid}}&return=1">{{#pix}}t/edit, core,{{#str}}editsettings{{/str}}{{/pix}}</a>
{{/caneditsettings}}
<div role="tooltip" id="tooltip-{{uniqid}}" class="accesshide">
{{#duedate}}
{{#str}}duedatecolon, mod_assign, {{duedatestr}}{{/str}}
{{/duedate}}
{{#cutoffdate}}
<br>{{cutoffdatestr}}
{{/cutoffdate}}
{{#duedate}}
<br>{{timeremainingstr}}
{{/duedate}}
</div>
{{#duedate}}
<br/><small data-region="assignment-tooltip" aria-describedby="tooltip-{{uniqid}}">{{#str}}duedatecolon, mod_assign, {{duedatestr}}{{/str}}</small>
{{/duedate}}
</span>
</div>
<div data-region="user-info" class="span4" data-assignmentid="{{assignmentid}}" data-groupid="{{groupid}}">
{{> mod_assign/grading_navigation_user_info }}
</div>
<div data-region="user-selector" class="span4">
<div class="alignment">
{{> mod_assign/grading_navigation_user_selector }}
</div>
</div>
</div>
{{#js}}
require(['mod_assign/grading_navigation', 'core/tooltip'], function(GradingNavigation, ToolTip) {
var nav = new GradingNavigation('[data-region="user-selector"]');
var tooltip = new ToolTip('[data-region="assignment-tooltip"]');
});
{{/js}}

View file

@ -0,0 +1,34 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_assign/grading_navigation_no_users
Notification when no users are available (given the current filters).
Classes required for JS:
* none
Data attributes required for JS:
* None
Context variables required for this template:
* None
Example context (json):
{ }
}}
<h3>{{#str}}nousersselected, mod_assign{{/str}}</h3>

View file

@ -0,0 +1,40 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_assign/grading_navigation_user_info
Initial template for the user info panel - until a user is selected
a loading spinner will be displayed.
Classes required for JS:
* none
Data attributes required for JS:
* None
Context variables required for this template:
* None
Example context (json):
{ }
}}
{{> mod_assign/loading }}
{{#js}}
require(['mod_assign/grading_navigation_user_info'], function(UserInfo) {
new UserInfo('[data-region="user-info"]');
});
{{/js}}

View file

@ -0,0 +1,67 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_assign/grading_navigation_user_selector
The template HTML for the user selector in the top right corner.
Classes required for JS:
* none
Data attributes required for JS:
* data-action, data-assignmentid, data-groupid, data-region
Context variables required for this template:
* see mod/assign/classes/output/grading_app.php
Example context (json):
This template uses ajax functionality, so it cannot be shown in the template library.
}}
<a href="#previous" data-action="previous-user">{{larrow}}</a>
<span>
<select data-action="change-user" data-assignmentid="{{assignmentid}}" data-groupid="{{groupid}}">
</select>
</span>
<a href="#next" data-action="next-user">{{rarrow}}</a>
<br>
<span data-region="user-count">
<small>
<span data-region="user-count-summary">{{#str}}xofy, mod_assign, { "x": "{{index}}", "y": "{{count}}" }{{/str}}</span>
</small>
</span>
<span data-region="configure-filters" id="filter-configuration-{{uniqid}}" class="well well-small">
<form>
<label><input type="checkbox" name="filter_submitted">{{#str}}filtersubmitted, mod_assign{{/str}}</label>
<label><input type="checkbox" name="filter_notsubmitted">{{#str}}filternotsubmitted, mod_assign{{/str}}</label>
<label><input type="checkbox" name="filter_requiregrading">{{#str}}filterrequiregrading, mod_assign{{/str}}</label>
</form>
</span>
<a href="#" data-region="user-filters" title="{{#str}}changefilters, mod_assign{{/str}}" aria-expanded="false" aria-controls="filter-configuration-{{uniqid}}">
<span class="accesshide">
{{#filters}}
{{filtername}}
{{/filters}}
{{^filters}}
{{#str}}nofilters, mod_assign{{/str}}
{{/filters}}
</span>
{{#pix}}i/filter{{/pix}}
</a>

View file

@ -0,0 +1,40 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_assign/grading_navigation_user_summary
Shown when the real data for a user has been loaded. Display in the top left corner.
Classes required for JS:
* none
Data attributes required for JS:
* data-region, data-assignmentid, data-groupid
Context variables required for this template:
* id, courseid, all fields from mod_assign_list_participants
Example context (json):
{
"id": "5",
"fullname": "Mr T",
"hasidentity": true,
"identity": "t@example.org, T"
"profileimageurl": "https://moodle.org/pix/u/f3.png"
}
}}
<h4><a href="{{globals.config.wwwroot}}/user/view.php?id={{id}}&course={{courseid}}">{{#profileimageurl}}<img src="{{profileimageurl}}" class="img-rounded" height="40" role="presentation"/>{{/profileimageurl}} {{fullname}}{{#hasidentity}}<em><small> {{identity}} </small></em>{{/hasidentity}}</a></h4>

View file

@ -0,0 +1,39 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_assign/grading_panel
Shown a place holder until the real content is fetched via ajax.
Classes required for JS:
* none
Data attributes required for JS:
* None
Context variables required for this template:
* None
Example context (json):
This template loads it's content via ajax, so it cannot be shown in the template library.
}}
{{> mod_assign/loading }}
{{#js}}
require(['mod_assign/grading_panel'], function(GradingPanel) {
new GradingPanel('[data-region="grade"]');
});
{{/js}}

View file

@ -0,0 +1,35 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_assign/grading_save_in_progress
Shown in an overlay when the grading form has been submitted, and we are
waiting for a response.
Classes required for JS:
* none
Data attributes required for JS:
* None
Context variables required for this template:
* None
Example context (json):
{ "id": "4" }
}}
<h3>{{#str}}savingchanges, mod_assign{{/str}} {{> mod_assign/loading }}</h3>

View file

@ -0,0 +1,41 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_assign/list_participant_user_summary
Shown as the options for the list of users in the user picker on the grading page.
Classes required for JS:
* none
Data attributes required for JS:
* None
Context variables required for this template:
* fullname
* requiregrading
* identity - list of only the visible identity fields
* list of fields from mod_assign_list_participants webservice
Example context (json):
{ "id": "4",
"fullname": "Mr T",
"requiregrading": "true",
"identity": "email, phone, etc"
}
}}
<span>{{fullname}} <small>{{identity}}</small> {{#requiregrading}}<abbr title="{{#str}}filterrequiregrading, mod_assign{{/str}}">*</abbr>{{/requiregrading}}</span>

View file

@ -0,0 +1,34 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_assign/loading
Loading spinner shown while waiting for an ajax request
Classes required for JS:
* None
Data attibutes required for JS:
* None
Context variables required for this template:
* None
Example context (json):
{ }
}}
{{#pix}}y/loading, core, {{#str}}loading, mod_assign{{/str}}{{/pix}}

View file

@ -0,0 +1 @@
<a href="#" data-region="popout-button">{{#pix}}e/fullscreen,core,{{#str}}togglezoom, mod_assign{{/str}}{{/pix}}</a>

View file

@ -0,0 +1,34 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_assign/review_panel
Show a placeholder in the review panel until something injects some content.
Classes required for JS:
* None
Data attibutes required for JS:
* None
Context variables required for this template:
* None
Example context (json):
{ }
}}
{{> mod_assign/loading }}