|
| 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 17 * NUMBER OF SLOTS 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(2018, 0, 15), |
| 34 | + // In case you want to customize the duties field for each activity |
| 35 | + // Do not modify the keys |
| 36 | + duties: { |
| 37 | + 'Tutorial': 'Conducted Tutorial Sessions', |
| 38 | + 'Consultation with students': 'Conducted Consultation sessions before written quizzes.' |
| 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 | + // Weekly tutorial session 1 |
| 46 | + for (var week = 3; week <= 13; week++) { |
| 47 | + activities_list.push({ |
| 48 | + activity_type: Claim.TUTORIAL, |
| 49 | + week: week, |
| 50 | + day: 'WEDNESDAY', |
| 51 | + start_time: '1200', |
| 52 | + end_time: '1300' |
| 53 | + }); |
| 54 | + } |
| 55 | + |
| 56 | + // Weekly tutorial session 2 |
| 57 | + for (var week = 3; week <= 13; week++) { |
| 58 | + activities_list.push({ |
| 59 | + activity_type: Claim.TUTORIAL, |
| 60 | + week: week, |
| 61 | + day: 'WEDNESDAY', |
| 62 | + start_time: '1300', |
| 63 | + end_time: '1400' |
| 64 | + }); |
| 65 | + } |
| 66 | + |
| 67 | + // 6 hours consultation per tutorial slot |
| 68 | + |
| 69 | + // Consultation 1 |
| 70 | + activities_list.push({ |
| 71 | + activity_type: Claim.CONSULTATION, |
| 72 | + week: 5, |
| 73 | + day: 'TUESDAY', |
| 74 | + start_time: '1200', |
| 75 | + end_time: '1400' |
| 76 | + }); |
| 77 | + |
| 78 | + // Consultation 2 |
| 79 | + activities_list.push({ |
| 80 | + activity_type: Claim.CONSULTATION, |
| 81 | + week: 9, |
| 82 | + day: 'SUNDAY', |
| 83 | + start_time: '1400', |
| 84 | + end_time: '1800' |
| 85 | + }); |
| 86 | + |
| 87 | + // Consultation 3 |
| 88 | + activities_list.push({ |
| 89 | + activity_type: Claim.CONSULTATION, |
| 90 | + week: 11, |
| 91 | + day: 'THURSDAY', |
| 92 | + start_time: '1400', |
| 93 | + end_time: '1700' |
| 94 | + }); |
| 95 | + |
| 96 | + // Consultation 4 |
| 97 | + activities_list.push({ |
| 98 | + activity_type: Claim.CONSULTATION, |
| 99 | + week: 10, |
| 100 | + day: 'MONDAY', |
| 101 | + start_time: '1200', |
| 102 | + end_time: '1500' |
| 103 | + }); |
| 104 | + |
| 105 | + |
| 106 | + return activities_list; |
| 107 | + } |
| 108 | +}; |
| 109 | + |
| 110 | +// *********************************************************** |
| 111 | +// DO NOT CHANGE THE BOTTOM UNLESS YOU KNOW WHAT YOU ARE DOING |
| 112 | +// *********************************************************** |
| 113 | + |
| 114 | +var core_script = 'https://rawgit.com/nusmodifications/nus-scripts/master/claims/claim.js'; |
| 115 | +var c = undefined; |
| 116 | +$.getScript(core_script) |
| 117 | + .done(function () { |
| 118 | + c = new Claim(config); |
| 119 | + }) |
| 120 | + .fail(function (jqxhr, settings, exception) { |
| 121 | + console.warn('Error loading script'); |
| 122 | + console.warn(jqxhr); |
| 123 | + console.warn(exception); |
| 124 | + }); |
| 125 | +// c.makeAllClaims(); |
0 commit comments