There are methods and software to measure facial emotions with videos or webcams. Valence is calculated with distinct emotions, arousal with muscle movements (action units following the Ekman FACE-system).
It’s also possible to measure heart rate via webcams using software. As cited by Conati et al. (2009): "Heart rate (HR) [...] has also been used as an indicator of affective valence (e.g., Papillo & Shapiro, 1990)."
To measure emotional arousal one can use skin conductance level. As cited by Conati et al. (2009): "Skin Conductance (SC) has been shown to be positively correlated with levels of affective arousal (Dawson et al, 2000; Lang et al., 1993). "