|
| 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: 'CS1010S', |
| 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(2015, 0, 12), |
| 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 | + 'Course Material Preparation': 'Prepared course materials', |
| 39 | + 'Tutorial': 'Conducted tutorial' |
| 40 | + }, |
| 41 | + |
| 42 | + // The following function should return a list of claim objects that you want to make |
| 43 | + activities_list_fn: function () { |
| 44 | + var activities_list = []; |
| 45 | + |
| 46 | + // Course prep: 18 (+4) hours |
| 47 | + |
| 48 | + for (var week = 1; week <= 12; week++) { |
| 49 | + activities_list.push({ |
| 50 | + activity_type: Claim.COURSE_MATERIAL_PREPARATION, |
| 51 | + week: week, |
| 52 | + day: 'SATURDAY', |
| 53 | + start_time: '1730', |
| 54 | + end_time: '1800' |
| 55 | + }); |
| 56 | + } |
| 57 | + for (var week = 1; week <= 12; week++) { |
| 58 | + activities_list.push({ |
| 59 | + activity_type: Claim.COURSE_MATERIAL_PREPARATION, |
| 60 | + week: week, |
| 61 | + day: 'MONDAY', |
| 62 | + start_time: '1100', |
| 63 | + end_time: '1200' |
| 64 | + }); |
| 65 | + } |
| 66 | + // 1-class tutors to reduce to 1hr |
| 67 | + for (var week = 1; week <= 12; week++) { |
| 68 | + activities_list.push({ |
| 69 | + activity_type: Claim.ASSIGNMENT_MARKING, |
| 70 | + week: week, |
| 71 | + day: 'SATURDAY', |
| 72 | + start_time: '1600', |
| 73 | + end_time: '1700' |
| 74 | + }); |
| 75 | + } |
| 76 | + |
| 77 | + // Weekly stuff (Fill in your tutorial timeslots) |
| 78 | + for (var week = 3; week <= 13; week++) { |
| 79 | + if(week === 7) { // no tutorial for week 7 |
| 80 | + continue |
| 81 | + } |
| 82 | + activities_list.push({ |
| 83 | + activity_type: Claim.TUTORIAL, |
| 84 | + week: week, |
| 85 | + day: 'MONDAY', |
| 86 | + start_time: '1600', |
| 87 | + end_time: '1700' |
| 88 | + }); |
| 89 | + } |
| 90 | + |
| 91 | + return activities_list; |
| 92 | + } |
| 93 | +}; |
| 94 | + |
| 95 | +// *********************************************************** |
| 96 | +// DO NOT CHANGE THE BOTTOM UNLESS YOU KNOW WHAT YOU ARE DOING |
| 97 | +// *********************************************************** |
| 98 | + |
| 99 | +var core_script = 'https://rawgit.com/nusmodifications/nus-soc-scripts/master/claims/claim.js'; |
| 100 | +var c = undefined; |
| 101 | +$.getScript(core_script) |
| 102 | + .done(function () { |
| 103 | + c = new Claim(config); |
| 104 | + }) |
| 105 | + .fail(function (jqxhr, settings, exception) { |
| 106 | + console.log('Error loading script'); |
| 107 | + console.log(jqxhr); |
| 108 | + console.log(exception); |
| 109 | + }); |
| 110 | +// c.makeAllClaims(); |
0 commit comments