For the above answer it is considered that the friction is negligible.
The situation can be explained as follows.
Since the 12kg is dangling and it's weight is more it will drag the 3kg mass along the inclined plane.
Let us say the acceleration of the masses is 'a' and tension of the string is T. The weights of the masses will also affect while accelerating.
Using Newton's second law of motion;
F = ma to 3kg mass to its direction of motion
3gcos30+T = 3*a ----(1)
F = ma to 12kg mass to its direction of motion
12g-T = 12*a ----(2)
3gcos30+12g = 15*a
a = 9.55m/s^2
Then T = 12g-12a = 3.15N
So the tension on the string is 3.15N and the acceleration is 9.55m/s^2.