I understand where you're coming from: you aren't doing as much work in your opinion, so you don't want to charge your full rate. I'm going to tell you though...
CHARGE YOUR FULL RATE
Why? Because, as a Freelancer, you are the professional, and companies need to realize that. As I state in other answers, you are being hired for your expertise, not your time. If you are selling just your time, you may as well be at a 9 to 5 job. Just because they don't want to use all your skills does not mean they automatically get a discount.
An hourly agreement would probably be the best bet in this case, instead of by-project; you don't know exactly how much time will be needed here. And absolutely, get a retainer! Your retainer should be enough to cover you week-to-week, and documented carefully. See the other questions around here about retainers.
Now, what happens when this contract is done? Do they give you 2 weeks notice, or some other notice period? They better! You are putting off other clients to help this one out, and you need to keep food on the table. When making your contract, add information about how either party can terminate the agreement; if they terminate before a deadline date, include a
penalty portion of the remaining payment. If you need to terminate the contract, offer to work until the retainer is completely drained, but explaining you will not be allowing them to refill it. This way, both of you have to agree to the end of the contract, or else the other has to deal with a "consequence", so to speak.
Until you are done with this client, you will unlikely be helping other people. You need to be prepared for that, and be compensated accordingly.
Now, what about the student's code? What if they need you later on in life? Can you restart the contract? Absolutely! Can you offer free support? Absolutely! Would I recommend offering free support? Heck no! It's up to the little tyke you're tutoring to ask all the questions they need to get going on their project. If they forget to ask something critical, and you remember, ethics tell us that you should tell them, and you absolutely should! But be aware of scope creep, or being contacted outside of the hours set aside for this client. You need compensated for your time and knowledge, which is what gives you value for your work. Never forget that!