25 Вересня, 07:42
7 на хв читання

GitHub Copilot for students: learning hints, the first match, indentation, control examples, and independently changing a requirement.
When a suggestion appears before students have formulated an algorithm, learning can easily turn into accepting familiar lines. It is useful to configure GitHub Copilot for another role: discussing the intention, explaining constructs, and helping check students' own code. Editor integration then preserves the central learning action: independently formulating and implementing a solution.
The author's Python exercise: first_long(words, limit) returns the first word whose length is strictly greater than limit, or None if no such word exists. For red, orange, blue and a limit of four, the result is orange. List order matters; there is no need to find the longest word. The exercise allows discussion of a loop, comparison, and early return.
The official learning guide suggests turning off automatic code suggestions and adding instructions for learning assistance; this process is described by GitHub: Setting Up Copilot for Learning. The examples below for 'learning with GitHub Copilot' are learning scenarios created by the author; they are not a report of product testing conducted.
The aim is to learn to find the first suitable element instead of copying a ready-made filter. This determines the form of Copilot assistance.
Record what students must do themselves: describe the criterion, write a loop, and explain the return point.
For a new list, learners must identify the first suitable word without a hint. This result becomes a control reference.
Configuration without a learning objective may only change the chat's appearance. Connect assistance limits with a specific skill.
When examining the student list exercise, begin with a question that can be checked through execution. Write a specific input and required output on paper, then name the property connecting them. This leaves room for an independent hypothesis before the assistant answers. If the program is too large, isolate a minimum fragment preserving the required behavior. Shortening must not hide the condition causing doubt. Explain which data are outside the example and why they are unnecessary now. Learners must know where a conclusion about a small function ends and unverified assumptions about the entire project begin; in this trial, the required reference is the first suitable list element. The first AI conversation thus gains an object and an observable result.
Automatic completion and conversation serve different roles. For an initial exercise, a ready-made line may reveal the very solution being learned.
Check settings in the available editor. Use the official VS Code guide if that is the editor you use.
Students must have time to write their own version. Ensure unwanted completion has not returned in another project.
Do not assume identical switches in every environment. GitHub's instructions have specific prerequisites and need checking against your editor.
For the student list exercise, separate permitted input, the way elements are traversed, and the result's form. These three parts can change independently. When the assistant suggests an improvement, establish whether it merely rewrites the same algorithm or adds new behavior; in this trial, the required reference is the first suitable list element. For example, silently removing duplicates, sorting, or changing the empty result already needs an agreed requirement; the specific object of checking here is the first suitable list element. Mark each change separately so a new contract is not accepted as a cosmetic edit. It is useful for students to explain which test should remain unchanged after editing and which would have a different expectation when checking the first suitable list element. If the answer is unknown, defer rewriting and return to describing what the function must do; the specific object of checking here is the first suitable list element.
The phrase 'help me learn' is too broad. Name the level, required actions, and boundary between explanation and implementation.
Add learning instructions: clarify the contract, discuss principles, and do not provide finished code at the first step.
A trial question about the loop must return an explanation or clarification instead of a completed first_long function.
Instructions do not guarantee flawless behavior. If an answer revealed the implementation, move the independent check to a new nearby exercise.
When explaining the student list exercise, do not skip the intermediate state for a short summary. Choose one element, name the state before processing it, the condition checked, and the state after the action. Then ask learners to continue the next step without a ready-made table. An error in this continuation reveals a specific point of misunderstanding: a variable's value, comparison direction, the moment of addition, or exiting the function; the specific object of checking here is the first suitable list element. AI can be asked to pose a question about this transition. A lengthy explanation of every line is unnecessary if the difficulty concerns one connection. After brief support, give learners another independent action so they do not merely listen to a correct trace performed by someone else when checking the first suitable list element.
Once orange meets the condition, later words no longer change the result. Early return is part of the contract here.
Describe list traversal and the stopping point. Separate finding the first word from finding the longest.
For orange, elephant and a limit of four, the result remains orange even though the second word is longer.
The model may optimize for a different task. Restore the word 'first' and the requirement to preserve traversal order in the dialogue.
Build the check of the student list exercise from an expectation established by the conditions to actual execution. If a test and implementation come from the same flawed assumption, they may agree with each other and still fail the task when checking the first suitable list element. First work through a small case manually, then run the code. If they differ, retain the input, expectation, and actual result. This is enough for a substantive request to the assistant: find the first point where execution diverges from the contract; in this trial, the required reference is the first suitable list element. Do not ask generally to make the program correct when you can name the precise behavior. After correction, repeat the specific discrepancy case and add a nearby control checking that the edit did not break another requirement; in this trial, the required reference is the first suitable list element.
The author's example returns the first word whose length is strictly greater than the limit. The return location and exact comparison operator are essential. Read the implementation after your own attempt, then close it for a new test.
def first_long(words, limit):
for word in words:
if len(word) > limit:
return word
return NoneFor red, orange, blue and a limit of four, the loop first skips red. At orange, the condition holds and the function ends. Blue is never checked. If the input is orange, elephant, the result remains orange. A learner who names elephant may be reading the task as finding the longest word. Clarification of the contract is needed here, not an additional syntax explanation.
A separate pair of cases checks the boundary. For blue and a limit of four, the result is None; for blue and a limit of three, the result is blue. Only one parameter changes, so the difference is easily connected to the comparison operator. For an empty list, the loop never executes and the final return applies. If None is placed inside the loop, the function may stop at the first short word and miss the required element later.
Copilot can be asked to explain this incorrect indentation without correcting the file. Have it suggest an input distinguishing the two versions, while learners record the expectation themselves. GitHub's official learning guide for VS Code provides for limiting automatic completions and configuring the assistant's role through instructions. Current steps should be taken from GitHub's Learning Guidance, while access and account terms should be checked separately.
After the analysis, change the requirement: find the first word with a length at least equal to the limit. Learners must state which expectation changes before editing the operator. Then suggest returning the index instead of the word. This is another change to the result that should not be combined with the previous one in a single invisible completion. A small sequential step gives instructors grounds to observe students' own understanding.
Strict comparison excludes a word whose length equals limit exactly. The equality case helps detect an operator error.
Check blue with a limit of four: it does not qualify. For orange with a limit of five, expect a match.
Explain the difference between > and >= using your own example. Record the expectation before running code.
A test using only an obviously long word will not detect incorrectly including equality. Add the boundary case itself.
A counterexample for the student list exercise must distinguish the approved algorithm from a specific incorrect idea. Choose that idea before selecting numbers or strings. If the wrong method passes every existing example, look for an input where its hidden assumption becomes visible; the specific object of checking here is the first suitable list element. Change one substantive property: order, repetition, operator, limit, or absence of elements. Ask learners to predict both methods' behavior and explain why expectations differ. This pair provides grounds for correction that can be checked independently of AI's authority. If prediction fails, return to manually executing this small input instead of adding several new difficulties at once; in this trial, the required reference is the first suitable list element.
If the function returns None after the first short word, the problem may lie in the location of the return for an absent result.
Provide your version and ask for a trace of red, orange. Find the point where the function ends too early.
None must be returned after the entire traversal ends if no word qualifies.
A complete rewrite masks the cause. First explain the incorrect route, then independently change one fragment.
In the student list exercise's learning route, it is useful to provide support in steps. First a clarifying question about the result, then the name of the required property, then one demonstrated state transition; in this trial, the required reference is the first suitable list element. Leave a full implementation for analysis after an independent attempt or a situation where the instructor explicitly defines its role when checking the first suitable list element. At every step, learners must have something to do themselves: choose an expectation, continue a loop, suggest a test, or explain indentation; the specific object of checking here is the first suitable list element. Note which support resolved the difficulty. In the next exercise, begin with less support while retaining sufficient conditions. This assesses the need for help through actual action instead of a general impression that students understood everything when checking the first suitable list element.
Student notes must show which hints were used and what the author implemented independently. This makes the analysis transparent.
Retain the initial algorithm, one piece of advice, the corrected version, and control cases. Add your own explanation of the return.
Learners must reconstruct the function without the chat history. Check it on a new word set.
A large conversation screenshot does not replace a description of the decision. Retain only fragments explaining a specific change.
After editing the student list exercise, review changed lines separately from the model's explanatory text. Every approved change must have a reason in the contract and an execution check. There is no need to turn a small learning function into a complex universal component without a corresponding task; in this trial, the required reference is the first suitable list element. If new input types, handling of damaged data, or external dependencies appear, record them as a separate extension; in this trial, the required reference is the first suitable list element. The initial control remains necessary. Learners must be able to state which old properties were retained and what is now checked additionally. This short review of a change shows responsible code reading, beyond agreement with a ready-made proposal; the specific object of checking here is the first suitable list element.
Copilot capabilities depend on the available account and environment. Student-access terms are checked separately from the teaching method.
Check current terms in your account and the instructor's rules. Prepare a way to complete the exercise without AI.
The independent route must contain the conditions, documentation, and tests. Service unavailability does not change the exercise's objective.
Do not promise every participant the same plan or access without checking. A learning assignment must not depend on an unconfirmed benefit.
Check completion of the student list exercise using a new input without the previous analysis in view. Retain the same principle but change external data. Ask learners first to predict the output, then run their own code and explain agreement or discrepancy. Then change one requirement so they name the necessary edit before making it. If they can explain only the old ready-made example, transfer has not yet been demonstrated. This is not a reason to immediately start everything again: restore the specific missing support and give another nearby control; the specific object of checking here is the first suitable list element. In notes, retain the selection rule, one verified case, and an open boundary of the function's applicability.
To check understanding of the first match, use a list with two suitable words and one unsuitable word before them. Students must indicate the element where execution stops, then name the words that will no longer be read. This question concerns control flow, so correct knowledge of every word's length is not yet a sufficient answer.
Separately provide only short words. Ask learners to show the path to None without omitted steps. If they say the function returns it after the first word, return to the indentation of the final return. The difference between a line inside the loop and a line after it has a specific consequence. It is useful to draw two routes and ask learners to choose the one matching the contract.
Prepare your own question for the Copilot dialogue: why can the final return not be placed immediately after checking the condition inside the loop? Have the assistant answer with a question about a control input or a short hint. Students construct a case with a short first word and longer second word themselves. This interaction leaves them the central action of finding a counterexample.
After analysis, take a break from the finished implementation. Write the algorithm in words and reconstruct the code from that record. Different variable names are not errors if behavior is preserved. Then run the examples selected in advance. If the reconstructed version fails, identify whether the comparison operator, indentation, return value, or element order changed. Correct one established cause at a time.
The new requirement about an index needs a decision for the no-match case. Retain None or explicitly approve another value, but do not let the model choose it invisibly. Learners must explain why zero cannot, without an additional agreement, mean both the first element and no result. This question connects the return format to the function's subsequent use.
To finish the class, ask students to create one correct and one incorrect version and devise an input distinguishing them. Have them withhold the versions' labels until a partner has made a prediction. Instructors assess the counterexample's rationale instead of code formatting. This independent check reveals the learning benefit of editor hints.
I am learning to write first_long(words, limit). Help explain the algorithm and check examples, but leave implementation to me. Ask one clarifying question and do not add finished code.
For practice on the student list exercise, add your initial version and name the location where help is needed. Retain in the prompt the part you want to perform yourself. After the answer about the student list exercise, record the approved step and its grounds. If the model revealed the full solution before your own attempt, use different nearby conditions for an independent check when testing the first suitable list element.

