Commit 33c41577 by chrisndodge

Merge pull request #128 from edx/cdodge/conflict-resolution

Cdodge/conflict resolution
parents 81722c3b 46c97778
...@@ -26,7 +26,3 @@ script: ...@@ -26,7 +26,3 @@ script:
- pylint edx_proctoring --report=no - pylint edx_proctoring --report=no
after_success: coveralls after_success: coveralls
branches:
only:
- master
...@@ -136,12 +136,31 @@ var edx = edx || {}; ...@@ -136,12 +136,31 @@ var edx = edx || {};
}, },
render: function () { render: function () {
if (this.template !== null) { if (this.template !== null) {
var data_json = this.collection.toJSON()[0];
// calculate which pages ranges to display
// show no more than 5 pages at the same time
var start_page = data_json.pagination_info.current_page - 2;
if (start_page < 1) {
start_page = 1;
}
var end_page = start_page + 4;
if (end_page > data_json.pagination_info.total_pages) {
end_page = data_json.pagination_info.total_pages;
}
var data = { var data = {
proctored_exam_attempts: this.collection.toJSON()[0].proctored_exam_attempts, proctored_exam_attempts: data_json.proctored_exam_attempts,
pagination_info: this.collection.toJSON()[0].pagination_info, pagination_info: data_json.pagination_info,
attempt_url: this.collection.toJSON()[0].attempt_url, attempt_url: data_json.attempt_url,
inSearchMode: this.inSearchMode, inSearchMode: this.inSearchMode,
searchText: this.searchText searchText: this.searchText,
start_page: start_page,
end_page: end_page
}; };
_.extend(data, viewHelper); _.extend(data, viewHelper);
var html = this.template(data); var html = this.template(data);
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</a> </a>
</li> </li>
<% }%> <% }%>
<% for(var n = 1; n <= pagination_info.total_pages; n++) { %> <% for(var n = start_page; n <= end_page; n++) { %>
<li> <li>
<a class="target-link <% if (pagination_info.current_page == n){ %> active <% } %>" <a class="target-link <% if (pagination_info.current_page == n){ %> active <% } %>"
data-target-url=" data-target-url="
......
...@@ -34,7 +34,7 @@ def load_requirements(*requirements_paths): ...@@ -34,7 +34,7 @@ def load_requirements(*requirements_paths):
setup( setup(
name='edx-proctoring', name='edx-proctoring',
version='0.6.3', version='0.7.2',
description='Proctoring subsystem for Open edX', description='Proctoring subsystem for Open edX',
long_description=open('README.md').read(), long_description=open('README.md').read(),
author='edX', author='edX',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment