forked from UCSB-CS56-F16/UCSB-CS56-F16.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexam.js
32 lines (23 loc) · 726 Bytes
/
exam.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---
layout: null
---
$(document).ready(function(){
console.log("exam.js: document is ready");
$('.page-break-before').each(function() {
var prev = $(this).prev();
var $div = $("<div>", {class: "pagebreak"});
prev.append($div);
$('.exam-page-header-template').first().clone().appendTo($div);
$('.exam-name-header-template').first().clone().appendTo($div);
prev.css('margin-bottom','0');
});
$('td.page-num').each(function(i) {
var pageNum = i+1;
$(this).html(pageNum); // re-calculate page numbers
$(this).data("pageNum",pageNum);
if (pageNum % 2==0) {
$(this).parents(".pagebreak").find(".exam-name-header-table").css("display","none");
}
});
console.log("exam.js: done");
});