Commit 1a8fde10 by Muhammad Shoaib

1 ) added the condition on the attempts section. If there is no attempts then…

1 ) added the condition on the attempts section. If there is no attempts then the header section shouldn't be visible.
2) accordion pane content behavior fix
parent 7ab4c451
......@@ -123,7 +123,6 @@ var edx = edx || {};
if (this.template !== null) {
var html = this.template({proctored_exam_allowances: this.collection.toJSON()});
this.$el.html(html);
this.$el.show();
}
},
showAddModal: function (event) {
......
......@@ -125,7 +125,6 @@ var edx = edx || {};
_.extend(data, viewHelper);
var html = this.template(data);
this.$el.html(html);
this.$el.show();
}
},
onRemoveAttempt: function (event) {
......
......@@ -75,47 +75,50 @@
</ul>
<div class="clearfix"></div>
</div>
<table class="exam-attempts-table">
<thead>
<tr class="exam-attempt-headings">
<th class="username"><%- gettext("Username") %></th>
<th class="exam-name"><%- gettext("Exam Name") %></th>
<th class="attempt-allowed-time"><%- gettext("Allowed Time (Minutes)") %> </th>
<th class="attempt-started-at"><%- gettext("Started At") %></th>
<th class="attempt-completed-at"><%- gettext("Completed At") %> </th>
<th class="attempt-status"><%- gettext("Status") %> </th>
<th class="c_action"><%- gettext("Action") %> </th>
</tr>
</thead>
<tbody>
<% _.each(proctored_exam_attempts, function(proctored_exam_attempt){ %>
<tr class="allowance-items">
<td>
<%- interpolate(gettext(' %(username)s '), { username: proctored_exam_attempt.user.username }, true) %>
</td>
<td>
<%- interpolate(gettext(' %(exam_display_name)s '), { exam_display_name: proctored_exam_attempt.proctored_exam.exam_name }, true) %>
</td>
<td> <%= proctored_exam_attempt.allowed_time_limit_mins %></td>
<td> <%= getDateFormat(proctored_exam_attempt.started_at) %></td>
<td> <%= getDateFormat(proctored_exam_attempt.completed_at) %></td>
<td>
<% if (proctored_exam_attempt.status){ %>
<%= proctored_exam_attempt.status %>
<% } else { %>
N/A
<% } %>
</td>
<td>
<% if (proctored_exam_attempt.status){ %>
<a href="#" class="remove-attempt" data-attempt-id="<%= proctored_exam_attempt.id %>" >[x]</a>
</td>
<% } else { %>
N/A
<% } %>
<% var is_proctored_attempts = proctored_exam_attempts.length !== 0 %>
<% if (is_proctored_attempts) { %>
<table class="exam-attempts-table">
<thead>
<tr class="exam-attempt-headings">
<th class="username"><%- gettext("Username") %></th>
<th class="exam-name"><%- gettext("Exam Name") %></th>
<th class="attempt-allowed-time"><%- gettext("Allowed Time (Minutes)") %> </th>
<th class="attempt-started-at"><%- gettext("Started At") %></th>
<th class="attempt-completed-at"><%- gettext("Completed At") %> </th>
<th class="attempt-status"><%- gettext("Status") %> </th>
<th class="c_action"><%- gettext("Action") %> </th>
</tr>
<% }); %>
</tbody>
</table>
</thead>
<tbody>
<% _.each(proctored_exam_attempts, function(proctored_exam_attempt){ %>
<tr class="allowance-items">
<td>
<%- interpolate(gettext(' %(username)s '), { username: proctored_exam_attempt.user.username }, true) %>
</td>
<td>
<%- interpolate(gettext(' %(exam_display_name)s '), { exam_display_name: proctored_exam_attempt.proctored_exam.exam_name }, true) %>
</td>
<td> <%= proctored_exam_attempt.allowed_time_limit_mins %></td>
<td> <%= getDateFormat(proctored_exam_attempt.started_at) %></td>
<td> <%= getDateFormat(proctored_exam_attempt.completed_at) %></td>
<td>
<% if (proctored_exam_attempt.status){ %>
<%= proctored_exam_attempt.status %>
<% } else { %>
N/A
<% } %>
</td>
<td>
<% if (proctored_exam_attempt.status){ %>
<a href="#" class="remove-attempt" data-attempt-id="<%= proctored_exam_attempt.id %>" >[x]</a>
</td>
<% } else { %>
N/A
<% } %>
</tr>
<% }); %>
</tbody>
</table>
<%} %>
</section>
</div>
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