Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://gitlab.inria.fr/lyao/visinmotion
12 November 2025, 14:48:24 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    No releases to show
  • 121c391
  • /
  • study2_trajectory_donut
  • /
  • html
  • /
  • content.php
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:363bb7aad30f673cd2aecc6faea5f52c14595cfb
origin badgedirectory badge Iframe embedding
swh:1:dir:52040aa952755a2870d3b5b1316ed5e7e8a5f4b1
origin badgerevision badge
swh:1:rev:dd99681039060e6dcec83a378405faa3bc4527d3
origin badgesnapshot badge
swh:1:snp:1b67b118c50b09a22aa5a6838946dd243ab1552a

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: dd99681039060e6dcec83a378405faa3bc4527d3 authored by lyao on 09 December 2023, 20:43:19 UTC
readme updated
Tip revision: dd99681
content.php
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title></title>

  <!-- Loads all styles -->
  <link rel="stylesheet" href="css/bootstrap.min.css">
  <link rel="stylesheet" href="css/main.css">

  <!-- Loads all libraries -->
  <script src="js/lib/jquery-3.3.1.min.js"></script>
  <script src="js/lib/d3.min.js"></script>
  <script src="js/lib/bootstrap.min.js"></script>
  <script src="js/lib/bowser-2.4.0-es5.js"></script>
  <script type="module" src="js/lib/seedrandom.min.js"></script>

</head>
<body>

  <div class ="container" id="no-cookie-container" style="display: none;">
    <h1>Your browser is blocking cookies.</h1>
    <p>
      You need to allow cookies to participate in this experiment. <br>If you don't know how to do this, you can use <a href="https://www.whatismybrowser.com/guides/how-to-enable-cookies/auto" target="_blank">this guide</a>.
    </p>
    <p>
      Once you activated cookies, please reload this page.
    </p>
  </div>

  <div class ="container" id="reloader-container" style="display: none;">
    <h1>You reloaded the page.</h1>
    <p>
      Unfortunately, it seems that you have reloaded this page <strong>after</strong> you finished the calibration tool. We indicated at the beginning of the experiment that reloading after finishing the calibration tool would lead to <strong>exclusion</strong> from the experiment.
    </p>
    <p>
      You can close the window now and return the task on the Prolific platform.
    </p>
  </div>

<?php
  /* Generate the _ID in pilot */
  $ip = getenv('HTTP_CLIENT_IP')?:
        getenv('HTTP_X_FORWARDED_FOR')?:
        getenv('HTTP_X_FORWARDED')?:
        getenv('HTTP_FORWARDED_FOR')?:
        getenv('HTTP_FORWARDED')?:
        getenv('REMOTE_ADDR');

  if( $_GET['PROLIFIC'] == 'False'){
    // session_start();
    //Petra: it's not really recommended to use get like this. I would prefer $_SESSION but then not sure if that would be compatible with the regular use through prolific
    $_GET["STUDY_ID"] = 'Pilot';
    $sessionID = session_id();
    $_GET["SESSION_ID"] = $sessionID;
    $useragent = $_SERVER['HTTP_USER_AGENT'];
    $_GET["PROLIFIC_PID"] = hash('md5', $ip.$useragent);
    $is_debug = 0;
  }
  /* ---------------------------------------------------------------------------------------------------------------------------------------------------------------- */

  $missing_parameters = false;
  // get URL parameters sent by Prolific
  if (isset($_GET["PROLIFIC_PID"])) {
    $participant_id = $_GET["PROLIFIC_PID"];
  } else {
    $missing_parameters = true;
  }

  if (isset($_GET["STUDY_ID"])){
    $study_id = $_GET["STUDY_ID"];
  } else {
    $missing_parameters = true;
  }

  if (isset($_GET["SESSION_ID"])) {
    $session_id = $_GET["SESSION_ID"];
  } else {
    $missing_parameters = true;
  }

  if (isset($_GET["DEBUG"]) || isset($_GET["debug"])) {
    $is_debug = 1;
    $participant_id = 'DEBUG'; 
    $study_id = "DEBUG";
    $session_id = 0;
    $missing_parameters = false;
  }  else {
    $is_debug = 0;
  }

  if (isset($_GET["PILOT"]) || isset($_GET["pilot"])) {
    $is_pilot = 1;
    $participant_id = '_' . base_convert(mt_rand() / mt_getrandmax(), 10, 36); // generating a random but unique ID
    $study_id = "pilot";
    $session_id = 0;
    $missing_parameters = false;
  }  else {
    $is_pilot = 0;
  }

  if (isset($_GET["condition"])) {
    $order_value = $_GET["condition"];
  }
  if (isset($_GET["page"])) {
    $start_page = max(1, intval($_GET["page"]));
  }

?>
  <div class ="container" id="missing-parameter-container" style="display:none;">
    <h1>Invalid link</h1>
    <p>
      You opened this page without the required experiment parameters. Please use the link provided in the Prolific interface.
    </p>
  </div>

  <main id="main-container" class="container">


