She gave 7 pens each to 44 students for a total of 7*44 = <<7*44=308>>308 pens
There are now 342-308 = <<342-308=34>>34 pens left
She left half of 34 pens in her locker which is 34*(1/2) = <<34*(1/2)=17>>17 pens
She took 34-17 = <<34-17=17>>17 pens home
#### 17