Skip to content

Commit

Permalink
Merge pull request barbarer#167 from xinyinghou/master
Browse files Browse the repository at this point in the history
Updated materials - modified clicking mechanism and posttest and puzzle 4
  • Loading branch information
barbarer authored Sep 3, 2024
2 parents 5ece32f + 1909767 commit d7bce4e
Show file tree
Hide file tree
Showing 25 changed files with 745 additions and 683 deletions.
12 changes: 3 additions & 9 deletions _sources/turtles/SE_turtle/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Python 3 Turtles Practice
Study Information
^^^^^^^^^^^^^^^^^^^^^^

Hi, we are a team of researchers in Professor Ericson’s Lab at UMSI. You are invited to participate in a study to help CS entry-level learning.
You must be at least 18 years old to participate into this study. Your participation will help more novice programmers become successful in introductory computing courses in a low-cost, scalable, and easily adopted way.
Hi, we are a team of researchers in Professor Ericson’s Lab at UMSI. You are invited to participate in a study to help CS entry-level learning (UM IRB HUM00253438).
Your participation will help more novice programmers become successful in introductory computing courses in a low-cost, scalable, and easily adopted way.

This study has four parts. It will take approximately 40 minutes to complete it.
Please do the parts in order and answer questions to the best of your ability without any outside help including ChatGPT.
Expand All @@ -18,13 +18,7 @@ The four parts are:
- **Practice** - Complete four mixed-up puzzle pairs, followed by survey questions.
- **Posttest** - Includes 10 multiple-choice / true-false / short-answer questions.

Only your anonymous log fles from this session will be used for this study. No identifiable information will be collected. Participating in this study is completely voluntary.

If you do not meet the eligibility criteria or if you choose to withdraw your consent and wish to have your **anonymous responses** deleted, please click to withdraw from the study.

.. poll:: withdrawal
:option_1: I do not want to participate in this study.
:results: instructor
Only your anonymous log fles from this session will be used for this study. No identifiable information will be collected. You will not be graded on your performance.

If you have questions at any time about the study or the procedures, you may contact the researcher at email xyhou@umich.edu.

Expand Down
9 changes: 0 additions & 9 deletions _sources/turtles/SE_turtle/pp-intro-IE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@ You may need to indent the blocks as well. There may also be extra blocks that
needed in a correct solution that you can leave on the left side. Click the "Check" button
to check your solution.

See the video below for an example.

.. youtube:: Rf7oWHlo-e0
:divid: iwgex1-parsons1-ppie
:optional:
:width: 500
:height: 415
:align: center

Try to solve the following mixed-up code problem. This problem doesn't require any indentation.

.. parsonsprob:: intro-simple-parsons-ppie-1
Expand Down
9 changes: 0 additions & 9 deletions _sources/turtles/SE_turtle/pp-intro-PP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ may need to indent the blocks as well. There may also be extra blocks that are
needed in a correct solution that you can leave on the left side. Click the "Check" button
to check your solution.

See the video below for an example.

.. youtube:: Rf7oWHlo-e0
:divid: iwgex1-parsons1-ppnse
:optional:
:width: 500
:height: 415
:align: center

Try to solve the following mixed-up code problem. This problem doesn't require any indentation.

.. parsonsprob:: intro-simple-parsons-ppnse-1
Expand Down
22 changes: 7 additions & 15 deletions _sources/turtles/SE_turtle/pp-intro-SE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ may need to indent the blocks as well. There may also be extra blocks that are
needed in a correct solution that you can leave on the left side. Click the "Check" button
to check your solution.

See the video below for an example.

.. youtube:: Rf7oWHlo-e0
:divid: iwgex1-parsons1-ppse
:optional:
:width: 500
:height: 415
:align: center

Try to solve the following mixed-up code problem. This problem doesn't require any indentation.

.. parsonsprob:: intro-simple-parsons-ppse-1
Expand Down Expand Up @@ -100,21 +91,22 @@ The clicable area are those with a dark gray background and a border around them
You will then receive a completed explanatoin of the solution you got from solving the mixed-up puzzle.


.. image:: <img src="https://i.postimg.cc/Kzgng2sJ/SE-introduction.png" width="400">

.. image:: https://i.postimg.cc/DvVqXB8F/SE-introduction.png
:width: 450
:align: center

Four types of feedback will be provided for each option you select.

👉 Correct / Incorrect feedback
If you see a feedback message like "You are correct!" or "Incorrect.", it means you have selected the correct or incorrect option.

👉 Detailed feedback on how many options you got correctly or incorrectly.
👉 Detailed feedback on how many options you got correct or wrong.
If you see a feedback message like "You clicked on 1 of the 2 correct elements and 0 of the 3 incorrect elements.", it tells you the number of correct and incorrect options you selected.

