User Tools

Site Tools


services:labtest:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
services:labtest:start [2024/02/14 15:13] jasservices:labtest:start [2024/04/23 08:48] (current) jas
Line 141: Line 141:
 ===== 1.  Create Directories ===== ===== 1.  Create Directories =====
  
-First, if you haven't done so yet, create a course directory for your course.  For example, if your course was "EECS9999", you would:+First, if you haven't done so yet, create a course directory for your course.  For example, if your course was "EECS9999A", you would:
  
-  mkdir /eecs/dept/www/course/9999+  mkdir /eecs/dept/www/course/9999A
  
 Now create a subdirectory in the course web directory called "labtest": Now create a subdirectory in the course web directory called "labtest":
  
-  mkdir /eecs/dept/www/course/9999/labtest+  mkdir /eecs/dept/www/course/9999A/labtest
  
 The "labtest" directory is the only "mandatory" directory.  How you choose to arrange the directory hierarchy under the "labtest" directory is totally up to you.  For example, you could create a different directory for each test: The "labtest" directory is the only "mandatory" directory.  How you choose to arrange the directory hierarchy under the "labtest" directory is totally up to you.  For example, you could create a different directory for each test:
  
 <code> <code>
-mkdir /eecs/dept/www/course/9999/labtest/test1 +mkdir /eecs/dept/www/course/9999A/labtest/test1 
-mkdir /eecs/dept/www/course/9999/labtest/test2+mkdir /eecs/dept/www/course/9999A/labtest/test2
 </code> </code>
  
-NOTE: For the purposes of simplicity, this documentation will frequently refer to /eecs/dept/www/course which is a shortcut that refers to the course web directories for the current session and term. If you would like to refer to a course directory by its full path, you may use instead: /eecs/dept/www/course_archive/SESSION/TERM/COURSE.  For example, /eecs/dept/www/course_archive/2018-19/F/9999.+NOTE: For the purposes of simplicity, this documentation will frequently refer to /eecs/dept/www/course which is a shortcut that refers to the course web directories for the current session and term. If you would like to refer to a course directory by its full path, you may use instead: /eecs/dept/www/course_archive/SESSION/TERM/COURSE.  For example, /eecs/dept/www/course_archive/2018-19/F/9999A.
    
 +===== 2.  Create a Labtest Start Page =====
  
-===== 2.  Create a Start Page =====+Students will see the labtest start page when they begin your labtest.  Create an HTML start page in your "labtest" directory, and call it "index.html".  
  
-Create a start page in your "labtest" directory, and call it "index.html" Students will see this page when their test begins.  For the most minimal labtest setup, this is the only page you need!+==== Basic Start Page ====
  