<?php
require "setup/constants.php";
require "setup/functions.php";
require "setup/pages_behavior.php";

assignFactorLevels();


  $condition = $factor1 . "_" . $factor2;


  // The following lines create a log file name "all_who_started.csv" which contains a timestamp and participants id for all people who requested the page. This is mainly useful for debugging purposes to figure where something went wrong. It can also be used to detect if someone reloaded the page.
  $starter_filename = "../results/requested.csv";
  $exists = file_exists($starter_filename);
  $starter_file = fopen($starter_filename, "a+");

  if (!$exists){
    fwrite($starter_file, "timestamp,participant_id,condition,study_id,session_id");
  }

  fwrite($starter_file,
    PHP_EOL .
    date(DateTime::ISO8601) . ',' .
    (($is_debug > 0) ? 'DEBUG' : $participant_id) . ',' .
    $condition . ',' .
    $study_id . ',' .
    $session_id
  );

  fclose($starter_file);

  // These are hidden input fields which store information to be retrievable with javascript.
?>

<div id="experiment-info">
<?php

  echo '<input type="hidden" id="participant_id" value="' . (($is_debug > 0) ? 'DEBUG' : $participant_id) .  '"</input>';
  echo '<input type="hidden" id="study_id" value="' . "" . $study_id .  '"</input>';
  echo '<input type="hidden" id="session_id" value="' . "" . $session_id .  '"</input>';
  echo '<input type="hidden" id="condition" value="' . "" . $condition .  '"</input>';
  if (!is_null($factor1)){
    echo '<input  type="hidden" 
                  id="' . $FACTOR_LEVELS["factor1"]["name"]  . '" value="' . "" . $factor1 .  '"</input>';
  }

  if (!is_null($factor2)){
    echo '<input type="hidden" id="' . $FACTOR_LEVELS["factor2"]["name"]  . '" value="' . "" . $factor2 .  '"</input>';
  }
  echo '<input type="hidden" id="is_debug" value="' . "" . $is_debug .  '"</input>';
  echo '<input type="hidden" id="exclude_reloaders" value="' . "" . $EXCLUDE_RELOADERS .  '"</input>';

?>
</div>

<?php

  // variable to collect the ids of the pages to hide at the beginning
  $pages_to_hide = "";

  // generate all pages listed in the PAGE_ORDER constant
  for ($i=0; $i < count($PAGE_ORDER); $i++) {
       $button = $PAGE_ORDER[$i]["button"];
       $id = $PAGE_ORDER[$i]["id"];
       $page_number = $i + 1;
       // if ($i>0){
        $pages_to_hide .= '#' . $id;
       // }
       if ($i < count($PAGE_ORDER)-1){
        $pages_to_hide .= ", ";
       }
       $next = $PAGE_ORDER[$i]["next"];
       $page = $PAGE_ORDER[$i]["page"];
       $disabled = $PAGE_ORDER[$i]["disabled"];
       include "page_skeleton.php";
     }
?>


  </main>

  <script src="js/init-logging.js" charset="utf-8"></script>
  <script type="text/javascript">

    var is_debug = $('#is_debug').val();
    // console.log("Debugging --> " + is_debug);
    if (is_debug) {
      // console.log("condition: " + $('#condition').val());
    }

    function getCookie(cname) {
      var name = cname + "=";
      var decodedCookie = decodeURIComponent(document.cookie);
      var ca = decodedCookie.split(';');
      for(var i = 0; i <ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') {
          c = c.substring(1);
        }
        if (c.indexOf(name) == 0) {
          return c.substring(name.length, c.length);
        }
      }
      return "";
    }

    function checkCookie(){
      // Quick test if browser has cookieEnabled host property
      if (navigator.cookieEnabled) return true;
      // Create cookie
      document.cookie = "cookietest=1";
      var ret = document.cookie.indexOf("cookietest=") != -1;
      // Delete cookie
      document.cookie = "cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT";
      return ret;
    }


    // if the constant $EXCLUDE_RELOADERS is set to true, check if a cookie has been set already
    if ($('#exclude_reloaders').val() > 0){
      if (checkCookie()){
        document.cookie = "prolific_study=" +  $('#participant_id').val() + "; max-age=" + 60*60*24*7;
        if (getCookie("accepted") == 1 && is_debug < 1) {
          $("main").hide();
          $("#reloader-container").show();
          $('body').trigger("reloaded");
        }
      } else {
          $("main").hide();
          $("#no-cookie-container").show();
      }
    }

    $('<?php echo $pages_to_hide;?>').hide();
    <?php  
    if (isset($start_page)){
      echo "$('#" . $PAGE_ORDER[$start_page - 1]["id"] . "').show();";
    } else {
      echo "$('#" . $PAGE_ORDER[0]["id"] . "').show();";
    }
    ?>


    function missingParameters() {
        $("main").hide();
        $("#missing-parameter-container").show();
    }

    <?php
    if ($missing_parameters){
      echo "missingParameters();";
    }
    ?>
  </script>
  
  <?php
  require "setup/load_js.php";
  ?>
  
</body>
</html>


back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API