|
1 | | -Posttest |
2 | | -======== |
3 | | - |
4 | | -.. raw:: html |
5 | | - |
6 | | - <script> |
7 | | -
|
8 | | - function triggerSaveClicks(callback) { |
9 | | - console.log("Triggering all Save and Save & Run clicks..."); |
10 | | -
|
11 | | - let saveButtons = document.querySelectorAll('button'); |
12 | | - let saveCount = 0; |
13 | | -
|
14 | | - saveButtons.forEach(button => { |
15 | | - if (button.innerText.includes('Save') || button.innerText.includes('Save & Run')) { |
16 | | - console.log(`Clicking button: ${button.innerText}`); |
17 | | - button.click(); // Simulate button click |
18 | | - saveCount++; |
19 | | - } |
20 | | - }); |
21 | | -
|
22 | | - // Ensure logging is complete before proceeding |
23 | | - setTimeout(() => { |
24 | | - console.log(`Triggered ${saveCount} Save clicks. Proceeding...`); |
25 | | - if (callback) callback(); |
26 | | - }, 1000); // Wait 1 second for logging to process |
27 | | - |
28 | | -
|
29 | | - document.addEventListener("DOMContentLoaded", function() { |
30 | | - let introLink = document.getElementById('thank_you'); // Change ID if needed |
31 | | - if (introLink) { |
32 | | - introLink.addEventListener("click", function(event) { |
33 | | - event.preventDefault(); // Stop immediate navigation |
34 | | -
|
35 | | - console.log("User clicked the Introduction link. Saving first..."); |
36 | | -
|
37 | | - // Trigger Save clicks, then navigate |
38 | | - triggerSaveClicks(() => { |
39 | | - window.location.href = introLink.href; // Navigate after saving |
40 | | - }); |
41 | | - }); |
42 | | - } |
43 | | - }); |
44 | | -
|
45 | | - </script> |
46 | | -
|
| 1 | +Wrap-Up Check |
| 2 | +============== |
47 | 3 |
|
48 | 4 | Please answer the following questions. |
49 | 5 | :: |
@@ -73,7 +29,8 @@ Please answer the following questions. |
73 | 29 | - Recommended Time: Spend at most 2 minutes - Put "I am not sure" and click "Save" if unsure of the answer. |
74 | 30 |
|
75 | 31 | For the code piece above, fill in the missing two lines to print each employee's name along with their skills using a nested loop. |
76 | | -
|
| 32 | + |
| 33 | + Note: Be sure to indent the second line correctly. |
77 | 34 |
|
78 | 35 | .. activecode:: posttest-2-mooc_nested |
79 | 36 | :autograde: unittest |
@@ -185,16 +142,16 @@ What to do next |
185 | 142 | ================ |
186 | 143 | .. raw:: html |
187 | 144 |
|
188 | | - <p>Click on the following link to the final page: <b><a id="post_survey"> <font size="+1">Thank you!</font></a></b></p> |
| 145 | + <p>Click on the following link to the final page: <b><a id="thank_you"> <font size="+1">Thank you!</font></a></b></p> |
189 | 146 |
|
190 | 147 | .. raw:: html |
191 | 148 |
|
192 | 149 | <script type="text/javascript" > |
193 | 150 |
|
194 | 151 | window.onload = function() { |
195 | 152 |
|
196 | | - a = document.getElementById("post_survey") |
197 | | - a.href = "mc_post_survey.html" |
| 153 | + a = document.getElementById("thank_you") |
| 154 | + a.href = "mc_thank_you.html" |
198 | 155 | }; |
199 | 156 |
|
200 | 157 | </script> |
0 commit comments