-For your convenience, you may choose to provide link to "/common" on your index page.  This link contains the Java API, and other documentation that is useful across labtests.  In non-labtest mode, the information appears [[http://www.eecs.yorku.ca/teaching/docs|here]]. +Here's a very basic example of a labtest start page:
  
-Note: If you decide to have different directories in your labtest directory for each labtest, you still need to have a common index.html file.+<code> 
 +<!DOCTYPE html
 +<html> 
 +<body> 
 +<h1>EECS1234</h1>
  
 +<p>Welcome to the labtest for EECS1234</p>
 +
 +<p>You could write a lot of introductory stuff here, or even write your question using HTML on this page.</p>
 +
 +<p>Click <a href="test.pdf">here</a> for your labtest question.</p>
 +
 +<p>You could include links to other resources on this page that could be available in labtest.</p>
 +
 +</body>
 +</html>
 +</code>
 +
 +On your start page, you can include information about the test, your rules and policies, the labtest questions (or a link to a PDF with the questions), and links to additional useful resources (such as PDFs) which you can include in your labtest directory.
 +
 +For your convenience, you may choose to provide a link to "/common" on your index page.  This link contains the Java API, and other documentation that is useful across labtests.  In non-labtest mode, the information appears [[http://www.eecs.yorku.ca/teaching/docs|here]].  
 + 
 Note: You cannot include links to content outside your labtest web directory.  Your regular course directory, or other Departmental web links will not be available during labtest. Note: You cannot include links to content outside your labtest web directory.  Your regular course directory, or other Departmental web links will not be available during labtest.
 +
 +==== eClass Quiz Start Page ====
 +
 +If you are hosting your labtest as an eClass quiz, then your start page can redirect the student to the eClass quiz page like this:
 +
 +
 +<code>
 +<!DOCTYPE html>
 +
 +<html>
 +<head>
 +<meta http-equiv="refresh" content="5; URL= https://eclass.yorku.ca/mod/quiz/view.php?id=12345" />
 +</head>
 +<body>
 +
 +<p>Redirecting you to eClass. If you are not redirected in 5 seconds, <a https://eclass.yorku.ca/mod/quiz/view.php?id=12345">click here</a>.</p>
 +
 +</body>
 +</html>
 +</code>
 +
 +NOTE: Replace "12345" with the quiz ID of your eClass quiz.
  
 ===== 3.  Create and/or Install Additional Content ===== ===== 3.  Create and/or Install Additional Content =====
Line 262: Line 305:
  
 Students can also submit using [[https://webapp.eecs.yorku.ca/submit|web submit]]. They login with their account details, select the proper assignment directory, and submit their files.  Like command line submit, the session, term, and course directory will not be switchable by the student, and must be configured at the time of your labtest booking.  Read more information on Web Submit [[services:submit:websubmit|here]]. Students can also submit using [[https://webapp.eecs.yorku.ca/submit|web submit]]. They login with their account details, select the proper assignment directory, and submit their files.  Like command line submit, the session, term, and course directory will not be switchable by the student, and must be configured at the time of your labtest booking.  Read more information on Web Submit [[services:submit:websubmit|here]].
 +
 +===== Returning Labtest Submissions to Students Following Labtest =====
 +
 +Sometimes, following a labtest, faculty want students to be able to retrieve their labtest submission.  
 +
 +In order to make this possible, complete the following steps:
 +
 +Copy the files from the labtest submit directory to a different directory - for example:
 +
 +  cd /eecs/course/9999A/submit
 +  cp -pr labtest1 labtest1-return
 +  
 +Make all the files in the new submit directory readable by group "submit":
 +
 +  chgrp -R submit labtest1-return
 +  
 +Finally, ensure that students can only retrieve their submission, and not re-submit:
 +
 +  chmod 750 labtest1-return
 +
 +Now, when students login to web submit outside of labtest, and choose their course, they will see an assignment "labtest1-return", and will be able to retrieve their submitted files. Since the directory is not writable, the students will not be able to modify and re-upload their submission.
  
 ====== Unsubmit (optional) ====== ====== Unsubmit (optional) ======
Line 485: Line 549:
 ====== Custom File Copy on User Login (optional) ====== ====== Custom File Copy on User Login (optional) ======
  
-If you want to be able to initialize a students labtest home directory with certain files  or directories when he logs in, simply create a directory called "ltinit" in your labtest directory (/eecs/dept/www/course/<COURSE>/labtest/ltinit).  The directory should be group labtest. ALL the files and directories in this directory readable by group labtest will be automatically copied to the ltinit directory in the student account when they login.  The files and directories will all be user readable, writable, and executable (mode 700).  Student files will never be overwritten, so if a student modifies files in the ltinit directory, and they log back in, the file will not be recopied from the server.+If you want to be able to initialize a students labtest home directory with certain files  or directories when he logs in, simply create a directory called "ltinit" in your labtest directory (/eecs/dept/www/course/<COURSE>/labtest/ltinit).  The directory should be group labtest. ALL the files and directories in this directory readable by group labtest will be automatically copied to the ltinit directory in the student account when they login.  Student files will never be overwritten, so if a student modifies files in the ltinit directory, and they log back in, the file will not be recopied from the server.
  
 For example: For example:
Line 529: Line 593:
 chgrp labtest /eecs/dept/www/course/9999/labtest/ltinit/labtest.sh chgrp labtest /eecs/dept/www/course/9999/labtest/ltinit/labtest.sh
 chmod g=rx /eecs/dept/www/course/9999/labtest/ltinit/labtest.sh chmod g=rx /eecs/dept/www/course/9999/labtest/ltinit/labtest.sh
 +</code>
 +
 +If you are using commands from /eecs/local/bin in ltinit, please ensure that you set the PATH variable accordingly in your labtest.sh script. For example, if you were installing a custom extension for vscode, and you want to use the "code" command in your script, ensure that /eecs/local/bin is in the PATH:
 +
 +<code>
 +#/bin/sh
 +
 +PATH=/eecs/local/bin:$PATH; export PATH
 +code --install-extension ~/ltinit/myextension.vsix
 </code> </code>
  
Line 548: Line 621:
 Create a file called "labtest.allow" in your labtest web directory (/eecs/dept/www/course/<COURSE>/labtest/labtest.allow).  Include in this file complete hostnames or IP addresses that you want students to be able to access during your test, one per line.  You can follow each hostname or IP address with a port number if required, otherwise web ports (both 80 and 443) will be assumed. Create a file called "labtest.allow" in your labtest web directory (/eecs/dept/www/course/<COURSE>/labtest/labtest.allow).  Include in this file complete hostnames or IP addresses that you want students to be able to access during your test, one per line.  You can follow each hostname or IP address with a port number if required, otherwise web ports (both 80 and 443) will be assumed.
  
-For example, if you're teaching a course EECS9999, and you want students in your labtest to be able to access the complete "www.w3schools.com" and "validator.w3.org" web sites during your test in addition to being able to access www.testing.com:8080, then create /eecs/dept/www/course/9999/labtest/labtest.allow containing:+For example, if you're teaching a course EECS9999, and you want students in your labtest to be able to access the "www.w3schools.com" and "validator.w3.org" web sites during your test in addition to being able to access www.testing.com:8080, then create /eecs/dept/www/course/9999/labtest/labtest.allow containing:
  
 <code> <code>
Line 583: Line 656:
 You will still create a labtest.allow file which tells the labtest environment which hosts the students can access.  In addition, you will also specify in labtest.allow the details on which URL fragments will be accepted, and which will be rejected.  Accepted URL fragments start with a "+" while rejected URL fragments start with a "-". If the user enters a URL that matches one of the accepted URL fragments, then the access will be successful.  On the other hand, if the user enters a URL that matches one of the rejected URL fragments, or if the URL does not match any accepted URL fragments, the access will be denied with the following error: "Access to this URL is blocked." You will still create a labtest.allow file which tells the labtest environment which hosts the students can access.  In addition, you will also specify in labtest.allow the details on which URL fragments will be accepted, and which will be rejected.  Accepted URL fragments start with a "+" while rejected URL fragments start with a "-". If the user enters a URL that matches one of the accepted URL fragments, then the access will be successful.  On the other hand, if the user enters a URL that matches one of the rejected URL fragments, or if the URL does not match any accepted URL fragments, the access will be denied with the following error: "Access to this URL is blocked."
  
-It is best to demonstrate host and URL level access control with an example.  If you wanted your students to only be able to access www.w3schools.com/html during your test (and not the main page www.w3schools.com, or www.w3schools.com/css, www.w3schools.com/jss, etc), then, as before, your labtest.allow file will start off looking like this: +It is best to demonstrate host and URL level access control with an example.  If you wanted your students to only be able to access https://www.w3schools.com/html during your test (and not the main page www.w3schools.com, or www.w3schools.com/css, www.w3schools.com/jss, etc), then, as before, your labtest.allow file will start off looking like this: 
  
   www.w3schools.com   www.w3schools.com
Line 631: Line 704:
 5) Always test your labtest in ltcloud every single time!  Just because your labtest.allow rules work for one test doesn't mean that the resources that you're trying to allow access to haven't changed between tests.  Testing your labtest in ltcloud ensures the smoothest experience for you and your students. 5) Always test your labtest in ltcloud every single time!  Just because your labtest.allow rules work for one test doesn't mean that the resources that you're trying to allow access to haven't changed between tests.  Testing your labtest in ltcloud ensures the smoothest experience for you and your students.
  
-Now that you've seen how to protect access to URLs on one web site, let's look at one additional example.  Many faculty use eclass from within labtest.  The following labtest.allow file contains the rules to limit eclass use to a quiz only.  **Your labtest page must provide a link to a specific quiz on your page which looks something like: https://eclass.yorku.ca/mod/quiz/view.php?id=XXXX**+==== eClass Quiz ==== 
 + 
 +Now that you've seen a basic example of how to restrict access to specific URLs in labtest, let's look at one additional example - eClass.  eClass is the name of the Moodle-based Learning Management System (LMS) used at York University.  Many faculty want to use eClass quizzes from within labtest.  This poses a few problems First, students can upload files to the platform before a quiz, and access those files during the quiz.  During a quiz, students have access to all materials posted on their course eclass site which may include materials that a faculty member would not want the students to access during a quiz.  In addition, students have access to materials from other courses they are taking as well.  As each student would be taking different courses, the faculty member may not be aware of which materials the student has access to during their quiz.  Finally, students have access to eclass forums, and messaging during a quiz.  Using labtest Host and URL Level Access Control, we can alleviate some of these issues with eClass quiz. 
 + 
 +1.  Place the following labtest.allow file in your course labtest web directory (/eecs/dept/www/course/labtest/labtest.allow):
  
   eclass.yorku.ca   eclass.yorku.ca
Line 643: Line 720:
   +eclass.yorku.ca/local   +eclass.yorku.ca/local
   +eclass.yorku.ca/repository   +eclass.yorku.ca/repository
 +  dm7crvy4e45rz.cloudfront.net
 +  +dm7crvy4e45rz.cloudfront.net
   cdn.jsdelivr.net   cdn.jsdelivr.net
   +cdn.jsdelivr.net   +cdn.jsdelivr.net
Line 650: Line 729:
   +fonts.googleapis.com   +fonts.googleapis.com
  
-Students won't be able to access just "eclass.yorku.ca", but they will be able to access your specific quiz.  +Ensure that the file is readable: <code>chmod 644 /eecs/dept/www/course/COURSE/labtest/labtest.allow</code> 
 + 
 +2.  Your labtest start page (eg. /eecs/dept/www/course/<COURSE>/labtest/index.html) (or a PDF that your start page refers to) **must** include a direct link to your specific eclass quiz.  It will look something like this: https://eclass.yorku.ca/mod/quiz/view.php?id=XXXX  You can get this link in eClass if you go to: Activities >> Quizzes  then hover your mouse over your quiz, or, if you click on the quiz to start it, you can copy and paste the URL from your browser.  
 + 
 +**IMPORTANT** If students try to access "https://eclass.yorku.ca" in their web browser during your labtest**they will be blocked**.  Students can **only** visit your quiz by clicking on the link to the quiz from your labtest start page.  
 + 
 +3.  Restrict access to your eclass quiz to the IP addresses of the lab machines where the students will be writing the quiz.  If you don't do this, even though your in-lab students will be limited in the proper way, students who are outside of the lab would also be able to write your quiz.  Go to: Activities >> Quizzes >> Settings >> Extra restriction on attempts >> Show more... >> Require network address.  For Lassonde labs, enter: 130.63.96.0/24.  For WSC labs, enter: 130.63.131.0/24.   
 + 
 +4.  Limit the start and end time of your quiz in eclass.  If you don't do this, then students on the lab machines will be able to access your quiz **before** your labtest!  Go to: Activities >> Quizzes >> Settings >> Timing and configure the "Open the quiz" and "Close the quiz" times.  Note that if students try to access the quiz before the open time, they will be denied because eclass will try to redirect them back to the course eclass page which has been blocked.  They should try again at the start time of your test.
  
-**IMPORTANT NOTES:**  +NOTESome faculty would like to use eclass "assignment" in labtest. Note that eclass assignments do not permit IP address restriction.  A quiz with 1 question can replace an "assignment".
  
-  eclass permits students with access to various repositories such as "Private Files" In labtest mode, repositories other than "Upload a File" will result in an "Invalid Repository ID" error. +** Always test your eclass quiz using ltcloud!  Don't assume that just because it works fine from your unrestricted PC that it will work fine in labtestEnsuring that your quiz works in ltcloud will guarantee an improved experience in your test session**
-  Controlling allowed URLs is only one way to protect the integrity of your eclass quiz.    It is recommended that you protect the quiz based on start and end time, and IP addresses as well. +
-  * Since all of our lab PCs use different IP addresses, consult with tech if you want to block access to your eclass based on IP address (See Quiz Settings >> Extra restriction on attempts >> Show more... >> Require network address). +
-  * If you protect your eclass quiz based on start time, please note that if you have the lab machines booting into labtest mode minutes before the time of your test, then if students login early, and click on the quiz link in your index.html file, eclass will try to redirect them back to the course eclass page.  In labtest mode, eclass.yorku.ca/course is blocked, and hence the student will receive an error that the URL they are trying to access has been blocked.  Let students know that they should click on the quiz link after the quiz has been opened+
  
 ====== SecureQ Setup (optional) ====== ====== SecureQ Setup (optional) ======
services/labtest/start.1707941586.txt.gz · Last modified: 2024/02/14 15:13 by jas