Time Left on Tab - Canvas Instructure

Shows the test/quiz/exam time left on the browser tab and also keeps the questions and time fixed on the screen.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

You will need to install an extension such as Tampermonkey to install this script.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Time Left on Tab - Canvas Instructure
// @namespace    CanvasTimeHelper
// @version      3
// @description  Shows the test/quiz/exam time left on the browser tab and also keeps the questions and time fixed on the screen.
// @author       hacker09
// @match        https://*.instructure.com/courses/*/quizzes/*
// @icon         https://du11hjcvx0uqb.cloudfront.net/br/dist/images/favicon-e10d657a73.ico
// @run-at       document-end
// @grant        none
// ==/UserScript==

(function() {
  'use strict';
  if (document.querySelector("div.time_running") !== null) //If the timer element exists on the page
  { //Starts the if condition
    setInterval(function() { //Starts the settimeout function
      document.title = document.querySelector("div.time_running").innerText;
    }, 1000); //Update the tab title to have the current test/quiz/exam left duration time
  } //Finishes the if condition

  document.querySelector("#right-side-wrapper").style.position = 'fixed'; //Make the questions and time elements position fixed on the screen
  document.querySelector("#right-side-wrapper").style.right = '0px'; //Make the questions and time elements position fixed on the right side of the screen
  document.querySelector("#right-side-wrapper").style.top = '0px'; //Make the questions and time elements position fixed on the top side of the screen
  document.querySelector("#questions").style.width = '70%'; //Keep the questions element the same width
  document.querySelector("#question_list").style.maxHeight = '430px'; //Fit 18 questions instead of 8

})();