Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Emotions Wheel

Hi,

I am trying to create an emotion recognition task using OpenSesame. Participants will be asked to watch videos and indicate the emotions that were showed during the clips. To do this, I would like the 14 emotions they can choose from to be presented in the form of an "emotions wheel" (as shown in the picture). As I am learning to use Opensesame and getting familiar with python, I am having trouble figuring out which script to write to achieve this result.


I found these two posts giving me hints for a solution but I don't understand the scripts :


Could someone explain them to me? What functions could I use to create the emotions wheel?  Thanks in advance for your help, 

Ingrid

Comments

  • Hi @Ingrid_D,

    That falls somewhat outside the remits of the forum. My recommendation would be to take some time to read up about some of the basic methods in Javascript such as functions, arrays,

    If you do so, the following code will make more sense:

    function choice(array) {
    array = array.slice()
    let counter = array.length;
    while (counter > 0) {
    let index = Math.floor(Math.random() * counter);
    counter--;
    let temp = array[counter];
    array[counter] = array[index];
    array[index] = temp;
    }
    return array[0]
    }
    
    vars.color_circle_rotation = choice([0, 60, 120, 180, 240, 300])
    

    The provided code snippet consists of a JavaScript function named choice and a line of code that uses this function. Let's break down each part for a clearer understanding:

    Function: choice(array)

    1. Parameter: The function takes one parameter, array, which is expected to be an array.
    2. Creating a Copy of the Array:
      • array = array.slice(): This line creates a shallow copy of the input array. This is done to avoid modifying the original array passed to the function.
    1. Shuffling the Array:
      • The function then enters a while loop, which continues as long as counter (initially set to the length of the array) is greater than 0.
        • Inside the loop:let index = Math.floor(Math.random() * counter): This line generates a random index within the range of the unshuffled portion of the array.
        • counter--: Decreases the counter, effectively reducing the range for the next random index.
        • The next three lines swap the element at the current counter index with the element at the randomly chosen index. This is a standard technique for shuffling an array (Fisher-Yates shuffle).
    1. Returning the First Element:
      • After the loop completes (i.e., the array is shuffled), the function returns the first element of the shuffled array (return array[0]).

    Usage: vars.color_circle_rotation = choice([0, 60, 120, 180, 240, 300])

    • This line of code calls the choice function with an array of numbers [0, 60, 120, 180, 240, 300].
    • The function shuffles this array and returns the first element of the shuffled array.
    • The returned value is then assigned to vars.color_circle_rotation. This suggests that the function is used to randomly select a value from the provided array, possibly for some kind of rotation value in degrees (as indicated by the variable name and the values in the array).

    In summary, the choice function is a utility for randomly selecting an element from an array by shuffling the array and returning its first element. The usage example shows it being used to select a random rotation value for a color circle.

    I recommend you follow the same process with the rest of the code. For example. to understand the line "let distance =Math.sqrt(vars.cursor_x * vars.cursor_x + vars.cursor_y * vars.cursor_y)", I'd recommend looking up what the "let", and "Math.sqrt" functions do. It takes a little time but it's the best way to learn and eventually get in control of your code.

    Best,

    Fabrice.

    Buy Me A Coffee

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games