The WeStudy LMS platform can organize a class on 'learning with GitHub Copilot.' Prepare the original conditions, instructions for an independent attempt, and a separate instructor answer key. For working on the student list exercise, it is important to define available supports before work begins. Check the specific capabilities for presenting materials and feedback in your learning environment when testing the first suitable list element.
In WeStudy materials for examining the student list exercise, it is appropriate to retain the initial fragment, approved revision, and control conditions. Instructors need an explanation of students' own choice in the list exercise, beyond a finished file or long chat history. In the next assignment, change external data and check the same learning action with less support.
For the student list exercise, begin with your own prediction or fragment. Use a sample after the attempt to analyze a specific difference. If studying an already completed example, explicitly name its learning role and retain different conditions for independent continuation when checking the first suitable list element. Independent action on the student list exercise must be visible separately from the assistant's work.
Return to the approved conditions and find the first discrepancy. For the student list exercise, record a specific question and material enabling it to be checked. The rule's source, a manual check, or an instructor's analysis must address the specific doubtful claim. The number of AI answers about the student list exercise does not itself determine which one is substantiated.
Retain one short support and suggest performing the next step. If independent continuation of the student list exercise succeeds, remove the support in a new nearby case. If not, clarify exactly what is unclear. Returning to a specific difficulty in the student list exercise is more useful than arbitrarily increasing the number of ready-made examples.
For the student list exercise, your initial independent attempt, approved decision, reason for the change, and a new control case are sufficient. This record allows the required action to be reconstructed without reading the entire conversation. Limit the conclusion about the student list exercise to the verified property; a broader result needs other independent trials with defined conditions.
Your next step
From your first idea to your own online school. Create, teach and grow your project with WeStudy.
Try for Free30days free
Full access to all features for 30 days — free