Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 31 additions & 15 deletions claims/module-claims/claim-cs3216.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,19 @@
// CONFIGURE THE RELEVANT PROPERTIES IN THE CONFIG OBJECT
// ***********************************************************

if (typeof STUDENT_ID == 'undefined') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

declare STUDENT_ID before this line

Copy link
Member

@yangshun yangshun Dec 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (!STUDENT_ID) will do

STUDENT_ID = null;
}

var config = {
// Your NUSSTU ID, such as a0012345
student_id: prompt('Your NUSSTU ID, such as a0012345'),
student_id: STUDENT_ID,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

argh extra space

// Module you are claiming hours for, such as CS1101S
module: 'CS3216',
// Format: YYYY/MM/DD
// Note: Month is from 0-11, Date is from 1-31
// This should be the semester's week 1. For AY15/16 Sem 1, it's Monday, Aug 10
first_day_of_sem: new Date(2015, 7, 10),
first_day_of_sem: new Date(2016, 7, 8),
// In case you want to customize the duties field for each activity
// Do not modify the keys
duties: {
Expand All @@ -43,7 +47,7 @@ var config = {
activities_list_fn: function () {
var activities_list = [];

// 2015: 24 hours of assignment marking!
// 2016: 24 hours of assignment marking and 6 hours of course material preparation!

for (var week = 4; week <= 10; week+=2) {
activities_list.push({
Expand All @@ -61,6 +65,14 @@ var config = {
end_time: '1900'
});
}

activities_list.push({
activity_type: Claim.COURSE_MATERIAL_PREPARATION, // Now called "Course Material Creation".
week: 1,
day: 'MONDAY',
start_time: '0900',
end_time: '1500'
});

return activities_list;
}
Expand All @@ -70,15 +82,19 @@ var config = {
// DO NOT CHANGE THE BOTTOM UNLESS YOU KNOW WHAT YOU ARE DOING
// ***********************************************************

var core_script = 'https://rawgit.com/nusmodifications/nus-scripts/master/claims/claim.js';
var c = undefined;
$.getScript(core_script)
.done(function () {
c = new Claim(config);
})
.fail(function (jqxhr, settings, exception ) {
console.warn('Error loading script');
console.warn(jqxhr);
console.warn(exception);
});
// c.makeAllClaims();
if (!STUDENT_ID) { // Chrome does not allow window.prompt() to run on an inactive tab.
alert('Please modify STUDENT_ID in the code, or run STUDENT_ID="a0123456" before pasting and running the code.');
} else {
var core_script = 'https://rawgit.com/nusmodifications/nus-scripts/master/claims/claim.js';
var c = undefined;
$.getScript(core_script)
.done(function () {
c = new Claim(config);
})
.fail(function (jqxhr, settings, exception ) {
console.warn('Error loading script');
console.warn(jqxhr);
console.warn(exception);
});
// c.makeAllClaims(); // Run this after successful pasting of code! :)
}