i used like this but duplicate is displaying.
@{
var tname="null" ;
}
@foreach (StudentGradeBook x in Model.Student)
{
if(!(tname.Equals(@x.TestName)))
{
}
tname = @x.TestName.ToString();
}
If x contains
test
test
test
testing
testing
But i need to display
test
testing
Shakil AhmedPosted Nov 18, 2017, 6:49 AM
Sunny SharmaPosted Aug 1, 2013, 8:19 AM
Cheer up!
vidhyaPosted Aug 1, 2013, 8:15 AM
i think , dont want to waste yr time.
Sunny SharmaPosted Aug 1, 2013, 8:12 AM
vidhyaPosted Aug 1, 2013, 8:09 AM
totalpoints is displayed/entered according to the testname,
pointspossible is displayed/entered according to the assignmentname.
then how is it possible to use like this
@foreach(var tName in (from gradeBook in Model.Student select gradeBook.TestName).Distinct())
{
}
Sunny SharmaPosted Aug 1, 2013, 8:01 AM
vidhyaPosted Aug 1, 2013, 7:58 AM
{
@ var tPoints = (from gradeBook in Model.Student where gradeBook.TestName==tName.ToString() select gradeBook.TotalPoints).sum();
@ var pointsPossible = (from gradeBook in Model.Student where gradeBook.TestName==tName.ToString() select gradeBook.PointsPossible).sum();
}
I get TotalPoints from testname according to the this
I get PointsPossible from assignmentname according to this.
Sunny SharmaPosted Aug 1, 2013, 7:49 AM
Sunny SharmaPosted Aug 1, 2013, 7:26 AM
use the code below:
{
}
{
@ var tPoints = (from gradeBook in Model.Student where gradeBook.TestName==tName.ToString() select gradeBook.TotalPoints).sum();
@ var pointsPossible = (from gradeBook in Model.Student where gradeBook.TestName==tName.ToString() select gradeBook.PointsPossible).sum();
}
-------------------------------------------
vidhyaPosted Aug 1, 2013, 7:04 AM
I need to change the 1st for loop like the 2nd for loop how can i change, 1st loop contains 2 fields.
vidhyaPosted Aug 1, 2013, 6:53 AM
Before sample assignment the heading is totalpoints the corresponding row i need to add the points and display there. pointspossible and totalpoints are displayed in 2nd row
Sunny SharmaPosted Aug 1, 2013, 6:45 AM
vidhyaPosted Aug 1, 2013, 6:39 AM
I need to display the total of totalpoints and pointspossible in the before column. how to add it?
Sunny SharmaPosted Aug 1, 2013, 6:32 AM
use tName instead of x.Testname:
----------------------
{
}
--------------------------------------
vidhyaPosted Aug 1, 2013, 6:28 AM
I am getting error
The name X does not contain in the current content
Then i changed like this
now its work fine.
Sunny SharmaPosted Aug 1, 2013, 6:19 AM
I have the solution for you, modify your view as following:
----------------------------
@model MavinLMSService.ViewModels.Professor.GradeBook.IndexModel
@{
ViewBag.Title = "Grade Book";
Layout = "~/Views/Shared/_PrimaryLayout.cshtml";
}
{
}
-------------------------------------------------------------
Yes, there's one catch also. You need to import the namespace into your view by adding @using System.Data.Linq at the top of your view. However if you want it in all your views then you need to add
Feedback awaited.
Cheers!
vidhyaPosted Aug 1, 2013, 6:15 AM
Iftikar HussainPosted Aug 1, 2013, 6:11 AM
Regards,
Iftikar
vidhyaPosted Aug 1, 2013, 6:03 AM
Iftikar HussainPosted Aug 1, 2013, 5:57 AM
var arrayPoints = new string[Model.Student.Count];
var j = 0;
Regards,
Iftikar
vidhyaPosted Aug 1, 2013, 5:51 AM
var j = 0;
For testname it work fine, same i tried for total points i does not work. y?
Iftikar HussainPosted Aug 1, 2013, 5:23 AM
Regards,
Iftikar
vidhyaPosted Aug 1, 2013, 5:21 AM
Iftikar HussainPosted Aug 1, 2013, 5:19 AM
the output should be?
test
testing
pretest
prestest
Regards,
Iftikar
vidhyaPosted Aug 1, 2013, 5:04 AM
Iftikar HussainPosted Aug 1, 2013, 3:18 AM
Regards,
Iftikar
vidhyaPosted Aug 1, 2013, 3:13 AM
test
test
test
testing
testing
@x.TestName displays like this
test
test
testing
testing
test
Iftikar HussainPosted Aug 1, 2013, 3:05 AM
Regards,
Iftikar
vidhyaPosted Aug 1, 2013, 2:50 AM
Iftikar HussainPosted Aug 1, 2013, 2:34 AM
Regards,
Iftikar
vidhyaPosted Aug 1, 2013, 2:24 AM
Iftikar HussainPosted Aug 1, 2013, 2:07 AM
Regards,
Iftikar
vidhyaPosted Aug 1, 2013, 1:49 AM
Iftikar HussainPosted Aug 1, 2013, 1:11 AM
Regards,
Iftikar
vidhyaPosted Aug 1, 2013, 1:08 AM
Iftikar HussainPosted Aug 1, 2013, 12:53 AM
try like this
Regards,
Iftikar
vidhyaPosted Aug 1, 2013, 12:40 AM
vidhyaPosted Aug 1, 2013, 12:39 AM
Iftikar HussainPosted Aug 1, 2013, 12:33 AM
Regards,
Iftikar
vidhyaPosted Aug 1, 2013, 12:19 AM
Iftikar HussainPosted Aug 1, 2013, 12:16 AM
Regards,
Iftikar
vidhyaPosted Jul 31, 2013, 11:56 PM
test
test
test
testing
testing
@tname displays
test
test
testing
testing
test
@x.TestName
test
test
testing
testing
test
Iftikar HussainPosted Jul 31, 2013, 11:54 AM
Regards,
Iftikar
vidhyaPosted Jul 31, 2013, 8:49 AM
Iftikar HussainPosted Jul 31, 2013, 8:45 AM
@{
var tname="" ;
}
@foreach (StudentGradeBook x in Model.Student)
{
if(tname!=@x.TestName.ToString())
{
}
tname = @x.TestName.ToString();
}
Regards,
Iftikar
vidhyaPosted Jul 31, 2013, 8:44 AM
we can use list in view class?
Iftikar HussainPosted Jul 31, 2013, 8:42 AM
Try like this
@{
var tname="" ;
}
@foreach (StudentGradeBook x in Model.Student)
{
if(!(tname.Equals(@x.TestName)))
{
}
tname = @x.TestName.ToString();
}
Regards,
Iftikar