From William Lyon Mackenzie C.I.
About
Hey CPT!
For a list of homework, set your user-script to this script:
function parse(data){
var first = true, items, line, lines = $('.user-content', data).text().split('\n');
$('#content > h2').text('Homework');
$('#content-body').empty();
for(var i = 0; i < lines.length; i++){
line = lines[i];
if(line.indexOf('HEAD') == 0){
items = line.split(' || ');
if(!first) $('#content-body').append('<br/>');
$('#content-body').append('<div style="font-size:22px;font-weight:bold;">' + items[1] + '</div>');
first = false;
}
else if(line.indexOf('PROBLEM') == 0){
items = line.split(' || ');
$('#content-body').append('<div style="font-size:18px;"><a href="/problem/' + items[1] + '">' + items[2] + ' (' + items[3] + ' points)' + '</a></div>');
}
}
}
$(document).ready(function(){
$('#nav-list li > a[href="/problems/"]').before('<li><a href="/homework" class="nav-problem">Homework</a>');
if(location.pathname == '/homework') $.get('https://dmoj.ca/user/MCPT', parse);
});
This script adds a "Homework" page to DMOJ and a link to it on the top-bar. All homework will be automatically updated by us.
(If you're wondering, this is where we store the homework)
HEAD || Fun Data Structures!
PROBLEM || ds5 || Dynamic Tree Test || 50
PROBLEM || ioi13p6 || IOI - Game || 40
HEAD || Fun Graph Theory!
PROBLEM || mockccc15s5 || Kongou || 50
PROBLEM || stnbd6 || Terminus Est || 50