Skip to content

Commit

Permalink
Merge pull request #17 from virtual-labs/revert-16-dev
Browse files Browse the repository at this point in the history
Revert "Dev"
  • Loading branch information
Dineshg49 authored Aug 5, 2021
2 parents 3a54b5f + 7d99b86 commit 496fb6c
Show file tree
Hide file tree
Showing 14 changed files with 286 additions and 378 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deployment-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
node-version: '12'
check-latest: true
- run: |
git clone --depth=1 https://github.com/virtual-labs/ph3-lab-mgmt
git clone -b pipeline-new https://github.com/virtual-labs/ph3-lab-mgmt
cd ph3-lab-mgmt
npm install
npm run build-exp
node exp.js
cd ../
git config --local user.email "[email protected]"
git config --local user.name "vleadadmin"
Expand Down
11 changes: 1 addition & 10 deletions experiment/aim.md
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
**Introduction**

Structural elements and machine components made of ductile material are usually designed so that the material will not yield under the expected loading conditions. When the element or component is under uniaxial stress, the value of the normal stress σ<sub>x</sub>, which will cause the material to yield, may be obtained readily from a tensile test conducted on a specimen of the same material, since the test specimen and the structural element or machine component are in the same state of stress. Thus, regardless of the actual mechanism which causes the material to yield, we may state that the element or component will be safe as long as σ<sub>x</sub> < σ<sub>y</sub>, where σ<sub>y</sub> is the yield strength of the test specimen.


**Objective**

- To investigate the principal stresses σ<sub>a</sub> and σ<sub>b</sub> at any given point of a structural element or machine component when it is in a state of plane stress.

- To evaluate the two different yield criteria ( Tresca and Von Mises ) for ductile materials under plane stresses.
### Aim of the experiment
2 changes: 1 addition & 1 deletion experiment/experiment-name.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
## Principal Stresses
## Experiment name
135 changes: 135 additions & 0 deletions experiment/posttest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
/////////////////////////////////////////////////////////////////////////////

/////////////////////// Do not modify the below code ////////////////////////

/////////////////////////////////////////////////////////////////////////////

(function() {
function buildQuiz() {
// we'll need a place to store the HTML output
const output = [];

// for each question...
myQuestions.forEach((currentQuestion, questionNumber) => {
// we'll want to store the list of answer choices
const answers = [];

// and for each available answer...
for (letter in currentQuestion.answers) {
// ...add an HTML radio button
answers.push(
`<label>
<input type="radio" name="question${questionNumber}" value="${letter}">
${letter} :
${currentQuestion.answers[letter]}
</label>`
);
}

// add this question and its answers to the output
output.push(
`<div class="question"> ${currentQuestion.question} </div>
<div class="answers"> ${answers.join("")} </div>`
);
});

// finally combine our output list into one string of HTML and put it on the page
quizContainer.innerHTML = output.join("");
}

function showResults() {
// gather answer containers from our quiz
const answerContainers = quizContainer.querySelectorAll(".answers");

// keep track of user's answers
let numCorrect = 0;

// for each question...
myQuestions.forEach((currentQuestion, questionNumber) => {
// find selected answer
const answerContainer = answerContainers[questionNumber];
const selector = `input[name=question${questionNumber}]:checked`;
const userAnswer = (answerContainer.querySelector(selector) || {}).value;

// if answer is correct
if (userAnswer === currentQuestion.correctAnswer) {
// add to the number of correct answers
numCorrect++;

// color the answers green
//answerContainers[questionNumber].style.color = "lightgreen";
} else {
// if answer is wrong or blank
// color the answers red
answerContainers[questionNumber].style.color = "red";
}
});

// show number of correct answers out of total
resultsContainer.innerHTML = `${numCorrect} out of ${myQuestions.length}`;
}

const quizContainer = document.getElementById("quiz");
const resultsContainer = document.getElementById("results");
const submitButton = document.getElementById("submit");


/////////////////////////////////////////////////////////////////////////////

/////////////////////// Do not modify the above code ////////////////////////

/////////////////////////////////////////////////////////////////////////////






/////////////// Write the MCQ below in the exactly same described format ///////////////


const myQuestions = [{
question: "1.This is a sample question:", ///// Write the question inside double quotes
answers: {
a: "This is a sample answer A", ///// Write the option 1 inside double quotes
b: "This is a sample answer B", ///// Write the option 2 inside double quotes
},
correctAnswer: "a" ///// Write the correct option inside double quotes
},

{
question: "<img src='images/8.PNG'><br>Identify the location of Secondary electron detector", ///// Write the question inside double quotes
answers: {
a: "<img src='images/1b.png'>", ///// Write the option 1 inside double quotes
b: "<img src='images/1a.png'>", ///// Write the option 2 inside double quotes
c: "<img src='images/1c.PNG'>", },
correctAnswer: "c" ///// Write the correct option inside double quotes
},



];




/////////////////////////////////////////////////////////////////////////////

/////////////////////// Do not modify the below code ////////////////////////

/////////////////////////////////////////////////////////////////////////////


// display quiz right away
buildQuiz();

// on submit, show results
submitButton.addEventListener("click", showResults);
})();


