|
| 1 | +// *********************************************************** |
| 2 | +// READ THE FOLLOWING BEFORE STARTING |
| 3 | +// *********************************************************** |
| 4 | +// 1. **IMPORTANT STEP** Change the properties in the config object in the next section. |
| 5 | + |
| 6 | +// 2. Login to the portal at: https://mysoc.nus.edu.sg/~tssclaim/. Fill in your bank account information if you haven't. |
| 7 | + |
| 8 | +// 3. Access the page titled 'Student Claim Submission' (https://mysoc.nus.edu.sg/~tssclaim/tutor/teach_claim.php?page=1) and click on |
| 9 | +// the 'Claim' button under your module. You should see the interface for you to enter details of the teaching claim activity. |
| 10 | + |
| 11 | +// 4. Open the JS console (Ctrl/Cmd + Shift/Option + J), paste all the code in this file in the JS console and press enter. You should |
| 12 | +// see the message 'Claim object successfully created. Run c.makeAllClaims() to start.'. |
| 13 | + |
| 14 | +// 5. Run the function c.makeAllClaims() . Wait until the alert 'All claims made!' is shown, then press 'OK'. |
| 15 | + |
| 16 | +// 6. You will be brought back to the previous page. Click on the button 'Claim' again and verify that you have 80 hours in total. |
| 17 | + |
| 18 | +// To delete all claims on the page, run the function c.deleteAllClaims() |
| 19 | + |
| 20 | + |
| 21 | +// *********************************************************** |
| 22 | +// CONFIGURE THE RELEVANT PROPERTIES IN THE CONFIG OBJECT |
| 23 | +// *********************************************************** |
| 24 | + |
| 25 | +var config = { |
| 26 | + // Your NUSSTU ID, such as a0012345 |
| 27 | + student_id: prompt('Your NUSSTU ID, such as a0012345'), |
| 28 | + // Module you are claiming hours for, such as CS1101S |
| 29 | + module: 'CS2010', |
| 30 | + // Format: YYYY/MM/DD |
| 31 | + // Note: Month is from 0-11, Date is from 1-31 |
| 32 | + // This should be the semester's week 1. For AY14/15 Sem 1, it's Monday, Aug 12 |
| 33 | + first_day_of_sem: new Date(2016, 7, 8), |
| 34 | + // In case you want to customize the duties field for each activity |
| 35 | + // Do not modify the keys |
| 36 | + duties: { |
| 37 | + 'Assignment Marking': 'Graded students\' assignments', |
| 38 | + 'Lab': 'Conducted laboratory sessions' |
| 39 | + }, |
| 40 | + |
| 41 | + // The following function should return a list of claim objects that you want to make |
| 42 | + activities_list_fn: function () { |
| 43 | + var activities_list = []; |
| 44 | + |
| 45 | + // 3 hours marking per class |
| 46 | + for (var week = 3; week <= 13; week++) { |
| 47 | + activities_list.push({ |
| 48 | + activity_type: Claim.ASSIGNMENT_MARKING, |
| 49 | + week: week, |
| 50 | + day: 'SATURDAY', |
| 51 | + start_time: '1600', |
| 52 | + end_time: '1900' |
| 53 | + }); |
| 54 | + } |
| 55 | + |
| 56 | + // Weekly lab sessions // fill in your time slot |
| 57 | + for (var week = 3; week <= 13; week++) { |
| 58 | + activities_list.push({ |
| 59 | + activity_type: Claim.LAB, |
| 60 | + week: week, |
| 61 | + day: 'THURSDAY', |
| 62 | + start_time: '1600', |
| 63 | + end_time: '1700' |
| 64 | + }); |
| 65 | + } |
| 66 | + |
| 67 | + return activities_list; |
| 68 | + } |
| 69 | +}; |
| 70 | + |
| 71 | +// *********************************************************** |
| 72 | +// DO NOT CHANGE THE BOTTOM UNLESS YOU KNOW WHAT YOU ARE DOING |
| 73 | +// *********************************************************** |
| 74 | + |
| 75 | +var core_script = 'https://rawgit.com/nusmodifications/nus-scripts/master/claims/claim.js'; |
| 76 | +var c = undefined; |
| 77 | +$.getScript(core_script) |
| 78 | + .done(function () { |
| 79 | + c = new Claim(config); |
| 80 | + }) |
| 81 | + .fail(function (jqxhr, settings, exception) { |
| 82 | + console.warn('Error loading script'); |
| 83 | + console.warn(jqxhr); |
| 84 | + console.warn(exception); |
| 85 | + }); |
| 86 | +// c.makeAllClaims(); |
0 commit comments