I commute to and from class and don't know if I can deduct the cost of gas for attending school.
No. The cost of commuting to and from school or work is a personal commuting expense and it is not deductible.