👉 Hints on how to correct the incorrectly selected options.
👉 Hints on how to correct the wrong options.
If you see a feedback message like "Think about the type of the input parameter.", it provides hints on how to correct the incorrect options you selected.

👉 Highlighted incorrectly selected options
👉 Highlighted incorrect options
The Incorrect options you selected will be highlighted in pink background with a red border. You need to deselect the incorrect options and select the correct options.


Expand Down Expand Up @@ -158,4 +150,4 @@ What to do next
a.href = "pps-SE-pp1.html"
};
</script>
</script>
84 changes: 45 additions & 39 deletions _sources/turtles/SE_turtle/pps-IE-pp1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,49 +39,55 @@ Practice Problems
.. raw:: html


<script type="text/javascript">
// Initialize a counter variable at a higher scope
let clickCount = 0;
// Function to update the click count
function updateClickCount() {
clickCount++;
// Here you would usually update the UI, but it's not needed now
console.log(`Button clicked ${clickCount} times`);
}
// Function to check for presence of button and handle the link click
function handleLinkClick(event) {
// Check if an element with the class 'alert alert-info' contains the text 'Perfect!'
const alertElement = document.querySelector('.alert');
if ((alertElement && alertElement.textContent.includes('Perfect!')) || clickCount >= 8) {
// Allow the link to be followed
return true;
} else {
// Prevent the default link action
event.preventDefault();
// Display a popup window
alert('Please try again to complete the mixed-up puzzle first.' + "\n" + 'Remember, you can click the "Help me" button to remove an unnecessary block or combine two blocks.' + "\n" + 'You can skip the puzzle after 8 attempts.');
return false;
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', () => {
let isC8 = false;
// Override the console.log function to capture the log event
const originalConsoleLog = console.log;
console.log = function (message) {
// Call the original console.log function to ensure the message still appears in the console
originalConsoleLog.apply(console, arguments);
// Check if the message contains the specific pattern
if (message.includes('Save logging event')) {
// Extract the JSON part from the log message
const jsonString = message.substring(message.indexOf('{'));
checkActValue(jsonString);
}
};
function checkActValue(loggingEvent) {
try {
const eventObj = JSON.parse(loggingEvent);
const actValue = eventObj.act;
const lastPart = actValue.split('|').pop();
if (lastPart === "c8") {
isC8 = true;
}
console.log(`Last part of act: ${lastPart}, isC8: ${isC8}`);
} catch (error) {
console.error('Error parsing the logging event:', error);
}
}
}
// Attach the click event handler to the link
document.getElementById('pp-e1').addEventListener('click', handleLinkClick);
function handleLinkClick(event) {
const alertElement = document.querySelector('.alert');
if ((alertElement && alertElement.textContent.includes('Perfect!')) || isC8) {
return true;
} else {
event.preventDefault();
alert('Please try again to complete the mixed-up puzzle first.' + "\n" + 'Remember, you can click the "Help me" button to remove an unnecessary block or combine two blocks.' + "\n" + 'You can skip the puzzle after 8 attempts.');
return false;
}
}
document.addEventListener('DOMContentLoaded', () => {
// Get references to the button
const checkButton = document.getElementById('parsons-1-check');
// Check if the button was found
if (checkButton) {
// Add an event listener to the button
checkButton.addEventListener('click', updateClickCount);
const linkElement = document.getElementById('ie1');
if (linkElement) {
linkElement.addEventListener('click', handleLinkClick);
} else {
console.error('Button with ID "parsons-1-check" not found.');
console.error('Element with ID "ie1" not found.');
}
});
Expand Down
78 changes: 42 additions & 36 deletions _sources/turtles/SE_turtle/pps-IE-pp2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,49 +34,55 @@ Practice Problems

.. raw:: html

<script type="text/javascript">
<script type="text/javascript">
// Initialize a counter variable at a higher scope
let clickCount = 0;
document.addEventListener('DOMContentLoaded', () => {
let isC8 = false;
// Function to update the click count
function updateClickCount() {
clickCount++;
// Here you would usually update the UI, but it's not needed now
console.log(`Button clicked ${clickCount} times`);
}
// Override the console.log function to capture the log event
const originalConsoleLog = console.log;
console.log = function (message) {
// Call the original console.log function to ensure the message still appears in the console
originalConsoleLog.apply(console, arguments);
// Function to check for presence of button and handle the link click
function handleLinkClick(event) {
// Check if an element with the class 'alert alert-info' contains the text 'Perfect!'
const alertElement = document.querySelector('.alert');
if ((alertElement && alertElement.textContent.includes('Perfect!')) || clickCount >= 8) {
// Allow the link to be followed
return true;
} else {
// Prevent the default link action
event.preventDefault();
// Display a popup window
alert('Please try again to complete the mixed-up puzzle first.' + "\n" + 'Remember, you can click the "Help me" button to remove an unnecessary block or combine two blocks.' + "\n" + 'You can skip the puzzle after 8 attempts.');
return false;
// Check if the message contains the specific pattern
if (message.includes('Save logging event')) {
// Extract the JSON part from the log message
const jsonString = message.substring(message.indexOf('{'));
checkActValue(jsonString);
}
};
function checkActValue(loggingEvent) {
try {
const eventObj = JSON.parse(loggingEvent);
const actValue = eventObj.act;
const lastPart = actValue.split('|').pop();
if (lastPart === "c8") {
isC8 = true;
}
console.log(`Last part of act: ${lastPart}, isC8: ${isC8}`);
} catch (error) {
console.error('Error parsing the logging event:', error);
}
}
}
// Attach the click event handler to the link
document.getElementById('pp-e1').addEventListener('click', handleLinkClick);
function handleLinkClick(event) {
const alertElement = document.querySelector('.alert');
if ((alertElement && alertElement.textContent.includes('Perfect!')) || isC8) {
return true;
} else {
event.preventDefault();
alert('Please try again to complete the mixed-up puzzle first.' + "\n" + 'Remember, you can click the "Help me" button to remove an unnecessary block or combine two blocks.' + "\n" + 'You can skip the puzzle after 8 attempts.');
return false;
}
}
document.addEventListener('DOMContentLoaded', () => {
// Get references to the button
const checkButton = document.getElementById('parsons-1-check');
// Check if the button was found
if (checkButton) {
// Add an event listener to the button
checkButton.addEventListener('click', updateClickCount);
const linkElement = document.getElementById('ie2');
if (linkElement) {
linkElement.addEventListener('click', handleLinkClick);
} else {
console.error('Button with ID "parsons-1-check" not found.');
console.error('Element with ID "ie2" not found.');
}
});
Expand Down
84 changes: 45 additions & 39 deletions _sources/turtles/SE_turtle/pps-IE-pp3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,49 +39,55 @@ Practice Problems

.. raw:: html

<script type="text/javascript">
// Initialize a counter variable at a higher scope
let clickCount = 0;
// Function to update the click count
function updateClickCount() {
clickCount++;
// Here you would usually update the UI, but it's not needed now
console.log(`Button clicked ${clickCount} times`);
}
// Function to check for presence of button and handle the link click
function handleLinkClick(event) {
// Check if an element with the class 'alert alert-info' contains the text 'Perfect!'
const alertElement = document.querySelector('.alert');
if ((alertElement && alertElement.textContent.includes('Perfect!')) || clickCount >= 8) {
// Allow the link to be followed
return true;
} else {
// Prevent the default link action
event.preventDefault();
// Display a popup window
alert('Please try again to complete the mixed-up puzzle first.' + "\n" + 'Remember, you can click the "Help me" button to remove an unnecessary block or combine two blocks.' + "\n" + 'You can skip the puzzle after 8 attempts.');
return false;
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', () => {
let isC8 = false;
// Override the console.log function to capture the log event
const originalConsoleLog = console.log;
console.log = function (message) {
// Call the original console.log function to ensure the message still appears in the console
originalConsoleLog.apply(console, arguments);
// Check if the message contains the specific pattern
if (message.includes('Save logging event')) {
// Extract the JSON part from the log message
const jsonString = message.substring(message.indexOf('{'));
checkActValue(jsonString);
}
};
function checkActValue(loggingEvent) {
try {
const eventObj = JSON.parse(loggingEvent);
const actValue = eventObj.act;
const lastPart = actValue.split('|').pop();
if (lastPart === "c8") {
isC8 = true;
}
console.log(`Last part of act: ${lastPart}, isC8: ${isC8}`);
} catch (error) {
console.error('Error parsing the logging event:', error);
}
}
}
// Attach the click event handler to the link
document.getElementById('pp-e1').addEventListener('click', handleLinkClick);
function handleLinkClick(event) {
const alertElement = document.querySelector('.alert');
if ((alertElement && alertElement.textContent.includes('Perfect!')) || isC8) {
return true;
} else {
event.preventDefault();
alert('Please try again to complete the mixed-up puzzle first.' + "\n" + 'Remember, you can click the "Help me" button to remove an unnecessary block or combine two blocks.' + "\n" + 'You can skip the puzzle after 8 attempts.');
return false;
}
}
document.addEventListener('DOMContentLoaded', () => {
// Get references to the button
const checkButton = document.getElementById('parsons-1-check');
// Check if the button was found
if (checkButton) {
// Add an event listener to the button
checkButton.addEventListener('click', updateClickCount);
const linkElement = document.getElementById('ie3');
if (linkElement) {
linkElement.addEventListener('click', handleLinkClick);
} else {
console.error('Button with ID "parsons-1-check" not found.');
console.error('Element with ID "ie3" not found.');
}
});
Expand Down
Loading

0 comments on commit d7bce4e

Please sign in to comment.