/////////////////////////////////////////////////////////////////////////////

/////////////////////// Do not modify the above code ////////////////////////

/////////////////////////////////////////////////////////////////////////////
38 changes: 0 additions & 38 deletions experiment/posttest.json

This file was deleted.

135 changes: 135 additions & 0 deletions experiment/pretest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
/////////////////////////////////////////////////////////////////////////////

/////////////////////// Do not modify the below code ////////////////////////

/////////////////////////////////////////////////////////////////////////////

(function() {
function buildQuiz() {
// we'll need a place to store the HTML output
const output = [];

// for each question...
myQuestions.forEach((currentQuestion, questionNumber) => {
// we'll want to store the list of answer choices
const answers = [];

// and for each available answer...
for (letter in currentQuestion.answers) {
// ...add an HTML radio button
answers.push(
`<label>
<input type="radio" name="question${questionNumber}" value="${letter}">
${letter} :
${currentQuestion.answers[letter]}
</label>`
);
}

// add this question and its answers to the output
output.push(
`<div class="question"> ${currentQuestion.question} </div>
<div class="answers"> ${answers.join("")} </div>`
);
});

// finally combine our output list into one string of HTML and put it on the page
quizContainer.innerHTML = output.join("");
}

function showResults() {
// gather answer containers from our quiz
const answerContainers = quizContainer.querySelectorAll(".answers");

// keep track of user's answers
let numCorrect = 0;

// for each question...
myQuestions.forEach((currentQuestion, questionNumber) => {
// find selected answer
const answerContainer = answerContainers[questionNumber];
const selector = `input[name=question${questionNumber}]:checked`;
const userAnswer = (answerContainer.querySelector(selector) || {}).value;

// if answer is correct
if (userAnswer === currentQuestion.correctAnswer) {
// add to the number of correct answers
numCorrect++;

// color the answers green
//answerContainers[questionNumber].style.color = "lightgreen";
} else {
// if answer is wrong or blank
// color the answers red
answerContainers[questionNumber].style.color = "red";
}
});

// show number of correct answers out of total
resultsContainer.innerHTML = `${numCorrect} out of ${myQuestions.length}`;
}

const quizContainer = document.getElementById("quiz");
const resultsContainer = document.getElementById("results");
const submitButton = document.getElementById("submit");


/////////////////////////////////////////////////////////////////////////////

/////////////////////// Do not modify the above code ////////////////////////

/////////////////////////////////////////////////////////////////////////////






/////////////// Write the MCQ below in the exactly same described format ///////////////


const myQuestions = [{
question: "1.This is a sample question:", ///// Write the question inside double quotes
answers: {
a: "This is a sample answer A", ///// Write the option 1 inside double quotes
b: "This is a sample answer B", ///// Write the option 2 inside double quotes
},
correctAnswer: "a" ///// Write the correct option inside double quotes
},

{
question: "<img src='images/8.PNG'><br>Identify the location of Secondary electron detector", ///// Write the question inside double quotes
answers: {
a: "<img src='images/1b.png'>", ///// Write the option 1 inside double quotes
b: "<img src='images/1a.png'>", ///// Write the option 2 inside double quotes
c: "<img src='images/1c.PNG'>", },
correctAnswer: "c" ///// Write the correct option inside double quotes
},



];




/////////////////////////////////////////////////////////////////////////////

/////////////////////// Do not modify the below code ////////////////////////

/////////////////////////////////////////////////////////////////////////////


// display quiz right away
buildQuiz();

// on submit, show results
submitButton.addEventListener("click", showResults);
})();


/////////////////////////////////////////////////////////////////////////////

/////////////////////// Do not modify the above code ////////////////////////

/////////////////////////////////////////////////////////////////////////////
49 changes: 0 additions & 49 deletions experiment/pretest.json

This file was deleted.

5 changes: 1 addition & 4 deletions experiment/procedure.md
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
**Procedure**
1. Change the value of stress(σ) along different components with the sliders.
2. Change the orientation(Θ) of the cube along all three directions using the sliders.
3. Observe the values of Principal Stress(σ') obtained across all the components in the table provided.
### Procedure
Loading

0 comments on commit 496fb6c

Please sign in to comment.